Maple 18 Questions and Posts

These are Posts and Questions associated with the product, Maple 18

Hallo every body 

How to add vector fields to the figure of this example of a three-dimensional differential system.

in maple 18

Porgram_of_corollary_1_in_Maple.mw

NULL

restart

X[j] := x^3*a[j, 0]+x^2*y*a[j, 1]+x^2*z*a[j, 2]+x*y^2*a[j, 3]+x*y*z*a[j, 4]+x*z^2*a[j, 5]+y^3*a[j, 6]+y^2*z*a[j, 7]+y*z^2*a[j, 8]+z^3*a[j, 9]

x^3*a[j, 0]+x^2*y*a[j, 1]+x^2*z*a[j, 2]+x*y^2*a[j, 3]+x*y*z*a[j, 4]+x*z^2*a[j, 5]+y^3*a[j, 6]+y^2*z*a[j, 7]+y*z^2*a[j, 8]+z^3*a[j, 9]

(1)

s := sum(epsilon^j*X[j], j = 0 .. 2)

x^3*a[0, 0]+x^2*y*a[0, 1]+x^2*z*a[0, 2]+x*y^2*a[0, 3]+x*y*z*a[0, 4]+x*z^2*a[0, 5]+y^3*a[0, 6]+y^2*z*a[0, 7]+y*z^2*a[0, 8]+z^3*a[0, 9]+epsilon*(x^3*a[1, 0]+x^2*y*a[1, 1]+x^2*z*a[1, 2]+x*y^2*a[1, 3]+x*y*z*a[1, 4]+x*z^2*a[1, 5]+y^3*a[1, 6]+y^2*z*a[1, 7]+y*z^2*a[1, 8]+z^3*a[1, 9])+epsilon^2*(x^3*a[2, 0]+x^2*y*a[2, 1]+x^2*z*a[2, 2]+x*y^2*a[2, 3]+x*y*z*a[2, 4]+x*z^2*a[2, 5]+y^3*a[2, 6]+y^2*z*a[2, 7]+y*z^2*a[2, 8]+z^3*a[2, 9])

(2)

s1 := subs(a = b, s)

x^3*b[0, 0]+x^2*y*b[0, 1]+x^2*z*b[0, 2]+x*y^2*b[0, 3]+x*y*z*b[0, 4]+x*z^2*b[0, 5]+y^3*b[0, 6]+y^2*z*b[0, 7]+y*z^2*b[0, 8]+z^3*b[0, 9]+epsilon*(x^3*b[1, 0]+x^2*y*b[1, 1]+x^2*z*b[1, 2]+x*y^2*b[1, 3]+x*y*z*b[1, 4]+x*z^2*b[1, 5]+y^3*b[1, 6]+y^2*z*b[1, 7]+y*z^2*b[1, 8]+z^3*b[1, 9])+epsilon^2*(x^3*b[2, 0]+x^2*y*b[2, 1]+x^2*z*b[2, 2]+x*y^2*b[2, 3]+x*y*z*b[2, 4]+x*z^2*b[2, 5]+y^3*b[2, 6]+y^2*z*b[2, 7]+y*z^2*b[2, 8]+z^3*b[2, 9])

(3)

s2 := subs(a = c, s)

x^3*c[0, 0]+x^2*y*c[0, 1]+x^2*z*c[0, 2]+x*y^2*c[0, 3]+x*y*z*c[0, 4]+x*z^2*c[0, 5]+y^3*c[0, 6]+y^2*z*c[0, 7]+y*z^2*c[0, 8]+z^3*c[0, 9]+epsilon*(x^3*c[1, 0]+x^2*y*c[1, 1]+x^2*z*c[1, 2]+x*y^2*c[1, 3]+x*y*z*c[1, 4]+x*z^2*c[1, 5]+y^3*c[1, 6]+y^2*z*c[1, 7]+y*z^2*c[1, 8]+z^3*c[1, 9])+epsilon^2*(x^3*c[2, 0]+x^2*y*c[2, 1]+x^2*z*c[2, 2]+x*y^2*c[2, 3]+x*y*z*c[2, 4]+x*z^2*c[2, 5]+y^3*c[2, 6]+y^2*z*c[2, 7]+y*z^2*c[2, 8]+z^3*c[2, 9])

