666 jvbasha

javid basha jv

65 Reputation

8 Badges

3 years, 252 days

MaplePrimes Activity


These are questions asked by 666 jvbasha

Dear maple users,

Greetings.

How to plot this function equation "An" for x=0.0001..1,0.02 with 0..1 range.

Wating for replay.

restart;
A2 := 1.107444364; A4 := 1.124502164; ad := .5; ed := 0.1e-1; pd := 21; ld := .3;
f := unapply(3*x^2-2*x^3-1.238616691*x^2*(x-1)^2-.7382714588*x^2*(x-1)^3+.1921034396*x^2*(x-1)^4+.5253305667*x^2*(x-1)^5+.7364291997*x^2*(x-1)^6+1.032724351*x^2*(x-1)^7+.8058204155*x^2*(x-1)^8+.3290860035*x^2*(x-1)^9, x);
t := unapply(.339997432+1.547096375*x^2-2.488736512*x^3+8.154594212*x^4-15.63643668*x^5+15.85832377*x^6-8.734300202*x^7+1.959461605*x^8, x);
b1 := f(x);
b2 := diff(f(x), x);
b3 := diff(f(x), x, x);
b4 := t(x);
b5 := diff(t(x), x);
An := A4*(1+(4/3)*ad)*(b5^2+b4^2/ld^2)+4*ed*pd*(b2^2/x^2+b1^2/x^4-b1*b2/x^3)/ld;
As := seq(An, x = 0.1e-2 .. 1, 0.5e-1);
L := [seq([x, As], x = 0.1e-2 .. 1, 0.5e-1)];

with(plots);
plots:-display(plot(L, style = point), plot(As, x = 0.1e-2 .. 1), color = blue, linestyle = solid, labels = ["η", "f'"], thickness = 1, labeldirections = [horizontal, vertical], labelfont = ['TIMES', 'BOLDOBLIQUE', 16], size = [450, 450], axes = box);
mp.mw
 

restart

A2 := 1.107444364:

f := unapply(3*x^2-2*x^3-1.238616691*x^2*(x-1)^2-.7382714588*x^2*(x-1)^3+.1921034396*x^2*(x-1)^4+.5253305667*x^2*(x-1)^5+.7364291997*x^2*(x-1)^6+1.032724351*x^2*(x-1)^7+.8058204155*x^2*(x-1)^8+.3290860035*x^2*(x-1)^9, x):

t := unapply(.339997432+1.547096375*x^2-2.488736512*x^3+8.154594212*x^4-15.63643668*x^5+15.85832377*x^6-8.734300202*x^7+1.959461605*x^8, x):

b1 := f(x):

b2 := diff(f(x), x):

b3 := diff(f(x), x, x):

b4 := t(x):

b5 := diff(t(x), x):

An := A4*(1+(4/3)*ad)*(b5^2+b4^2/ld^2)+4*ed*pd*(b2^2/x^2+b1^2/x^4-b1*b2/x^3)/ld:

As := seq(An, x = 0.1e-2 .. 1, 0.5e-1):

L := [seq([x, As], x = 0.1e-2 .. 1, 0.5e-1)]:

``

with(plots):

plots:-display(plot(L, style = point), plot(As, x = 0.1e-2 .. 1), color = blue, linestyle = solid, labels = ["η", "f'"], thickness = 1, labeldirections = [horizontal, vertical], labelfont = ['TIMES', 'BOLDOBLIQUE', 16], size = [450, 450], axes = box)

Error, (in plot) found points with fewer or more than 2 components

 

``


 

Download mp.mw

 

Dear maple users,

Greetings

How to eval a function as a sequence of x(x=0..1)

f := unapply(3*x^2-2*x^3-1.080674649*x^2*(x-1)^2-.8118769171*x^2*(x-1)^3+.4147046974*x^2*(x-1)^4+.4585681954*x^2*(x-1)^5, x);
ma := seq(eval(f(x), x = 0 .. 1))

Dear maple users,
Greetings.
Now I'm working on a project "solving ODE with an analytical solution".

So, I need how to find a residual error. 

Here I used the Homotopy Analysis Method(HAM) to solve the ode problem.

A similar HAM problem has solved using the Mathematica BVP2.H package.

Here I have encoded a maple code for my working problem. HAM.mw

CODE:Note(N is order of ittrration)

restart; with(plots)

pr := .5; ec := .5; N := 7; re := 2; ta := .5; H := 1:

dsolve(diff(f(x), `$`(x, 4)))

