Question: Finite element method

pls help me cirrect this. i am trying to use finite element method to siolve a fluid equation. The code is give below

> pde := alpha^2*(diff(u(t, r), t))+2*(-1/2)^(1/n)*(diff(u(t, r), r))/r-(-1/2)^((1-n)/n)*(diff(u(t, r), `$`(r, 2)))*(diff(u(t, r), r))^(1/n-1)/n+2*theta/r-4*(1+e)+4*B*cos(.2) = 0; /1\ |-| \n/ /-1\ / d \ 2 |--| |--- u(t, r)| 2 / d \ \2 / \ dr / alpha |--- u(t, r)| + ----------------------- \ dt / r /1 - n\ /1 \ |-----| |- - 1| \ n / \n / /-1\ / d / d \\ / d \ |--| |--- |--- u(t, r)|| |--- u(t, r)| \2 / \ dr \ dr // \ dr / 2 theta - ---------------------------------------------------- + ------- - 4 - 4 e n r + 3.920266311 B = 0 > tmax := 0.5e-1; > rmin := 0; > rmax := 10; > N := 6; > bc1 := diff(u(t, r = rmin), r) = 1/mu; > bc2 := u(t, r = rmax) = 0; > ic1 := u(0, r) = 0; > PDE*Boundary*condition*colllection; > bcs := {u(0, r) = rhs(ic1), D[1](diff(u(t, r = rmin), r)) = rhs(bc1), (D[1](u))(t, r = rmax) = rhs(bc2)}; / / d \ 1 \ { u(0, r) = 0, D[1]|--- u(t, r = 0)| = --, D[1](u)(t, r = 10) = 0 } \ \ dr / mu / > > Collocation*method; > Typesetting[delayDotProduct](Define*a*simple*function*with*known*solution.one, can, true)*choose*either*a*trigonometric*function, othorgonal*polynomia, (Typesetting[delayDotProduct](legendre*polynomia*etc.we, want, true)*will*choose*a*simple*polynomia*which*will)*make*our*work*easier; > basis := r^i; > uhat := sum(A[i](t)*basis, i = 0 .. N-1); > Alist := indets(uhat, function(identical(t))); > Here, we*will*determine*the^2*two*unknowns*(A1, A2)*using*boundary*conditions; > duhat := diff(uhat, r); > knownAs := solve({subs(r = rmin, duhat) = rhs(bc1), subs(A[1](t) = 0, r = rmax, duhat) = rhs(bc2)}, {A[1](t), A[2](t)}); > unknownAs := `minus`(Alist, {seq(lhs(knownAs[i]), i = 1 .. nops(knownAs))}); > `and`(uhat*after*substituting*A1, A2); > uhat := subs(knownAs, uhat); > uhat := collect(uhat, Alist); > Residual*function*is*obtai*ned*after*substituting*uhat*into*the*original*pde; > residual := eval(subs(u(t, r) = uhat, pde)); > residual := collect(residual, r); > `and`(Typesetting[delayDotProduct](Now*we*choose*points*where*exact*solution*must*be*matched.since, we, true)*have*point*A[1], A[2]), we*will*only*need*N-2*points; > odes := {seq(subs(r = i*rmax/N, residual), i = 1 .. nops(unknownAs))}; > Find*ICs*of*unknown*A(t)*s; > iceqs := {seq(subs(t = 0, r = i*rmax/N, uhat) = rhs(bc2), i = 1 .. nops(unknownAs))}; > ics := solve(iceqs, subs(t = 0, unknownAs)); > > sols := dsolve(`union`(odes, ics)); Warning, computation interrupted > Approximate*solution; > uhat := subs(sols, uhat); Error, invalid input: subs received sols, which is not valid for its 1st argument > uhat := collect(uhat, r); > Plot*solution; > plot3d(uhat, r = 0 .. rmax, t = 0 .. tmax, axes = boxed, lightmodel = light4, orientation = [-120, 40], shading = zhue, transparency = .3); Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct > >
Please Wait...