(4)

Considérons le système suivant:

a[1] := 0; c[1] := 0

a[0, 9] := 0; c[0, 8] := 0; b[0, 7] := 0; a[0, 4] := 0; a[0, 7] := 0; c[0, 3] := 0; c[0, 0] := 0; c[0, 5] := 0; b[0, 4] := 0; a[0, 2] := 0; c[0, 6] := 0; c[0, 1] := 0; c[0, 7] := 0; a[0, 8] := 0; b[0, 5] := 0

b0 := 5; a[4] := 0; c[4] := 0; c[2, 9] := 0; c[2, 2] := 0; c[2, 7] := 0; a[2, 5] := 0; b[2, 8] := 0; a[2, 0] := 0; b[2, 6] := 0; b[2, 1] := 0; a[2, 3] := 0; b[0, 9] := 0

b[1] := 0; b[2] := 0; b[3] := 0; b[4] := 0; a[1, 2] := 0; a[1, 1] := 0; a[1, 4] := 0; a[1, 6] := 0; a[1, 7] := 0; a[1, 8] := 0; a[1, 9] := 0; a[2, 9] := 0; a[2, 8] := 0; a[2, 7] := 0; a[2, 6] := 0; a[2, 4] := 0; a[2, 2] := 0; a[2, 1] := 0; b[1, 0] := 0; b[1, 2] := 0; b[1, 3] := 0; b[1, 4] := 0; b[1, 5] := 0; b[1, 7] := 0; b[1, 9] := 0; b[2, 0] := 0; b[2, 2] := 0; b[2, 3] := 0; b[2, 4] := 0; b[2, 5] := 0; b[2, 7] := 0; b[2, 9] := 0; c[1, 0] := 0; c[1, 1] := 0; c[1, 3] := 0; c[1, 4] := 0; c[1, 5] := 0; c[1, 6] := 0; c[1, 8] := 0; c[2, 0] := 0; c[2, 1] := 0; c[2, 3] := 0; c[2, 4] := 0; c[2, 5] := 0; c[2, 6] := 0; c[2, 8] := 0; b[0, 2] := 0; c[1, 7] := 0

a[1, 0] := 0; a[1, 3] := 0; a[1, 5] := 0; b[1, 1] := 0; b[1, 6] := 0; b[1, 8] := 0; c[1, 2] := 0; c[1, 9] := 0; a[3] := 0; c[3] := 0; a[2] := 1/2; c[2] := 3/2; a[0, 0] := -1/2; a[0, 3] := 5/4; a[0, 1] := 0; a[0, 5] := 0; a[0, 6] := 0; b[0, 6] := -1; b[0, 1] := 3/2; b[0, 0] := 0; b[0, 3] := 0; b[0, 8] := 0; c[0, 2] := 0; c[0, 4] := 0; c[0, 9] := -1/3

eq1 := (epsilon^4*a[4]+epsilon^3*a[3]+epsilon^2*a[2]+epsilon*a[1])*x-(epsilon^4*b[4]+epsilon^3*b[3]+epsilon^2*b[2]+epsilon*b[1]+b0)*y+s

(1/2)*epsilon^2*x-5*y-(1/2)*x^3+(5/4)*x*y^2

(5)

eq2 := (epsilon^4*b[4]+epsilon^3*b[3]+epsilon^2*b[2]+epsilon*b[1]+b0)*x+(epsilon^4*a[4]+epsilon^3*a[3]+epsilon^2*a[2]+epsilon*a[1])*y+s1

5*x+(1/2)*epsilon^2*y+(3/2)*x^2*y-y^3

(6)

eq3 := (epsilon^4*c[4]+epsilon^3*c[3]+epsilon^2*c[2]+epsilon*c[1])*z+s2

(3/2)*epsilon^2*z-(1/3)*z^3

(7)

Faisons le changement (x,y,z)=(εX,εY,εZ)

 

x := epsilon*X; y := epsilon*Y; z := epsilon*Z

epsilon*X

 

