MaplePrimes Questions

GUI state after interupting with :

After switching to untitled 17 and back to test_timeout:

Sometimes it is necessary to switch back and forth twice.

Does this mean that the kernel did not receive the interupt?

eqn := B(n) = -sum(binomial(n + 1, k)*B(k), k = 0 .. n - 1)/(n + 1);
init := B(0) = 1, B(1) = -1/2;
sol := rsolve({eqn, init}, B(n));
Why doesn’t this give me any solution ? Thank you.

How to add x,y,z axis in plotsetup command? I need to enhance the quality of figure, so I use plotsetup command width=5000,height=5000. But in this case, the range of x,y,z axis vanish like this. The related code is attached.

Could someone explain to me why when adding the line 

dsolve(diff(y(x),x$20)=1,arbitraryconstants=subscripted):

before calling odetest on some ode to verify the solutioin causes Maple to hang completely?

I had to kill mserver.exe.   My understamding is that the above call is used to Make maple use the new nicer `c__1` in place of `_C1` which I still have some in my code.

If this is not needed in Maple 2024, I will remove the above line as it seems to cause too many problems.

But I really like to know why Maple hangs because of this.  This could explain why I see random hangs in Maple as I have been using the above for many years now.

Make sure to save your work. Because Maple will hang if you run this.

The same thing happens in command line mode. (cmaple.exe). It hangs when add the above line.

Can someone else reproduce this?  I am on windows 10, Maple 2024. Latest Physics.

When Maple hangs, I see mserver.exe running at full CPU all the time, as if it is in infinite LOOP.

