Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

restart;
_local(D, O);
with(Student:-MultivariateCalculus);
A := [0, 0, 0];
B := [a, 0, 0];
C := [a, b, 0];
D := [0, b, 0];
S := [0, 0, h];
O := [x, y, z];
lineSC := Line(S, C);
lineSD := Line(S, D);
H := Projection(A, lineSC);
K := Projection(A, lineSD);
OH := H - O;
OK := K - O;
OC := C - O;
M := Matrix([OH, OK, OC]);
O := eval(O, %);
simplify(Distance(O, H));
                               O

Error, invalid input: eval received Matrix(3, 3, {(1, 1) = -x+h^2*a/(a^2+b^2+h^2), (1, 2) = -y+h^2*b/(a^2+b^2+h^2), (1, 3) = -z+h*(a^2+b^2)/(a^2+b^2+h^2), (2, 1) = -x, (2, 2) = -y+h^2*b/(b^2+h^2), (2, 3) = -z+h*b^2/(b^2+h^2), (3, 1) = -x+a, (3, 2) = -y+b, (3, 3) = -z}), which is not valid for its 2nd argument, eqns
How to correct this error ? Thank you.

i am writing code for an iterative process at the end i want to evaluate the summation expression with two loops but it is not evaluating kindly help me out here automatic_differentiation.mw
 

restart

v := 1; a := 2; t := 0.1e-2; dt := 0.1e-3; N := 40; h := 1/40; K := 4

NULL

NULL

for i from 0 to N do x[i] := i*h end do

x[5]

1/8

(1)

initial_condition := []; for i to N do initial_condition := [op(initial_condition), evalf(2*v*Pi*sin(Pi*x[i])/(a+cos(Pi*x[i])))] end do

u := proc (i) local u_x, u_xx, expr, j; u_x := (1/2)*(u[i+1]-u[i-1])/h; u_xx := (u[i-1]-2*u[i]+u[i+1])/h^2; expr := -alpha*u[i]*u_x+v*u_xx; expr end proc
NULL

NULL

odes := [seq(u(i, [seq(u[j], j = 1 .. N-1)]), i = 1 .. N-1)]

for i to N-1 do assign(o[i] = odes[i]) end do

for i to N-1 do printf("u_%d = %s\n", i, convert(u(i), string)) end do

u_1 = -alpha*u[1]*(20*u[2]-20*u[0])+1600*u[0]-3200*u[1]+1600*u[2]
u_2 = -alpha*u[2]*(20*u[3]-20*u[1])+1600*u[1]-3200*u[2]+1600*u[3]
u_3 = -alpha*u[3]*(20*u[4]-20*u[2])+1600*u[2]-3200*u[3]+1600*u[4]
u_4 = -alpha*u[4]*(20*u[5]-20*u[3])+1600*u[3]-3200*u[4]+1600*u[5]
u_5 = -alpha*u[5]*(20*u[6]-20*u[4])+1600*u[4]-3200*u[5]+1600*u[6]
u_6 = -alpha*u[6]*(20*u[7]-20*u[5])+1600*u[5]-3200*u[6]+1600*u[7]
u_7 = -alpha*u[7]*(20*u[8]-20*u[6])+1600*u[6]-3200*u[7]+1600*u[8]
u_8 = -alpha*u[8]*(20*u[9]-20*u[7])+1600*u[7]-3200*u[8]+1600*u[9]
u_9 = -alpha*u[9]*(20*u[10]-20*u[8])+1600*u[8]-3200*u[9]+1600*u[10]
u_10 = -alpha*u[10]*(20*u[11]-20*u[9])+1600*u[9]-3200*u[10]+1600*u[11]
u_11 = -alpha*u[11]*(20*u[12]-20*u[10])+1600*u[10]-3200*u[11]+1600*u[12]
u_12 = -alpha*u[12]*(20*u[13]-20*u[11])+1600*u[11]-3200*u[12]+1600*u[13]
u_13 = -alpha*u[13]*(20*u[14]-20*u[12])+1600*u[12]-3200*u[13]+1600*u[14]
u_14 = -alpha*u[14]*(20*u[15]-20*u[13])+1600*u[13]-3200*u[14]+1600*u[15]
u_15 = -alpha*u[15]*(20*u[16]-20*u[14])+1600*u[14]-3200*u[15]+1600*u[16]
u_16 = -alpha*u[16]*(20*u[17]-20*u[15])+1600*u[15]-3200*u[16]+1600*u[17]
u_17 = -alpha*u[17]*(20*u[18]-20*u[16])+1600*u[16]-3200*u[17]+1600*u[18]
u_18 = -alpha*u[18]*(20*u[19]-20*u[17])+1600*u[17]-3200*u[18]+1600*u[19]
u_19 = -alpha*u[19]*(20*u[20]-20*u[18])+1600*u[18]-3200*u[19]+1600*u[20]
u_20 = -alpha*u[20]*(20*u[21]-20*u[19])+1600*u[19]-3200*u[20]+1600*u[21]
u_21 = -alpha*u[21]*(20*u[22]-20*u[20])+1600*u[20]-3200*u[21]+1600*u[22]
u_22 = -alpha*u[22]*(20*u[23]-20*u[21])+1600*u[21]-3200*u[22]+1600*u[23]
u_23 = -alpha*u[23]*(20*u[24]-20*u[22])+1600*u[22]-3200*u[23]+1600*u[24]
u_24 = -alpha*u[24]*(20*u[25]-20*u[23])+1600*u[23]-3200*u[24]+1600*u[25]
u_25 = -alpha*u[25]*(20*u[26]-20*u[24])+1600*u[24]-3200*u[25]+1600*u[26]
u_26 = -alpha*u[26]*(20*u[27]-20*u[25])+1600*u[25]-3200*u[26]+1600*u[27]
u_27 = -alpha*u[27]*(20*u[28]-20*u[26])+1600*u[26]-3200*u[27]+1600*u[28]
u_28 = -alpha*u[28]*(20*u[29]-20*u[27])+1600*u[27]-3200*u[28]+1600*u[29]
u_29 = -alpha*u[29]*(20*u[30]-20*u[28])+1600*u[28]-3200*u[29]+1600*u[30]
u_30 = -alpha*u[30]*(20*u[31]-20*u[29])+1600*u[29]-3200*u[30]+1600*u[31]
u_31 = -alpha*u[31]*(20*u[32]-20*u[30])+1600*u[30]-3200*u[31]+1600*u[32]
u_32 = -alpha*u[32]*(20*u[33]-20*u[31])+1600*u[31]-3200*u[32]+1600*u[33]
u_33 = -alpha*u[33]*(20*u[34]-20*u[32])+1600*u[32]-3200*u[33]+1600*u[34]
u_34 = -alpha*u[34]*(20*u[35]-20*u[33])+1600*u[33]-3200*u[34]+1600*u[35]
u_35 = -alpha*u[35]*(20*u[36]-20*u[34])+1600*u[34]-3200*u[35]+1600*u[36]
u_36 = -alpha*u[36]*(20*u[37]-20*u[35])+1600*u[35]-3200*u[36]+1600*u[37]
u_37 = -alpha*u[37]*(20*u[38]-20*u[36])+1600*u[36]-3200*u[37]+1600*u[38]
u_38 = -alpha*u[38]*(20*u[39]-20*u[37])+1600*u[37]-3200*u[38]+1600*u[39]
u_39 = -alpha*u[39]*(20*u[40]-20*u[38])+1600*u[38]-3200*u[39]+1600*u[40]

 

