I have written a code
u_pre = []
u_1 = np.zeros(tpts)
u_2 = np.zeros(tpts)
u_3 = np.zeros(tpts)
for i in range (0,tpts):
a = u0[i]
u_pre.append(a)
time = 0.00
timemax = 2001 #milli_s
while (time<timemax):
uj_prime_stage1 = [matrix_C] @ (np.transpose(u0))
for i in range(0,tpts):
u_1[i] = u_pre[i] + 0.5 * (dt/a_sec) * (-c*(uj_prime_stage1[i]))
I am getting an error in the last line of this block of code as Exception has occurred: ValueError setting an array element with a sequence. I tried referring to other answers but could not find much help.
u0 is a 1D array having tptselements.
Any help is highly appreciated