#April 17, 2014, continuing Rayleigh-Ritz #C23.txt Help:=proc():print(` EvalFunct(p,q,f,x,Lx,Lu):`): print(` EvalFunct(1,0,2*Pi^2*sin(Pi*x),x,[0,1/2,1],[u1(x),u2(x)]); `): print(` RR(p,q,f,x,Lx) , BSpline(d,Lx,i)`): end: #old stuff Help22:=proc(): print(` EL(L,Y,Y1,y,t), Eval1(Lx,Lf,x,x1), Mul1a(p,Lf) `): print(`Mul1b(Lf,Lg) , phii(Lx,x,i), TestF(c,Lx,x)`): 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]xd, and continuous to order d-1 #(d+1)*(d+1) unknown numbers, #(d+2)*d equations #and f(Lx[i+1])=1 BSpline:=proc(d,Lx,i) local a,Lu,i1,j1,var,eq: if nops(Lx)<>d+2 then RETURN(FAIL): fi: Lu:=[seq(add(a[i1,j1]*x^j1,j1=0..d),i1=0..d)]: var:={seq(seq(a[i1,j1],j1=0..d),i1=0..d)}: eq:={subs(x=Lx[1],Lu[1]), seq(subs(x=Lx[1],diff(Lu[1],x\$i1)),i1=1..d-1)}: eq:= eq union {subs(x=Lx[d+2],Lu[d+1]), seq(subs(x=Lx[d+2],diff(Lu[d+1],x\$i1)),i1=1..d-1)}: end: