Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Is there a way to reassign the arcsecant function "arcsec()" as "asec()" so that "arcsec" can be assigned to the arcsecond unit "Unit(arcsec)"?

Ideally, I would like all of the inverse trigonometric functions to use the shorter notation "asec()" instead of "arcsec()".  I usually do this as aliases, i.e. "alias(asin = arcsin) : alias(asec = arcsec) :" but this won't allow reusing "arcsec" for a unit instead.

Example error for Maple 2023:

alias(asec = arcsec) :
AddUnit(astronomical_unit, context = astronomy, default = true, prefix = SI, conversion = 149597870700*m) : # https://en.wikipedia.org/wiki/astronomical_unit
AddUnit(second, context = angle, spelling = arcsecond, plural = arcseconds, symbol = arcsec, prefix = SI_negative) :

AddUnit(parsec, context = astronomy, default = true, prefix = SI, conversion = AU/tan(arcsec)) ; # https://en.wikipedia.org/wiki/Parsec#Calculating_the_value_of_a_parsec

"Pi/648000" has to be used instead of "arcsec" here when defining the parsec since "arcsec" is already reserved for the arcsecant function, even with "alias(asec = arcsec) ;".

Correction: it looks like the parsec was redefined by the IAU in 2012 as exactly "648000*AU/Pi" without any tangents (or sines) in the definition (so the angle subtended by 1 AU at 1 PC is actually 0.999999999992" not 1").  Both "astronomical_unit" and "parsec" have the wrong values in Maple 2023 which need to be corrected manually.  But the conflict between arcseconds and arcsecants remains the same.

https://iau.org/static/resolutions/IAU2015_English.pdf

https://iopscience.iop.org/article/10.3847/0004-6256/152/2/41

I just saw that Maple 2024 no longer supports importing Quandl data.

If this is a feature that I will like to use, it is possible to keep both Maple 2023 and Maple 2024 installed at the same time on Microsoft Windows 11 without conflicts?  Or should I just not upgrade to Maple 2024?  I currently have a perpetual license for Maple 2023 and am on the 15-day trial for Maple 2024.

I just installed the 15-day trial for the new Maple 2024.  It looks like Maple 2024 has the same problem as Maple 2023 in that it will not maintain a connection to MapleCloud.  I can sign in to MapleCloud no problem but as soon as I close the window, it forgets my password and I have to log back in each time I want to access MapleCloud.  Is there a way for Maple 2023 or Maple 2024 to remember my Maplesoft password so I do not have to log back in every time I want to access MapleCloud?

display([plottools[arc]([op(coordinates(Omega))], r, t .. t + Pi/2, color = red, t4), plottools[arc]([op(coordinates(Omega))], r, t + Pi .. t + (3*Pi)/2, color = coral, t4), plottools[arc]([op(coordinates(Omega))], r, t - Pi/2 .. t, color = cyan, t4), plottools[arc]([op(coordinates(Omega))], r, t + Pi/2 .. t + Pi, color = green, t4)],
draw([Cir(color = blue, t4), cir(color = grey, t4), sT(color = black, t4), XXp(color = black, l3), YYp(color = black, l3), L1(color = black, l3), L2(color = black, l3), N1(color = blue, symbol = solidcircle, symbolsize = 15), N2(color = blue, symbol = solidcircle, symbolsize = 15), N3(color = blue, symbol = solidcircle, symbolsize = 15), M1(color = blue, symbol = solidcircle, symbolsize = 15)]), axes = none, view = [-30 .. 10, -10 .. 10], size = [800, 800])::
plots:-animate(Proc, [t], t = 0 .. 2*Pi, frames = 30).;

why the instruction concerning the arcs is not resected ? Thank you.

Is the a print or plot function that can generate from an expression an expression tree

and/or the corresponding expression DAG

 

Taken from ?ProgrammingGuide,Chapter02

