Question: Ordinary differential equations

Hi guys,

This is the first time of solving partial differential equation, can some please help me point out some errows in my code. 
 

restart

ODEs := `<,>`(diff(v(y), y, y)+(diff(v(y), y))/y-(Ha^2/(1-eta)^2+1/y^2)*v(y)-Re*v(y)*(diff(v(y), y)) = 0, diff(theta(y), y, y)+Ec*Pr*(diff(v(y), y)-v(y)/y)^2-Pr*Re*v(y)*(diff(theta(y), y))+Nb*(diff(theta(y), y))*(diff(phi(y), y))+Nt*(diff(theta(y), y))^2 = 0, diff(phi(y), y, y)-Re*Sc*v(y)*(diff(phi(y), y))+Nt*(diff(theta(y), y, y)+(diff(theta(y), y))/y)/Nb = 0)

ODEs := Matrix(3, 1, {(1, 1) = diff(diff(v(y), y), y)+(diff(v(y), y))/y-(Ha^2/(1-eta)^2+1/y^2)*v(y)-Re*v(y)*(diff(v(y), y)) = 0, (2, 1) = diff(diff(theta(y), y), y)+Ec*Pr*(diff(v(y), y)-v(y)/y)^2-Pr*Re*v(y)*(diff(theta(y), y))+Nb*(diff(theta(y), y))*(diff(phi(y), y))+Nt*(diff(theta(y), y))^2 = 0, (3, 1) = diff(diff(phi(y), y), y)-Re*Sc*v(y)*(diff(phi(y), y))+Nt*(diff(diff(theta(y), y), y)+(diff(theta(y), y))/y)/Nb = 0})

(1)

BCs := `<,>`(phi(eta) = 1, v(eta) = 1, theta(eta) = 1, phi(1) = 0, theta(1) = 0, v(1) = 0)

BCs := Matrix(6, 1, {(1, 1) = phi(eta) = 1, (2, 1) = v(eta) = 1, (3, 1) = theta(eta) = 1, (4, 1) = phi(1) = 0, (5, 1) = theta(1) = 0, (6, 1) = v(1) = 0})

(2)

param_names := [eta, Ha, Ec, Nt, Nb, Re, Sc, Pr];

[eta, Ha, Ec, Nt, Nb, Re, Sc, Pr]

(3)

pdSolve := subs(_P = param_names, proc ({ eta::realcons := .5, Ha::realcons := 1, Sc::realcons := .8, Nt::realcons := .1, Nb::realcons := .1, Re::realcons := 2, Ec::realcons := 0.1e-1, Pr::realcons := 10 }) userinfo(1, Solve, `~`[`=`](param_names, _P)); dsolve(eval(`union`(convert(ODEs, set), convert(BCs, set)), `~`[`=`](param_names, _P)), numeric) end proc);

proc ({ Ec::realcons := 0.1e-1, Ha::realcons := 1, Nb::realcons := .1, Nt::realcons := .1, Pr::realcons := 10, Re::realcons := 2, Sc::realcons := .8, eta::realcons := .5 }) userinfo(1, Solve, `~`[`=`](param_names, [eta, Ha, Ec, Nt, Nb, Re, Sc, Pr])); dsolve(eval(`union`(convert(ODEs, set), convert(BCs, set)), `~`[`=`](param_names, [eta, Ha, Ec, Nt, Nb, Re, Sc, Pr])), numeric) end proc

(4)

infolevel[Solve] := 1:

Fig. 3 (changing values of Ha):

P:= Ha:
vals:= [1, 5, 10, 20]:
sols:= [seq(Solve(P= v), v= vals)]:
colors:= [red, green, blue]:
for F in [v,theta,phi](y) do
   print(plots:-display(
      [seq(
         plots:-odeplot(sols[k], [y,F], color= colors[k], legend= [P= vals[k]]),
         k= 1..nops(vals)
      )],
      labeldirections= [horizontal,vertical]
   ))
od:

Error, pdeplot is not a command in the plots package

 

``


 

Download chapter5.mw

 

Please Wait...