22068

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1763 and is the same as the version installed in this computer, created 2024, June 24, 10:50 hours Pacific Time.`

restart;

25992

 

NO HANG EXAMPLE

 

sol:=u(x)= ((1/x)^(2^(1/2))*c__1)^(1/2*2^(1/2))+2+((((1/x)^(2^(1/2))*c__1)^(1/2*2^(1/2)))^2+2*((1/x)^(2^(1/2))*c__1)^(1/2*2^(1/2))-((1/x)^(2^(1/2))*c__1)^(2^(1/2))+3)^(1/2):
ode:= (u(x)*(u(x)+1)^2)^(1/2)*2^(1/2)+x*(2*u()-1)*diff(u(x),x)+2*u(x)^2-4*u(x) = 0:

st:=time[real]();
try
   timelimit(20,odetest(sol,ode)):
catch:
   print("timed out ok");
end try:
print("time used is ",time[real]()-st," seconds ");

48.255

"time used is ", .251, " seconds "

 

61.986

"time used is ", .392, " seconds "

HANG EXAMPLE.

 

restart;

21508

dsolve(diff(y(x),x$20)=1,arbitraryconstants=subscripted): #this line causes hang

sol:=u(x)= ((1/x)^(2^(1/2))*c__1)^(1/2*2^(1/2))+2+((((1/x)^(2^(1/2))*c__1)^(1/2*2^(1/2)))^2+2*((1/x)^(2^(1/2))*c__1)^(1/2*2^(1/2))-((1/x)^(2^(1/2))*c__1)^(2^(1/2))+3)^(1/2):
ode:= (u(x)*(u(x)+1)^2)^(1/2)*2^(1/2)+x*(2*u()-1)*diff(u(x),x)+2*u(x)^2-4*u(x) = 0:

st:=time[real]();
try
   timelimit(20,odetest(sol,ode)):
catch:
   print("timed out ok");
end try:
print("time used is ",time[real]()-st," seconds ");

104.875


This show mserver.exe from task manage in infinite loop. I can leave this for hrs and nothing changes.

 

Download test_timeout_sheet.mw

important update

I found something important. During my testing, I found that the hang happens depending on the amount of timeout. For my PC, I changed the timeout about to 10 seconds, and now the second case did not hang.

Changed the timeout to 30 seconds, then it hanged.  This is because depending on how long the timeout, the code can reach differfent places where the problem happens.

So if you try the above with 20 seconds and it does not hang, please try again with 30 or 40 or 50 seconds., It should eventually hang also.

This for me makes programming in Maple completely unpredictable.

 

Hi all,

I'm new to this software, I've started using it to build myself a spacemouse, and figuring out the "inverse kinematics" involved in its working. I've done a little research on how Maple works, I'm fortunate enough to have a student license, but maybe this problem is above my capacity.

Essentially, I want to control a 6-DOF platform by measuring six distances (with magnetic sensors, but that's not relevant, I believe), from three points forming an equiliateral triangle on the top platform, to six points on the bottom platform. So far I've been able to calculate the effect that each of the degrees of freedom has on the platform and on each of this distances that I want to measure.

But that's where the problem lies. Now I have a system of six equations with six variables and a few parameters, a system that's heavily nonlinear, involving a lot of trig functions and multiplications between them. I've tried to "brute force" a symbolic solution by simply typing in: solve(equations, variables) (note that both equations and variables were properly defined) but Maple just ran for a couple of hours without providing an answer. I don't know if this particular application reaches this software's limits, or if it's me who is doing something wrong.
I'll try to provide the maple Worksheet, I'm still not familiar with this site's formatting, sorry in advance:


restart;
L := Matrix(3, 3, [[cos(theta)*cos(psi), cos(theta)*sin(psi), -sin(theta)], [sin(phi)*sin(theta)*cos(psi) - cos(phi)*sin(psi), sin(phi)*sin(theta)*sin(psi) + cos(phi)*cos(psi), sin(phi)*cos(theta)], [cos(phi)*sin(theta)*cos(psi) + sin(psi)*sin(phi), cos(phi)*sin(theta)*sin(psi) - sin(phi)*cos(psi), cos(phi)*cos(theta)]]);
T := Matrix(3, 3, [[1, psi, -theta], [phi*theta - psi, phi*psi*theta + 1, phi], [phi*psi + theta, psi*theta - phi, 1]]);
p[ni] := Typesetting[delayDotProduct](R, Vector[column](3, [cos(theta[n]), -sin(theta[n]), 0]), true)

p__n := (T . (p[ni])) + Vector[column](3, [u, v, w])

m[m] := R*Vector[column](3, [cos(phi__m), -sin(phi__m), h/R])

`Δp` := p__n - m[m]

with(VectorCalculus)

s[n] := sqrt(`Δp` . `Δp`)

theta[1] := -Pi/12;
theta[2] := Pi/12;
theta[3] := (2*Pi)/3 - Pi/12;
theta[4] := Pi/12 + (2*Pi)/3;
theta[5] := (4*Pi)/3 - Pi/12;
theta[6] := (4*Pi)/3 + Pi/12;

phi[1] := 0;
phi[2] := (2*Pi)/3;
phi[3] := (4*Pi)/3;

s[1] := eval(s[n], {phi__m = phi[1], theta[n] = theta[1]})

s[2] := eval(s[n], {phi__m = phi[1], theta[n] = theta[2]})

s[3] := eval(s[n], {phi__m = phi[2], theta[n] = theta[3]})

s[4] := eval(s[n], {phi__m = phi[2], theta[n] = theta[4]})

s[5] := eval(s[n], {phi__m = phi[3], theta[n] = theta[5]})

s[6] := eval(s[n], {phi__m = phi[3], theta[n] = theta[6]})

 

equations := [-d[1]^2 + s[1]^2 = 0, -d[2]^2 + s[2]^2 = 0, -d[3]^2 + s[3]^2 = 0, -d[4]^2 + s[4]^2 = 0, -d[5]^2 + s[5]^2 = 0, -d[6]^2 + s[6]^2 = 0]

variables := [u, v, w, psi, theta, phi]

solve(equations, variables)

 

So far this is what I've got, thanks in advance for the help.

EDIT: In the beginning of the worksheet two rotation matrices are declared, L and T. T is a "linearized" version of L, assuming small angles, and I'm using it to simplify the expressions. Still there is no luck.

There is an integration method called orering in Maple. But see no mention on it at help page 

It shows up when using option 

method=_RETURNVERBOSE

And that is how I knew about it.

It gives division by zero when asked to integrate zero !

Any one knows what is this method? Will send bug email to Maplesoft suport just in case also.
 

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

int(0,x)

0

int(0,x,method=orering)

Error, (in IntegrationTools:-Indefinite) numeric exception: division by zero

int(1,x,method=orering)

x

 


 

Download division_by_zero_int_orering_method.mw

 

 

Dear all, how can I simplify the following command by using nested SEQ?

tagsCornersPlot := textplot3d([[seq(cornerPoints[1 .. dim, 1]), cornerPoints[1 .. dim, 1]], [seq(cornerPoints[1 .. dim, 2]), cornerPoints[1 .. dim, 2]], [seq(cornerPoints[1 .. dim, 3]), cornerPoints[1 .. dim, 3]], [seq(cornerPoints[1 .. dim, 4]), cornerPoints[1 .. dim, 3]]], align = {above, right}, font = [Courier, bold, 20])

Hello Everyone 

I created a file to sum up 5 vectors and display them in 3d space. (see below)

I would like to optimize my input so that I input the total length of the vector and the angle in the x-y plane and the angle in the x-z plane. 

At the top of the document there is an idea from a different pots how to do it with 2d vectors but I can't get it to work with 3d vectors. 

Any ideas?

Thanks in advance!

3d_vector.mw

I'm trying to replicate this video: https://www.youtube.com/watch?app=desktop&v=EUVPsxYIauo

Note that the variables a, b, c are integers.

Here is my Maple worksheet:

restart;
eq1 := a*b + c = 2020;
                     eq1 := a b + c = 2020

eq2 := b*c + a = 2021;
                     eq2 := b c + a = 2021

sol1 := isolve({eq1, eq2});
              sol1 := {a = 2021, b = 0, c = 2020}

However, there is another solution {a = 673, b = 2, c = 674}. Why does isolve not find the second solution? I tried 'allvalues', but it did not work.

Hello all,

I need to perform this numerical integration through maple. Having been a complete beginner I just wanted to ask if at all this is feasible using maple? I have done similar stuff using mathematica, but would like to try and calculate the same using maple, especially with the gamma function in the above equation.

W_{-} := M*sqrt(Pi)/(2*A*a)*(x*erf(a*x) + (1/(a*sqrt(Pi)))*exp(-a^2*x^2)) + (M/(A*a*sqrt(Pi)))*evalf(Int(exp(-epsilon^2/(4*a^2) - tau*epsilon^3)*(cos(epsilon*x) - 1)/epsilon^2, epsilon = 0..infinity)) + (2*m/Pi)*evalf(Int(exp(-tau*epsilon^3)*(cos(epsilon*x) - 1)/epsilon^2, epsilon = 0..infinity)) + (M/(A*a*sqrt(Pi)))*evalf(Int((1/(2*a^2) + 3*tau*epsilon)*exp(-epsilon^2/(4*a^2) - tau*epsilon^3), epsilon = 0..infinity)) - (2*m/Pi)*tau^(1/3)*GAMMA(2/3) -m*x;

W_{+} := M*sqrt(Pi)/(2*A*a)*(x*erf(a*x) + (1/(a*sqrt(Pi)))*exp(-a^2*x^2)) + (M/(A*a*sqrt(Pi)))*evalf(Int(ecp(-epsilon^2/(4*a^2) - tau*epsilon^3)*(cos(epsilon*x) - 1)/epsilon^2, epsilon = 0..infinity)) + (2*m/Pi)*evalf(Int(exp(-tau*epsilon^3)*(cos(epsilon*x) - 1)/epsilon^2, epsilon = 0..infinity)) + (M/(A*a*sqrt(Pi)))*evalf(Int((1/(2*a^2) + 3*tau*epsilon)*exp(-epsilon^2/(4*a^2) - tau*epsilon^3), epsilon = 0..infinity)) - (2*m/Pi)*tau^(1/3)*GAMMA(2/3) + m*x;

M := 6.3*10^{17};

t := 7200;

a := 10^3 ;

m := 1;

D := 10^{-5};

Omega := 1.7*10^{23}

tau := 10^{-14}

A := tau/(D*Omega*t);

Any suggestions as how to proceed would be very helpful. Thanks.

 

EDIT: for some reason I cannot reply to the comments but I have modified the question based on the comments below

For the legend in the image below I would have expected a black image and not a white

 

 

I wanted to keep a running total over a number of independent batch mode Maple scripts.

So I figured I use .m file.   

Each run will read the old variable from .m file, update it, and write it again.

All what it need to do is just check if the .m file exist or not to account for the very first run.

But to my surprise, I found the variable content do not update after doing SAVE A,"TMP.m"

It seems Maple sees A variable already in TMP.m and does not save the new value of A again?. Just guessing. I was expecting that after I do  read "TMP.m" that the variable in the file will overwrite same variable value in the local proc. 

After one time update, each time I read the variable, its value is same.

First time using save myself, so may be I am doing something wrong but do not see it. I was expecting to see   10,20,30,40,50,..... running total, but I see 10,20,20,20,20,...../

What Am I doing wrong? do I need to make the variable global for this to work?

Here is worksheet. Maple 2024 on windows 10.


 

24344

restart;

24344

currentdir("G:/public_html/my_notes/solving_ODE/new_version/tests/");
try  #remove TMP.m first time
    FileTools:-Remove("TMP.m");
catch:
    NULL;
end try;

#this function is called many times.
foo:=proc()
 local A:=0,B;
 A:=A+10;
 if FileTools:-Exists("TMP.m") then
     print("TMP.m exists, will read its content");
     B:=A; #save copy
     read "TMP.m";
     print("Read old value of A from file",A);
     A:= A + B; #update running total
     print("Now A is ",A," will now save this new value");     
     save A,"TMP.m";
  else
     print("TMP.m do not exist, first time saving to it");
     save A,"TMP.m";
  fi;
  print("A=",A);
end proc:
 

"C:\Program Files\Maple 2024"

foo();

"TMP.m do not exist, first time saving to it"

"A=", 10

foo();

"TMP.m exists, will read its content"

"Read old value of A from file", 10

"Now A is ", 20, " will now save this new value"

"A=", 20

foo();

"TMP.m exists, will read its content"

"Read old value of A from file", 10

"Now A is ", 20, " will now save this new value"

"A=", 20

foo();

"TMP.m exists, will read its content"

"Read old value of A from file", 10

"Now A is ", 20, " will now save this new value"

"A=", 20

foo();

"TMP.m exists, will read its content"

"Read old value of A from file", 10

"Now A is ", 20, " will now save this new value"

"A=", 20

 


 

Download T.mw

How to show that the angle QF2P remains constant when M moves on the ellipse ? Perhaps with Explore ?
restart;
with(plots);
with(geometry);
_EnvHorizontalName := 'x';
_EnvVerticalName := 'y';
x0 := 100;
y0 := 40;
a := 7;
b := 5;
c := sqrt(a^2 - b^2);
ellipse(el, x^2/a^2 + y^2/b^2 - 1);
point(F1, -c, 0);
point(F2, c, 0);
eq := simplify((a^2 - x0^2)*(y - y0)^2 + (b^2 - y0^2)*(x - x0)^2 + 2*x0*y0*(x - x0)*(y - y0)) = 0;
sol := solve({eq}, {y});
line(tang1, op(sol[1]));
line(tang2, op(sol[2]));
sol2 := op(solve({op(sol[1]), x^2/a^2 + y^2/b^2 - 1 = 0}, {x, y}));
xM2 := rhs(sol2[1]);
yM2 := rhs(sol2[2]);
point(A, xM2, yM2);
sol3 := op(solve({op(sol[2]), x^2/a^2 + y^2/b^2 - 1 = 0}, {x, y}));
xM3 := rhs(sol3[1]);
yM3 := rhs(sol3[2]);
point(B, xM3, yM3);
line(Pol, [A, B]);
simplify(Equation(Pol));
isolate(%, y);
xM := 4;
sol := solve({subs(x = xM, x^2/a^2 + y^2/b^2 - 1 = 0)}, {y});
yM := rhs(op(sol[1]));
point(M, xM, yM);
line(Tang, x*xM/a^2 + y*yM/b^2 - 1 = 0);
intersection(P, tang1, Tang);
intersection(Q, tang2, Tang);
line(PF2, [P, F2]);
line(QF2, [Q, F2]);
alpha := FindAngle(PF2, QF2);
arctan(alpha);
evalf(%);
display(textplot([[-c, 0, "F1"], [c, 0, "F2"], [coordinates(B)[], "B"], [coordinates(A)[], "A "], [coordinates(M)[], "M "], [coordinates(P)[], "P "], [coordinates(Q)[], "Q "]], align = {"above", 'right'}), draw([el(color = red), A(color = black, symbol = solidcircle, symbolsize = 16), PF2(color = brown), QF2(color = brown), B(color = black, symbol = solidcircle, symbolsize = 16), M(color = black, symbol = solidcircle, symbolsize = 16), P(color = black, symbol = solidcircle, symbolsize = 16), tang1(color = green), tang2(color = green), Tang(color = green), F1(color = blue, symbol = solidcircle, symbolsize = 16), Q(color = blue, symbol = solidcircle, symbolsize = 16), F2(color = red, symbol = solidcircle, symbolsize = 16)]), axes = none, view = [-7 .. 15, -7 .. 12]);

Just found very serious problem.

Was trying my code in command line maple (cmaple.exe) only to find latex() command fails now.

Same code works with no problem in worksheet.  Here is first the worksheet version.
 

33308

restart;

33308

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

ode:=diff(y(x),x)=x;
try
    s:=latex(ode,'output'=string):
    print("Latex command worked on ode");
catch:
    error lastexception;
end try:


the_output:=Student:-ODEs:-ODESteps(ode,y(x)):
try
    s:=latex(the_output,'output'=string):
    print("Latex command worked");
catch:
    error lastexception;
end try:

diff(y(x), x) = x

"Latex command worked on ode"

"Latex command worked"

 


 

Download worksheet_version_latex_OK_june_21_2024.mw

Now I do same thing but from command line. I put the above code in A.mpl file in some folder on windows:

ode:=diff(y(x),x)=x;
try
    s:=latex(ode,'output'=string):
    print("Latex command worked on ode");
catch:
    error lastexception;
end try:


the_output:=Student:-ODEs:-ODESteps(ode,y(x)):
try
    s:=latex(the_output,'output'=string):
    print("Latex command worked");
catch:
    error lastexception;
end try:

 

Then opened a command windows terminal and cd to the above folder and typed this command

"C:\Program Files\Maple 2024\bin.X86_64_WINDOWS\cmaple.exe"  -q A.mpl

And this is what happens. Latex works OK on generating latex for the ode, but not for the steps!It gives error

 

Error, latex, invalid input: %1 uses a %-2 argument, %3 (of type %4), which is missing, latex:-ModuleApply, 1, e, anything

Also I was not able to suppress the display of the odesteps on the terminal even though they do not display in worksheet, they still print in the terminal. But this is a side issue.

Why does Latex gives error in command line? 

I think it is related to those funny looking characters (bullets?) signs at the start of each ODE step that show in the terminal? 

But in worksheet latex has no problem converting the ODE steps to Latex. It is only in cmaple. 

Is there a way to correct this? It seems to be some character encoding is causing the problem for Latex on command line vs. worksheet.

 

Windows 10, Maple 2024

 

 

 

'odeadvisor' suggests isolating y(x) from the equation as a first step, y=G(x,y'(x)), then apply the method of 'patterns'. For the first step, y(x) = (9/4)*[(y'(x))^2]/{[int(f(x),x)]^5} is what I found but, could take it no further. Nevertheless, Maple finds an intrinsic solution of the form, (3/4)*y(x)^(4/3) +(2/3)*int(sqrt(y(x)*f(x))^(-5/3) + _C1 =0, from which an explicit solution can be obtained. If anyone can supply the steps leading to the Maple solution - that would be great.

1 2 3 4 5 6 7 Last Page 1 of 2332