Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

 

Friends, as above in the picture,I want T to differentiate diff(x,t),taken diff(x,t) as a variable.

The answer is m*diff(x,t)+m__1/2 

Is there any way to do that? Substitute diff(x,t) with another variable and then substitute back isn't convenient.

differential_question.mw

Hello,friends.I want to know is there any maple command that can change the order of integral?I searched the Student package and the DEtools,can not find it.

for instance,there is an integral 

int(f(x,y),y=sqrt(4*x-x^2)..2*sqrt(x),x=0..4), 

it first integral y then integral x.I want the integral order be x then y. I appreciate your help!

 

How to futher simplify so that we could exact value

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

Hello everyone,

I'm studying an equation with three variables similar to the following:

x*y+z=0

Now, I would like to obtain the numeric values of x associated to (y, z) that are free to assume any integer value within the intervals [-1...5] and [0...5] respectively. Thus, I should get 42 values of x overall. The question is very similar to the one asked here: https://www.mapleprimes.com/questions/146636-How-To-Solve-An-Equation-In-Three-Variables but in my case I would like to obtain all the 42 values of x (included undefined solutions) associated to the sets (y,z), possibly arranged in a 42x3 matrix where the columns are the variables (x,y,z) and the rows the values (x,y,z) that satisfy the equation.

I started to tackle the problem using a for loop:

for y from -1 by 1 to 5 do

    for z from 0 by 1 to 5 do

        eq:= fsolve(x*y + z, x);

    end do;

end do;

eq;

 

But it returns only one value: -1.000. Any help is appreciated.

Thank you for your time.

Hello

I use Maple 20018.2.

When I use "Data Set Search" and press Search I get following Error Message. I check that the network access to the internet is on enable. Does anybody has an Idea?

thank you

Murad

Hi,

I was hoping someone can tell me if there's a better way for doing this math.

I think i was doing this wrong so i posted the full results. The answers r correct but i might be doing this the long way.

Thanks in Advance.
 

Section 1.6: Combinations of Functions

 

Example 1: - Sum Rule

"ex1f(x):= 2 x+1"

proc (x) options operator, arrow, function_assign; 2*x+1 end proc

(1)

"ex1g(x):=x^(2)+2 x-1"

proc (x) options operator, arrow, function_assign; x^2+2*x-1 end proc

(2)

ex1f(x)+ex1g(x)

x^2+4*x

(3)

eval(x^2+4*x, [x = 2])

12

(4)

 

Example 2: - Difference Rule

"ex2f(x):=2 x+1"

proc (x) options operator, arrow, function_assign; 2*x+1 end proc

(5)

"ex2g(x):=x^(2)+2 x-1"

proc (x) options operator, arrow, function_assign; x^2+2*x-1 end proc

(6)

ex2f(x)-ex2g(x)

-x^2+2

(7)

eval(-x^2+2, [x = 2])

-2

(8)

Example 3: - Product Rule

"ex3f(x):=x^(2)"

proc (x) options operator, arrow, function_assign; x^2 end proc

(9)

"ex3g(x):= x-3"

proc (x) options operator, arrow, function_assign; x-3 end proc

(10)

ex3f(x)*ex3g(x)

x^2*(x-3)

(11)

collect(x^2*(x-3), x)

x^3-3*x^2

(12)

eval(x^3-3*x^2, [x = 4])

16

(13)

Example 4: - Quotient Rule

"ex4f(x):=sqrt(x)"

proc (x) options operator, arrow, function_assign; sqrt(x) end proc

(14)

"ex4g(x):=sqrt(4-x^(2))"

proc (x) options operator, arrow, function_assign; sqrt(4-x^2) end proc

(15)

ex4f(x)/ex4g(x)

x^(1/2)/(-x^2+4)^(1/2)

(16)

 

Example 5: - Composition - Chain Rule

 

This is an example of the chain rule.

"ex5t1(x):=sqrt(x):"

"ex5t2(x):=x-1:"

Function in another function:

 

ex5t1(ex5t2(x))

(x-1)^(1/2)

(1.1)

eval((x-1)^(1/2), [x = 2])

1

(1.2)

plot((x-1)^(1/2))

 

Example 6: - Composition - Chain Rule

 

Insert*two*functions

 

"ex6f(x):=x+2:"

"ex6g(x):=4-x^(2):"

 

ex6f(ex6g(x))

-x^2+6

(2.1)

eval(-x^2+6, [x = 0])

6

(2.2)

eval(-x^2+6, [x = 1])

5

(2.3)

``

ex6g(ex6f(x))

4-(x+2)^2

(2.4)

eval(4-(x+2)^2, [x = 0])

0

(2.5)

eval(4-(x+2)^2, [x = 1])

-5

(2.6)

``

Example 7: Find Domain with Chain Rule

 

