MaplePrimes Questions

i am trying to make code for automatic differentiation method. kindly help me out with that. i have asked chatgpt too. i am going to attach my file alongwith chatgpt code kindly help meautomatic_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

NULL

initial_conditions := []; for i to N do initial_conditions := [op(initial_conditions), 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]

 

eval_derivatives := proc (k, u) local T1i, T2i, T3i, T1ik, T2ik, T3ik, ui_k, i, j; T1i := Array(0 .. N); T2i := Array(0 .. N); T3i := Array(0 .. N); ui_k := Array(0 .. N); for i to N-1 do T1i[i] := (1/2)*(u[i+1]-u[i-1])/h; T2i[i] := u[i]*T1i[i]; T3i[i] := (u[i-1]-2*u[i]+u[i+1])/h^2; ui_k[i] := v*T3i[i]-T2i[i] end do; T1ik := Array(0 .. N); T2ik := Array(0 .. N); T3ik := Array(0 .. N); for i to N-1 do T1ik[i] := (1/2)*(u[i+1, k]-u[i-1, k])/h; T2ik[i] := add(u[i, j]*T1i[i, k-j], j = 0 .. k); T3ik[i] := (u[i-1, k]-2*u[i, k]+u[i+1, k])/h^2; ui_k[i] := (v*T3ik[i]-T2ik[i])/(k+1) end do; return ui_k end proc
``

proc (k, u) local T1i, T2i, T3i, T1ik, T2ik, T3ik, ui_k, i, j; T1i := Array(0 .. N); T2i := Array(0 .. N); T3i := Array(0 .. N); ui_k := Array(0 .. N); for i to N-1 do T1i[i] := (1/2)*(u[i+1]-u[i-1])/h; T2i[i] := u[i]*T1i[i]; T3i[i] := (u[i-1]-2*u[i]+u[i+1])/h^2; ui_k[i] := v*T3i[i]-T2i[i] end do; T1ik := Array(0 .. N); T2ik := Array(0 .. N); T3ik := Array(0 .. N); for i to N-1 do T1ik[i] := (1/2)*(u[i+1, k]-u[i-1, k])/h; T2ik[i] := add(u[i, j]*T1i[i, k-j], j = 0 .. k); T3ik[i] := (u[i-1, k]-2*u[i, k]+u[i+1, k])/h^2; ui_k[i] := (v*T3ik[i]-T2ik[i])/(k+1) end do; return ui_k end proc

(1)

u := Array(1 .. N, 0 .. K); for i to N do u[i, 0] := evalf(initial_conditions[i]) end do

Array(%id = 36893489585014251020)

 

.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 k to K do ui_k := eval_derivatives(k, u); for i to N-1 do u[i, k] := ui_k[i] end do end do

Error, (in eval_derivatives) Array index out of range

 

NULL

"     local u_new, i, k;      u_new := Array(1..N);      for i from 1 to N do          u_new[i] := evalf(add(u[i, k] * dt^k / factorial(k), k = 0 .. K));      end do;      return u_new;  end proc;"

Error, unable to parse

"     local u_new, i, k;   u_new := Array(1..N);      for i from 1 to N do   u_new[i] := evalf(add(u[i, k] * dt^k / factorial(k), k = 0 .. K));      end do;   return u_new;  end proc;"

 

num_steps := round(0.1e-2/dt); for step to num_steps do u_new := advance_solution(t, dt, K, u); for i to N do u[i, 0] := u_new[i] end do; for k to K do ui_k := eval_derivatives(k, u); for i to N do u[i, k] := ui_k[i] end do end do; t := t+dt end do; print(u_new)

num_steps := 10

 

advance_solution(0.1e-2, 0.1e-3, 4, Array(%id = 36893489585014251020))

(3)

NULL


 

Download automatic_differentiation.mw

resolve the issue

I noticed very serious problem in Maple 2024.1

This is new windows 10  22H2  installation. With Maple 2024.1. I've only seen this using Maple and no other windows applications. I have 2 monitors and NVIDIA GeForce RTX 3060 graphics card.