restart;
Proc := proc(t) local t4, l3, R, r, eq, sol; _EnvHorizontalName := 'x'; _EnvVerticalName := 'y'; t4 := thickness = 4; l3 := linestyle = dot; R := 9; r := 1/2*R; geometry:-point(OO, 0, 0); geometry:-circle(Cir, [OO, R]); geometry:-point(K, R*cos(t), R*sin(t)); geometry:-point(Omega, r*cos(t), r*sin(t)); geometry:-circle(cir, [Omega, r]); eq := geometry:-Equation(cir); geometry:-line(XXp, y = 0); geometry:-line(YYp, x = 0); geometry:-line(L1, y = x); geometry:-line(L2, y = -x); geometry:-projection(M1, K, XXp); geometry:-coordinates(M1); geometry:-point(K2, geometry:-coordinates(M1)[1] - 2*R, 0); geometry:-coordinates(K2); geometry:-segment(sT, K2, M1); geometry:-point(N1, 0, R*sin(t)); subs(y = x, eq); sol := solve(%, x); geometry:-point(N2, sol[2], sol[2]); subs(y = -x, eq); sol := solve(%, x); geometry:-point(N3, sol[2], -sol[2]); plots:-display(geometry:-draw([Cir(color = blue, t4), cir(color = grey, t4), sT(color = black, t4), XXp(color = black, l3), YYp(color = black, l3), L1(color = black, l3), L2(color = black, l3), N1(color = blue, symbol = solidcircle, symbolsize = 15), N2(color = blue, symbol = solidcircle, symbolsize = 15), N3(color = blue, symbol = solidcircle, symbolsize = 15), M1(color = blue, symbol = solidcircle, symbolsize = 15)]), axes = none, view = [-30 .. 10, -10 .. 10], size = [800, 800]); end proc;
plots:-animate(Proc, [t], t = 0 .. 2*Pi, frames = 200);
NULL;
I am trying to program  this drawing, how to improve this code ? Thank you.

Whenever I call RandomGraph(20,200), Maple crashes both on the laptop and on the PC: any suggestion?

with(GraphTheory); with(RandomGraphs)

interface(version)

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

(1)

G := RandomGraph(20, 200)


Download crash.mw

I called dsolve with timelimit on this ode.  All of Maple instantly locks up.

I do not mean the worksheet, but everything. I have each worksheet using its own engine,. Not able to open new worksheet, nothing clicks. The whole front end locks up. Can't click on anything. 

Killing every mserver.exe does not even resolve this. I had to terminate all of Maple from the task manager. The strange thing, is that looking at task manager I see mserver.exe doing nothing. zero CPU. Only the front end process is at high CPU (the one with the Java icon).  It looks like the Java frontend is locked up for some reason.

 

Do others see the same thing? does this happen on the mac also? Please make sure to save all your work before trying to run this on your PC.

Maple 2024.1 on windows 10. This is first order Riccati ode.

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 1774 and is the same as the version installed in this computer, created 2024, July 16, 17:18 hours Pacific Time.`

ode:=(a2*x^2+b2*x+c2)*diff(y(x),x)=y(x)^2+(a1*x+b1)*y(x)+a0*x^2+b0*x+c0;

(a2*x^2+b2*x+c2)*(diff(y(x), x)) = y(x)^2+(a1*x+b1)*y(x)+a0*x^2+b0*x+c0

DEtools:-odeadvisor(ode);

[_rational, _Riccati]

#WARNING. This will freeze all of Maple.
timelimit(30,dsolve(ode));


Download maple_lock_up_july_17_2024.mw

These are GUI options on my end.

 

 

 

 

UPDATE 1

in Maple 2023.2 also on windows 10,  there is no lock up at all. same code. The solution to the ode is very large. I tried using both typesetting level  to EXTENDED  and  typesetting level MAPLE STANDARD and no hang.

I wonder if this has something to do with why Maple 2024.1 locks up? But I have not changed anything in my end. I made no change in options or anything else. same PC, same graphics card. 

UPDATE 2

Found the BUG!!  

In Maple 2024.1, if I change the display option typesetting level  to EXTENDED, the front end do not hang.

If I change the display typesetting level MAPLE STANDARD, the ftont end hangs.

But why??


 

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 1774 and is the same as the version installed in this computer, created 2024, July 16, 17:18 hours Pacific Time.`

ode:=(a2*x^2+b2*x+c2)*diff(y(x),x)=y(x)^2+(a1*x+b1)*y(x)+a0*x^2+b0*x+c0;

(a2*x^2+b2*x+c2)*(diff(y(x), x)) = y(x)^2+(a1*x+b1)*y(x)+a0*x^2+b0*x+c0