Rf := x^3*(diff(f[m-1](x), x, x, x, x))-2*x^2*(diff(f[m-1](x), x, x, x))+3*x*(diff(f[m-1](x), x, x))-3*(diff(f[m-1](x), x))-re*x^2*R*(sum((diff(f[m-1-n](x), x, x, x))*(diff(f[n](x), x)), n = 0 .. m-1))-re*x*R*(sum((diff(f[m-1-n](x), x))*(diff(f[n](x), x)), n = 0 .. m-1))+re*x^2*R*(sum((diff(f[m-1-n](x), x, x, x))*f[n](x), n = 0 .. m-1))-3*re*x*R*(sum((diff(f[m-1-n](x), x, x))*f[n](x), n = 0 .. m-1))+3*re*R*(sum((diff(f[m-1-n](x), x))*f[n](x), n = 0 .. m-1))+ta*x^3*(diff(f[m-1](x), x, x))-ta*x^2*(diff(f[m-1](x), x)):

dsolve(diff(f[m](x), x, x, x, x)-CHI[m]*(diff(f[m-1](x), x, x, x, x)) = h*H*Rf, f[m](x)):

f[0](x):=3 *x^(2)-2* x^(3);

for m from 1 by 1 to N do  CHI[m]:=`if`(m>1,1,0);  f[m](x):=int(int(int(int(CHI[m]*(x^(3)* diff(f[m-1](x),x,x,x,x))+h*H*(x^(3)* diff(f[m-1](x),x,x,x,x))-2*h*H*x^(2)*diff(f[m-1](x),x,x,x)+3*h*H*x*diff(f[m-1](x),x,x)-3*h*H*diff(f[m-1](x),x)-re*h*H*x^(2)*sum(diff(f[m-1-n](x),x,x,x)*diff(f[n](x),x),n=0..m-1)-re*h*H*x*sum(diff(f[m-1-n](x),x)*diff(f[n](x),x),n=0..m-1)+re*h*H*x^(2)*sum(diff(f[m-1-n](x),x,x,x)*(f[n](x)),n=0..m-1)-3*re*x*h*H*sum(diff(f[m-1-n](x),x,x)*(f[n](x)),n=0..m-1)+3* re*h*H*sum(diff(f[m-1-n](x),x)*(f[n](x)),n=0..m-1)+ta*x^(3)*h*H*diff(f[m-1](x),x,x)-ta*x^(2)*h*H*diff(f[m-1](x),x),x),x)+_C1*x,x)+_C2*x,x)+_C3*x+_C4;  s1:=evalf(subs(x=0,f[m](x)))=0;  s2:=evalf(subs(x=0,diff(f[m](x),x)))=0;  s3:=evalf(subs(x=1,f[m](x)))=0;  s4:=evalf(subs(x=1,diff(f[m](x),x)))=0;   s:={s1,s2,s3,s4}:  f[m](x):=simplify(subs(solve(s,{_C1,_C2,_C3,_C4}),f[m](x)));  end do:

f(x):=sum(f[l](x),l=0..N):  hh:=evalf(subs(x=1,diff(f(x),x)));

plot(hh, h = -5 .. 5);

 

For Mathematica, code already exist to find a residual error for another problem(Not this) 

which is,

eq:

Bc:

Mathematica code:

waiting for users' responses.

Have a good day

Dear maple users,
Greetings.
How to plot residual error for BVP.
Here I have enclosed the file.rerror.mw
 

restart; with(plots)

fcns := {f(eta), g(eta)}:

bet := 0.:

eq1 := diff(f(eta), `$`(eta, 3))+(diff(f(eta), `$`(eta, 2)))*f(eta)+be*((diff(g(eta), `$`(eta, 1)))^2-(diff(g(eta), `$`(eta, 2)))*g(eta)) = 0:

eq2 := pr*lam*(diff(g(eta), `$`(eta, 3)))+(diff(g(eta), `$`(eta, 2)))*f(eta)-(diff(f(eta), `$`(eta, 2)))*g(eta) = 0:

bc := f(0) = 0, (D(f))(0) = 0, (D(f))(N) = 1, g(0) = 0, ((D@@2)(g))(0) = 0, (D(g))(N) = 1;

f(0) = 0, (D(f))(0) = 0, (D(f))(5) = 1, g(0) = 0, ((D@@2)(g))(0) = 0, (D(g))(5) = 1

(1)

R := dsolve(eval({bc, eq1, eq2}), fcns, type = numeric, method = bvp[midrich], output = listprocedure):

Sol_exact := dsolve(eval({bc, eq1, eq2}), fcns):

``


 

Download rerror.mw

Have a good day

 

Dear maple users,

How to plot a figure for different values of rk?

like rk=5,10,15,20:

jb.mw

Thanking you,

Waiting for replay.

 

2 3 4 5 6 7 8 Page 4 of 9