What happens is that sometimes (may be 2-3 times each day), Maple frontend gets all mangled up. I could not figure what causes it. it could be when I move the window from one terminal to the other. sometimes it happens when I open a debugger window.

Only way to fix this is to close all of Maple and start it again. 

Just wondering if anyone seen anything like this and what can cause it. Again, it is only Maple that shows this problem, no other windows application does this. Have 128 GB Ram and PC is only 2 years old.

This is the very first time I see this in Maple and used Maple for long time and on this same PC before and had two terminals also before all the time. I have no idea what causes it.

Could it be Java problem in Maple 2024.1 ?

I created the following worksheet to illustrate my question.

restart

We have two equations. w and w__0 are parameters and we wish to solve for A__1 and A__2.

eq1 := A__1*(w^2-3*w__0^2)+A__2*w__0^2 = 0 = A__1*(w^2-3*w__0^2)+A__2*w__0^2 = 0NULL

eq2 := A__1*w__0^2+A__2*(w^2-w__0^2) = 0 = A__1*w__0^2+A__2*(w^2-w__0^2) = 0NULL

solve({eq1, eq2}, {A__1, A__2}) = {A__1 = 0, A__2 = 0}NULL

 

Maple says the only solution is the trivial solution.

If we check the determinant of the matrix of the system we see it can be zero for certain values of w given w__0.

M := Matrix([[w^2-3*w__0^2, w__0^2], [w__0^2, w^2-w__0^2]]) = Matrix(%id = 36893488152149895276)NULL

d := LinearAlgebra:-Determinant(M) = w^4-4*w^2*w__0^2+2*w__0^4NULL

solutions := solve(d = 0, w)

(2+2^(1/2))^(1/2)*w__0, -(2+2^(1/2))^(1/2)*w__0, (2-2^(1/2))^(1/2)*w__0, -(2-2^(1/2))^(1/2)*w__0

(1)

If w is one of these values then the system of equations is singular and has non-zero solutions.``

 

For example, subbing the first value above into the equations and solving Maple gives us non-trivial solutions.

 

solve({subs(w = solutions[1], eq1), subs(w = solutions[1], eq2)}, {A__1, A__2})

{A__1 = -(1+2^(1/2))*A__2, A__2 = A__2}

(2)

``

Why didn't Maple give us any indication that there could be non-zero solutions in the first call to solve?


For context, the system of equations comes from a calculation involving coupled oscillators.

I had a system of differential equations, guessed at a solution, plugged it in and got the equations shown in the worksheet. The guess isn't a correct solution in general, but it is a solution if w is one of the values computed in the worksheet (the values of the variable "solutions").

Download solve-nonzero-solutions.mw

hw8.mw

I am struggling to find the answer how to force maple to give finakl answer and not some expression. Actually i am trying to solve for a

i have a generator function but in out come i have phi(p_1,p_2,p_3, so on )=** result is clear but this p_1 and p_2 in not shown i want to be shown in my outcome

generate_solution.mw

It happens from time to time that context menus do not appear. Normally, they appear at mouse-over (i.e. when the cursor is moved over an menu item).

Example: Right-click on input line

A Maple restart is required to get the normal behaviour back.

Recently I noticed that repeatedly clicking at different location on the menu item make the contex menus appear again.

This can be workarround if a restart is not acceptable.

It seems that the new Java IDE, which was introduced with Maple 2021, is more susceptible to this phenomen. 

All on Windows 10.

Since this behaviour is rare I could not identify a clear pattern which system state or event could be responsible for the appearance of this phenomen.

I would be interested if someone else has observed it and found another solution how to get the menus back without restarting Maple.