epsilon*Y

 

epsilon*Z

(8)

Xpoint := collect(eq1/epsilon, epsilon)

((1/2)*X-(1/2)*X^3+(5/4)*X*Y^2)*epsilon^2-5*Y

(9)

Ypoint := collect(eq2/epsilon, epsilon)

((1/2)*Y+(3/2)*X^2*Y-Y^3)*epsilon^2+5*X

(10)

Zpoint := collect(eq3/epsilon, epsilon)

((3/2)*Z-(1/3)*Z^3)*epsilon^2

(11)

Faisons le changement (X, Y, Z) = (`ϱ`*cos(theta), `ϱ`*sin(theta), eta)

 

X := `ϱ`*cos(theta); Y := `ϱ`*sin(theta); Z := eta

`ϱ`*cos(theta)

 

`ϱ`*sin(theta)

 

eta

(12)

`ϱt` := collect(simplify((X*Xpoint+Y*Ypoint)/`ϱ`), epsilon)

-(1/4)*`ϱ`*epsilon^2*(17*`ϱ`^2*cos(theta)^4-19*cos(theta)^2*`ϱ`^2+4*`ϱ`^2-2)

(13)

`θt` := collect(simplify((X*Ypoint-Xpoint*Y)/`ϱ`^2), epsilon)

5+((17/4)*`ϱ`^2*cos(theta)^3*sin(theta)-(9/4)*`ϱ`^2*sin(theta)*cos(theta))*epsilon^2

(14)

`ηt` := collect(Zpoint, epsilon)

((3/2)*eta-(1/3)*eta^3)*epsilon^2

(15)

Utilisons le développpement de taylor

p := series(`ϱt`/`θt`, epsilon, 5)

series(-((1/20)*`ϱ`*(17*`ϱ`^2*cos(theta)^4-19*cos(theta)^2*`ϱ`^2+4*`ϱ`^2-2))*epsilon^2+((1/100)*`ϱ`*(17*`ϱ`^2*cos(theta)^4-19*cos(theta)^2*`ϱ`^2+4*`ϱ`^2-2)*((17/4)*`ϱ`^2*cos(theta)^3*sin(theta)-(9/4)*`ϱ`^2*sin(theta)*cos(theta)))*epsilon^4+O(epsilon^6),epsilon,6)

(16)

q := series(`ηt`/`θt`, epsilon, 5)

series(((3/10)*eta-(1/15)*eta^3)*epsilon^2+((1/5)*(-(3/10)*eta+(1/15)*eta^3)*((17/4)*`ϱ`^2*cos(theta)^3*sin(theta)-(9/4)*`ϱ`^2*sin(theta)*cos(theta)))*epsilon^4+O(epsilon^6),epsilon,6)

(17)

NULL

Averaging d'ordre 1

Les fonctions F11 et F21 sont données comme suit:

NULL

F11 := coeff(p, epsilon)

0

(18)

F21 := coeff(q, epsilon)

0

(19)

NULL

Calculons les fonctions moyennées f11et f12

f11 := (int(F11, theta = 0 .. 2*Pi))/(2*Pi)

0

(20)

f12 := (int(F21, theta = 0 .. 2*Pi))/(2*Pi)

0

(21)

solve({f11 = 0, f12 = 0}, {eta, `ϱ`})

{eta = eta, `ϱ` = `ϱ`}

(22)

NULL

Averaging d'ordre 2

NULL

F12 := simplify(coeff(p, epsilon^2))

-(1/20)*`ϱ`*(17*`ϱ`^2*cos(theta)^4-19*cos(theta)^2*`ϱ`^2+4*`ϱ`^2-2)

(23)

F22 := simplify(coeff(q, epsilon^2))

(3/10)*eta-(1/15)*eta^3

(24)

NULL

Calculons les fonctions moyennées "f21 "et "f22"

f21 := simplify((int(F12, theta = 0 .. 2*Pi))/(2*Pi))

-(1/160)*`ϱ`*(7*`ϱ`^2-16)

(25)

f22 := simplify((int(F22, theta = 0 .. 2*Pi))/(2*Pi))

