>
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >

## How to plot a figure for different values of M?...

Dear maple users,

Greetings.

Q1.How to plot a figure for different values of M?

like M=1,2,3,4:

Code:Mplot.mw

Q2. How to assign all the expressions are "remember table assignment"

## How to plot a function at a point 0....

Dear Maple Users @acer @Carl Love @Kitonum @Preben Alsholm ,

Greetings.

How to plot a function "Am" for various values of "kt"(eg: kt=-1..1) at a point x=0.

Am vs kt.

The code has provided below.

ktplot.mw

## set of 2-vectors...

Hallo;
the following MAPLE code generates 2-vectors. To collect them into a set K unfortunately does not work. K contains vectors two-fold etc. So K is not a set which I hoped to get. What is wrong?

restart:m:=5;#m Module
with(LinearAlgebra[Modular]):
K:={};
M:=Matrix([[3, 4*168], [4,3]]);
L:=Matrix([[3],[4]]);
#with(LinearAlgebra[Modular]):
for s from 0 to 10 do
a:=Mod(m,(M^s).L,integer);
K:=K union {a};
od:
K:=K;

Gerd

## How to plot a contour for function...

Dear maple users,

Greetings.

How to plot a contour for the below-mentioned function.

f(x):=-0.09465519086 x^3+0.02711194463 x^2+0.3862193003 x-0.00030060626-0.0003613678673 x^6-0.001538973646 x^5-0.01937304057 x^4-3.822344860 10^(-8) x^8-0.000007297718101 x^7

## optimization code for mathematical model with nine...

How can I generate a code to plot the optimals; h, chi and psi?

## Why Maple is not plotting the solution?...

 > restart;
 > with(PDEtools):
 > with(plot):
 > A1:=Matrix([[phi,(chi),conjugate(phi),conjugate(chi)],           [chi,(phi),conjugate(chi),conjugate(phi)],           [lambda*phi,-(lambda)*(chi),            conjugate(lambda)*conjugate(phi),-conjugate(lambda)*conjugate(chi)],           [lambda*chi,-(lambda)*(phi),            conjugate(lambda)*conjugate(chi),-conjugate(lambda)*conjugate(phi)]]);
 (1)
 > d1 := LinearAlgebra:-Determinant(A1):
 > d1; length(%);
 (2)
 > den:=simplify(d1,size); length(%);
 (3)
 >
 > con1:=phi=exp(I*lambda*(x-t/(4*lambda^2)-w^2)):con2:=chi=exp(-I*lambda*(x-t/(4*lambda^2)-w^2)):
 >
 > den1:=simplify(dsubs({con1,con2},den));
 (4)
 > plot3d(subs(Re(lambda)=1, Im(lambda)=.2, w=1, rhs(den1)),x=-6..6, t=-6..6)
 >
 >

 >
 >
 >
 (1)
 >
 >
 (2)
 >
 (3)
 >
 >
 (4)
 >
 >

## How to common a factor appears in many terms in th...

> den := -(-(conjugate(chi)-conjugate(phi))*(chi+phi)*conjugate(lambda)+lambda*(conjugate(chi)+conjugate(phi))*(chi-phi))*(-(conjugate(chi)+conjugate(phi))*(chi-phi)*conjugate(lambda)+lambda*(conjugate(chi)-conjugate(phi))*(chi+phi));

> phi:=exp(I*lambda*(x-t/(4*lambda^2)-w^2)):chi:=exp(-I*lambda*(x-t/(4*lambda^2)-w^2)):

> den1:=simplify(dsubs({phi,chi},den));