initial_conditions := [.1644933719, .3289856976, .4934717144, .6579375992, .8223563570, .9866828090, 1.150848028, 1.314753051, 1.478261707, 1.641192349, 1.803308276, 1.964306617, 2.123805434, 2.281328760, 2.436289364, 2.587968970, 2.735495794, 2.877819368, 3.013682762, 3.141592654, 3.259788188, 3.366210070, 3.458472370, 3.533840560, 3.589220824, 3.621167336, 3.625916040, 3.599455182, 3.537643690, 3.436388151, 3.291886154, 3.100937330, 2.861312732, 2.572157998, 2.234388242, 1.851015873, 1.427342882, .9709526944, .4914580366, 0.]; u := table(); for i to N do u[i] := initial_conditions[i] end do

.1644933719

 

.3289856976

 

.4934717144

 

.6579375992

 

.8223563570

 

.9866828090

 

1.150848028

 

1.314753051

 

1.478261707

 

1.641192349

 

1.803308276

 

1.964306617

 

2.123805434

 

2.281328760

 

2.436289364

 

2.587968970

 

2.735495794

 

2.877819368

 

3.013682762

 

3.141592654

 

3.259788188

 

3.366210070

 

3.458472370

 

3.533840560

 

3.589220824

 

3.621167336

 

3.625916040

 

3.599455182

 

3.537643690

 

3.436388151

 

3.291886154

 

3.100937330

 

2.861312732

 

2.572157998

 

2.234388242

 

1.851015873

 

1.427342882

 

.9709526944

 

.4914580366

 

0.

(2)

for i from 2 to N-1 do T1[i] := (u[i+1]-u[i-1])/(2*h); T2[i] := u[i]*T1[i]; T3[i] := (u[i-1]-2*u[i]+u[i+1])/h^2; uN[i][1] := v*T3[i]-T2[i] end do

6.579566850

 

2.164583390

 

-0.100942400e-1

 

-2.174677630

 

6.579038030

 

3.246569176

 

-0.322112000e-1

 

-3.278780376

 

6.577692850

 

4.327711442

 

-0.754025600e-1

 

-4.403114002

 

6.574904195

 

5.406914261

 

-.1476892800

 

-5.554603541

 

6.569833420

 

6.482341694

 

-.257972800

 

-6.740314494

 

6.561404840

 

7.551179821

 

-.416313600

 

-7.967493421

 

6.548273580

 

8.609362668

 

-.634187200

 

-9.243549868

 

6.528785960

 

9.651254278

 

-.924822400

 

-10.57607668

 

6.500931380

 

10.66927884

 

-1.303544000

 

-11.97282284

 

6.462285360

 

11.65349267

 

-1.788137600

 

-13.44163027

 

6.409943160

 

12.59109376

 

-2.399238400

 

-14.99033216

 

6.340442860

 

13.46586700

 

-3.160785600

 

-16.62665260

 

6.249678600

 

14.25757153

 

-4.100355200

 

-18.35792673

 

6.132804200

 

14.94128564

 

-5.249596800

 

-20.19088244

 

5.984128600

 

15.48673913

 

-6.644451200

 

-22.13119033

 

5.797007960

 

15.85769089

 

-8.325200000

 

-24.18289089

 

5.563739360

 

16.01143689

 

-10.33628800

 

-26.34772489

 

5.275465720

 

15.89858010

 

-12.72560320

 

-28.62418330

 

4.922108520

 

15.46325997

 

-15.54297280

 

-31.00623277

 

4.492348320

 

14.64410399

 

-18.83784320

 

-33.48194719

 

3.973683640

 

13.37625388

 

-22.65533120

 

-36.03158508

 

3.352609800

 

11.59490836

 

-27.03057600

 

-38.62548436

 

2.614969080

 

9.240883798

 

-31.98068160

 

-41.22156540

 

1.746535520

 

6.268701658

 

-37.49400320

 

-43.76270486

 

.7339043200

 

2.657590351

 

-43.51649280

 

-46.17408315

 

-.4342430800

 

-1.574528949

 

-49.93529920

 

-48.36077025

 

-1.765447000

 

-6.354647353

 

-56.56101440

 

-50.20636705

 

-3.261340620

 

-11.53746107

 

-63.11047520

 

-51.57301413

 

-4.915150720

 

-16.89036569

 

-69.19433280

 

-52.30396711

 

-6.709016420

 

-22.08531826

 

-74.31492320

 

-52.22960494

 

-8.611468440

 

-26.70362395

 

-77.88123840

 

-51.17761445

 

-10.57558664

 

-30.26006070

 

-79.24821760

 

-48.98815690

 

-12.53848980

 

-32.25097682

 

-77.78403520

 

-45.53305838

 

-14.42284250

 

-32.22622970

 

-72.96418080

 

-40.73795110

 

-16.14090720

 

-29.87707543

 

-64.48099520

 

-34.60391977

 

-17.60126357

 

-25.12303827

 

-52.34751456

 

-27.22447629

 

-18.71769691

 

-18.17399825

 

-36.96715264

 

-18.79315439

 

-19.41905389

 

-9.543650097

 

-19.14140608

 

-9.597755983

(3)

for i from 3 to N do for k to 4 do T1[i][k] := (uN[i+1][k]-uN[i-1][k])/(2*h); T2[i][k] := 0; for j from 0 to k do T2[i][k] := T1[i][k-j]*uN[i][j]+T2[i][k] end do; T3[i][k] := (uN[i-1][k]-2*uN[i][k]+uN[i+1][k])/h^2; uN[i][k+1] := (-T2[i][k]+T3[i][k])/(k+1) end do end do

NULL

NULL

NULL

NULL

NULL

NULL

NULL

"for i from1 to N do          for j  from 1 to 10  do      uNew[i]:=sum(uN[i][k] *( j*dt)^(k), k=0..K);      end do;      end do;"

Error, controlling variable of for loop must be a name or sequence of 2 names

"for i from1 to N do         for j  from 1 to 10  do  uNew[i]:=sum(uN[i][k] * j*dt, k=0..K);      end do;    end do;"

 

NULL

NULL

NULL

NULL

NULL

NULL

NULL


 

Download automatic_differentiation.mw

 

How to get Li(x) to display as result of int(1/ln(x),x) in Maple instead of -Ei(1,-ln(x))

I'd like to match result of Maple with another software I use and it is also simpler to look at

int(1/ln(x),x)

Now gives

             -Ei(1,-ln(x))

How to make it show  Li(x) instead?

The Maple help page for Li is this

And the other software Li help page is this

I tried simplify in Maple but it does not do anything. How to get Li(x) in Maple for int(1/ln(x),x);  instead of -Ei(1, -ln(y)) ?

Note that 

diff(Li(x),x)

Gives 1/ln(x) so Li(x) is the correct antiderivative.

Here is also the wiki page

I know that Maple's result is correct, I am just asking about the form it is shown. Since Maple has Li(x) function, why not use it for this result?

 

Maple 2024.1


 

An attractor is called strange if it has a fractal structure, that is if it has a non-integer Hausdorff dimension. This is often the case when the dynamics on it are chaotic, but strange nonchaotic attractors also exist.  If a strange attractor is chaotic, exhibiting sensitive dependence on initial conditions, then any two arbitrarily close alternative initial points on the  attractor, after any of various numbers of iterations, will lead to  points that are arbitrarily far apart (subject to the confines of the attractor), and after any of various other numbers of iterations will  lead to points that are arbitrarily close together. Thus a dynamic system with a chaotic attractor is locally unstable yet globally stable: once some sequences have entered the attractor, nearby points diverge  from one another but never depart from the attractor.


The term strange attractor was coined by David Ruelle and Floris Takens to describe the attractor resulting from a series of bifurcations of a system describing fluid flow. Strange attractors are often differentiable in a few directions, but some are like a Cantor dust, and therefore not differentiable. Strange attractors may also be found  in the presence of noise, where they may be shown to support invariant  random probability measures of Sinai–Ruelle–Bowen type.


Examples of strange attractors include the  Rössler attractor, and Lorenz attractor.

 

 