-(1/30)*eta*(2*eta^2-9)

(26)

solve({f21 = 0, f22 = 0}, {eta, `ϱ`})

{eta = 0, `ϱ` = 0}, {eta = 3*RootOf(2*_Z^2-1), `ϱ` = 0}, {eta = 0, `ϱ` = 4*RootOf(7*_Z^2-1)}, {eta = 3*RootOf(2*_Z^2-1), `ϱ` = 4*RootOf(7*_Z^2-1)}

(27)

allvalues({eta = 0, `ϱ` = 4*RootOf(7*_Z^2-1)})

{eta = 0, `ϱ` = (4/7)*7^(1/2)}, {eta = 0, `ϱ` = -(4/7)*7^(1/2)}

(28)

allvalues({eta = 3*RootOf(2*_Z^2-1), `ϱ` = 4*RootOf(7*_Z^2-1)})

{eta = (3/2)*2^(1/2), `ϱ` = (4/7)*7^(1/2)}, {eta = -(3/2)*2^(1/2), `ϱ` = (4/7)*7^(1/2)}, {eta = (3/2)*2^(1/2), `ϱ` = -(4/7)*7^(1/2)}, {eta = -(3/2)*2^(1/2), `ϱ` = -(4/7)*7^(1/2)}

(29)

NULL

with(VectorCalculus)

M, d := Jacobian([f21, f22], [`ϱ`, eta] = [(4/7)*sqrt(7), 0], 'determinant')

Matrix(%id = 18446744074358842782), -3/50

(30)

factor(d)

-3/50

(31)

M1, d1 := Jacobian([f21, f22], [`ϱ`, eta] = [(4/7)*sqrt(7), (3/2)*sqrt(2)], 'determinant')

Matrix(%id = 18446744074358843142), 3/25

(32)

d1 := factor(d1)

3/25

(33)

M2, d2 := Jacobian([f21, f22], [`ϱ`, eta] = [(4/7)*sqrt(7), -(3/2)*sqrt(2)], 'determinant')

Matrix(%id = 18446744074358843382), 3/25

(34)

factor(d2)

3/25

(35)

restart

with(DEtools):

epsilon := 10^(-2)

1/100

(36)

eq1 := diff(x(t), t) = (1/2)*epsilon^2*x(t)-5*y(t)-(1/2)*x(t)^3+(5/4)*x(t)*y(t)^2

diff(x(t), t) = (1/20000)*x(t)-5*y(t)-(1/2)*x(t)^3+(5/4)*x(t)*y(t)^2

(37)

eq2 := diff(y(t), t) = 5*x(t)+(1/2)*epsilon^2*y(t)+(3/2)*x(t)^2*y(t)-y(t)^3

diff(y(t), t) = 5*x(t)+(1/20000)*y(t)+(3/2)*x(t)^2*y(t)-y(t)^3

(38)

eq3 := diff(z(t), t) = (3/2)*epsilon^2*z(t)-(1/3)*z(t)^3

diff(z(t), t) = (3/20000)*z(t)-(1/3)*z(t)^3

(39)

DEplot3d([eq1, eq2, eq3], [x(t), y(t), z(t)], t = -10 .. 10, [[x(0) = 0.1511857892e-1, y(0) = 0, z(0) = 0], [x(0) = 0.1511857892e-1, y(0) = 0, z(0) = 0.2121320343e-1], [x(0) = 0.1511857892e-1, y(0) = 0, z(0) = -0.2121320343e-1]], linecolor = [blue, red, black], stepsize = 0.1e-1)

 

Download Porgram_of_corollary_1_in_Maple.mw

Dears, 

Can you look the code bellow and send me my error please? I used Maple 18.

