def oderest(sizes,x,u,pi,t,constants,boundary,restrictions):
print("\nIn oderest.")
# get sizes
N = sizes['N']
n = sizes['n']
m = sizes['m']
p = sizes['p']
print("Calc phi...")
# calculate phi and psi
phi = calcPhi(sizes,x,u,pi,constants,restrictions)
# aux: phi - dx/dt
aux = phi - ddt(sizes,x)
# get gradients
print("Calc grads...")
Grads = calcGrads(sizes,x,u,pi,constants,restrictions)
phix = Grads['phix']
lam = 0*x
B = numpy.zeros((N,m))
C = numpy.zeros(p)
print("Integrating ODE for A...")
# integrate equation for A:
A = odeint(calcADotOdeRest,numpy.zeros(n),t,args= (t,phix,aux))
#optPlot = dict()
#optPlot['mode'] = 'var'
#plotSol(sizes,t,A,B,C,constants,restrictions,optPlot)
print("Calculating step...")
alfa = calcStepOdeRest(sizes,t,x,u,pi,A,B,C,constants,boundary,restrictions)
nx = x + alfa * A
print("Leaving oderest with alfa =",alfa)
return nx,u,pi,lam,mu
# ##################
# MAIN SEGMENT:
# ##################
评论列表
文章目录