Any idea why calling solve(eqs,unknowns) gives Error, (in is/internal) type does not exist when the unknowns are in a set, but the error goes away when the unknowns are in a list? Is this expected or is this a bug?


 

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 1779 and is the same as the version installed in this computer, created 2024, July 25, 8:56 hours Pacific Time.`

restart;

eqs:={0 = ln(2)+ln(-a*sech(1/2*2^(1/2)*b)^2), 1 = -tanh(1/2*2^(1/2)*b)*a^(1/2)*2^(1/2)};
unknown:={a, b};

{0 = ln(2)+ln(-a*sech((1/2)*2^(1/2)*b)^2), 1 = -tanh((1/2)*2^(1/2)*b)*a^(1/2)*2^(1/2)}

{a, b}

solve(eqs,unknown)

Error, (in is/internal) type `a` does not exist

solve(eqs,unknown)

Error, (in is/internal) type `a` does not exist

restart;

eqs:=[0 = ln(2)+ln(-a*sech(1/2*2^(1/2)*b)^2), 1 = -tanh(1/2*2^(1/2)*b)*a^(1/2)*2^(1/2)];
unknown:={a, b};

[0 = ln(2)+ln(-a*sech((1/2)*2^(1/2)*b)^2), 1 = -tanh((1/2)*2^(1/2)*b)*a^(1/2)*2^(1/2)]

{a, b}

solve(eqs,unknown)

Error, (in is/internal) type `a` does not exist

restart;

eqs:=[0 = ln(2)+ln(-a*sech(1/2*2^(1/2)*b)^2), 1 = -tanh(1/2*2^(1/2)*b)*a^(1/2)*2^(1/2)];
unknown:=[a, b];

[0 = ln(2)+ln(-a*sech((1/2)*2^(1/2)*b)^2), 1 = -tanh((1/2)*2^(1/2)*b)*a^(1/2)*2^(1/2)]

[a, b]

solve(eqs,unknown)

[]

 


 

Download is_internal_error_from_solve_maple_2024_1.mw

Update

Reported to Maplesoft support.

 

Any idea why limit(e,x=0) fail to evaluate but  eval(e,x=0) does in this example? 

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 1779 and is the same as the version installed in this computer, created 2024, July 25, 8:56 hours Pacific Time.`

restart;

e:=-tanh(sqrt(2)*(a*x+b))

-tanh(2^(1/2)*(a*x+b))

limit(e,x=0)

limit(-tanh(2^(1/2)*(a*x+b)), x = 0)

eval(e,x=0)

-tanh(b*2^(1/2))

 

 

Download limit_problem_maple_2024_1.mw

I tried the above using some other software, and there both evaluate to same result as expected:

In Maple, I found that by removing the sqrt(2) from inside the tanh, then limit now works

e:=-tanh((a*x+b));
limit(e,x=0)

Is this a bug?

Dear all, I have the following issue:

Goal is to calculate saddle, turning point, etc.

As you can see in the code above only in case of a second restart x2 is calculated correctly.

Thanks for help.

I have created a document on my computer that runs normally in Maple 2024.1. However, when I upload this document to MaplePrimes, it shows an error or behaves unexpectedly. The document contains a system of differential equations, which I solved numerically and plotted, but the plots and equilibrium points do not display correctly after uploading.

 

When I run this code on my local machine, it works perfectly. However, after uploading the document to MaplePrimes, it does not run as expected. What could be causing this issue? Is there a known problem with Maple 2024.1 when uploading documents, or could there be a compatibility issue with MaplePrimes?

Any help or suggestions would be greatly appreciated. Thank you!

This project discusses the predator-prey system, particularly the Lotka-Volterra equations, which model the interaction between two species: prey and predators. Let's solve the Lotka-Volterra equations numerically and visualize the results.

NULL

NULL

alpha := 1.0; beta := .1; g := 1.5; delta := 0.75e-1; ode1 := diff(x(t), t) = alpha*x(t)-beta*x(t)*y(t); ode2 := diff(y(t), t) = delta*x(t)*y(t)-g*y(t); eq1 := -beta*x*y+alpha*x = 0; eq2 := delta*x*y-g*y = 0; equilibria := solve({eq1, eq2}, {x, y}); print("Equilibrium Points: ", equilibria); initial_conditions := x(0) = 40, y(0) = 9; sol := dsolve({ode1, ode2, initial_conditions}, {x(t), y(t)}, numeric); eq_points := [seq([rhs(eq[1]), rhs(eq[2])], `in`(eq, equilibria))]

