MaplePrimes Questions


 

restart

sigma[1] := 0.1e-5;

0.1e-5

 

3.0

 

1.1

 

0.1e-1

 

0.1e-5

 

4.0

 

0.1e-1

 

.12

 

.2

 

0.2e-1

(1)

"(∂)/(∂ t) C(t, x)=`sigma__1`*((ⅆ)^2)/((ⅆ)^( )x^2) C(t, x)+alpha[1]*C(t, x)^(`k__1`)+alpha[1]*C(t, x)^(`k__2`)*B(t, x)^(`k__3`)-`beta__1`*C(t, x),  (∂)/(∂ t) B(t, x)=`sigma__2`*((ⅆ)^2)/((ⅆ)^( )x^2) B(t, x)+alpha[2]*B(t, x)^(`k__3`)+alpha[2]*C(t, x)^(`k__2`)*B(t, x)^(`k__4`)-`beta__2`*B(t, x),    #`with boundary conditions`  (∂)/(∂ x) C(t, 0)=0,(∂)/(∂ x) C(t, 1)=0,  (∂)/(∂ x) B(t, 0)=0,(∂)/(∂ x) B(t, 1)=0,    #`and initial conditions`   C(0, x) = `C__o`(x) ,  B(0, x)=B[o](x), #`In this model C(0) = 13.0 and B(0) = 300 `    #`I need the numerical solutions of C and B`  #`variations of parameters like sigma`[1], sigma[2, ]beta[1], beta[2]  #thanks    "


 

Download pde_solve.mw

alpha:=1:dT:=Th-Tc:n:=1:

plot(subs(Tc=400,n*alpha*dT/2),Th=300..700);

All the units are in Kelvin but now I want to have Th on x-axis to be in Celsius.

Is this possible?

Thanks  
 

How I can determine the trace of the matrix.

My answer has a lot of differences comparing the result provided in the pdf file (end of the file).

Also, I think we should use from  EQ(4).

what is the problem?

Please help me..

Best

Doc2.pdf

1111.mw


 

restart; x__2 := beta*gamma+2*beta+delta*gamma+delta-alpha-sqrt(alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)/(2*(beta+delta))

y__2 := 1-x__2

J := Matrix([[1-2*x__2-y__2, -x__2], [beta*y__2^2/x__2^2, delta-2*beta*y__2/x__2-alpha*gamma/(gamma+y__2)^2]])

 

 

                            

and y__2*(delta-beta*y__2/x__2)-alpha*y__2/(gamma+y__2) = 0``

Error, reserved word `and` unexpected

 
  NULL

 

 

NULL

TTR := Trace(J)

TTR := 1-2*x__2-y__2+delta-2*beta*y__2/x__2-alpha*gamma/(gamma+y__2)^2

-beta*gamma-2*beta-delta*gamma+alpha+(alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)/(2*beta+2*delta)-2*beta*(1-beta*gamma-2*beta-delta*gamma-delta+alpha+(alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)/(2*beta+2*delta))/(beta*gamma+2*beta+delta*gamma+delta-alpha-(alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)/(2*beta+2*delta))-alpha*gamma/(gamma+1-beta*gamma-2*beta-delta*gamma-delta+alpha+(alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)/(2*beta+2*delta))^2

(1)

s := diff(TTR, alpha)

1+(1/2)*(-2*beta*gamma-2*delta*gamma+2*alpha-4*beta-2*delta)/((alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)*(2*beta+2*delta))-2*beta*(1+(1/2)*(-2*beta*gamma-2*delta*gamma+2*alpha-4*beta-2*delta)/((alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)*(2*beta+2*delta)))/(beta*gamma+2*beta+delta*gamma+delta-alpha-(alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)/(2*beta+2*delta))+2*beta*(1-beta*gamma-2*beta-delta*gamma-delta+alpha+(alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)/(2*beta+2*delta))*(-1-(1/2)*(-2*beta*gamma-2*delta*gamma+2*alpha-4*beta-2*delta)/((alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)*(2*beta+2*delta)))/(beta*gamma+2*beta+delta*gamma+delta-alpha-(alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)/(2*beta+2*delta))^2-gamma/(gamma+1-beta*gamma-2*beta-delta*gamma-delta+alpha+(alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)/(2*beta+2*delta))^2+2*alpha*gamma*(1+(1/2)*(-2*beta*gamma-2*delta*gamma+2*alpha-4*beta-2*delta)/((alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)*(2*beta+2*delta)))/(gamma+1-beta*gamma-2*beta-delta*gamma-delta+alpha+(alpha^2-2*alpha*(beta*gamma+delta*gamma+2*beta+delta)+(beta*gamma+delta*gamma+delta)^2)^(1/2)/(2*beta+2*delta))^3

(2)

NULL

NULL


 

Download 1111.mw

Can Maple open a Mathematica .cdf file (computable document format)?

If so, how?

I am slightly new to maple and have the following problem... I need to draw phase portrait of nonlinear dynamical system (differential equasion: ), where function is a hysteresis loop with parameters b=2, c=1.

Solving:

Split phase plane it two areas:

A:

B:

Finally I have two differencial equasions.

1. For A area:

2. For B area:

In a textbook this phase portrait looks like:

I know how to draw phase portrait of the first differencial equasion:

restart; with(plots); with(plottools); with(DEtools):
initialset := {seq(seq([x1(0) = a, y1(0) = b], a = -2 .. 2), b = -2 .. 2)};
DE := [diff(x1(t), t) = y1(t), diff(y1(t), t) = 1-x1(t)];
phaseportrait([DE[]], [x1, y1], t = -5 .. 5, initialset, x1 = -3 .. 3, y1 = -3 .. 3, stepsize = .1, color = green, numpoints = 600, thickness = 2, linecolor = black, title = "first de");

I know how to draw phase portrait of the second differencial equasion:

restart; with(plots); with(plottools); with(DEtools):
initialset := {seq(seq([x1(0) = a, y1(0) = b], a = -2 .. 2), b = -2 .. 2)};
DE := [diff(x1(t), t) = -y1(t), diff(y1(t), t) = 1+x1(t)]
phaseportrait([DE[]], [x1, y1], t = -5 .. 5, initialset, x1 = -3 .. 3, y1 = -3 .. 3, stepsize = .1, color = green, numpoints = 600, thickness = 2, linecolor = black, title = "second de");

Unfortunately, I don`t know how to combine it in Maple...

The help for option threadsafe (on page ?option) includes this sentence: 

  • Portions of the kernel may recognize this option and allow the procedure to be called in multiple threads simultaneously.

Huh? What exactly does that mean? Isn't it already capable of being called in multiple threads simultaneously?

I understand the significance of this option for procedures to be compiled, mentioned later in the same paragraph. But is there any benefit for a non-compiled procedure that will be used in multithreaded code? If my code has numerous one-liner arrow procedures, is there any point to cluttering up my code by turning them all into procs with option threadsafe? (Y'all know how I hate cluttered code.)

 

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

First 436 437 438 439 440 441 442 Last Page 438 of 2308