restart;
with(plots);
theta(t) = 19.592+1.2697*cos(.5240*t+4.3391)-.6343*cos((2*.5240)*t-.6963);
omicron(t) = 99.4876+89.8581*cos(.5232*t+15.4500)+19.1069*sin((2*.5232)*t)-8.5891*cos((3*.5232)*t+3.7723)+6.4660*sin((5*.5232)*t);
`ϕ`(theta):=0.000203*theta*(theta - 11.7)*sqrt(42.3-theta);
mu[v](theta,omicron):=0.0886*exp(((0.01*omicron +1.01*theta  -21.211)/(14.852))^(4));
p[0](theta):=(-0.153* theta*theta + 8.61*theta - 97)/(mu[v](theta,omicron)):
p[2](omicron):=(4*0.25)/(2500)*omicron*( 50 -omicron);
p[3](omicron):=(4*0.75)/(2500)*omicron*( 50 -omicron);
p[2](theta):=exp (0.06737 - 0.00554*theta);
theta[EA](theta):=1/(-0.00094*theta*theta + 0.049*theta - 0.552);
L[v](theta,omicron):=(3.375*(4*omicron*(50-omicron))^(3)*exp(0.0054*theta+0.6737))/(50^(6)*(2+(0.00554*theta-0.06737)^(-1)));
eta(theta,omicron):=(p[0](theta)*p[1](omicron)*p[2](omicron)*p[3](omicron)*p[2](theta))/(theta[EA](theta));
lambda[v] := beta[v]*`ϕ`(theta)*i[v](t)/n[h](t);
lambda[h] := (beta[h]*`ϕ`(theta)*i[h](t)+beta[h]*`ϕ`(theta)*omega*r[h](t))/n[h](t);
n[v](t):=s[v](t)+i[v](t);
beta[h] := 0.9e-1; beta[v] := 0.2e-1; Lambda[h] := .50; sigma[1] := 0.15e-1; sigma[2] := 0.71e-1; Omega[h] := .50; mu[h] := 0.128e-1; delta[h] := .45; k[v] := .66; omega := .3; mu[d] := 0.14e-2;
sys := {diff(i[h](t), t) = Omega[h]+sigma[2]*r[h](t)+lambda[v]*s[h](t)-(delta[h]+mu[d]+mu[h])*i[h](t), diff(i[v](t), t) = lambda[h]*s[v](t)-mu[v](theta, omicron)*i[v](t), diff(j[v](t), t) = L[v](theta, omicron)*(1-j[v](t)/k[v])*n[v](t)-(eta(theta, omicron)+mu[j](theta, omicron))*j[v](t), diff(r[h](t), t) = delta[h]*i[h](t)-(sigma[1]+sigma[2]+mu[h])*r[h](t), diff(s[h](t), t) = Lambda[h]+sigma[1]*r[h](t)-(lambda[v]+mu[h])*s[h](t), diff(s[v](t), t) = eta(theta, omicron)*j[v](t)-(lambda[h]+mu[v](theta, omicron))*s[v](t), i[h](0) = 100, i[v](0) = 100, j[v](0) = 200, r[h](0) = 0, s[h](0) = 10000, s[v](0) = 5000};
p1 := dsolve(sys, numeric, method = rkf45, output = procedurelist);
Error, (in dsolve/numeric/process_input) input system must be an ODE system, found {mu[j](theta, omicron), mu[v](theta, omicron)}
p1o := odeplot(p1, [theta, omicron, i[h](t)], 0 .. 10, numpoints = 100, labels = ["Time (Days)", " infectious population"], labeldirections = [horizontal, vertical], style = line, color = red, axes = boxed, legend = [front, rear, ideal]);

I tried to solve a hogher order ODE system to reduce first order ODE sytem. In this case I have assume a initial conditions as a variable. (sse the attachment, Conver_to_first_order.mw).

I got an error in specification of initial value...

How can I solve this problem in RKF45 method with shooting technique.

Here, I have assume f=x[1], f'=x[2]. f''=x[3], f'''=x[3]' and theta=x[4], theta'=x[5], theta''=x[5]'

Determine the solution or integral curve given by the differential equation x+yy'=0 by the method of isodine. hence display its 2Dplot 

I tried to solve a ODE system using rkf45 with shooting technique. But I have a lot of errors. How to resolve this...

See the attachment: Shoot_Blasius.mw

How to solve a ODE system using Newton's finite difference method?
How to plot f', theta and phi functions for various alpha values.

Difference.mw

How to convert a ploting values in a graph to excel?