[[0., 0.], [20., 10.]]

(1)

plots[odeplot](sol, [[t, x(t)], [t, y(t)]], t = 0 .. 100, legend = ["Rabbits", "Wolves"], title = "Prey-Predator Dynamics", labels = ["Time", "Population"])

 

``

NULL

NULL

sol_plot := plots:-odeplot(sol, [[x(t), y(t)]], 0 .. 100, color = "blue"); equilibrium_plot := plots:-pointplot(eq_points, color = "red", symbol = solidcircle, symbolsize = 15); plots:-display([sol_plot, equilibrium_plot], title = "Phase Portrait with Equilibrium Points", labels = ["Rabbits", "Wolves"])

 

Now, we need to handle a modified version of the Lotka-Volterra equations. These modified equations incorporate logistic growth fot the prey population.

 

 

restart

alpha := 1.0; beta := .1; g := 1.5; delta := 0.75e-1; k := 100; ode1 := diff(x(t), t) = alpha*x(t)*(1-x(t)/k)-beta*x(t)*y(t); ode2 := diff(y(t), t) = delta*x(t)*y(t)-g*y(t); eq1 := alpha*x*(1-x/k)-beta*x*y = 0; eq2 := delta*x*y-g*y = 0; equilibria := solve({eq1, eq2}, {x, y}); print("Equilibrium Points: ", equilibria); initial_conditions := x(0) = 40, y(0) = 9; sol := dsolve({ode1, ode2, initial_conditions}, {x(t), y(t)}, numeric); eq_points := [seq([rhs(eq[1]), rhs(eq[2])], `in`(eq, equilibria))]

[[0., 0.], [100., 0.], [20., 8.]]

(2)

plots[odeplot](sol, [[t, x(t)], [t, y(t)]], t = 0 .. 100, legend = ["Rabbits", "Wolves"], title = "Prey-Predator Dynamics", labels = ["Time", "Population"])

 

``

 

 

plots:-odeplot(sol, [[x(t), y(t)]], 0 .. 50, color = "blue"); equilibrium_plot := plots:-pointplot(eq_points, color = "red", symbol = solidcircle, symbolsize = 15); plots:-display([plots:-odeplot(sol, [[x(t), y(t)]], 0 .. 50, color = "blue"), equilibrium_plot], title = "Phase Portrait with Equilibrium Points", labels = ["Rabbits", "Wolves"])

 

NULL


 

Download predator_prey.mw

I can't combine standard font and Greek symbols in a plot legend. I want to type:

"Limit of X_{i}^{\rho=0} (\alpha\mapsto+\infty)>0"

where I used LaTeX notation to emphasise that I want (1) superscript and subscript of X displayed as aligned exactly on top of each other, (2) rho, alpha, mapsto-style arrow, and infinity typed in their respective symbolic forms.

thanks!

I do not have earlier Maple version to check now. But Maple 2024.1 gives division by zero on this second order ode with missing x. This looks like new problem in Maple. Would someone who have access to earlier version of Maple be able to check if this problem shows there also? I solved this and get y=x+3 as solution which Maple verifies.

interface(version);

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

restart;

ode:=diff(y(x),x$2)=(diff(y(x),x))^3-(diff(y(x),x))^2;
IC:=y(0)=3,D(y)(0)=1;

diff(diff(y(x), x), x) = (diff(y(x), x))^3-(diff(y(x), x))^2

y(0) = 3, (D(y))(0) = 1

dsolve([ode,IC])

Error, (in dsolve) numeric exception: division by zero

sol:=y(x)=3+x;
odetest(sol,[ode,IC])

y(x) = 3+x

[0, 0, 0]

DEtools:-odeadvisor(ode);

[[_2nd_order, _missing_x], [_2nd_order, _reducible, _mu_y_y1]]

infolevel[dsolve]:=5;

5

dsolve([ode,IC])

Methods for second order ODEs:

--- Trying classification methods ---

trying 2nd order Liouville

trying 2nd order WeierstrassP

trying 2nd order JacobiSN

differential order: 2; trying a linearization to 3rd order