DEtools:-odeadvisor(ode);

[_rational, _Riccati]

interface(typesetting=extended):

timelimit(30,dsolve(ode));

`[Length of output exceeds limit of 1000000]`

interface(typesetting=standard):

#WARNING, this will hang MAPLE now. WHY??
timelimit(30,dsolve(ode));


 

Download maple_lock_up_july_17_2024_2.mw

ps. Reported to Maplesoft support. July 17, 2024. Hopefully this will be fixed in Maple 2024.2

 

Good day, all.

Please I want to solve the following delay differential equation:

ODE := diff(y(t), t$2) = (2*(1-y(t-1)^2))*(diff(y(t), t))-y(t)

ics := y(0) = 1, (D(y))(0) = 0

using the following codes but there is an error. Please kindly help to modify the codes.

restart;
Digits:=30:

f:=proc(n)
	2*(1-(y[n-1])^2)*delta[n]+y[n]:
end proc:

g:=proc(n)
	-4*y[n-1]*delta[n-1]+2*(1-(y[n-1])^2)*f(n)-delta[n]:
end proc:


e1:=y[n+2] = -y[n]+2*y[n+1]+(1/120)*h^2*(-3*h*g(n+2)+3*g(n)*h+16*f(n+2)+16*f(n)+88*f(n+1)):
e2:=h*delta[n] = -y[n]+y[n+1]-(1/1680)*h^2*(-128*h*g(n+1)-11*h*g(n+2)+59*g(n)*h+40*f(n+2)+520*f(n)+280*f(n+1)):
e3:=h*delta[n+1] = -y[n]+y[n+1]+(1/1680)*h^2*(-152*h*g(n+1)-10*h*g(n+2)+32*g(n)*h+37*f(n+2)+187*f(n)+616*f(n+1)):
e4:=h*delta[n+2] = -y[n]+y[n+1]+(1/1680)*h^2*(128*h*g(n+1)-101*h*g(n+2)+53*g(n)*h+744*f(n+2)+264*f(n)+1512*f(n+1)):

inx:=0:
ind:=0:
iny:=1:
h:=1/2:
n:=1:
omega:=10:
u:=omega*h:
N:=solve(h*p = 10, p):

err := Vector(round(N)):
exy_lst := Vector(round(N)):
numerical_y1:=Vector(round(N)):

c:=1:
for j from 0 to 2 do
	t[j]:=inx+j*h:
end do:

vars:=y[n+1],y[n+2],delta[n+1],delta[n+2]:

step := [seq](eval(x, x=c*h), c=1..N):
printf("%6s%45s%45s\n", 
	"h","Num.y","Num.z");
#eval(<vars>, solve({e||(1..4)},{vars}));


st := time():
for k from 1 to N/2 do

	par1:=x[0]=t[0],x[1]=t[1],x[2]=t[2]:
	par2:=y[n]=iny,delta[n]=ind:
	res:=eval(<vars>, fsolve(eval({e||(1..4)},[par1,par2]), {vars}));

	for i from 1 to 2 do
		printf("%6.5f%45.30f%45.30f\n", 
		h*c,res[i],res[i+2]):
		
		numerical_y1[c] := res[i]:
		
		c:=c+1:
	end do:
	iny:=res[2]:
	ind:=res[4]:
	inx:=t[2]:
	for j from 0 to 2 do
		t[j]:=inx + j*h:
	end do:
end do:
v:=time() - st;
v/4;
printf("Maximum error is %.13g\n", max(err));
NFE=evalf((N/4*3)+1);
#get array of numerical and exact solutions for y1
numerical_array_y1 := [seq(numerical_y1[i], i = 1 .. N)]:
#exact_array_y1 := [seq(exy[i], i = 1 .. N)]:

#get array of time steps
time_t := [seq](step[i], i = 1 .. N):

#display graphs for y1
with(plots):
numerical_plot_y1 := plot(time_t, numerical_array_y1, style = [point], symbol = [asterisk],
				color = [blue,blue],symbolsize = 20, legend = ["TFIBF"]);

 Thank you, and best regards.

Dear all,

I'd like to explore graphically a polynomial surface depending on two parameters a and b.

The problem is that, as soon as I start playing with the sliders, Maple freezes and I have to 'force quit'.

Can you please tell me if you have the same problem with this example?

Thanks.

restart:

with(plots):

K := 1 - y*x - (1 - x)*(b*x^3 + a*x^2 + x + 1)*(1 - y)*(b*y^3 + a*y^2 + y + 1)

1-y*x-(1-x)*(b*x^3+a*x^2+x+1)*(1-y)*(b*y^3+a*y^2+y+1)

(1)

Explore(plot3d(K, x=0..1, y=0..1,  font= [Times, bold, 20], labels= ['x', 'y','z'],   labelfont= [Times, bold, 40],  title = "K(x,y)"), b = 0..1., a=0..1.);

 

 

Download Explore.mw

Hello Dear Professional users,

I have a question regarding the "fsolve" command and also the "assign" command in Maple.

In my previous codes, I just used one time from "fsolve" and then "assign" command.

Today, I want to use "fsolve" and "assign" in a for loop. But, I can not get the results correctly.

For example, previously I reach a system of algebraic equations and the solve my problem easily:

N:=8:
y:=sum(a[n]*t^n,n=0..N):
y:=unapply(y,t):
*****some calculations with a[n] coefficients *****
A:={a set of nonlinear algebraic equations in terms of a[n]}%The number of equations is N+1 (same as the number of a[n] for n=0..N)
sol:=fsolve(A):
assign(sol)
plot(y(t),t=0..1)

****************************************************************************************************
****************************************************************************************************
****************************************************************************************************

Today, my problem is:

N:=8:
M:=4:
for i from 1 to M do
y[i]:=sum(a[i,n]*t^n,n=0..N):
y[i]:=unapply(y[i],t):
end do
for i from 1 to M do
*****some calculations with a[n] coefficients *****
@A[i]:={a set of nonlinear algebraic equations in terms of a[i,n]}%The number of equations is N+1 (same as the number of a[n] for n=0..N)
@sol[i]:=fsolve(A[i]):
@assign(sol[i])
@plot(y[i](t),t=0..1)
end do
****************************************************************************************************
****************************************************************************************************
****************************************************************************************************

What I should write instead of "A[i]", "sol[i]", and "assign(sol[i])" the lines started with
@A[i],....
@sol[i],...
@assign(sol[i]),....

Thanks for your attention in advance

With kind regards,
Emran

I am trying to install Syrup in my home computer (I have it installed in my work computer).  I followed the instructions in the Readme file: 

From Standard Maple:
    Open the file Syrup-Installer.mla.
    To do so, use File -> Open, choose file type 
    "Maple Library Archive (.mla)", select the file, and
    click "Open".

Everything seemed to work and the help page opened up:  But, it is not the syrup help page.  furthermore, when I type ?Syrup, it doesn't open it either.

 

When I try to run a worksheet that uses Syrup (that works on my work computer), I get these errors:

I"m going to reboot now and try again.  

Jorge

I was working with a Dataframe when I wanted to change the datatype of multiple columns at the same time as this is quite a large dataframe. I found in the helpfile that I can change datatype by the following command: 

SubsDatatype(Data, plts, float) which then change the datatype of "plts" into float. I had hoped that using multiple columns in the command would work in this way: SubsDatatype(Data, [plts, act], float)  but apparently not. Is there a way to do this or do I have to do it column by column?

Additionally I have another question about dataframes. I would like to replace "0" in the dataframe by a "blank" as you can do in excel. How do you do this in a dataframe?

Thanks in advance for any help given!

there is any way for define conformable fractional derivative in partial differential equation

restart;
with(PDEtools);
pde := a*diff(psi(x, t), x $ 2) + (b*abs(psi(x, t))^(-2*n) + c*abs(psi(x, t))^(-n) + d*abs(psi(x, t))^n + f*abs(psi(x, t))^(2*n))*psi(x, t) = 0;
pde + i*diff(u(x, t), [t $ beta]) = 0;

how define a  fractional derivative in sense of conformable derivative

I notice that the command gcd(a,b), if a and b are large degree polynomials, takes too much time and often crashes Windows (not only Maple).

As the euclidean algorithm is very efficient even for large numbers,why not for polynomials?

And how could I calculate the gcd between polynomials with a large degree?

Thanks Michele

First 16 17 18 19 20 21 22 Last Page 18 of 2210