THOMAS``with(plots); b := .20; sys := diff(x(t), t) = sin(y(t))-b*x(t), diff(y(t), t) = sin(z(t))-b*y(t), diff(z(t), t) = sin(x(t))-b*z(t); sol := dsolve({sys, x(0) = 1.1, y(0) = 1.1, z(0) = -0.1e-1}, {x(t), y(t), z(t)}, numeric); odeplot(sol, [x(t), y(t), z(t)], t = 0 .. 600, axes = boxed, numpoints = 50000, labels = [x, y, z], title = "Thomas Attractor")

 

 

 

Dabras``

with(plots); a := 3.00; b := 2.7; c := 1.7; d := 2.00; e := 9.00; sys := diff(x(t), t) = y(t)-a*x(t)+b*y(t)*z(t), diff(y(t), t) = c*y(t)-x(t)*z(t)+z(t), diff(z(t), t) = d*x(t)*y(t)-e*z(t); sol := dsolve({sys, x(0) = 1.1, y(0) = 2.1, z(0) = -2.00}, {x(t), y(t), z(t)}, numeric); odeplot(sol, [x(t), y(t), z(t)], t = 0 .. 100, axes = boxed, numpoints = 35000, labels = [x, y, z], title = "Dabras Attractor")

 

Halvorsen

NULLwith(plots); a := 1.89; sys := diff(x(t), t) = -a*x(t)-4*y(t)-4*z(t)-y(t)^2, diff(y(t), t) = -a*y(t)-4*z(t)-4*x(t)-z(t)^2, diff(z(t), t) = -a*z(t)-4*x(t)-4*y(t)-x(t)^2; sol := dsolve({sys, x(0) = -1.48, y(0) = -1.51, z(0) = 2.04}, {x(t), y(t), z(t)}, numeric, maxfun = 300000); odeplot(sol, [x(t), y(t), z(t)], t = 0 .. 600, axes = boxed, numpoints = 35000, labels = [x, y, z], title = "Halvorsen Attractor")

 

Chen

 

 

with(plots); alpha := 5.00; beta := -10.00; delta := -.38; sys := diff(x(t), t) = alpha*x(t)-y(t)*z(t), diff(y(t), t) = beta*y(t)+x(t)*z(t), diff(z(t), t) = delta*z(t)+(1/3)*x(t)*y(t); sol := dsolve({sys, x(0) = -7.00, y(0) = -5.00, z(0) = -10.00}, {x(t), y(t), z(t)}, numeric); odeplot(sol, [x(t), y(t), z(t)], t = 0 .. 100, axes = boxed, numpoints = 35000, labels = [x, y, z], title = "Chen Attractor")

 

References

1. 

https://www.dynamicmath.xyz/strange-attractors/

2. 

https://en.wikipedia.org/wiki/Attractor#Strange_attractor

``


 

Download Attractors.mw

Hi everyone...

How can I remove the warning (Warning, (in anonymous procedure created in Typesetting:-FI) `m` is implicitly declared local
) from this for command in Maple 2024? I know the warning can be ignored but I want to remove it anyway.

for k from 1 to 4 do
    A[k] := Matrix(k, k, (i, j) -> local m; ifelse(i + j < k + 2, add(Y[i - m + j - 1]*binomial(i - 1, m)*(-1)^m, m = 0 .. i - 1), 0));
end do

tnx...

Hey!

I am having difficulties inputting in text and math mode in my Maple 2023 document. It was working fine in the beginning, but all of a sudden the problem occured. I was restarting maple initially which would temporarily solve the problem, now I cannot input anything after restart. I am doing exam excercises and have been copy/pasting text from a pdf into the document. 

I have tried to install Maple 2024 and open the file but to no avail.  Any help/ pointers would be greatly appreciated.

The attached file -

ml.mw

How do I stop truncation in Maple 2023?  Everything was working fine yesterday but today all of a sudden all assignments are truncated to only 10 digits.

If:

with(Units) :

a_Terra := 149598023.*Unit(km) :
A_Luna := 0.136 :
L_Sol := 3.75E28*Unit(lm) :
S_sphere := r -> 4*Pi*r^2 :

J_Luna := A_Luna*L_Sol/S_sphere(a_Terra) :

Then:

"" gives ""

but

"" gives ""

"" without "evalf" also provides a truncated number instead of showing the "Pi" for an exact value.  So something is wrong in the assignment settings.

Somehow the settings must have changed for how assignments are stored. The answer is irrational with a factor of "1/Pi" and so should not be truncated for calculations.  "a_Terra" is assigned with 9 significant digits ("" km) which I am wondering if maybe why "evalf" is truncating to 10 digits (though it should round and not truncate in that case) but it wasn't doing this before.

"Tools --> Options --> Precision" hasn't changed is set globally to round screen display to 32 decimal places and to round calculation to 64 significant digits.

I do not think I ever saw this warning messages from dsolve. This is _Clairaut first order ode. When adding the option singsol=all in the dsolve call, Maple replies with 

I do not have earlier version of Maple to try as my C: drive died and lost all my Maple's installed versions. I need to to try to install older version of Maple sometime and check.