> dsubs({exp((1/4*I)*(4*lambda^2*w^2-4*lambda^2*x+t)/lambda), exp(-(1/4*I)*(4*lambda^2*w^2-4*lambda^2*x+t)/lambda)}, 4*conjugate(lambda)^2*cos((1/4)*(4*w^2*lambda^2-4*x*lambda^2+conjugate((4*lambda^2*w^2-4*lambda^2*x+t)/lambda)*lambda+t)/lambda)^2-4*conjugate(lambda)^2*cos((1/4)*(-4*w^2*lambda^2+4*x*lambda^2+conjugate((4*lambda^2*w^2-4*lambda^2*x+t)/lambda)*lambda-t)/lambda)^2+8*abs(lambda)^2*cos((1/4)*(4*w^2*lambda^2-4*x*lambda^2+conjugate((4*lambda^2*w^2-4*lambda^2*x+t)/lambda)*lambda+t)/lambda)^2+8*abs(lambda)^2*cos((1/4)*(-4*w^2*lambda^2+4*x*lambda^2+conjugate((4*lambda^2*w^2-4*lambda^2*x+t)/lambda)*lambda-t)/lambda)^2+4*cos((1/4)*(4*w^2*lambda^2-4*x*lambda^2+conjugate((4*lambda^2*w^2-4*lambda^2*x+t)/lambda)*lambda+t)/lambda)^2*lambda^2-4*cos((1/4)*(-4*w^2*lambda^2+4*x*lambda^2+conjugate((4*lambda^2*w^2-4*lambda^2*x+t)/lambda)*lambda-t)/lambda)^2*lambda^2-16*abs(lambda)^2)

Since "cos(...)" appears in every term in last equation (except a last one), how to common it?

## How to verify the solution of PDEs?...

 > restart:
 > with(PDEtools):
 > with(LinearAlgebra):
 >
 > alias(f=f(x,t),g=g(x,t));
 (1)
 >
 >
 > eq1:=diff(f,x)=-I*eta*f +I*exp(-I*t)*g;
 (2)
 > eq2:=diff(g,x)=-I*eta*g +I*exp(I*t)*f;
 (3)
 > eq3:=diff(f,t)=(I*eta^2-I/2)*f +I*eta*exp(-I*t)*g;
 (4)
 > eq4:=diff(g,t)=(-I*eta^2+I/2)*g +I*eta*exp(I*t)*f;
 (5)
 > #### The solution of (2)-(5) is
 > eq5:=f=I*(c1*exp(A)-c2*exp(-A))*exp(-i*t/2);
 (6)
 > eq6:=g=(c2*exp(A)-c1*exp(-A))*exp(i*t/2);
 (7)
 > #### where
 > c1=sqrt(h-sqrt(h^2-1))/sqrt(h^2-1);c2=sqrt(h+sqrt(h^2-1))/sqrt(h^2-1);A=sqrt(h^2-1)*(x+I*h*t);
 (8)
 > #### How to verify (6) and (7) is the solution of (2)-(5)?

## Find domain to get positive function ...

Dear all

I want if possible to solve the inequation   f(x,y)>0 using maple

positive_function.mw

Thanks for any help

## How to plot this functions...

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);
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 = ["&eta;", "f'"], thickness = 1, labeldirections = [horizontal, vertical], labelfont = ['TIMES', 'BOLDOBLIQUE', 16], size = [450, 450], axes = box);
mp.mw

 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >

## Solving Optimization problem using the Karush Khun...

Hi everyone, I have problem solving a given optimization problem using the Karush Khun Tucke conditions. The working is as follows:

restart;
with(linalg);
f := 49*x[1]+94*x[2]+90*x[3]+24*x[4]+6*x[5]+63*x[6]+17*x[7]+65*x[8]+72*x[9]+40*x[10]+67*x[11]+99*x[12]+97*x[13]+53*x[14]+22*x[15]+47*x[16]+60*x[17]+36*x[18]+54*x[19]+67*x[20]+46*x[21]+55*x[22]+42*x[23]+70*x[24];
49 x[1] + 94 x[2] + 90 x[3] + 24 x[4] + 6 x[5] + 63 x[6]

+ 17 x[7] + 65 x[8] + 72 x[9] + 40 x[10] + 67 x[11] + 99 x[12]

+ 97 x[13] + 53 x[14] + 22 x[15] + 47 x[16] + 60 x[17]

+ 36 x[18] + 54 x[19] + 67 x[20] + 46 x[21] + 55 x[22]

+ 42 x[23] + 70 x[24]
g[1] := x[1]+x[2]+x[3]+x[4]+x[5]+x[6]+x[7]+x[8]+x[9]+x[10]+x[11]+x[12]-475;
x[1] + x[2] + x[3] + x[4] + x[5] + x[6] + x[7] + x[8] + x[9]

