Commit 76d52ca1 authored by Lars Stietz's avatar Lars Stietz
Browse files

corrected sweep function

parent 8e7a38bf
......@@ -33,7 +33,7 @@ if coll.nodes[0] != t_interval[0]:
# if last node is not interval end add value
if coll.nodes[-1] != t_interval[1]:
nd = False
nd = False-1
u = np.append(u,1)
"""
......@@ -67,9 +67,9 @@ def sweep(u,d_tau,Smat,Qmat,f):
"""
num_nodes = len(u)-1
u_old = deepcopy(u)
quad = Smat[1:,1:]@u_old[1:-1]
for m in range(1,num_nodes-1):
u[m] = 1/(1-f(1)*d_tau[m-1])*(u[m-1]-d_tau[m-1]*f(u_old[m]) + quad[m])
quad = f(1)*Smat[1:,1:]@u_old[1:-1]
for m in range(1,num_nodes):
u[m] = 1/(1-f(1)*d_tau[m-1])*(u[m-1]-d_tau[m-1]*f(u_old[m]) + quad[m-1])
return u
# function for SDC sweep with matrices
......@@ -96,7 +96,7 @@ if solving == 1:
# SDC straight forward approach
k_max = 100
k_max = 50
res_2 = 2
res_it = np.empty(0)
res_itM = np.empty(0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment