Items tagged with ode ode Tagged Items Feed

In a recent conversation I explained whyLSODE was giving wrong results (http://www.mapleprimes.com/questions/210948-Can-We-Trust-Maple#comment230167). After a lot of confusions and weird infinite loops for answers, it turned out that Newton Raphson was not properly done.

Both LSODE and MEBDFI are currently incompletely implemented (only one iteration is done instead of Newton Raphson till convergence). Maplesoft should update the help files accordingly.

The post below explains how better results are obtained with method = mgear. To run the command mgear you will need Maple 6 or earlier versions. For lsode, any current version is fine.  Unfortunately Maple deprecated an algorithm that worked fine. From Maple 8, the algorithm moved to Rosenbrock methods for stiff equations. This is still not ideal.

If Maple had a working algorithm, I am hoping that Maplesoft folks would consider bringing it back in future versions. (At least with the same functionality as in Maple 6).

PLEASE NOTE, the issue is not with solving this example (Very simple). This example is chosen to show how a popular algorithm in the literature is wrongly implemented.

 

Here Maple's lsode is forced to take only one step and use first order back ward difference formula to integrate from 0 to 1.  LSODE mimics Eulerbackward using the options given below. The post shows that LSODE does not do Newton Raphson and just performs only iteration for nonlinear equations.

restart;

Digits:=15;

Digits := 15

(1)

eq:=diff(y(t),t)=-y(t);

eq := diff(y(t), t) = -y(t)

(2)

C:=array([0$22]);

C := Vector[row](22, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 0, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 0, (19) = 0, (20) = 0, (21) = 0, (22) = 0})

(3)

C[9]:=1;

C[9] := 1

(4)

sol:=dsolve({eq,y(0)=1},type=numeric,method=lsode[backfull],ctrl=C,initstep=0.1,minstep=0.1,abserr=1,relerr=1):

sol(0.1);

[t = .1, y(t) = .909090909090834]

(5)

subs(diff(y(t),t)=(y1-1)/0.1,y(t)=y1,eq);

0.1e2*y1-0.1e2 = -y1

(6)

fsolve(%,y1=0.5);

.909090909090909

(7)

 While for linear it gave the expected result, it gives wrong results for nonlinear problems.

sol1:=dsolve({eq,y(0)=1},type=numeric):

sol1(0.1);

[t = .1, y(t) = .904837355407810]

(8)

eq:=diff(y(t),t)=-y(t)^2*exp(-y(t))-10*y(t)*(1+0.01*exp(y(t)));

eq := diff(y(t), t) = -y(t)^2*exp(-y(t))-10*y(t)*(1+0.1e-1*exp(y(t)))

(9)

sol:=dsolve({eq,y(0)=1},type=numeric,method=lsode[backfull],ctrl=C,initstep=0.1,minstep=0.1,abserr=1,relerr=1):

sol(0.1);

[t = .1, y(t) = .501579294869466]

(10)

subs(diff(y(t),t)=(y1-1)/0.1,y(t)=y1,eq);

0.1e2*y1-0.1e2 = -y1^2*exp(-y1)-10*y1*(1+0.1e-1*exp(y1))

(11)

fsolve(%,y1=1);

.488691779256025

(12)

sol1:=dsolve({eq,y(0)=1},type=numeric):

 the expected answer is correctly obtained with default tolerance as

sol1(0.1);

[t = .1, y(t) = .349614721994122]

(13)

 The results obtained are worse than single iteration using jacobian.

eq2:=(lhs-rhs)(subs(diff(y(t),t)=(y1-1)/0.1,y(t)=y1,eq));

eq2 := 0.1e2*y1-0.1e2+y1^2*exp(-y1)+10*y1*(1+0.1e-1*exp(y1))

(14)

jac:=unapply(diff(eq2,y1),y1);

jac := proc (y1) options operator, arrow; 20.+2*y1*exp(-y1)-y1^2*exp(-y1)+.10*exp(y1)+.10*y1*exp(y1) end proc

(15)

f:=unapply(eq2,y1);

f := proc (y1) options operator, arrow; 0.1e2*y1-0.1e2+y1^2*exp(-y1)+10*y1*(1+0.1e-1*exp(y1)) end proc

(16)

y0:=1;

y0 := 1

(17)

dy:=-evalf(f(y0)/jac(y0));

dy := -.508796088545793

(18)

ynew:=y0+dy;

ynew := .491203911454207

(19)

 Following procedures confirm that it is indeed calling the procedure only at 0 and 0.1, with backdiag giving slightly better results.

myfun:= proc(x,y) if not type(x,'numeric') or not type(evalf(y),numeric)then 'procname'(x,y);
    else lprint(`Request at x=`,x); -y^2*exp(-y(x))-10*y*(1+0.01*exp(y)); end if; end proc;

myfun := proc (x, y) if not (type(x, 'numeric') and type(evalf(y), numeric)) then ('procname')(x, y) else lprint(`Request at x=`, x); -y^2*exp(-y(x))-10*y*(1+0.1e-1*exp(y)) end if end proc

(20)

sol1:=dsolve({diff(y(x),x)=myfun(x,y(x)),y(0)=1},numeric,method=lsode[backfull],ctrl=C,initstep=0.1,minstep=0.1,abserr=1,relerr=1,known={myfun}):

sol1(0.1);

`Request at x=`, 0.

`Request at x=`, 0.

`Request at x=`, .1

`Request at x=`, .1

[x = .1, y(x) = .501579304183583]

(21)

sol2:=dsolve({diff(y(x),x)=myfun(x,y(x)),y(0)=1},numeric,method=lsode[backdiag],ctrl=C,initstep=0.1,minstep=0.1,abserr=1,relerr=1,known={myfun}):

sol2(0.1);

`Request at x=`, 0.

`Request at x=`, 0.

`Request at x=`, .1

`Request at x=`, .1

[x = .1, y(x) = .497831388424072]

(22)

 

Download Lsodeanalysistrunc.mws

 

Next see how dsolve method = mgear works just fine in Maple 6 (gives the expected answer upto 3 Digits accuracy). To run this code you will need Maple 6 or earlier versions. Maple 7 has this algorithm, but I don't know to use it as it is hidden. I would like to get support from other members to get Maplesoft's attention to bring this algorithm back.

If Mdy/dt = f(y) is solved using mgear algorithm (instead of dy/dt =f ), then one can have a good DAE solver based on this (M being singular). 

 

restart;

myfun:= proc(x,y) if not type(x,'numeric') or not type(evalf(y),numeric)then 'procname'(x,y);
    else lprint(`Request at x=`,x); -y^2*exp(-y(x))-10*y*(1+0.01*exp(y)); end if; end proc;

myfun := proc (x, y) if not (type(x, 'numeric') and type(evalf(y), numeric)) then ('procname')(x, y) else lprint(`Request at x=`, x); -y^2*exp(-y(x))-10*y*(1+0.1e-1*exp(y)) end if end proc

(1)

sol2:=dsolve({diff(y(x),x)=myfun(x,y(x)),y(0)=1},{y(x)},numeric,method=mgear[mstepnum],stepsize=0.1,minstep=0.1,errorper=1):

sol2(0.1);

`Request at x=`, 0.

`Request at x=`, .1

`Request at x=`, .1

`Request at x=`, .1

[x = .1, y(x) = .4887165263]

(2)

 

 

Download Mgearworks.mws

Hi everyone!

I have a problem solving the nonlinear ode (as attached below). I got this error ---> Error, (in fproc) unable to store '-1.32352941215398+(-0.441176470717993e-1, -0.)' when datatype=float[8]

1) Could someone please explain to me what does the unable store .... error means? 

and i will be grateful if you could help me finding the solution out. Thanks in advance


problem4.mw

Trying to solve this IVP of the SHO  (second order linear costant-coefficient).

Everything works fine until I come to the solving even after using dsolve with initial conditions (even using the differential operator D in the initial conditions)  , the answer still contains _C1, an unknown constant.

The full worksheet is below.  The code for dsolve is:

sol3 := dsolve(subs(par1, {de1, D(x)*0 = 0, x(0) = 1}), x(t));

 

Hoping you can help with a solution.

 

 

 

 

 

Hi

Please find the attachment

It seems a singularity has been occurred at left end point for n less than unit (say n=0.5, n>0)

Is there a way to fix it?

 

n.mw

DEAR SIR,

PLEASE HELP ME WITH THAT QUESTION

Hi...

 

I want to solve  this ODEs using Maple...

f’’’ + f f’’ – f’2 + λ θ = 0

(1/Pr) θ’’ + f θ’ – f’ θ = 0


and boundary conditions

f(0) = s,  f’(0) = σ + a f’’(0) + b f’’’(0),  θ(0) = 1,

f’(η) = 0, θ(η) = 0  as  η → ∞.

 

Can anyone help me to solve this problem? Thank you... =)

Hello,

 

I tried to plot the problem presented below:

restart; with(plots); C := setcolors(); with(LinearAlgebra);

formula1 := 2.6*BodyWeight*abs(sin(4*Pi*t));
2.6 BodyWeight |sin(4 Pi t)|
BodyWeight := 80*9.81;
plot(formula1, t = 0 .. 2);


eq2 := formula1-SpringConstant*y(t)-DampConstant*(diff(y(t), t)) = Mass*(diff(y(t), `$`(t, 2)));
2040.480 |sin(4 Pi t)| - SpringConstant y(t)

/ d \ / d / d \\
- DampConstant |--- y(t)| = Mass |--- |--- y(t)||
\ dt / \ dt \ dt //
DampConstant := 50;
50
Mass := .200;
Springt := 200;
200
SpringConstant := Youngsmodulus*Surface/DeltaLength;
DeltaLength := 0.2e-1-y(t);
Surface := .15;
Youngsmodulus := 6.5*10^6/(t+1)+6.5*10^6;
plot(Youngsmodulus, t = 0 .. 10000);

eq2;
2040.480 |sin(4 Pi t)|

/ 6 \
|6.5000000 10 6|
0.15 |------------- + 6.5000000 10 | y(t)
\ t + 1 / / d \
- ----------------------------------------- - 50 |--- y(t)| =
0.02 - y(t) \ dt /

/ d / d \\
0.200 |--- |--- y(t)||
\ dt \ dt //

incs := y(0) = 0, (D(y))(0) = 0;
eq4 := dsolve({eq2, incs}, y(t), type = numeric, method = lsode[backfull], maxfun = 0);
proc(x_lsode) ... end;

plots:-odeplot(eq4, [t, y(t)], 0 .. 5);

 When I try to plot it beyond t=5, Maple gives the following error:

Warning, could not obtain numerical solution at all points, plot may be incomplete

Does anyone know how to plot it even further?

 

 

Here is ODE

restart:
with(plots):
Digits:=35:

ini1:=D(x)(0)=0,x(0)=1:
dsys:=diff(x(t),t,t)+(x(t)-2)*diff(x(t),t)+5*x(t)=0;
dsol1 :=dsolve({dsys,ini1},numeric,abserr=1e-9, relerr=1e-8,maxfun=0);
plots:-odeplot(dsol1,[[t,x(t)]],0..20,axes=boxed,color=black,linestyle=1,tickmarks=[6, 6],axes=boxed,titlefont=[SYMBOL,12]);

1-Why when i run for long time>1.5 give me error

2- how to plot phase plot of x'(t) against x(t)

Any comments will be helpful

Hi!

I am simulate the code for fractional differential equation. But the out put is not wright...
sir_(2).mw

``

S[0] := .8;

.8

(1)

V[0] := .2;

.2

(2)

R[0] := 0;

0

(3)

alpha := 1;

1

 

.4

 

.8

 

gamma = 0.3e-1

(4)

q := .9;

.9

(5)

T := 1;

1

(6)

N := 5;

5

(7)

h := T/N;

1/5

(8)

``

for i from 0 to N do for j from 0 to 0 do a[j, i+1] := i^(alpha+1)-(i-alpha)*(i+1)^alpha; b[j, i+1] := h^alpha*((i+1-j)^alpha-(i-j)^alpha)/alpha end do end do;

for n from 0 to N do Sp[n+1] = S[0]+(sum(b[d, n+1]*(mu*(1-q)-beta*S[d]*V[d]-mu*S[d]), d = 0 .. n))/GAMMA(alpha); Vp[n+1] = V[0]+(sum(b[d, n+1]*(beta*S[d]*V[d]-(mu+gamma)*S[d]), d = 0 .. n))/GAMMA(alpha); Rp[n+1] = R[0]+(sum(b[d, n+1]*(mu*q-mu*R[d]+gamma*V[d]), d = 0 .. n))/GAMMA(alpha); S[n+1] = S[0]+h^alpha*(mu*(1-q)-beta*Sp[n+1]*Vp[n+1]-mu*Sp[n+1])/GAMMA(alpha+2)+h^alpha*(sum(a[e, n+1]*(mu*(1-q)-beta*S[e]*V[e]-mu*S[e]), e = 0 .. n))/GAMMA(alpha+2); V[n+1] = V[0]+h^alpha*(beta*Sp[n+1]*Vp[n+1]-(mu+gamma)*Sp[n+1])/GAMMA(alpha+2)+h^alpha*(sum(a[e, n+1]*(beta*S[e]*V[e]-(mu+gamma)*S[e]), e = 0 .. n))/GAMMA(alpha+2); R[n+1] = R[0]+h^alpha*(mu*q-mu*Rp[n+1]-gamma*Vp[n+1])/GAMMA(alpha+2)+h^alpha*(sum(a[e, n+1]*(mu*q-mu*R[e]-gamma*V[e]), e = 0 .. n))/GAMMA(alpha+2) end do;

Sp[1] = .7184000000

 

Vp[1] = 0.692454936e-1

 

Rp[1] = 0.9508862660e-1

 

S[1] = .7632000000-0.8000000000e-1*Sp[1]*Vp[1]-0.4000000000e-1*Sp[1]

 

V[1] = .1346227468+0.8000000000e-1*Sp[1]*Vp[1]-(1/10)*(.4+gamma)*Sp[1]

 

R[1] = 0.6045568670e-1-(1/10)*gamma*Vp[1]-0.4000000000e-1*Rp[1]

 

Sp[2] = .7264000000-.1600000000*S[1]*V[1]-0.8000000000e-1*S[1]

 

Vp[2] = 0.692454936e-1+.1600000000*S[1]*V[1]-.1954431330*S[1]

 

Rp[2] = .1670886266+.1154431330*V[1]-0.8000000000e-1*R[1]

 

S[2] = .7712000000-0.8000000000e-1*Sp[2]*Vp[2]-0.4000000000e-1*Sp[2]-.1600000000*S[1]*V[1]-0.8000000000e-1*S[1]

 

V[2] = .1346227468+0.8000000000e-1*Sp[2]*Vp[2]-(1/10)*(.4+gamma)*Sp[2]+.1600000000*S[1]*V[1]-.1954431330*S[1]

 

R[2] = .1324556867-(1/10)*gamma*Vp[2]-0.4000000000e-1*Rp[2]-.1154431330*V[1]-0.8000000000e-1*R[1]

 

Sp[3] = .7344000000-.1600000000*S[1]*V[1]-0.8000000000e-1*S[1]-.1600000000*S[2]*V[2]-0.8000000000e-1*S[2]

 

Vp[3] = 0.692454936e-1+.1600000000*S[1]*V[1]-.1954431330*S[1]+.1600000000*S[2]*V[2]-.1954431330*S[2]

 

Rp[3] = .2390886266+.1154431330*V[1]-0.8000000000e-1*R[1]+.1154431330*V[2]-0.8000000000e-1*R[2]

 

S[3] = .7792000000-0.8000000000e-1*Sp[3]*Vp[3]-0.4000000000e-1*Sp[3]-.1600000000*S[1]*V[1]-0.8000000000e-1*S[1]-.1600000000*S[2]*V[2]-0.8000000000e-1*S[2]

 

V[3] = .1346227468+0.8000000000e-1*Sp[3]*Vp[3]-(1/10)*(.4+gamma)*Sp[3]+.1600000000*S[1]*V[1]-.1954431330*S[1]+.1600000000*S[2]*V[2]-.1954431330*S[2]

 

R[3] = .2044556867-(1/10)*gamma*Vp[3]-0.4000000000e-1*Rp[3]-.1154431330*V[1]-0.8000000000e-1*R[1]-.1154431330*V[2]-0.8000000000e-1*R[2]

 

Sp[4] = .7424000000-.1600000000*S[1]*V[1]-0.8000000000e-1*S[1]-.1600000000*S[2]*V[2]-0.8000000000e-1*S[2]-.1600000000*S[3]*V[3]-0.8000000000e-1*S[3]

 

Vp[4] = 0.692454936e-1+.1600000000*S[1]*V[1]-.1954431330*S[1]+.1600000000*S[2]*V[2]-.1954431330*S[2]+.1600000000*S[3]*V[3]-.1954431330*S[3]

 

Rp[4] = .3110886266+.1154431330*V[1]-0.8000000000e-1*R[1]+.1154431330*V[2]-0.8000000000e-1*R[2]+.1154431330*V[3]-0.8000000000e-1*R[3]

 

S[4] = .7872000000-0.8000000000e-1*Sp[4]*Vp[4]-0.4000000000e-1*Sp[4]-.1600000000*S[1]*V[1]-0.8000000000e-1*S[1]-.1600000000*S[2]*V[2]-0.8000000000e-1*S[2]-.1600000000*S[3]*V[3]-0.8000000000e-1*S[3]

 

V[4] = .1346227468+0.8000000000e-1*Sp[4]*Vp[4]-(1/10)*(.4+gamma)*Sp[4]+.1600000000*S[1]*V[1]-.1954431330*S[1]+.1600000000*S[2]*V[2]-.1954431330*S[2]+.1600000000*S[3]*V[3]-.1954431330*S[3]

 

R[4] = .2764556867-(1/10)*gamma*Vp[4]-0.4000000000e-1*Rp[4]-.1154431330*V[1]-0.8000000000e-1*R[1]-.1154431330*V[2]-0.8000000000e-1*R[2]-.1154431330*V[3]-0.8000000000e-1*R[3]

 

Sp[5] = .7504000000-.1600000000*S[1]*V[1]-0.8000000000e-1*S[1]-.1600000000*S[2]*V[2]-0.8000000000e-1*S[2]-.1600000000*S[3]*V[3]-0.8000000000e-1*S[3]-.1600000000*S[4]*V[4]-0.8000000000e-1*S[4]

 

Vp[5] = 0.692454936e-1+.1600000000*S[1]*V[1]-.1954431330*S[1]+.1600000000*S[2]*V[2]-.1954431330*S[2]+.1600000000*S[3]*V[3]-.1954431330*S[3]+.1600000000*S[4]*V[4]-.1954431330*S[4]

 

Rp[5] = .3830886266+.1154431330*V[1]-0.8000000000e-1*R[1]+.1154431330*V[2]-0.8000000000e-1*R[2]+.1154431330*V[3]-0.8000000000e-1*R[3]+.1154431330*V[4]-0.8000000000e-1*R[4]

 

S[5] = .7952000000-0.8000000000e-1*Sp[5]*Vp[5]-0.4000000000e-1*Sp[5]-.1600000000*S[1]*V[1]-0.8000000000e-1*S[1]-.1600000000*S[2]*V[2]-0.8000000000e-1*S[2]-.1600000000*S[3]*V[3]-0.8000000000e-1*S[3]-.1600000000*S[4]*V[4]-0.8000000000e-1*S[4]

 

V[5] = .1346227468+0.8000000000e-1*Sp[5]*Vp[5]-(1/10)*(.4+gamma)*Sp[5]+.1600000000*S[1]*V[1]-.1954431330*S[1]+.1600000000*S[2]*V[2]-.1954431330*S[2]+.1600000000*S[3]*V[3]-.1954431330*S[3]+.1600000000*S[4]*V[4]-.1954431330*S[4]

 

R[5] = .3484556867-(1/10)*gamma*Vp[5]-0.4000000000e-1*Rp[5]-.1154431330*V[1]-0.8000000000e-1*R[1]-.1154431330*V[2]-0.8000000000e-1*R[2]-.1154431330*V[3]-0.8000000000e-1*R[3]-.1154431330*V[4]-0.8000000000e-1*R[4]

 

Sp[6] = .7584000000-.1600000000*S[1]*V[1]-0.8000000000e-1*S[1]-.1600000000*S[2]*V[2]-0.8000000000e-1*S[2]-.1600000000*S[3]*V[3]-0.8000000000e-1*S[3]-.1600000000*S[4]*V[4]-0.8000000000e-1*S[4]-.1600000000*S[5]*V[5]-0.8000000000e-1*S[5]

 

Vp[6] = 0.692454936e-1+.1600000000*S[1]*V[1]-.1954431330*S[1]+.1600000000*S[2]*V[2]-.1954431330*S[2]+.1600000000*S[3]*V[3]-.1954431330*S[3]+.1600000000*S[4]*V[4]-.1954431330*S[4]+.1600000000*S[5]*V[5]-.1954431330*S[5]

 

Rp[6] = .4550886266+.1154431330*V[1]-0.8000000000e-1*R[1]+.1154431330*V[2]-0.8000000000e-1*R[2]+.1154431330*V[3]-0.8000000000e-1*R[3]+.1154431330*V[4]-0.8000000000e-1*R[4]+.1154431330*V[5]-0.8000000000e-1*R[5]

 

S[6] = .8032000000-0.8000000000e-1*Sp[6]*Vp[6]-0.4000000000e-1*Sp[6]-.1600000000*S[1]*V[1]-0.8000000000e-1*S[1]-.1600000000*S[2]*V[2]-0.8000000000e-1*S[2]-.1600000000*S[3]*V[3]-0.8000000000e-1*S[3]-.1600000000*S[4]*V[4]-0.8000000000e-1*S[4]-.1600000000*S[5]*V[5]-0.8000000000e-1*S[5]

 

V[6] = .1346227468+0.8000000000e-1*Sp[6]*Vp[6]-(1/10)*(.4+gamma)*Sp[6]+.1600000000*S[1]*V[1]-.1954431330*S[1]+.1600000000*S[2]*V[2]-.1954431330*S[2]+.1600000000*S[3]*V[3]-.1954431330*S[3]+.1600000000*S[4]*V[4]-.1954431330*S[4]+.1600000000*S[5]*V[5]-.1954431330*S[5]

 

R[6] = .4204556867-(1/10)*gamma*Vp[6]-0.4000000000e-1*Rp[6]-.1154431330*V[1]-0.8000000000e-1*R[1]-.1154431330*V[2]-0.8000000000e-1*R[2]-.1154431330*V[3]-0.8000000000e-1*R[3]-.1154431330*V[4]-0.8000000000e-1*R[4]-.1154431330*V[5]-0.8000000000e-1*R[5]

(9)

``

``

 

Download sir_(2).mw

 

Hello guys,

I was just playing around with differential equations, when I noticed that symbolic solution is  different from the numerical.What is the reason for this strange behavior?


ODE := (diff(y(x), x))*(ln(y(x))+x) = 1

sol := dsolve({ODE, y(1) = 1}, y(x))

a := plot(op(2, sol), x = .75 .. 2, color = "Red");
sol2 := dsolve([ODE, y(1) = 1], numeric, range = .75 .. 2);

with(plots);
b := odeplot(sol2, .75 .. 2, thickness = 4);
display({a, b});

 

 

Strange_issue.mw

Mariusz Iwaniuk

Hi everyone. I'm going to solve a problem of an article with hpm. well I wrote some initial codes(I uploaded both codes and article). but now I face with a problem. I cant reach to the correct plot that is in the article. could you please help me???