--- trying a change of variables {x -> y(x), y(x) -> x}

differential order: 2; trying a linearization to 3rd order

trying 2nd order ODE linearizable_by_differentiation

trying 2nd order, 2 integrating factors of the form mu(x,y)

trying differential order: 2; missing variables

-> Computing canonical coordinates for the symmetry [0, 1]

-> Rewriting ODE in canonical coordinates by means of differential invariants

Try computing 1 more symmetries for ODE written in canonical coordinates

 -> Computing symmetries using: way = 3

 Found another symmetry:

[1, 0]

 Found another symmetry:

[-x+y, 0]

Computing a convenient ordering to use the 3 symmetries available

<- differential order: 2; canonical coordinates successful

<- differential order 2; missing variables successful

Error, (in dsolve) numeric exception: division by zero

dsolve(ode)

Methods for second order ODEs:

--- Trying classification methods ---

trying 2nd order Liouville

trying 2nd order WeierstrassP

trying 2nd order JacobiSN

differential order: 2; trying a linearization to 3rd order

--- trying a change of variables {x -> y(x), y(x) -> x}

differential order: 2; trying a linearization to 3rd order

trying 2nd order ODE linearizable_by_differentiation

trying 2nd order, 2 integrating factors of the form mu(x,y)

trying differential order: 2; missing variables

-> Computing canonical coordinates for the symmetry [0, 1]

-> Rewriting ODE in canonical coordinates by means of differential invariants

Try computing 1 more symmetries for ODE written in canonical coordinates

 -> Computing symmetries using: way = 3

 Found another symmetry:

[1, 0]

 Found another symmetry:

[-x+y, 0]

Computing a convenient ordering to use the 3 symmetries available

-> Calling odsolve with the ODE diff(_b(_a) _a) = _b(_a)^3-_b(_a)^2 _b(_a) HINT = [[1 0] [-_a+y -_b*(_b-1)]]

   *** Sublevel 2 ***

   symmetry methods on request

 1st order, trying reduction of order with given symmetries:

[1, 0], [-_a+y, -_b*(_b-1)]

   1st order, trying the canonical coordinates of the invariance group

   <- 1st order, canonical coordinates successful

<- differential order: 2; canonical coordinates successful

<- differential order 2; missing variables successful

y(x) = ln(LambertW(-c__1*exp(x-1)))+c__2

 

 

Download divide_by_zero_maple_2024_1_august_5_2024.mw

I want to substitute a variable r' =sqrt(x^2 + y^2 + z^2).

But how do I change my output so that r' is displayed instead of sqrt(x^2+y^2+z^2)?