Insert two Functions:

"ex7f(x):=x^(2)-9:"

"ex7g(x):=sqrt(9-x^(2)):"

``

ex7f(ex7g(x))

-x^2

(3.1)

plot(-x^2)

 

[-3, 3]

[-3, 3]

(3.2)

``


 

Download Ch1_6_Combo_Functions.mw

z1 := a1+I*b1; z2 := a2+I*b2; abs(z1) = 1; abs(z2) = 1; argument(z1) = alpha; argument(z2) = beta; On considère dans ℂ les complexes z1 et z2 de module 1 et d'argument α et β Show that (z1+z2)^2/(z1+z2) est un réel positf ou nul. Dans quel cas est-il nul ? is((z1^2+2*z1*z2+z2^2)/(z1+z2) = z1/z2+z2/z1+2);#wrong answer z1/z2 = exp(I*(alpha-beta)); z2/z1 = exp(I*(beta-alpha)); is(z1/z2+z2/z1+2 = 2*(1+cos(alpha-beta)));#wong answer Miscalculations. Thank you for your help.

I have noticed that fieldplot3d can fail when calling a procedure that contains if statements.  It appears that fieldplot3d is attempting to evaluate the statements within the procedure, instead of simply calling the procedure with numerical values.

We are still on lockdown in the UK, and this has kept me amused for a while now.  But I have run out of ideas and could really use some help!

fieldplot3d_and_if_statements.mw

restart;

kernelopts(version);

`Maple 2020.0, X86 64 LINUX, Mar 4 2020, Build ID 1455132`

convert([1,2,3], Vector[row]);

Vector[row](3, {(1) = 1, (2) = 2, (3) = 3})

convert([1,2,3], Vector[col]);

This worksheet shows an unexpected behavior of pdsolve().  It solves the heat equation on the interval (−1,1) but fails on the interval (0,1).  I see no technical reason for this happening — it's probably due to a little bug lurking somewhere.

restart;

kernelopts(version);

`Maple 2020.0, X86 64 LINUX, Mar 4 2020, Build ID 1455132`

Physics:-Version();

`The "Physics Updates" package is not installed`

Solve the heat equation on the interval -1 < x and x < 1 and

boundary conditions u(-1, t) = 0, u(1, t) = 0.

pde := diff(u(x,t),t) = diff(u(x,t),x,x);

diff(u(x, t), t) = diff(diff(u(x, t), x), x)

bc := u(-1,t)=0, u(1,t)=0;

u(-1, t) = 0, u(1, t) = 0

ic := u(x,0) = cos(Pi/2*x);

u(x, 0) = cos((1/2)*Pi*x)

pdsol := expand(pdsolve({pde,bc,ic}));

u(x, t) = cos((1/2)*Pi*x)*exp(-(1/4)*t*Pi^2)

That's good.  Apply pdetest to verify it:

pdetest(pdsol, [pde,bc,ic]);

[0, 0, 0, 0]

Now, solve the same problem on the interval 0 < x and x < 1 and

boundary condition u__x(0, t) = 0 and u(1, t) = 0.  It should be

evident that the solution remains the same as the one calculated

above, due to symmetry, and here is the verification:

bc_new := D[1](u)(0,t)=0, u(1,t)=0;

(D[1](u))(0, t) = 0, u(1, t) = 0

pdetest(pdsol, [pde,bc_new,ic]);

[0, 0, 0, 0]

But for some reason Maple's pdsolve fails to solve the PDE.  Actually

its response is somewhat erratic -- sometimes it returns nothing at all,

and sometimes it exits with an error message.

pdsolve({pde,bc_new,ic});

 

Download pdsolve-fails.mw

 

I need to solve general linear programming problem with multi-precision support. What are my options with Maple 2020?

 

What have I done!

Whatever I have created - Maple doesn't think it is a list.

The question is - what is it then?

proclist.mw

I'm trying to obtain the dynamical response of a simply-supported beam with a cantilever extension, coupled to a spring-mass system. In mathematical terms, this system is ruled by three PDEs (relative to each bare part of the main structure) and one ODE (relative to the spring-mass system). I think my mathemical model is finely formulated, but Maple keeps telling me this:

Error, (in pdsolve/numeric/process_IBCs) improper op or subscript selector

I believe it is because my PDEs depend on "x" and "t", while the ODE depends solely on "t". I have tried to transform my ODE into a "PDE", making it also dependent of "x", but without imposing any boundary conditions relative to "x". However, after this Maple points a new error message:

Error, (in pdsolve/numeric) initial/boundary conditions must be defined at one or two points for each independent variable

Could someone help me finding a solution? My algorythm in shown in the attached file below.

Worksheet.mw

First 429 430 431 432 433 434 435 Last Page 431 of 2097