#C22.txt, April 14, 2014, Calculus of Variation, Rayleigh-Ritz #methop Help:=proc(): print(` EL(L,Y,Y1,y,t), Eval1(Lx,Lf,x,x1), Mul1a(p,Lf) `): print(`Mul1b(Lf,Lg) , phii(Lx,x,i), EvalFuncl(L,Y,Y1,t,Lx,c), TestF(c,Lx,x)`): end: #EL(L,Y,Y1,y,t): implements the Euler-Lagrange Equation #inputs an expression L in Y (stading for y(t)) Y1 (short for y'(t)) # y and t are symbols EL:=proc(L,Y,Y1,y,t) local andrew: andrew:=subs({Y=y(t), Y1=D(y)(t) }, diff(L,Y))- diff(subs({Y=y(t), Y1=D(y)(t) }, diff(L,Y1)),t): normal(andrew): end: #Eval1(Lx,Lf,x,x1): Given a partition of [0,1]=[x0,x1,x2,...,xn,x_{n+1}] #and corresponding list of expressions Lf of n+1 expressions #where the function between xi and x_{i+1} is Lf[i+1] #EVALUATE it at x1 Eval1:=proc(Lx,Lf,x,x1) local i: if x1<0 or x1>1 then RETURN(0): fi: for i from 1 while Lx[i]