restart;
with(PDETools): with(DETools): with(plots):with(plottools):
eq1 := ((D@@2)(f))(eta)*f(eta)*sin(alpha)+((D@@2)(f))(eta)*eta*cos(alpha)+2*((D@@3)(f))(eta) = 0;
ics := f(0) = 0, (D(f))(0) = 0, (D(f))(10) = 1; bcs := (D(f))(10) = 0, theta(10) = 0, phi(10) = 0;
Parameters1 := alpha = (1/3)*Pi;
sol1 := dsolve(eval({eq1, ics}, {Parameters1}), numeric);
p1 := odeplot(sol1, [[eta, ((D@@2)(f))(eta)]], eta = 0 .. 10, color = [red], axes = boxed);
display({p1});

Hello everyone,

I'm using Maple 18. I have a problem that I can't solve. It concerns the programmatic - from the Maple code level - export of animations (even single images) with good quality graphics, i.e. either high resolution or "large" size - which translates into the same. This is because Maple 18 does not have a size option in plot3d.

Even manually enlarged graphics - a bit too much, makes manual export impossible; Maple reports "..the file could not be created...". Most often, this ends with the creation of a gif file with a capacity of 0 bytes.

I am asking for help if anyone knows how to deal with this [normal export of "normal" graphics manually or with software can of course be done in Maple 18].

Regards.

Hello,

Attached I am sending several procedures for curves in 3D space. They were written without using Maple's built-in DiffGeo procedures and functions. As an example of their use, I made several animations - Maple worksheets are attached. I hope that maybe they will be useful to someone.

Regards.

ClsDGproc-Curves.zip

I tried to solve a Blasius problem (available in maple), but I have an error. How to solve this issue.

Download Shoot_Blasius_solution.mw

 

p1>0, p2<0 and x[0] are arbitrary constants. How can i solve this integral? 

 

   I want to see    

thanks in advance. 

How to solve and plot a ODE system in RK method.
eq1 := diff(f(x), x, x, x)-(1/2)*Sc*sin(alpha)*g(x)*(diff(g(x), x, x))+(1/2)*x*cos(alpha)*(diff(f(x), x, x))+(1/2)*sin(alpha)*f(x)*(diff(f(x), x, x)) = 0; eq2 := (diff(g(x), x, x, x))/Pm+(1/2)*x*cos(alpha)*(diff(g(x), x, x))+sin(alpha)*f(x)*(diff(g(x), x, x))-sin(alpha)*(diff(f(x), x, x))*g(x) = 0; eq3 := (diff(theta(x), x, x))/Pr+(1/2)*x*cos(alpha)*(diff(theta(x), x))+(1/2)*x*(diff(f(x), x))*(diff(theta(x), x))+sin(alpha)*(x*(diff(f(x), x))-f(x))*(diff(theta(x), x))-Nb*(diff(s(x), x))*(diff(theta(x), x))-Nt*(diff(theta(x), x))^2+(1/4)*Sc*Br*sin(alpha)^2*(diff(f(x), x))^2*(x*(diff(g(x), x))-g(x))+(diff(g(x), x))^2*(x*(diff(f(x), x))-f(x)) = 0; eq4 := diff(s(x), x, x)+S*((1/2)*cos(alpha)*x*(diff(s(x), x))+(1/2)*sin(alpha)*f(x)*(diff(s(x), x)))+Nt*(diff(theta(x), x, x))/Nb = 0

ics := f(0) = 0, (D(f))(0) = 1, g(0) = 0, (D(g))(0) = 1, theta(0) = 1, s(0) = 1; bcs := (D(f))(100) = 0, (D(g))(100) = 0, theta(100) = 0, s(100) = 0

alpha = - 30 degree, Sc = 1.0, Pm = .1, Pr = 6.2, Nb = .1, Nt = .1, Br = .5, S = 1

Hello,

How to  outer loop index setup as the upper value of the inner loop index?

Boundary condition of my problem is   f(0) =1  and  d(f)(1) = -(k[f]/k[nf])*Bi*f(1).

But i am getting error when solve this.How to clear this .

my attached file is,

HNF_1.mw

How to rectify this error.

NF-1.mw

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