+ x[10] + x[11] + x[12] - 475
g[2] := x[13]+x[14]+x[15]+x[16]+x[17]+x[18]+x[19]+x[20]+x[21]+x[22]+x[23]+x[24]-30;
x[13] + x[14] + x[15] + x[16] + x[17] + x[18] + x[19] + x[20]

+ x[21] + x[22] + x[23] + x[24] - 30
for i from 3 to 26 do g[i] := -x[i] end do;
h[1] := 54-x[1];
54 - x[1]
h[2] := 30-x[2];
13 - x[2]
h[3] := 13-x[3];
13 - x[3]
h[4] := 41-x[4];
41 - x[4]
h[5] := 97-x[5];
97 - x[5]
h[6] := 11-x[6];
11 - x[6]
h[7] := 62-x[7];
62 - x[7]
h[8] := 59-x[8];
59 - x[8]
h[9] := 35-x[9];
35 - x[9]
h[10] := 42-x[10];
42 - x[10]
h[11] := 19-x[11];
19 - x[11]
h[12] := 12-x[12];
12 - x[12]
vars := [x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10], x[11], x[12], x[13], x[14], x[15], x[16], x[17], x[18], x[19], x[20], x[21], x[22], x[23], x[24]];
[x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10],

x[11], x[12], x[13], x[14], x[15], x[16], x[17], x[18], x[19],

x[20], x[21], x[22], x[23], x[24]]
H := Hessian(f, vars);
Hessian(49 x[1] + 94 x[2] + 90 x[3] + 24 x[4] + 6 x[5] + 63 x[6]

+ 17 x[7] + 65 x[8] + 72 x[9] + 40 x[10] + 67 x[11] + 99 x[12]

+ 97 x[13] + 53 x[14] + 22 x[15] + 47 x[16] + 60 x[17]

+ 36 x[18] + 54 x[19] + 67 x[20] + 46 x[21] + 55 x[22]

+ 42 x[23] + 70 x[24], [x[1], x[2], x[3], x[4], x[5], x[6],

x[7], x[8], x[9], x[10], x[11], x[12], x[13], x[14], x[15],

x[16], x[17], x[18], x[19], x[20], x[21], x[22], x[23], x[24]])
Del(49 x[1] + 94 x[2] + 90 x[3] + 24 x[4] + 6 x[5] + 63 x[6]

+ 17 x[7] + 65 x[8] + 72 x[9] + 40 x[10] + 67 x[11] + 99 x[12]

+ 97 x[13] + 53 x[14] + 22 x[15] + 47 x[16] + 60 x[17]

+ 36 x[18] + 54 x[19] + 67 x[20] + 46 x[21] + 55 x[22]

+ 42 x[23] + 70 x[24], [x[1], x[2], x[3], x[4], x[5], x[6],

x[7], x[8], x[9], x[10], x[11], x[12], x[13], x[14], x[15],

x[16], x[17], x[18], x[19], x[20], x[21], x[22], x[23], x[24]])
for i to 26 do grad_g[i] := Del(g[i], vars) end do;
for i to 12 do grad_h[i] := Del(h[i], vars) end do;
eq[1] := grad_f+sum(mu[i]*g[i], i = 13 .. 26)+sum(lambda[i]*h[j], j = 1 .. 12) = 0;
Error, (in sum) summation variable previously assigned, second argument evaluates to 13 = 13 .. 37
eq[2] := g[i] <= 0;
-x[13] <= 0
eq[3] := h[j] <= 0;
h[j] <= 0
eq[4] := mu[i] >= 0;
0 <= mu[13]
eq[5] := lambda[j] <= 0;
lambda[j] <= 0
eq[6] := mu[i]*g[i] = 0;
-mu[13] x[13] = 0
eval(solve({eq[1], eq[2], eq[3], eq[4], eq[5], eq[6]}, [vars, lambda[j], mu[i]]));
Error, invalid input: too many and/or wrong type of arguments passed to solve; first unused argument is [[x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10], x[11], x[12], x[13], x[14], x[15], x[16], x[17], x[18], x[19], x[20], x[21], x[22], x[23], x[24]], lambda[j], mu[13]]

 >
 >
 (1)
 >

## solving ODE with analytical solution...

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

 1 2 3 4 5 6 7 Last Page 3 of 70
﻿