ogunsmichael

5 Reputation

One Badge

6 years, 270 days

MaplePrimes Activity


These are replies submitted by ogunsmichael

Any solution from anybody yet?

@Christopher2222  this is the real code. thanks in advance 
 

 

 

``

restart

mu := 0.3e-2:

n := 3/2:

alpha := .5:

theta := .1:

phi := .2:

B := 2:

velocity := u = u(t, r):

e := .5:

``

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;

.25*(diff(u(t, r), t))+(-1)^(2/3)*2^(1/3)*(diff(u(t, r), r))/r+(2/3)*(-1)^(2/3)*2^(1/3)*(diff(diff(u(t, r), r), r))/(diff(u(t, r), r))^(1/3)+.2/r+1.840532624 = 0

(1.1)

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)};

{u(0, r) = 0, D[1](diff(u(t, r = 0), r)) = 333.3333333, (D[1](u))(t, r = 10) = 0}

(1.2)

``

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))})

uhat*after*substituting*A1 and 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]), N*need*only*we*will-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))

NULL

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

 

NULL

``

NULL


 

Download finite.mw

@Christopher2222 

Thank you very much

@waseem have been trying to attach the file it isn't going. 

Page 1 of 1