(dont think I am lazy ;))) I found f and g (by make a system with A1 and B1 and solve it i found f[0] and g[0], with p^3 coefficient in A-->f[1] and then with B2 I foud g[1]) and their plot was correct. but the problem is theta and phi and their plots :(( )

Project.mw

2.pdf   this is article



 

restart;

lambda:=0.5;K[r]:=0.5;Sc:=0.5;Nb:=0.1;Nt:=0.1;Pr:=10;

.5

 

.5

 

.5

 

.1

 

.1

 

10

(1)

EQUATIONS

equ1:=diff(f(eta),eta$4)-R*(diff(f(eta),eta)*diff(f(eta),eta$2)-f(eta)*diff(f(eta),eta$2))-2*K[r]*diff(g(eta),eta)=0;

equ2:=diff(g(eta),eta$2)-R*(diff(f(eta),eta)*g(eta)-f(eta)*diff(g(eta),eta))+2*K[r]*diff(f(eta),eta)=0;

equ3:=diff(theta(eta),eta$2)+Pr*R*f(eta)*diff(theta(eta),eta)+Nb*diff(phi(eta),eta)*diff(theta(eta),eta)+Nt*diff(theta(eta),eta)^2=0;

equ4:=diff(phi(eta),eta$2)+R*Sc*f(eta)*diff(phi(eta),eta)+diff(theta(eta),eta$2)*(Nt/Nb)=0;

diff(diff(diff(diff(f(eta), eta), eta), eta), eta)-R*((diff(f(eta), eta))*(diff(diff(f(eta), eta), eta))-f(eta)*(diff(diff(f(eta), eta), eta)))-1.0*(diff(g(eta), eta)) = 0

 

diff(diff(g(eta), eta), eta)-R*((diff(f(eta), eta))*g(eta)-f(eta)*(diff(g(eta), eta)))+1.0*(diff(f(eta), eta)) = 0

 

diff(diff(theta(eta), eta), eta)+10*R*f(eta)*(diff(theta(eta), eta))+.1*(diff(phi(eta), eta))*(diff(theta(eta), eta))+.1*(diff(theta(eta), eta))^2 = 0

 

diff(diff(phi(eta), eta), eta)+.5*R*f(eta)*(diff(phi(eta), eta))+1.000000000*(diff(diff(theta(eta), eta), eta)) = 0

(2)

BOUNDARY*CONDITIONS

ics:=
f(0)=0,D(f)(0)=1,g(0)=0,theta(0)=1,phi(0)=1;
f(1)=lambda,D(f)(1)=0,g(1)=0,theta(1)=0,phi(1)=0;

f(0) = 0, (D(f))(0) = 1, g(0) = 0, theta(0) = 1, phi(0) = 1

 

f(1) = .5, (D(f))(1) = 0, g(1) = 0, theta(1) = 0, phi(1) = 0

(3)

HPMs

hpm1:=(1-p)*(diff(f(eta),eta$4)-2*K[r]*diff(g(eta),eta))+p*(diff(f(eta),eta$4)-R*(diff(f(eta),eta)*diff(f(eta),eta$2)-f(eta)*diff(f(eta),eta$2))-2*K[r]*diff(g(eta),eta))=0;

hpm2:=(1-p)*(diff(g(eta),eta$2)+2*K[r]*diff(f(eta),eta))+p*(diff(g(eta),eta$2)-R*(diff(f(eta),eta)*g(eta)-f(eta)*diff(g(eta),eta))+2*K[r]*diff(f(eta),eta))=0;

hpm3:=(1-p)*(diff(theta(eta),eta$2))+p*(diff(theta(eta),eta$2)+Pr*R*f(eta)*diff(theta(eta),eta)+Nb*diff(phi(eta),eta)*diff(theta(eta),eta)+Nt*diff(theta(eta),eta)^2)=0;

hpm4:=(1-p)*(diff(phi(eta),eta$2)+diff(theta(eta),eta$2)*(Nt/Nb))+p*(diff(phi(eta),eta$2)+R*Sc*f(eta)*diff(phi(eta),eta)+diff(theta(eta),eta$2)*(Nt/Nb))=0;

(1-p)*(diff(diff(diff(diff(f(eta), eta), eta), eta), eta)-1.0*(diff(g(eta), eta)))+p*(diff(diff(diff(diff(f(eta), eta), eta), eta), eta)-R*((diff(f(eta), eta))*(diff(diff(f(eta), eta), eta))-f(eta)*(diff(diff(f(eta), eta), eta)))-1.0*(diff(g(eta), eta))) = 0

 

(1-p)*(diff(diff(g(eta), eta), eta)+1.0*(diff(f(eta), eta)))+p*(diff(diff(g(eta), eta), eta)-R*((diff(f(eta), eta))*g(eta)-f(eta)*(diff(g(eta), eta)))+1.0*(diff(f(eta), eta))) = 0

 

(1-p)*(diff(diff(theta(eta), eta), eta))+p*(diff(diff(theta(eta), eta), eta)+10*R*f(eta)*(diff(theta(eta), eta))+.1*(diff(phi(eta), eta))*(diff(theta(eta), eta))+.1*(diff(theta(eta), eta))^2) = 0

 

(1-p)*(diff(diff(phi(eta), eta), eta)+1.000000000*(diff(diff(theta(eta), eta), eta)))+p*(diff(diff(phi(eta), eta), eta)+.5*R*f(eta)*(diff(phi(eta), eta))+1.000000000*(diff(diff(theta(eta), eta), eta))) = 0

(4)

f(eta)=sum(f[i](eta)*p^i,i=0..1);

f(eta) = f[0](eta)+f[1](eta)*p

(5)

g(eta)=sum(g[i](eta)*p^i,i=0..1);

g(eta) = g[0](eta)+g[1](eta)*p

(6)

theta(eta)=sum(theta[i](eta)*p^i,i=0..1);

theta(eta) = theta[0](eta)+theta[1](eta)*p

(7)

phi(eta)=sum(phi[i](eta)*p^i,i=0..1);

phi(eta) = phi[0](eta)+phi[1](eta)*p

(8)

FORequ1

A:=collect(expand(subs(f(eta)=f[0](eta)+f[1](eta)*p,g(eta)=g[0](eta)+g[1](eta)*p,hpm1)),p);

(-1.*R*(diff(f[1](eta), eta))*(diff(diff(f[1](eta), eta), eta))+R*f[1](eta)*(diff(diff(f[1](eta), eta), eta)))*p^3+(-1.*R*(diff(f[0](eta), eta))*(diff(diff(f[1](eta), eta), eta))-1.*R*(diff(f[1](eta), eta))*(diff(diff(f[0](eta), eta), eta))+R*f[0](eta)*(diff(diff(f[1](eta), eta), eta))+R*f[1](eta)*(diff(diff(f[0](eta), eta), eta)))*p^2+(diff(diff(diff(diff(f[1](eta), eta), eta), eta), eta)-1.0*(diff(g[1](eta), eta))-1.*R*(diff(f[0](eta), eta))*(diff(diff(f[0](eta), eta), eta))+R*f[0](eta)*(diff(diff(f[0](eta), eta), eta)))*p+diff(diff(diff(diff(f[0](eta), eta), eta), eta), eta)-1.0*(diff(g[0](eta), eta)) = 0

(9)

A1:=diff(f[0](eta),eta$4)-2*K[r]*(diff(g[0](eta),eta))=0;
A2:=diff(f[1](eta),eta$4)-2*K[r]*(diff(g[1](eta),eta))-R*(diff(f[0](eta),eta))*(diff(f[0](eta),eta$2))+R*f[0](eta)*(diff(f[0](eta),eta$2))=0;

diff(diff(diff(diff(f[0](eta), eta), eta), eta), eta)-1.0*(diff(g[0](eta), eta)) = 0

 

diff(diff(diff(diff(f[1](eta), eta), eta), eta), eta)-1.0*(diff(g[1](eta), eta))-R*(diff(f[0](eta), eta))*(diff(diff(f[0](eta), eta), eta))+R*f[0](eta)*(diff(diff(f[0](eta), eta), eta)) = 0

(10)

icsA1:=f[0](0)=0,D(f[0])(0)=1,g[0](0)=0,f[0](1)=lambda,D(f[0])(1)=0,g[0](1)=0;
icsA2:=f[1](0)=0,D(f[1])(0)=0,g[1](0)=0,f[1](1)=0,D(f[1])(1)=0,g[1](1)=0;

f[0](0) = 0, (D(f[0]))(0) = 1, g[0](0) = 0, f[0](1) = .5, (D(f[0]))(1) = 0, g[0](1) = 0

 

f[1](0) = 0, (D(f[1]))(0) = 0, g[1](0) = 0, f[1](1) = 0, (D(f[1]))(1) = 0, g[1](1) = 0

(11)

NULLFORequ2

B:=collect(expand(subs(f(eta)=f[0](eta)+f[1](eta)*p,g(eta)=g[0](eta)+g[1](eta)*p,hpm2)),p);

(-1.*R*(diff(f[1](eta), eta))*g[1](eta)+R*f[1](eta)*(diff(g[1](eta), eta)))*p^3+(-1.*R*(diff(f[0](eta), eta))*g[1](eta)-1.*R*(diff(f[1](eta), eta))*g[0](eta)+R*f[0](eta)*(diff(g[1](eta), eta))+R*f[1](eta)*(diff(g[0](eta), eta)))*p^2+(diff(diff(g[1](eta), eta), eta)+1.0*(diff(f[1](eta), eta))-1.*R*(diff(f[0](eta), eta))*g[0](eta)+R*f[0](eta)*(diff(g[0](eta), eta)))*p+diff(diff(g[0](eta), eta), eta)+1.0*(diff(f[0](eta), eta)) = 0

(12)

B1:=diff(g[0](eta),eta$2)+2*K[r]*(diff(f[0](eta),eta))=0;
B2:=diff(g[1](eta),eta$2)+2*K[r]*(diff(f[1](eta),eta))-R*(diff(f[0](eta),eta))*g[0](eta)+R*f[0](eta)*(diff(g[0](eta),eta))=0;

diff(diff(g[0](eta), eta), eta)+1.0*(diff(f[0](eta), eta)) = 0

 

diff(diff(g[1](eta), eta), eta)+1.0*(diff(f[1](eta), eta))-R*(diff(f[0](eta), eta))*g[0](eta)+R*f[0](eta)*(diff(g[0](eta), eta)) = 0

(13)

icsB1:=f[0](0)=0,D(f[0])(0)=1,g[0](0)=0,f[0](1)=lambda,D(f[0])(1)=0,g[0](1)=0;
icsB2:=f[1](0)=0,D(f[1])(0)=0,g[1](0)=0,f[1](1)=0,D(f[1])(1)=0,g[1](1)=0;

f[0](0) = 0, (D(f[0]))(0) = 1, g[0](0) = 0, f[0](1) = .5, (D(f[0]))(1) = 0, g[0](1) = 0

 

f[1](0) = 0, (D(f[1]))(0) = 0, g[1](0) = 0, f[1](1) = 0, (D(f[1]))(1) = 0, g[1](1) = 0

(14)

FORequ3

C:=collect(expand(subs(theta(eta)=theta[0](eta)+theta[1](eta)*p,phi(eta)=phi[0](eta)+phi[1](eta)*p,f(eta)=f[0](eta)+f[1](eta)*p,hpm3)),p);

(10.*R*f[1](eta)*(diff(theta[1](eta), eta))+.1*(diff(phi[1](eta), eta))*(diff(theta[1](eta), eta))+.1*(diff(theta[1](eta), eta))^2)*p^3+(10.*R*f[0](eta)*(diff(theta[1](eta), eta))+10.*R*f[1](eta)*(diff(theta[0](eta), eta))+.1*(diff(phi[0](eta), eta))*(diff(theta[1](eta), eta))+.1*(diff(phi[1](eta), eta))*(diff(theta[0](eta), eta))+.2*(diff(theta[0](eta), eta))*(diff(theta[1](eta), eta)))*p^2+(diff(diff(theta[1](eta), eta), eta)+10.*R*f[0](eta)*(diff(theta[0](eta), eta))+.1*(diff(phi[0](eta), eta))*(diff(theta[0](eta), eta))+.1*(diff(theta[0](eta), eta))^2)*p+diff(diff(theta[0](eta), eta), eta) = 0

(15)

C1:=diff(theta[0](eta),eta$2)=0;
C2:=diff(theta[1](eta), eta, eta)+Pr*R*f[0](eta)*(diff(theta[0](eta), eta))+Nb*(diff(phi[0](eta), eta))*(diff(theta[0](eta), eta))+Nt*(diff(theta[0](eta), eta))^2=0;

diff(diff(theta[0](eta), eta), eta) = 0

 

diff(diff(theta[1](eta), eta), eta)+10*R*f[0](eta)*(diff(theta[0](eta), eta))+.1*(diff(phi[0](eta), eta))*(diff(theta[0](eta), eta))+.1*(diff(theta[0](eta), eta))^2 = 0

(16)

icsC1:=theta[0](0)=1,theta[0](1)=0;
icsC2:=f[0](0)=0,D(f[0])(0)=1,f[1](1)=0,D(f[1])(1)=0,theta[1](0)=0,theta[1](1)=0,phi[0](0)=0,phi[0](1)=0;

theta[0](0) = 1, theta[0](1) = 0

 

f[0](0) = 0, (D(f[0]))(0) = 1, f[1](1) = 0, (D(f[1]))(1) = 0, theta[1](0) = 0, theta[1](1) = 0, phi[0](0) = 0, phi[0](1) = 0

(17)

FORequ4

E:=collect(expand(subs(theta(eta)=theta[0](eta)+theta[1](eta)*p,phi(eta)=phi[0](eta)+phi[1](eta)*p,f(eta)=f[0](eta)+f[1](eta)*p,hpm4)),p);

.5*R*f[1](eta)*p^3*(diff(phi[1](eta), eta))+(.5*R*f[0](eta)*(diff(phi[1](eta), eta))+.5*R*f[1](eta)*(diff(phi[0](eta), eta)))*p^2+(diff(diff(phi[1](eta), eta), eta)+1.000000000*(diff(diff(theta[1](eta), eta), eta))+.5*R*f[0](eta)*(diff(phi[0](eta), eta)))*p+diff(diff(phi[0](eta), eta), eta)+1.000000000*(diff(diff(theta[0](eta), eta), eta)) = 0

(18)

E1:=diff(phi[0](eta),eta$2)+Nt*(diff(theta[0](eta),eta$2))/Nb=0;
E2:=diff(phi[1](eta),eta$2)+Nt*(diff(theta[1](eta),eta$2))/Nb+R*Sc*f[0](eta)*(diff(phi[0](eta),eta))=0;

diff(diff(phi[0](eta), eta), eta)+1.000000000*(diff(diff(theta[0](eta), eta), eta)) = 0

 

diff(diff(phi[1](eta), eta), eta)+1.000000000*(diff(diff(theta[1](eta), eta), eta))+.5*R*f[0](eta)*(diff(phi[0](eta), eta)) = 0

(19)

icsE1:=phi[0](0)=1,phi[0](1)=0;
icsE2:=f[0](0)=0,D(f[0])(0)=1,f[1](1)=0,D(f[1])(1)=0,theta[1](0)=0,theta[1](1)=0,phi[1](0)=0,phi[1](1)=0;

phi[0](0) = 1, phi[0](1) = 0

 

f[0](0) = 0, (D(f[0]))(0) = 1, f[1](1) = 0, (D(f[1]))(1) = 0, theta[1](0) = 0, theta[1](1) = 0, phi[1](0) = 0, phi[1](1) = 0

(20)

``

NULL



Download Project.mw


Project.mw

Download Project.mw

thanks for your favorits

Hi, i am trying to solve my PDEs with HPM method ,but i get strange errors.

first one is :Error, (in trig/reduce/reduce) Maple was unable to allocate enough memory to complete this computation.  Please see ?alloc,

but when i run my last function again,the error chages,let me show you.


restart;
lambda:=0.5;K[r]:=0.5;Sc:=0.5;Nb:=0.1;Nt:=0.1;Pr:=10;
                              0.5
                              0.5
                              0.5
                              0.1
                              0.1
                               10
> EQUATIONS;


equ1:=diff(f(eta),eta$4)-R*(diff(f(eta),eta)*diff(f(eta),eta$2)-f(eta)*diff(f(eta),eta$2))-2*K[r]*diff(g(eta),eta)=0;

equ2:=diff(g(eta),eta$2)-R*(diff(f(eta),eta)*g(eta)-f(eta)*diff(g(eta),eta))+2*K[r]*diff(f(eta),eta)=0;

equ3:=diff(theta(eta),eta$2)+Pr*R*f(eta)*diff(theta(eta),eta)+Nb*diff(phi(eta),eta)*diff(theta(eta),eta)+Nt*diff(theta(eta),eta)^2=0;

equ4:=diff(phi(eta),eta$2)+R*Sc*f(eta)*diff(phi(eta),eta)+diff(theta(eta),eta$2)*(Nt/Nb)=0;
/  d   /  d   /  d   /  d         \\\\     //  d         \ /  d  
|----- |----- |----- |----- f(eta)|||| - R ||----- f(eta)| |-----
\ deta \ deta \ deta \ deta       ////     \\ deta       / \ deta

   /  d         \\          /  d   /  d         \\\
   |----- f(eta)|| - f(eta) |----- |----- f(eta)|||
   \ deta       //          \ deta \ deta       ///

         /  d         \    
   - 1.0 |----- g(eta)| = 0
         \ deta       /    
     /  d   /  d         \\
     |----- |----- g(eta)||
     \ deta \ deta       //

            //  d         \                 /  d         \\
        - R ||----- f(eta)| g(eta) - f(eta) |----- g(eta)||
            \\ deta       /                 \ deta       //

              /  d         \    
        + 1.0 |----- f(eta)| = 0
              \ deta       /    
  /  d   /  d             \\               /  d             \
  |----- |----- theta(eta)|| + 10 R f(eta) |----- theta(eta)|
  \ deta \ deta           //               \ deta           /

           /  d           \ /  d             \
     + 0.1 |----- phi(eta)| |----- theta(eta)|
           \ deta         / \ deta           /

                             2    
           /  d             \     
     + 0.1 |----- theta(eta)|  = 0
           \ deta           /     
    /  d   /  d           \\                /  d           \
    |----- |----- phi(eta)|| + 0.5 R f(eta) |----- phi(eta)|
    \ deta \ deta         //                \ deta         /

                     /  d   /  d             \\    
       + 1.000000000 |----- |----- theta(eta)|| = 0
                     \ deta \ deta           //    
> BOUNDARY*CONDITIONS;


ics:=
f(0)=0,D(f)(0)=1,g(0)=0,theta(0)=1,phi(0)=1;
f(1)=lambda,D(f)(1)=0,g(1)=0,theta(1)=0,phi(1)=0;
   f(0) = 0, D(f)(0) = 1, g(0) = 0, theta(0) = 1, phi(0) = 1
  f(1) = 0.5, D(f)(1) = 0, g(1) = 0, theta(1) = 0, phi(1) = 0
> HPMs;


hpm1:=(1-p)*(diff(f(eta),eta$4)-2*K[r]*diff(g(eta),eta))+p*(diff(f(eta),eta$4)-R*(diff(f(eta),eta)*diff(f(eta),eta$2)-f(eta)*diff(f(eta),eta$2))-2*K[r]*diff(g(eta),eta))=0;

hpm2:=(1-p)*(diff(g(eta),eta$2)+2*K[r]*diff(f(eta),eta))+p*(diff(g(eta),eta$2)-R*(diff(f(eta),eta)*g(eta)-f(eta)*diff(g(eta),eta))+2*K[r]*diff(f(eta),eta))=0;

hpm3:=(1-p)*(diff(theta(eta),eta$2))+p*(diff(theta(eta),eta$2)+Pr*R*f(eta)*diff(theta(eta),eta)+Nb*diff(phi(eta),eta)*diff(theta(eta),eta)+Nt*diff(theta(eta),eta)^2)=0;

hpm4:=(1-p)*(diff(phi(eta),eta$2)+diff(theta(eta),eta$2)*(Nt/Nb))+p*(diff(phi(eta),eta$2)+R*Sc*f(eta)*diff(phi(eta),eta)+diff(theta(eta),eta$2)*(Nt/Nb))=0;

        //  d   /  d   /  d   /  d         \\\\
(1 - p) ||----- |----- |----- |----- f(eta)||||
        \\ deta \ deta \ deta \ deta       ////

         /  d         \\     //  d   /  d   /  d   /  d         \
   - 1.0 |----- g(eta)|| + p ||----- |----- |----- |----- f(eta)|
         \ deta       //     \\ deta \ deta \ deta \ deta       /

  \\\     //  d         \ /  d   /  d         \\
  ||| - R ||----- f(eta)| |----- |----- f(eta)||
  ///     \\ deta       / \ deta \ deta       //

            /  d   /  d         \\\       /  d         \\    
   - f(eta) |----- |----- f(eta)||| - 1.0 |----- g(eta)|| = 0
            \ deta \ deta       ///       \ deta       //    
        //  d   /  d         \\       /  d         \\     //  d  
(1 - p) ||----- |----- g(eta)|| + 1.0 |----- f(eta)|| + p ||-----
        \\ deta \ deta       //       \ deta       //     \\ deta

   /  d         \\
   |----- g(eta)||
   \ deta       //

       //  d         \                 /  d         \\
   - R ||----- f(eta)| g(eta) - f(eta) |----- g(eta)||
       \\ deta       /                 \ deta       //

         /  d         \\    
   + 1.0 |----- f(eta)|| = 0
         \ deta       //    
                                       /                         
        /  d   /  d             \\     |/  d   /  d             \
(1 - p) |----- |----- theta(eta)|| + p ||----- |----- theta(eta)|
        \ deta \ deta           //     \\ deta \ deta           /

  \               /  d             \
  | + 10 R f(eta) |----- theta(eta)|
  /               \ deta           /

         /  d           \ /  d             \
   + 0.1 |----- phi(eta)| |----- theta(eta)|
         \ deta         / \ deta           /

                           2\    
         /  d             \ |    
   + 0.1 |----- theta(eta)| | = 0
         \ deta           / /    
        //  d   /  d           \\
(1 - p) ||----- |----- phi(eta)||
        \\ deta \ deta         //

                 /  d   /  d             \\\     //  d   /  d   
   + 1.000000000 |----- |----- theta(eta)||| + p ||----- |-----
                 \ deta \ deta           ///     \\ deta \ deta

          \\                /  d           \
  phi(eta)|| + 0.5 R f(eta) |----- phi(eta)|
          //                \ deta         /

                 /  d   /  d             \\\    
   + 1.000000000 |----- |----- theta(eta)||| = 0
                 \ deta \ deta           ///    
f(eta)=sum(f[i](eta)*p^i,i=0..1);
                f(eta) = f[0](eta) + f[1](eta) p
g(eta)=sum(g[i](eta)*p^i,i=0..1);
                g(eta) = g[0](eta) + g[1](eta) p
theta(eta)=sum(theta[i](eta)*p^i,i=0..1);
          theta(eta) = theta[0](eta) + theta[1](eta) p
phi(eta)=sum(phi[i](eta)*p^i,i=0..1);
             phi(eta) = phi[0](eta) + phi[1](eta) p
> FORequ1;


A:=collect(expand(subs(f(eta)=f[0](eta)+f[1](eta)*p,g(eta)=g[0](eta)+g[1](eta)*p,hpm1)),p);
/      /  d            \ /  d   /  d            \\
|-1. R |----- f[1](eta)| |----- |----- f[1](eta)||
\      \ deta          / \ deta \ deta          //

                 /  d   /  d            \\\  3   /
   + R f[1](eta) |----- |----- f[1](eta)||| p  + |
                 \ deta \ deta          ///      \
      /  d            \ /  d   /  d            \\
-1. R |----- f[0](eta)| |----- |----- f[1](eta)||
      \ deta          / \ deta \ deta          //

          /  d            \ /  d   /  d            \\
   - 1. R |----- f[1](eta)| |----- |----- f[0](eta)||
          \ deta          / \ deta \ deta          //

                 /  d   /  d            \\
   + R f[0](eta) |----- |----- f[1](eta)||
                 \ deta \ deta          //

                 /  d   /  d            \\\  2   //  d   /  d   /
   + R f[1](eta) |----- |----- f[0](eta)||| p  + ||----- |----- |
                 \ deta \ deta          ///      \\ deta \ deta \

    d   /  d            \\\\       /  d            \
  ----- |----- f[1](eta)|||| - 1.0 |----- g[1](eta)|
   deta \ deta          ////       \ deta          /

          /  d            \ /  d   /  d            \\
   - 1. R |----- f[0](eta)| |----- |----- f[0](eta)||
          \ deta          / \ deta \ deta          //

                 /  d   /  d            \\\  
   + R f[0](eta) |----- |----- f[0](eta)||| p
                 \ deta \ deta          ///  

     /  d   /  d   /  d   /  d            \\\\
   + |----- |----- |----- |----- f[0](eta)||||
     \ deta \ deta \ deta \ deta          ////

         /  d            \    
   - 1.0 |----- g[0](eta)| = 0
         \ deta          /    
A1:=diff(f[0](eta),eta$4)-2*K[r]*(diff(g[0](eta),eta))=0;
A2:=diff(f[1](eta),eta$4)-2*K[r]*(diff(g[1](eta),eta))-R*(diff(f[0](eta),eta))*(diff(f[0](eta),eta$2))+R*f[0](eta)*(diff(f[0](eta),eta$2))=0;
/  d   /  d   /  d   /  d            \\\\       /  d            \   
|----- |----- |----- |----- f[0](eta)|||| - 1.0 |----- g[0](eta)| =
\ deta \ deta \ deta \ deta          ////       \ deta          /   

  0
/  d   /  d   /  d   /  d            \\\\       /  d            \
|----- |----- |----- |----- f[1](eta)|||| - 1.0 |----- g[1](eta)|
\ deta \ deta \ deta \ deta          ////       \ deta          /

       /  d            \ /  d   /  d            \\
   - R |----- f[0](eta)| |----- |----- f[0](eta)||
       \ deta          / \ deta \ deta          //

                 /  d   /  d            \\    
   + R f[0](eta) |----- |----- f[0](eta)|| = 0
                 \ deta \ deta          //    
icsA1:=f[0](0)=0,D(f[0])(0)=1,g[0](0)=0,f[0](1)=lambda,D(f[0])(1)=0,g[0](1)=0;
icsA2:=f[1](0)=0,D(f[1])(0)=0,g[1](0)=0,f[1](1)=0,D(f[1])(1)=0,g[1](1)=0;
   f[0](0) = 0, D(f[0])(0) = 1, g[0](0) = 0, f[0](1) = 0.5,

     D(f[0])(1) = 0, g[0](1) = 0
    f[1](0) = 0, D(f[1])(0) = 0, g[1](0) = 0, f[1](1) = 0,

      D(f[1])(1) = 0, g[1](1) = 0
>
FORequ2;


B:=collect(expand(subs(f(eta)=f[0](eta)+f[1](eta)*p,g(eta)=g[0](eta)+g[1](eta)*p,hpm2)),p);
/      /  d            \          
|-1. R |----- f[1](eta)| g[1](eta)
\      \ deta          /          

                 /  d            \\  3   /
   + R f[1](eta) |----- g[1](eta)|| p  + |
                 \ deta          //      \
      /  d            \          
-1. R |----- f[0](eta)| g[1](eta)
      \ deta          /          

          /  d            \          
   - 1. R |----- f[1](eta)| g[0](eta)
          \ deta          /          

                 /  d            \
   + R f[0](eta) |----- g[1](eta)|
                 \ deta          /

                 /  d            \\  2   //  d   /  d            
   + R f[1](eta) |----- g[0](eta)|| p  + ||----- |----- g[1](eta)
                 \ deta          //      \\ deta \ deta          

  \\       /  d            \        /  d            \          
  || + 1.0 |----- f[1](eta)| - 1. R |----- f[0](eta)| g[0](eta)
  //       \ deta          /        \ deta          /          

                 /  d            \\     /  d   /  d            \\
   + R f[0](eta) |----- g[0](eta)|| p + |----- |----- g[0](eta)||
                 \ deta          //     \ deta \ deta          //

         /  d            \    
   + 1.0 |----- f[0](eta)| = 0
         \ deta          /    
B1:=diff(g[0](eta),eta$2)+2*K[r]*(diff(f[0](eta),eta))=0;
B2:=diff(g[1](eta),eta$2)+2*K[r]*(diff(f[1](eta),eta))-R*(diff(f[0](eta),eta))*g[0](eta)+R*f[0](eta)*(diff(g[0](eta),eta))=0;
     /  d   /  d            \\       /  d            \    
     |----- |----- g[0](eta)|| + 1.0 |----- f[0](eta)| = 0
     \ deta \ deta          //       \ deta          /    
       /  d   /  d            \\       /  d            \
       |----- |----- g[1](eta)|| + 1.0 |----- f[1](eta)|
       \ deta \ deta          //       \ deta          /

              /  d            \          
          - R |----- f[0](eta)| g[0](eta)
              \ deta          /          

                        /  d            \    
          + R f[0](eta) |----- g[0](eta)| = 0
                        \ deta          /    
icsB1:=f[0](0)=0,D(f[0])(0)=1,g[0](0)=0,f[0](1)=lambda,D(f[0])(1)=0,g[0](1)=0;
icsB2:=f[1](0)=0,D(f[1])(0)=0,g[1](0)=0,f[1](1)=0,D(f[1])(1)=0,g[1](1)=0;
   f[0](0) = 0, D(f[0])(0) = 1, g[0](0) = 0, f[0](1) = 0.5,

     D(f[0])(1) = 0, g[0](1) = 0
    f[1](0) = 0, D(f[1])(0) = 0, g[1](0) = 0, f[1](1) = 0,

      D(f[1])(1) = 0, g[1](1) = 0
> FORequ3;


C:=collect(expand(subs(theta(eta)=theta[0](eta)+theta[1](eta)*p,phi(eta)=phi[0](eta)+phi[1](eta)*p,f(eta)=f[0](eta)+f[1](eta)*p,hpm3)),p);
 /                                     
 |                /  d                \
 |10. R f[1](eta) |----- theta[1](eta)|
 \                \ deta              /

          /  d              \ /  d                \
    + 0.1 |----- phi[1](eta)| |----- theta[1](eta)|
          \ deta            / \ deta              /

                               2\                              
          /  d                \ |  3   /                /  d   
    + 0.1 |----- theta[1](eta)| | p  + |10. R f[0](eta) |-----
          \ deta              / /      \                \ deta

                \                   /  d                \
   theta[1](eta)| + 10. R f[1](eta) |----- theta[0](eta)|
                /                   \ deta              /

          /  d              \ /  d                \
    + 0.1 |----- phi[0](eta)| |----- theta[1](eta)|
          \ deta            / \ deta              /

          /  d              \ /  d                \
    + 0.1 |----- phi[1](eta)| |----- theta[0](eta)|
          \ deta            / \ deta              /

                                                            /
          /  d                \ /  d                \\  2   |/
    + 0.2 |----- theta[0](eta)| |----- theta[1](eta)|| p  + ||
          \ deta              / \ deta              //      \\

     d   /  d                \\
   ----- |----- theta[1](eta)||
    deta \ deta              //

                      /  d                \
    + 10. R f[0](eta) |----- theta[0](eta)|
                      \ deta              /

          /  d              \ /  d                \
    + 0.1 |----- phi[0](eta)| |----- theta[0](eta)|
          \ deta            / \ deta              /

                               2\  
          /  d                \ |  
    + 0.1 |----- theta[0](eta)| | p
          \ deta              / /  

      /  d   /  d                \\    
    + |----- |----- theta[0](eta)|| = 0
      \ deta \ deta              //    
C1:=diff(theta[0](eta),eta$2)=0;
C2:=diff(theta[1](eta), eta, eta)+Pr*R*f[0](eta)*(diff(theta[0](eta), eta))+Nb*(diff(phi[0](eta), eta))*(diff(theta[0](eta), eta))+Nt*(diff(theta[0](eta), eta))^2=0;
                  d   /  d                \    
                ----- |----- theta[0](eta)| = 0
                 deta \ deta              /    
       /  d   /  d                \\
       |----- |----- theta[1](eta)||
       \ deta \ deta              //

                           /  d                \
          + 10 R f[0](eta) |----- theta[0](eta)|
                           \ deta              /

                /  d              \ /  d                \
          + 0.1 |----- phi[0](eta)| |----- theta[0](eta)|
                \ deta            / \ deta              /

                                     2    
                /  d                \     
          + 0.1 |----- theta[0](eta)|  = 0
                \ deta              /     
icsC1:=theta[0](0)=1,theta[0](1)=0;
icsC2:=theta[1](0)=0,theta[1](1)=0,phi[0](0)=0,phi[0](1)=0;
                theta[0](0) = 1, theta[0](1) = 0
 theta[1](0) = 0, theta[1](1) = 0, phi[0](0) = 0, phi[0](1) = 0
> FORequ4;


E:=collect(expand(subs(theta(eta)=theta[0](eta)+theta[1](eta)*p,phi(eta)=phi[0](eta)+phi[1](eta)*p,f(eta)=f[0](eta)+f[1](eta)*p,hpm4)),p);
                 3 /  d              \   /                /  d   
0.5 R f[1](eta) p  |----- phi[1](eta)| + |0.5 R f[0](eta) |-----
                   \ deta            /   \                \ deta

             \                   /  d              \\  2   //
  phi[1](eta)| + 0.5 R f[1](eta) |----- phi[0](eta)|| p  + ||
             /                   \ deta            //      \\

    d   /  d              \\
  ----- |----- phi[1](eta)||
   deta \ deta            //

                 /  d   /  d                \\
   + 1.000000000 |----- |----- theta[1](eta)||
                 \ deta \ deta              //

                     /  d              \\  
   + 0.5 R f[0](eta) |----- phi[0](eta)|| p
                     \ deta            //  

     /  d   /  d              \\
   + |----- |----- phi[0](eta)||
     \ deta \ deta            //

                 /  d   /  d                \\    
   + 1.000000000 |----- |----- theta[0](eta)|| = 0
                 \ deta \ deta              //    
E1:=diff(phi[0](eta),eta$2)+Nt*(diff(theta[0](eta),eta$2))/Nb=0;
E2:=diff(phi[1](eta),eta$2)+Nt*(diff(theta[1](eta),eta$2))/Nb+R*Sc*f[0](eta)*(diff(phi[0](eta),eta))=0;
       /  d   /  d              \\
       |----- |----- phi[0](eta)||
       \ deta \ deta            //

                        /  d   /  d                \\    
          + 1.000000000 |----- |----- theta[0](eta)|| = 0
                        \ deta \ deta              //    
         /  d   /  d              \\
         |----- |----- phi[1](eta)||
         \ deta \ deta            //

                          /  d   /  d                \\
            + 1.000000000 |----- |----- theta[1](eta)||
                          \ deta \ deta              //

                              /  d              \    
            + 0.5 R f[0](eta) |----- phi[0](eta)| = 0
                              \ deta            /    
icsE1:=theta[0](0)=1,theta[0](1)=0,phi[0](0)=1,phi[0](1)=0;
icsE2:=theta[1](0)=0,theta[1](1)=0,phi[1](0)=0,phi[1](1)=0;
 theta[0](0) = 1, theta[0](1) = 0, phi[0](0) = 1, phi[0](1) = 0
 theta[1](0) = 0, theta[1](1) = 0, phi[1](0) = 0, phi[1](1) = 0
       
theta[0](eta) = -(152675527/100000000)*eta+1;
                                152675527        
              theta[0](eta) = - --------- eta + 1
                                100000000        
U:=f[1](eta)=0;
                         f[1](eta) = 0
Dsolve(A1,B1,icsA1,icsB1);
                  Dsolve(A1, B1, icsA1, icsB1)


sys:={ diff(g[0](eta), eta, eta)+1.0*(diff(f[0](eta), eta)) = 0, diff(f[0](eta), eta, eta, eta, eta)-1.0*(diff(g[0](eta), eta)) = 0};
    //  d   /  d   /  d   /  d            \\\\
   { |----- |----- |----- |----- f[0](eta)||||
    \\ deta \ deta \ deta \ deta          ////

            /  d            \      
      - 1.0 |----- g[0](eta)| = 0,
            \ deta          /      

     /  d   /  d            \\       /  d            \    \
     |----- |----- g[0](eta)|| + 1.0 |----- f[0](eta)| = 0 }
     \ deta \ deta          //       \ deta          /    /
IC_1:={ f[0](0) = 0, (D(f[0]))(0) = 1, g[0](0) = 0, f[0](1) = .5, (D(f[0]))(1) = 0, g[0](1) = 0,f[0](0) = 0, (D(f[0]))(0) = 1, g[0](0) = 0, f[0](1) = .5, (D(f[0]))(1) = 0, g[0](1) = 0};
    {f[0](0) = 0, f[0](1) = 0.5, g[0](0) = 0, g[0](1) = 0,

      D(f[0])(0) = 1, D(f[0])(1) = 0}
ans1 := combine(dsolve(sys union IC_1,{f[0](eta),g[0](eta)}),trig);
Error, (in dsolve) expecting an ODE or a set or list of ODEs. Received `union`(IC_1, sys)
>

Hello everybody.

I'm trying to obtain the numerical solution of a differential equation. Unfortunately, this prove to be quite challenging. I was able to obtain a rough solution using mathematica, but nothing more. The function is strictly increasing (for sure).

Any help is really REALLY appreciated, thanks!

 

``

deq1 := 1/(b-f(b)) = (2*(3-(1-f(b)*(diff(f(b), b, b)))/((diff(f(b), b))*(diff(f(b), b)))))/(1-2*(b-(1-f(b))/(diff(f(b), b))))

1/(b-f(b)) = 2*(3-(1-f(b)*(diff(diff(f(b), b), b)))/(diff(f(b), b))^2)/(1-2*b+2*(1-f(b))/(diff(f(b), b)))

(1)

ic1 := eval(f(b), b = 3/8) = 0, eval(f(b), b = 1/2) = 1/2

f(3/8) = 0, f(1/2) = 1/2

(2)

digits := 3

3

(3)

dsol1 := dsolve({deq1, ic1}, method = bvp[middefer], numeric, range = 3/8 .. 1/2)

Error, (in dsolve/numeric/bvp) initial Newton iteration is not converging

 

``

 

Download diffeqn.mw

Hello

I was looking for information on how to solve a differential equation in Maple, but I do not know how to start.

I have yet equations in symbolic form and I want to apply for the calculation of such a procedure ODE4 (Runge Kutta 4) with fixed step integration Tc and time calculations ongoing T.

Where to start?
1. This should be done in another sheet, or I could write command in next line under the symbolic transformations?
2. To enter numeric parameters that certain symbols were they equal?
3. How to perform iterative calculations?

Thank you in advance for your help

I'm working in a tridimensional euclidean space, with vectorial functions of the type:

Fi(t)=<fix(t),fiy(t),fiz(t)>

Fi'(t)=<fix'(t),fiy'(t),fiz'(t)>

The two odes are of the type:

ode1:=K1*F1''(t)=K2*F2(t)&xF3(t)+...

While there are other non-differential vectorial equations like:

eq1:=K4*F4''(t)=(K5*F5(t)&x<0,1,0>)/Norm(F6(t))+..., etc

 

Is there a way i can input this system in dsolve with vectors instead of scalars? And without splitting everything into its 3 vectorial components? I can't make maple realize some of the Fi(t) functions are vectors, it counts them as scalars and says the number of functions and equations are not the same.

 

Thank you!

1 2 3 4 5 6 7 Last Page 1 of 29