Is this new warning and why does it show? Is this suppose to happen? 


 

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1782 and is the same as the version installed in this computer, created 2024, August 8, 16:5 hours Pacific Time.`

restart;

ode:=a*(1 + diff(y(x), x)^3)^(1/3) + x*diff(y(x), x) - y(x) = 0;

a*(1+(diff(y(x), x))^3)^(1/3)+x*(diff(y(x), x))-y(x) = 0

dsolve(ode,y(x),singsol=all)

Warning, only 1 systems are considered

Warning, only 1 systems are considered

y(x) = a*(c__1^3+1)^(1/3)+x*c__1

 


 

Download strange_warning_message_from_dsolve.mw

I also noticed these warning messages show up only the first time dsolve is called on this ode.

Calling it again right after, using the same command, the warning messages no longer show up, which is  even more strange.

 

i am writing the code and unfortunately i am struck in a pb  where i assign initial condition values to u[i] from i 1 to N but when i use them in a loop it is not taking values of u[i] it is just taking value of u[1] only kindly help me in this regard i am attaching my file here.

automatic_differentiation.mw
 

restart

v := 1; a := 2; t := 0.1e-2; dt := 0.1e-3; N := 40; h := 1/40; K := 4

NULL

NULL

for i from 0 to N do x[i] := i*h end do

x[5]

1/8

(1)

initial_condition := []; for i to N do initial_condition := [op(initial_condition), evalf(2*v*Pi*sin(Pi*x[i])/(a+cos(Pi*x[i])))] end do

initial_conditions := [.1644933719, .3289856976, .4934717144, .6579375992, .8223563570, .9866828090, 1.150848028, 1.314753051, 1.478261707, 1.641192349, 1.803308276, 1.964306617, 2.123805434, 2.281328760, 2.436289364, 2.587968970, 2.735495794, 2.877819368, 3.013682762, 3.141592654, 3.259788188, 3.366210070, 3.458472370, 3.533840560, 3.589220824, 3.621167336, 3.625916040, 3.599455182, 3.537643690, 3.436388151, 3.291886154, 3.100937330, 2.861312732, 2.572157998, 2.234388242, 1.851015873, 1.427342882, .9709526944, .4914580366, 0.]; u := proc (i) local u_x, u_xx, expr, j; u_x := (1/2)*(u[i+1]-u[i-1])/h; u_xx := (u[i-1]-2*u[i]+u[i+1])/h^2; expr := -alpha*u[i]*u_x+v*u_xx; expr end proc
NULL

NULL

odes := [seq(u(i, [seq(u[j], j = 1 .. N-1)]), i = 1 .. N-1)]

for i to N-1 do assign(o[i] = odes[i]) end do

for i to N-1 do printf("u_%d = %s\n", i, convert(u(i), string)) end do

u_1 = -alpha*u[1]*(20*u[2]-20*u[0])+1600*u[0]-3200*u[1]+1600*u[2]
u_2 = -alpha*u[2]*(20*u[3]-20*u[1])+1600*u[1]-3200*u[2]+1600*u[3]
u_3 = -alpha*u[3]*(20*u[4]-20*u[2])+1600*u[2]-3200*u[3]+1600*u[4]
u_4 = -alpha*u[4]*(20*u[5]-20*u[3])+1600*u[3]-3200*u[4]+1600*u[5]
u_5 = -alpha*u[5]*(20*u[6]-20*u[4])+1600*u[4]-3200*u[5]+1600*u[6]
u_6 = -alpha*u[6]*(20*u[7]-20*u[5])+1600*u[5]-3200*u[6]+1600*u[7]
u_7 = -alpha*u[7]*(20*u[8]-20*u[6])+1600*u[6]-3200*u[7]+1600*u[8]
u_8 = -alpha*u[8]*(20*u[9]-20*u[7])+1600*u[7]-3200*u[8]+1600*u[9]
u_9 = -alpha*u[9]*(20*u[10]-20*u[8])+1600*u[8]-3200*u[9]+1600*u[10]
u_10 = -alpha*u[10]*(20*u[11]-20*u[9])+1600*u[9]-3200*u[10]+1600*u[11]
u_11 = -alpha*u[11]*(20*u[12]-20*u[10])+1600*u[10]-3200*u[11]+1600*u[12]
u_12 = -alpha*u[12]*(20*u[13]-20*u[11])+1600*u[11]-3200*u[12]+1600*u[13]
u_13 = -alpha*u[13]*(20*u[14]-20*u[12])+1600*u[12]-3200*u[13]+1600*u[14]
u_14 = -alpha*u[14]*(20*u[15]-20*u[13])+1600*u[13]-3200*u[14]+1600*u[15]
u_15 = -alpha*u[15]*(20*u[16]-20*u[14])+1600*u[14]-3200*u[15]+1600*u[16]
u_16 = -alpha*u[16]*(20*u[17]-20*u[15])+1600*u[15]-3200*u[16]+1600*u[17]
u_17 = -alpha*u[17]*(20*u[18]-20*u[16])+1600*u[16]-3200*u[17]+1600*u[18]
u_18 = -alpha*u[18]*(20*u[19]-20*u[17])+1600*u[17]-3200*u[18]+1600*u[19]
u_19 = -alpha*u[19]*(20*u[20]-20*u[18])+1600*u[18]-3200*u[19]+1600*u[20]
u_20 = -alpha*u[20]*(20*u[21]-20*u[19])+1600*u[19]-3200*u[20]+1600*u[21]
u_21 = -alpha*u[21]*(20*u[22]-20*u[20])+1600*u[20]-3200*u[21]+1600*u[22]
u_22 = -alpha*u[22]*(20*u[23]-20*u[21])+1600*u[21]-3200*u[22]+1600*u[23]
u_23 = -alpha*u[23]*(20*u[24]-20*u[22])+1600*u[22]-3200*u[23]+1600*u[24]
u_24 = -alpha*u[24]*(20*u[25]-20*u[23])+1600*u[23]-3200*u[24]+1600*u[25]
u_25 = -alpha*u[25]*(20*u[26]-20*u[24])+1600*u[24]-3200*u[25]+1600*u[26]
u_26 = -alpha*u[26]*(20*u[27]-20*u[25])+1600*u[25]-3200*u[26]+1600*u[27]
u_27 = -alpha*u[27]*(20*u[28]-20*u[26])+1600*u[26]-3200*u[27]+1600*u[28]
u_28 = -alpha*u[28]*(20*u[29]-20*u[27])+1600*u[27]-3200*u[28]+1600*u[29]
u_29 = -alpha*u[29]*(20*u[30]-20*u[28])+1600*u[28]-3200*u[29]+1600*u[30]
u_30 = -alpha*u[30]*(20*u[31]-20*u[29])+1600*u[29]-3200*u[30]+1600*u[31]
u_31 = -alpha*u[31]*(20*u[32]-20*u[30])+1600*u[30]-3200*u[31]+1600*u[32]
u_32 = -alpha*u[32]*(20*u[33]-20*u[31])+1600*u[31]-3200*u[32]+1600*u[33]
u_33 = -alpha*u[33]*(20*u[34]-20*u[32])+1600*u[32]-3200*u[33]+1600*u[34]
u_34 = -alpha*u[34]*(20*u[35]-20*u[33])+1600*u[33]-3200*u[34]+1600*u[35]
u_35 = -alpha*u[35]*(20*u[36]-20*u[34])+1600*u[34]-3200*u[35]+1600*u[36]
u_36 = -alpha*u[36]*(20*u[37]-20*u[35])+1600*u[35]-3200*u[36]+1600*u[37]
u_37 = -alpha*u[37]*(20*u[38]-20*u[36])+1600*u[36]-3200*u[37]+1600*u[38]
u_38 = -alpha*u[38]*(20*u[39]-20*u[37])+1600*u[37]-3200*u[38]+1600*u[39]
u_39 = -alpha*u[39]*(20*u[40]-20*u[38])+1600*u[38]-3200*u[39]+1600*u[40]

 

u := table(); for i to N do u[i] := initial_conditions[i] end do

.1644933719

 

.3289856976

 

.4934717144

 

.6579375992

 

.8223563570

 

.9866828090

 

1.150848028

 

1.314753051

 

1.478261707

 

1.641192349

 

1.803308276

 

1.964306617

 

2.123805434

 

2.281328760

 

2.436289364

 

2.587968970

 

2.735495794

 

2.877819368

 

3.013682762

 

3.141592654

 

3.259788188

 

3.366210070

 

3.458472370

 

3.533840560

 

3.589220824

 

3.621167336

 

3.625916040

 

3.599455182

 

3.537643690

 

3.436388151

 

3.291886154

 

3.100937330

 

2.861312732

 

2.572157998

 

2.234388242

 

1.851015873

 

1.427342882

 

.9709526944

 

.4914580366

 

0.

(2)

for i from 2 to N do T1[i] := (u[i+1]-u[i-1])/(2*h); T2[i] := u[i]*T1[i]; T3[i] := (u[i-1]-2*u[i]+u[i+1])/h^2; u[i][1] := v*T3[i]-T2[i] end do

20*u[3]-3.289867438

 

u[2]*(20*u[3]-3.289867438)

 

263.1893950-3200*u[2]+1600*u[3]

 

263.1893950-3200*u[2]+1600*u[3]-u[2]*(20*u[3]-3.289867438)

 

20*u[4]-20*u[2]

 

u[3]*(20*u[4]-20*u[2])

 

1600*u[2]-3200*u[3]+1600*u[4]

 

1600*u[2]-3200*u[3]+1600*u[4]-u[3]*(20*u[4]-20*u[2])

 

20*u[5]-20*u[3]

 

u[4]*(20*u[5]-20*u[3])

 

1600*u[3]-3200*u[4]+1600*u[5]

 

1600*u[3]-3200*u[4]+1600*u[5]-u[4]*(20*u[5]-20*u[3])

 

20*u[6]-20*u[4]

 

u[5]*(20*u[6]-20*u[4])

 

1600*u[4]-3200*u[5]+1600*u[6]

 

1600*u[4]-3200*u[5]+1600*u[6]-u[5]*(20*u[6]-20*u[4])

 

20*u[7]-20*u[5]

 

u[6]*(20*u[7]-20*u[5])

 

1600*u[5]-3200*u[6]+1600*u[7]

 

1600*u[5]-3200*u[6]+1600*u[7]-u[6]*(20*u[7]-20*u[5])

 

20*u[8]-20*u[6]

 

u[7]*(20*u[8]-20*u[6])

 

1600*u[6]-3200*u[7]+1600*u[8]

 

1600*u[6]-3200*u[7]+1600*u[8]-u[7]*(20*u[8]-20*u[6])

 

20*u[9]-20*u[7]

 

u[8]*(20*u[9]-20*u[7])

 

1600*u[7]-3200*u[8]+1600*u[9]

 

1600*u[7]-3200*u[8]+1600*u[9]-u[8]*(20*u[9]-20*u[7])

 

20*u[10]-20*u[8]

 

u[9]*(20*u[10]-20*u[8])

 

1600*u[8]-3200*u[9]+1600*u[10]

 

1600*u[8]-3200*u[9]+1600*u[10]-u[9]*(20*u[10]-20*u[8])

 

20*u[11]-20*u[9]

 

u[10]*(20*u[11]-20*u[9])

 

1600*u[9]-3200*u[10]+1600*u[11]

 

1600*u[9]-3200*u[10]+1600*u[11]-u[10]*(20*u[11]-20*u[9])

 

20*u[12]-20*u[10]

 

u[11]*(20*u[12]-20*u[10])

 

1600*u[10]-3200*u[11]+1600*u[12]

 

1600*u[10]-3200*u[11]+1600*u[12]-u[11]*(20*u[12]-20*u[10])

 

20*u[13]-20*u[11]

 

u[12]*(20*u[13]-20*u[11])

 

1600*u[11]-3200*u[12]+1600*u[13]

 

1600*u[11]-3200*u[12]+1600*u[13]-u[12]*(20*u[13]-20*u[11])

 

20*u[14]-20*u[12]

 

u[13]*(20*u[14]-20*u[12])

 

1600*u[12]-3200*u[13]+1600*u[14]

 

1600*u[12]-3200*u[13]+1600*u[14]-u[13]*(20*u[14]-20*u[12])

 

20*u[15]-20*u[13]

 

u[14]*(20*u[15]-20*u[13])

 

1600*u[13]-3200*u[14]+1600*u[15]

 

1600*u[13]-3200*u[14]+1600*u[15]-u[14]*(20*u[15]-20*u[13])

 

20*u[16]-20*u[14]

 

u[15]*(20*u[16]-20*u[14])

 

1600*u[14]-3200*u[15]+1600*u[16]

 

1600*u[14]-3200*u[15]+1600*u[16]-u[15]*(20*u[16]-20*u[14])

 

20*u[17]-20*u[15]

 

u[16]*(20*u[17]-20*u[15])

 

1600*u[15]-3200*u[16]+1600*u[17]

 

1600*u[15]-3200*u[16]+1600*u[17]-u[16]*(20*u[17]-20*u[15])

 

20*u[18]-20*u[16]

 

u[17]*(20*u[18]-20*u[16])

 

1600*u[16]-3200*u[17]+1600*u[18]

 

1600*u[16]-3200*u[17]+1600*u[18]-u[17]*(20*u[18]-20*u[16])

 

20*u[19]-20*u[17]

 

u[18]*(20*u[19]-20*u[17])

 

1600*u[17]-3200*u[18]+1600*u[19]

 

1600*u[17]-3200*u[18]+1600*u[19]-u[18]*(20*u[19]-20*u[17])

 

20*u[20]-20*u[18]

 

u[19]*(20*u[20]-20*u[18])

 

1600*u[18]-3200*u[19]+1600*u[20]

 

1600*u[18]-3200*u[19]+1600*u[20]-u[19]*(20*u[20]-20*u[18])

 

20*u[21]-20*u[19]

 

u[20]*(20*u[21]-20*u[19])

 

1600*u[19]-3200*u[20]+1600*u[21]

 

1600*u[19]-3200*u[20]+1600*u[21]-u[20]*(20*u[21]-20*u[19])

 

20*u[22]-20*u[20]

 

u[21]*(20*u[22]-20*u[20])

 

1600*u[20]-3200*u[21]+1600*u[22]

 

1600*u[20]-3200*u[21]+1600*u[22]-u[21]*(20*u[22]-20*u[20])

 

20*u[23]-20*u[21]

 

u[22]*(20*u[23]-20*u[21])

 

1600*u[21]-3200*u[22]+1600*u[23]

 

1600*u[21]-3200*u[22]+1600*u[23]-u[22]*(20*u[23]-20*u[21])

 

20*u[24]-20*u[22]

 

u[23]*(20*u[24]-20*u[22])

 

1600*u[22]-3200*u[23]+1600*u[24]

 

1600*u[22]-3200*u[23]+1600*u[24]-u[23]*(20*u[24]-20*u[22])

 

20*u[25]-20*u[23]

 

u[24]*(20*u[25]-20*u[23])

 

1600*u[23]-3200*u[24]+1600*u[25]

 

1600*u[23]-3200*u[24]+1600*u[25]-u[24]*(20*u[25]-20*u[23])

 

20*u[26]-20*u[24]

 

u[25]*(20*u[26]-20*u[24])

 

1600*u[24]-3200*u[25]+1600*u[26]

 

1600*u[24]-3200*u[25]+1600*u[26]-u[25]*(20*u[26]-20*u[24])

 

20*u[27]-20*u[25]

 

u[26]*(20*u[27]-20*u[25])

 

1600*u[25]-3200*u[26]+1600*u[27]

 

1600*u[25]-3200*u[26]+1600*u[27]-u[26]*(20*u[27]-20*u[25])

 

20*u[28]-20*u[26]

 

u[27]*(20*u[28]-20*u[26])

 

1600*u[26]-3200*u[27]+1600*u[28]

 

1600*u[26]-3200*u[27]+1600*u[28]-u[27]*(20*u[28]-20*u[26])

 

20*u[29]-20*u[27]

 

u[28]*(20*u[29]-20*u[27])

 

1600*u[27]-3200*u[28]+1600*u[29]

 

1600*u[27]-3200*u[28]+1600*u[29]-u[28]*(20*u[29]-20*u[27])

 

20*u[30]-20*u[28]

 

u[29]*(20*u[30]-20*u[28])

 

1600*u[28]-3200*u[29]+1600*u[30]

 

1600*u[28]-3200*u[29]+1600*u[30]-u[29]*(20*u[30]-20*u[28])

 

20*u[31]-20*u[29]

 

u[30]*(20*u[31]-20*u[29])

 

1600*u[29]-3200*u[30]+1600*u[31]

 

1600*u[29]-3200*u[30]+1600*u[31]-u[30]*(20*u[31]-20*u[29])

 

20*u[32]-20*u[30]

 

u[31]*(20*u[32]-20*u[30])

 

1600*u[30]-3200*u[31]+1600*u[32]

 

1600*u[30]-3200*u[31]+1600*u[32]-u[31]*(20*u[32]-20*u[30])

 

20*u[33]-20*u[31]

 

u[32]*(20*u[33]-20*u[31])

 

1600*u[31]-3200*u[32]+1600*u[33]

 

1600*u[31]-3200*u[32]+1600*u[33]-u[32]*(20*u[33]-20*u[31])

 

20*u[34]-20*u[32]

 

u[33]*(20*u[34]-20*u[32])

 

1600*u[32]-3200*u[33]+1600*u[34]

 

1600*u[32]-3200*u[33]+1600*u[34]-u[33]*(20*u[34]-20*u[32])

 

20*u[35]-20*u[33]

 

u[34]*(20*u[35]-20*u[33])

 

1600*u[33]-3200*u[34]+1600*u[35]

 

1600*u[33]-3200*u[34]+1600*u[35]-u[34]*(20*u[35]-20*u[33])

 

20*u[36]-20*u[34]

 

u[35]*(20*u[36]-20*u[34])

 

1600*u[34]-3200*u[35]+1600*u[36]

 

1600*u[34]-3200*u[35]+1600*u[36]-u[35]*(20*u[36]-20*u[34])

 

20*u[37]-20*u[35]

 

u[36]*(20*u[37]-20*u[35])

 

1600*u[35]-3200*u[36]+1600*u[37]

 

1600*u[35]-3200*u[36]+1600*u[37]-u[36]*(20*u[37]-20*u[35])

 

20*u[38]-20*u[36]

 

u[37]*(20*u[38]-20*u[36])

 

1600*u[36]-3200*u[37]+1600*u[38]

 

1600*u[36]-3200*u[37]+1600*u[38]-u[37]*(20*u[38]-20*u[36])

 

20*u[39]-20*u[37]

 

u[38]*(20*u[39]-20*u[37])

 

1600*u[37]-3200*u[38]+1600*u[39]

 

1600*u[37]-3200*u[38]+1600*u[39]-u[38]*(20*u[39]-20*u[37])

 

20*u[40]-20*u[38]

 

u[39]*(20*u[40]-20*u[38])

 

1600*u[38]-3200*u[39]+1600*u[40]

 

1600*u[38]-3200*u[39]+1600*u[40]-u[39]*(20*u[40]-20*u[38])

 

20*u[41]-20*u[39]

 

u[40]*(20*u[41]-20*u[39])

 

1600*u[39]-3200*u[40]+1600*u[41]

 

1600*u[39]-3200*u[40]+1600*u[41]-u[40]*(20*u[41]-20*u[39])

(3)

u[1]

.1644933719

(4)

u[2]

u[2]

(5)
 

NULL

Download automatic_differentiation.mw

Why is this sum form for tan(x) not reported by FunctionAdvisor?
(sum = ''sum'')(-2/(2*Pi*n+Pi+2*x)-2/(-2*Pi*n-Pi+2*x), n = 0 .. infinity);
FunctionAdvisor(tan);

Function X__2(y1,y2) is a function of X__1(y1,y2). How do I express (implicitly) d(X__2)/d(y1) and d(X__2)/d(y2) in terms of d(X__1)/d(y1) and d(X__1)/d(y2) and perhaps of X__1 and X__2 themselves?

I illustrate what I mean with an example for X__1(y1,y2), where d(X__1)/d(y1) and d(X__1)/d(y2) are written in a relatively compact form in terms of X__1 itself:
 

restart;

X1 := RootOf((8*y__1^14 + 32*y__1^12*y__2^2 + 48*y__1^10*y__2^4 + 32*y__1^8*y__2^6 + 8*y__1^6*y__2^8 + 16*y__1^12 + 80*y__1^10*y__2^2 + 160*y__1^8*y__2^4 + 160*y__1^6*y__2^6 + 80*y__1^4*y__2^8 + 16*y__1^2*y__2^10)*_Z^10 + (40*y__1^13*y__2^2 + 120*y__1^11*y__2^4 + 120*y__1^9*y__2^6 + 40*y__1^7*y__2^8 + 16*y__1^13 + 176*y__1^11*y__2^2 + 544*y__1^9*y__2^4 + 736*y__1^7*y__2^6 + 464*y__1^5*y__2^8 + 112*y__1^3*y__2^10)*_Z^9 + (84*y__1^12*y__2^4 + 168*y__1^10*y__2^6 + 84*y__1^8*y__2^8 - 20*y__1^14 + 28*y__1^12*y__2^2 + 552*y__1^10*y__2^4 + 1288*y__1^8*y__2^6 + 1132*y__1^6*y__2^8 + 348*y__1^4*y__2^10 - 48*y__1^12 - 192*y__1^10*y__2^2 - 272*y__1^8*y__2^4 - 128*y__1^6*y__2^6 + 48*y__1^4*y__2^8 + 64*y__1^2*y__2^10 + 16*y__2^12)*_Z^8 + (88*y__1^11*y__2^6 + 88*y__1^9*y__2^8 - 80*y__1^13*y__2^2 + 56*y__1^11*y__2^4 + 960*y__1^9*y__2^6 + 1432*y__1^7*y__2^8 + 608*y__1^5*y__2^10 - 48*y__1^13 - 416*y__1^11*y__2^2 - 944*y__1^9*y__2^4 - 736*y__1^7*y__2^6 + 16*y__1^5*y__2^8 + 256*y__1^3*y__2^10 + 80*y__1*y__2^12)*_Z^7 + (40*y__1^10*y__2^8 - 128*y__1^12*y__2^4 + 168*y__1^10*y__2^6 + 928*y__1^8*y__2^8 + 632*y__1^6*y__2^10 + 12*y__1^14 - 192*y__1^12*y__2^2 - 1084*y__1^10*y__2^4 - 1472*y__1^8*y__2^6 - 340*y__1^6*y__2^8 + 432*y__1^4*y__2^10 + 180*y__1^2*y__2^12 + 48*y__1^12 + 144*y__1^10*y__2^2 + 112*y__1^8*y__2^4 - 48*y__1^6*y__2^6 - 96*y__1^4*y__2^8 - 32*y__1^2*y__2^10)*_Z^6 + (-92*y__1^11*y__2^6 + 228*y__1^9*y__2^8 + 368*y__1^7*y__2^10 + 32*y__1^13*y__2^2 - 384*y__1^11*y__2^4 - 1272*y__1^9*y__2^6 - 704*y__1^7*y__2^8 + 376*y__1^5*y__2^10 + 224*y__1^3*y__2^12 + 48*y__1^13 + 304*y__1^11*y__2^2 + 432*y__1^9*y__2^4 + 16*y__1^7*y__2^6 - 288*y__1^5*y__2^8 - 128*y__1^3*y__2^10)*_Z^5 + (-24*y__1^10*y__2^8 + 96*y__1^8*y__2^10 + 24*y__1^12*y__2^4 - 412*y__1^10*y__2^6 - 576*y__1^8*y__2^8 + 164*y__1^6*y__2^10 + 160*y__1^4*y__2^12 + 4*y__1^14 + 172*y__1^12*y__2^2 + 532*y__1^10*y__2^4 + 252*y__1^8*y__2^6 - 328*y__1^6*y__2^8 - 216*y__1^4*y__2^10 - 16*y__1^12 - 32*y__1^10*y__2^2 + 32*y__1^6*y__2^6 + 16*y__1^4*y__2^8)*_Z^4 + (-8*y__1^11*y__2^6 - 192*y__1^9*y__2^8 + 28*y__1^7*y__2^10 + 60*y__1^5*y__2^12 + 16*y__1^13*y__2^2 + 232*y__1^11*y__2^4 + 296*y__1^9*y__2^6 - 168*y__1^7*y__2^8 - 184*y__1^5*y__2^10 - 16*y__1^13 - 64*y__1^11*y__2^2 - 32*y__1^9*y__2^4 + 64*y__1^7*y__2^6 + 48*y__1^5*y__2^8)*_Z^3 + (-15*y__1^10*y__2^8 + 9*y__1^6*y__2^12 + 24*y__1^12*y__2^4 + 116*y__1^10*y__2^6 - 36*y__1^8*y__2^8 - 80*y__1^6*y__2^10 - 4*y__1^14 - 40*y__1^12*y__2^2 - 48*y__1^10*y__2^4 + 40*y__1^8*y__2^6 + 52*y__1^6*y__2^8)*_Z^2 + (12*y__1^11*y__2^6 - 4*y__1^9*y__2^8 - 16*y__1^7*y__2^10 - 8*y__1^13*y__2^2 - 24*y__1^11*y__2^4 + 8*y__1^9*y__2^6 + 24*y__1^7*y__2^8)*_Z - y__1^10*y__2^8 - y__1^8*y__2^10 - 4*y__1^12*y__2^4 + 4*y__1^8*y__2^8):

alias(X__1=X1);

X__2 := -y__1*y__2^2*X__1*(8*X__1^7*y__1^10 + 24*X__1^7*y__1^8*y__2^2 + 24*X__1^7*y__1^6*y__2^4 + 8*X__1^7*y__1^4*y__2^6 + 24*X__1^6*y__1^9*y__2^2 + 48*X__1^6*y__1^7*y__2^4 + 24*X__1^6*y__1^5*y__2^6 + 26*X__1^5*y__1^8*y__2^4 + 26*X__1^5*y__1^6*y__2^6 + 8*X__1^4*y__1^7*y__2^6 + 32*X__1^7*y__1^8 + 128*X__1^7*y__1^6*y__2^2 + 192*X__1^7*y__1^4*y__2^4 + 128*X__1^7*y__1^2*y__2^6 + 32*X__1^7*y__2^8 + 16*X__1^6*y__1^9 + 192*X__1^6*y__1^7*y__2^2 + 480*X__1^6*y__1^5*y__2^4 + 448*X__1^6*y__1^3*y__2^6 + 144*X__1^6*y__1*y__2^8 - 16*X__1^5*y__1^10 + 32*X__1^5*y__1^8*y__2^2 + 392*X__1^5*y__1^6*y__2^4 + 624*X__1^5*y__1^4*y__2^6 + 280*X__1^5*y__1^2*y__2^8 - 36*X__1^4*y__1^9*y__2^2 + 72*X__1^4*y__1^7*y__2^4 + 396*X__1^4*y__1^5*y__2^6 + 288*X__1^4*y__1^3*y__2^8 - 28*X__1^3*y__1^8*y__2^4 + 84*X__1^3*y__1^6*y__2^6 + 156*X__1^3*y__1^4*y__2^8 - 7*X__1^2*y__1^7*y__2^6 + 33*X__1^2*y__1^5*y__2^8 - 64*X__1^5*y__1^8 - 192*X__1^5*y__1^6*y__2^2 - 192*X__1^5*y__1^4*y__2^4 - 64*X__1^5*y__1^2*y__2^6 - 32*X__1^4*y__1^9 - 288*X__1^4*y__1^7*y__2^2 - 480*X__1^4*y__1^5*y__2^4 - 224*X__1^4*y__1^3*y__2^6 + 8*X__1^3*y__1^10 - 88*X__1^3*y__1^8*y__2^2 - 408*X__1^3*y__1^6*y__2^4 - 312*X__1^3*y__1^4*y__2^6 + 12*X__1^2*y__1^9*y__2^2 - 108*X__1^2*y__1^7*y__2^4 - 196*X__1^2*y__1^5*y__2^6 + 4*X__1^2*y__1^3*y__2^8 + 2*X__1*y__1^8*y__2^4 - 46*X__1*y__1^6*y__2^6 + 4*X__1*y__1^4*y__2^8 - y__1^7*y__2^6 + y__1^5*y__2^8 + 32*X__1^3*y__1^8 + 64*X__1^3*y__1^6*y__2^2 + 32*X__1^3*y__1^4*y__2^4 + 16*X__1^2*y__1^9 + 96*X__1^2*y__1^7*y__2^2 + 80*X__1^2*y__1^5*y__2^4 + 32*X__1*y__1^8*y__2^2 + 64*X__1*y__1^6*y__2^4 + 16*y__1^7*y__2^4)/(-8*X__1^7*y__1^11*y__2^2 - 24*X__1^7*y__1^9*y__2^4 - 24*X__1^7*y__1^7*y__2^6 - 8*X__1^7*y__1^5*y__2^8 - 32*X__1^6*y__1^10*y__2^4 - 64*X__1^6*y__1^8*y__2^6 - 32*X__1^6*y__1^6*y__2^8 - 50*X__1^5*y__1^9*y__2^6 - 50*X__1^5*y__1^7*y__2^8 - 28*X__1^4*y__1^8*y__2^8 + 32*X__1^8*y__1^10 + 160*X__1^8*y__1^8*y__2^2 + 320*X__1^8*y__1^6*y__2^4 + 320*X__1^8*y__1^4*y__2^6 + 160*X__1^8*y__1^2*y__2^8 + 32*X__1^8*y__2^10 + 160*X__1^7*y__1^9*y__2^2 + 640*X__1^7*y__1^7*y__2^4 + 960*X__1^7*y__1^5*y__2^6 + 640*X__1^7*y__1^3*y__2^8 + 160*X__1^7*y__1*y__2^10 - 8*X__1^6*y__1^12 - 24*X__1^6*y__1^10*y__2^2 + 328*X__1^6*y__1^8*y__2^4 + 1048*X__1^6*y__1^6*y__2^6 + 1056*X__1^6*y__1^4*y__2^8 + 352*X__1^6*y__1^2*y__2^10 - 24*X__1^5*y__1^11*y__2^2 - 48*X__1^5*y__1^9*y__2^4 + 400*X__1^5*y__1^7*y__2^6 + 848*X__1^5*y__1^5*y__2^8 + 424*X__1^5*y__1^3*y__2^10 - 38*X__1^4*y__1^10*y__2^4 - 54*X__1^4*y__1^8*y__2^6 + 274*X__1^4*y__1^6*y__2^8 + 290*X__1^4*y__1^4*y__2^10 - 44*X__1^3*y__1^9*y__2^6 - 32*X__1^3*y__1^7*y__2^8 + 104*X__1^3*y__1^5*y__2^10 - 27*X__1^2*y__1^8*y__2^8 + 15*X__1^2*y__1^6*y__2^10 - 64*X__1^6*y__1^10 - 256*X__1^6*y__1^8*y__2^2 - 384*X__1^6*y__1^6*y__2^4 - 256*X__1^6*y__1^4*y__2^6 - 64*X__1^6*y__1^2*y__2^8 - 256*X__1^5*y__1^9*y__2^2 - 768*X__1^5*y__1^7*y__2^4 - 768*X__1^5*y__1^5*y__2^6 - 256*X__1^5*y__1^3*y__2^8 + 16*X__1^4*y__1^12 + 32*X__1^4*y__1^10*y__2^2 - 408*X__1^4*y__1^8*y__2^4 - 848*X__1^4*y__1^6*y__2^6 - 424*X__1^4*y__1^4*y__2^8 + 48*X__1^3*y__1^11*y__2^2 + 48*X__1^3*y__1^9*y__2^4 - 352*X__1^3*y__1^7*y__2^6 - 352*X__1^3*y__1^5*y__2^8 + 54*X__1^2*y__1^10*y__2^4 - 150*X__1^2*y__1^6*y__2^8 + 22*X__1*y__1^9*y__2^6 - 30*X__1*y__1^7*y__2^8 - 2*y__1^8*y__2^8 + 32*X__1^4*y__1^10 + 96*X__1^4*y__1^8*y__2^2 + 96*X__1^4*y__1^6*y__2^4 + 32*X__1^4*y__1^4*y__2^6 + 96*X__1^3*y__1^9*y__2^2 + 192*X__1^3*y__1^7*y__2^4 + 96*X__1^3*y__1^5*y__2^6 - 8*X__1^2*y__1^12 - 8*X__1^2*y__1^10*y__2^2 + 104*X__1^2*y__1^8*y__2^4 + 104*X__1^2*y__1^6*y__2^6 - 16*X__1*y__1^11*y__2^2 + 48*X__1*y__1^7*y__2^6 - 8*y__1^10*y__2^4 + 8*y__1^8*y__2^6):


Synthetic representation of derivatives


derivatives for X__1 okay: written in terms of y__1, y__2, and X__1 itself.

derX1_y1 := diff(X1, y__1):
derX1_y2 := diff(X1, y__2):

Diff('X__1(y__1,y__2)', y__1) = collect~(normal(eval(derX1_y1, X1 = 'X__1(y__1,y__2)')), 'X__1(y__1,y__2)');
Diff('X__1(y__1,y__2)', y__2) = collect~(normal(eval(derX1_y2, X1 = 'X__1(y__1,y__2)')), 'X__1(y__1,y__2)');


derivatives for X__2 not okay (X__2 is itself a function of X__1): how do I write them in terms of y__1, y__2, X__1 AND the derivatives for X__1 just found? What's the most compact way to express these two derivatives below?

derX2_y1 := diff(X__2, y__1):
derX2_y2 := diff(X__2, y__2):

Diff('X__2(y__1,y__2)', y__1) = collect~(normal(eval(eval(derX2_y1, derX1_y1='Diff('X__1(y__1,y__2)', y__1)'), X__1 = 'X__1(y__1,y__2)')), 'X__1(y__1,y__2)');
Diff('X__2(y__1,y__2)', y__2) = collect~(normal(eval(derX2_y2, X__1 = 'X__1(y__1,y__2)')), 'X__1(y__1,y__2)');

``

 

Download compact_derivatives.mw


Thank you for the help.

I am plotting phase plot of two first order ode's.

I noticed when added +t to one ode, the plot generated losses all the slope fields. Any one knows why and if this is just limitation of DEplot or if there is a way to workaround it. 

THis worksheet has first example showing expected output, then second example where +t was added first ode. Now same code generates plot will all the slope field gone.


 

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

sys:=[diff(x(t),t)+diff(y(t),t) = x(t)+y(t), 2*diff(x(t),t)+diff(y(t),t) = 2*x(t)+3*y(t)];
DEtools:-DEplot(sys,[x(t), y(t)],
        t = 0 .. 200,x = -1000 .. 1000,y = -1000 .. 1000,
        [[x(0)=1, y(0)=2]],
        labels = [x(t), y(t)],
        linecolor =red,arrowsize = 1.5,axes = boxed,
        color = 'magnitude[legacy]')

[diff(x(t), t)+diff(y(t), t) = x(t)+y(t), 2*(diff(x(t), t))+diff(y(t), t) = 2*x(t)+3*y(t)]

#added +t to the RHS of one ode. Everything else the same.
sys_2:=[diff(x(t),t)+diff(y(t),t) = x(t)+y(t)+t, 2*diff(x(t),t)+diff(y(t),t) = 2*x(t)+3*y(t)];
DEtools:-DEplot(sys_2,[x(t), y(t)],
        t = 0 .. 200,x = -1000 .. 1000,y = -1000 .. 1000,
        [[x(0)=1, y(0)=2]],
        labels = [x(t), y(t)],
        linecolor =red,arrowsize = 1.5,axes = boxed,
        color = 'magnitude[legacy]')

[diff(x(t), t)+diff(y(t), t) = x(t)+y(t)+t, 2*(diff(x(t), t))+diff(y(t), t) = 2*x(t)+3*y(t)]

dsolve([op(sys),x(0)=1, y(0)=2]);

{x(t) = 3*exp(t)-2*exp(-t), y(t) = 2*exp(-t)}

dsolve([op(sys_2),x(0)=1, y(0)=2]);

{x(t) = 4*exp(t)-4*exp(-t)+1-3*t, y(t) = 4*exp(-t)-2+2*t}

 


 

Download strange_DEplot.mw

update

if someone is interested, I found Maple has builtin function to check if system of ode's is autonomous or not. So changed my code to check first. Here is how to check:


 

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

restart;

sys:=[diff(x(t),t)+diff(y(t),t) = x(t)+y(t), 2*diff(x(t),t)+diff(y(t),t) = 2*x(t)+3*y(t)];
if DEtools:-autonomous(sys,[x(t),y(t)],t) then
    DEtools:-DEplot(sys,[x(t), y(t)],
        t = 0 .. 200,x = -1000 .. 1000,y = -1000 .. 1000,
        [[x(0)=1, y(0)=2]],
        labels = [x(t), y(t)],
        linecolor =red,arrowsize = 1.5,axes = boxed,
        color = 'magnitude[legacy]');
else
  print("WARNING, non-autonomous system. Will not do phase plot");
fi;

[diff(x(t), t)+diff(y(t), t) = x(t)+y(t), 2*(diff(x(t), t))+diff(y(t), t) = 2*x(t)+3*y(t)]

#added +t to the RHS of one ode. Everything else the same.
sys_2:=[diff(x(t),t)+diff(y(t),t) = x(t)+y(t)+t, 2*diff(x(t),t)+diff(y(t),t) = 2*x(t)+3*y(t)];
if DEtools:-autonomous(sys_2,[x(t),y(t)],t) then
   DEtools:-DEplot(sys_2,[x(t), y(t)],
        t = 0 .. 200,x = -1000 .. 1000,y = -1000 .. 1000,
        [[x(0)=1, y(0)=2]],
        labels = [x(t), y(t)],
        linecolor =red,arrowsize = 1.5,axes = boxed,
        color = 'magnitude[legacy]');
else
  print("WARNING, non-autonomous system. Will not do phase plot");
fi;

[diff(x(t), t)+diff(y(t), t) = x(t)+y(t)+t, 2*(diff(x(t), t))+diff(y(t), t) = 2*x(t)+3*y(t)]

"WARNING, non-autonomous system. Will not do phase plot"

 


 

Download strange_DEplot_V2.mw

 

 

 

Hello everyone

I want to use some limitations in fsolve by using seq command, but I can not achieve to any solution.

Can you help me?

I provided my maple codes here

restart;
f := sin(x[1] + x[2]) - exp(x[1])*x[2] = 0;
g := x[1]^2 - x[2] - 2 = 0;
cond := {seq(x[i] = -1 .. 1, i = 1 .. 2)};

fsolve({f, g}, cond);

I found that  DynamicSystems package uses global variable called s

THis makes zero design sense. Why would a package use a global variable that could have been used by a user? 

What is the correct way to prevent this warning message from showing up, as I have no control over what variable can be used in global space.  I also tried to declare as local to the function that is using the package, but that did not help. Only way was to remove variable from global space before.

Any suggestions?  And why DynamicSystems is even using global symbols in first place?


 

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

restart;

z

foo:=proc()
 local sv;

 DynamicSystems:-SystemOptions('statevariable'=sv);

end proc;
 

proc () local sv; DynamicSystems:-SystemOptions('statevariable' = sv) end proc

s:="test";
foo();

"test"

Warning, the global variable(s) {s} used by DynamicSystems are assigned values.  They must be unassigned to load DynamicSystems.  DynamicSystems:-SystemOptions may be used to reassign the options that use these variable(s):
  complexfreqvar = s

x

restart;

foo:=proc()
 local sv;
 local s;

 DynamicSystems:-SystemOptions('statevariable'=sv);

end proc;

proc () local sv, s; DynamicSystems:-SystemOptions('statevariable' = sv) end proc

s:="test";
foo();

"test"

Warning, the global variable(s) {s} used by DynamicSystems are assigned values.  They must be unassigned to load DynamicSystems.  DynamicSystems:-SystemOptions may be used to reassign the options that use these variable(s):
  complexfreqvar = s

x

restart;

#warnign goes away when there is no global used  s before the call is made
foo:=proc()
 local sv;
 local s;

 DynamicSystems:-SystemOptions('statevariable'=sv);

end proc;

proc () local sv, s; DynamicSystems:-SystemOptions('statevariable' = sv) end proc

foo();

x

 


 

Download dynamic_systems_uses_gloabl_s.mw

 

My (intutive) interpretation of combine was so far in line with the combine help page

The combine function applies transformations which combine terms in sums,...

For the expression below I have to do the opposite (i.e. expand)

1/2 + cos(2*x)/2
                         1   1         
                         - + - cos(2 x)
                         2   2         

expand(%,trig)
                                  2
                            cos(x) 

Why is this and why does the context pannel offer (the ineffective) combine,trig on the first expression but not (the effective) expand,trig?

This cannot be a bug (this trig identity is so elementary) but I cannot make sense of it.

 

First 83 84 85 86 87 88 89 Last Page 85 of 2216