-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGlobal_constants.py
23 lines (20 loc) · 1019 Bytes
/
Global_constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
'''Global constants and arrays'''
from time_steps import *
'''=========================================================================='''
'''Some Global Constants for the code'''
h = 0.01 #step size in x coordinate
k = 0.1 #step size in t coordinate
x_range = (-4,4)
n = int((x_range[1]- x_range[0])/h)+1 #no. of x points
lam = (1j*k)/(4*(h**2)) #lambda value of L and U matrices
omega = float(input('Enter the value of omega : '))
x = np.linspace(x_range[0],x_range[1],n)
y = np.zeros(n)
z = 0.000001 #initial slope to calculate Psi
y[1] = z*h
'''=========================================================================='''
ntp = 1
tsteps = time_steps(ntp,k,omega)
t_val = tsteps.t_val()
print('number of time steps = ',len(t_val))
'''=========================================================================='''