E.g. line (5) D(g)(r')x/r' and not D(g)(sqrt(x^2 + y^2 + z^2))*/sqrt(x^2 + y^2 + z^2). 

And one more question. How can I make sure that my output in (6) is only the result on the right side and the left side of the equal sign is not displayed? 


 

restart

with(Physics)

__________________________________________________________________

(1)

with(Vectors)``

Setup(spacetimeindices = greek, spaceindices = lowercaselatin, su2indices = uppercaselatin, signature = `- - - +`, coordinates = cartesian)

[coordinatesystems = {X}, signature = `- - - +`, spaceindices = lowercaselatin, spacetimeindices = greek, su2indices = uppercaselatin]

(2)

diff(r(x), x) := sqrt(x^2+y^2+z^2)

(x^2+y^2+z^2)^(1/2)

(3)

``

g(diff(r(x), x))

g((x^2+y^2+z^2)^(1/2))

(4)

diff(g(diff(r(x), x)), x)

(D(g))((x^2+y^2+z^2)^(1/2))*x/(x^2+y^2+z^2)^(1/2)

(5)

NULL

NULL

H := (x*Psigma[1, matrix]+y*Psigma[2, matrix]+z*Psigma[3, matrix]).Vector(2, {1 = 0, 2 = U(diff(r(x), x))})

(x*Physics:-Psigma[1]+y*Physics:-Psigma[2]+z*Physics:-Psigma[3]).Vector[column](%id = 36893490180036880732) = Vector[column](%id = 36893490180036881092)

(6)

NULL


 

Download representation_of_code.mw

In the code below, I define an expression, then turn it into a function of omega_d.

Consider the results (5) and (6) below.

I take the derivative of the function relative to omega_d, set the derivative to zero and ask Maple to solve for the critical point (ie, the omega_d at which the derivative is zero).

I get the correct result in (5), ie three different critical points. But when I simplify this result, Maple returns only one of the critical points.

Why?

restart

expr := f/sqrt((`&omega;__0`^2-`&omega;__d`^2)^2+`&gamma;__b`^2*`&omega;__d`^2)

f/((omega__0^2-omega__d^2)^2+gamma__b^2*omega__d^2)^(1/2)

(1)

A := unapply(expr, `&omega;__d`)

proc (omega__d) options operator, arrow; f/((omega__0^2-omega__d^2)^2+gamma__b^2*omega__d^2)^(1/2) end proc

(2)

diff(A(`&omega;__d`), `&omega;__d`)

-(1/2)*f*(-4*(omega__0^2-omega__d^2)*omega__d+2*gamma__b^2*omega__d)/((omega__0^2-omega__d^2)^2+gamma__b^2*omega__d^2)^(3/2)

(3)

simplify(diff(A(`&omega;__d`), `&omega;__d`))

-f*omega__d*(gamma__b^2-2*omega__0^2+2*omega__d^2)/(omega__d^4+(gamma__b^2-2*omega__0^2)*omega__d^2+omega__0^4)^(3/2)

(4)

solve(diff(A(`&omega;__d`), `&omega;__d`) = 0, `&omega;__d`)

0, (1/2)*(-2*gamma__b^2+4*omega__0^2)^(1/2), -(1/2)*(-2*gamma__b^2+4*omega__0^2)^(1/2)

(5)

simplify(solve(diff(A(`&omega;__d`), `&omega;__d`) = 0, `&omega;__d`))

0

(6)

NULL


This was a problem for me just now because I used the command in (6) first and just could not figure out what the heck was going on. I did the calculations by hand to check, and then finally found out it was this simplify command.

Download simplifysolve.mw

Something seems to have changed.  I do not now have Maple 2024.0 to check or earlier Maple's as I have to reinstall windows since my C:\ drive died. 

I installed Maple 2024.1 new on windows 10 home edition.

I noticed now when evaluating the current cell, the cursor automatically jumps to next cell, which is what I want and how Maple always worked.

But now the cursor jumps to the end of the command in the next cell. Before, I could swear that not how it worked and it used to jump to the start of the next cell.

This makes it very confusing, as I keep looking for where the cursor is now.

Why was this changed in 2024.1? I looked at option and see nothing to change this. 

Here is worksheet and small movie. 

This is my display options

 


 

interface(version);

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

x:=1;

1

y:=3;

3

z:=4;

4

h:=4;

4

 


 

Download cursor_jump_to_end_of_line.mw

 

 

Update

I tried to change the cursor size and thickness in windows 10 itself (using settings->Ease of access->Text cursor) and made it much bigger and restarted Maple but this had no effect. Cursor inside Maple remained the same.

I was hoping if there is a way to make the cursor bigger then this will make it easier to see where it jumped to when hitting enter.

It is bad, since the Maple cursor jumps to random places in the next cell. sometimes it jumps to the middle of the code in the next cell when there are more than one line there.

Here is a movie. Notice how it jumped to the start of the second line now in next cell in one case and not to the end of the code.

I can't believe no one at Maplesoft have noticed this and is able to fix it. This is ridiculous behavior. I spend few seconds each time I hit enter looking for where the cursor has landed as I keep looking at start of the next cell and it is not there. I could have 10-20 lines of code in one cell and have too look to find where the cursor is hidden in these 20 lines.

It natural for one to look for where the cursor is when woking and this makes it annoying. Hopefully someone can find a way to tell Maple to bring the old behaviour back where cursor jumps always to the start of the next cell.

 

 

 

 

First 74 75 76 77 78 79 80 Last Page 76 of 2417