MaplePrimes Questions

I would like to define a binary operator, let's say T, such that `T`(a, b) be displayed a T b.

Is this possible in Maple (preferably 2015 [define doesn't have a 'binary' property], but a solution for any higher version would be welcome)?

Example

restart;

`union`(a, b);

`union`(a, b)

(1)

alias(`#mo("≅")` = `union`):
`union`(a, b);  

`#mo("≅")`(a, b)

(2)

# desired:
`#mrow(mo("a"),mo(" "),mo("≅"),mo(" "),mo("b"))`

`#mrow(mo("a"),mo(" "),mo("≅"),mo(" "),mo("b"))`

(3)
 

 

Download binary_operator.mw

Thanks in advance

I am trying to find the phase portraits of a dynamical system; couples ODE system but it appears in singular form. How can we remove the singularity of coupled ODE system in P and W depending on \xi, where \alpha is scalar and v is velocity.

How remove quadratic singularity to make this system Hamiltonian in below coupled ODE system in P & W.

 singular_system.mw

restart

with(PDEtools):

alias(P = P(xi), W = W(xi))

P, W

(1)

rf1 := diff(P, xi) = W

diff(P, xi) = W

(2)

rf2 := diff(W, xi) = (P-(alpha^2+1)*P*W^2)/(v+(1/2*(alpha^2+1))*P^2)

diff(W, xi) = (P-(alpha^2+1)*P*W^2)/(v+(1/2)*(alpha^2+1)*P^2)

(3)
 

 

Download singular_system.mw

I would like the graph to display the optimal point clearly marked with a red dot. Additionally, the optimal point should be labeled for easy identification. what is the syntax for it.
The  sheet is attached below :
trial_question.mw

ContoursWithLabels(............................, labels = ["delta0", "s2"]);

how to make delta0  and s2 ? and delta should be symbol not word?

I am trying to look at source code of one Maple application to learn it. The application is old and uses  .lib and .ind files and not the new .mla files to store the code.

When I use the command march('list',path_to_lib), it shows the .m files there OK.

Next, when I use the command march('extractfile',path_to_lib,member_name.m,file_name_to_extract_to.m)

And then look at file_name_to_extract_to.m created in text editor, it is a binary and not plain text.

But when I do print(member_name),  in the worksheet, Maple prints the source code on the screen OK.

Below is worksheet to show this. All what you need to run this is download the zip file to your C:/TMP/ folder (or any other folder of your choice). 

https://www.maplesoft.com/applications/download.aspx?id=123874/an_extension_of_prelle-singer_method_and_maple_implementatio.zip

When you unzip the above file, you will see maple.lib, maple.ind, and maple.hdb files.  

I changed the names to PS.lib, PS.ind and PS.hdb (not to conflict with any maple own files).

So my C:/TMP/ folder now have these 3 files PS.lib, PS.ind and PS.hdb in it. 

Then I opened worksheet and did the following

restart;

libname := "C:/TMP",libname;

"C:/TMP", "C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

march('list',"C:/TMP/PS.lib");

[["PSsolve.m", [2001, 11, 22, 12, 23, 49], 15008, 59], ["PSIntFac.m", [2001, 11, 22, 12, 23, 50], 15067, 517], ["polygen.m", [2001, 11, 22, 12, 23, 55], 16722, 433], ["Signature.m", [2001, 11, 22, 12, 23, 56], 17155, 404], ["dPSBasis.m", [2001, 11, 22, 12, 23, 51], 16267, 55], ["powerN.m", [2001, 11, 22, 12, 24, 19], 18866, 200], ["PS.m", [2001, 11, 22, 12, 6, 33], 1, 15007], ["Darboux.m", [2001, 11, 22, 12, 23, 50], 15584, 269], ["PSDop.m", [2001, 11, 22, 12, 23, 52], 16322, 335], ["typos.m", [2001, 11, 22, 12, 23, 57], 17559, 749], ["EigenPval.m", [2001, 11, 22, 12, 23, 51], 15853, 273], ["PSBasis.m", [2001, 11, 22, 12, 23, 51], 16126, 141], ["nothas.m", [2001, 11, 22, 12, 23, 55], 16657, 65], ["unknownfunc.m", [2001, 11, 22, 12, 24, 16], 18308, 464], ["int.m", [2001, 11, 22, 12, 24, 18], 18772, 94]]

march('extractfile',"C:/TMP/PS.lib","PSIntFac.m","C:/TMP/PSIntFac.m")

interface(verboseproc=3);

1

print(PSIntFac)

proc (ode, n) local base, intfac, subs_Us_by_func, x, y, M, N, eq; n; base := PS(args, PSBasis); subs_Us_by_func := map(proc (u) options operator, arrow; rhs(u) = lhs(u) end proc, base); intfac := [PS(args, PSIntFac)]; if intfac = [`We could not find an integrating factor.`] then RETURN(`We could not find an integrating factor.`) end if; x := intfac[2]; y := intfac[3]; M := subs(subs_Us_by_func, intfac[4]); N := subs(subs_Us_by_func, intfac[5]); eq := diff(y(x), x) = subs(y = y(x), M/N); print(`For the FOODE in the form`); print(eq); print(`the integrating factor will be`); intfac := normal(subs(subs_Us_by_func, intfac[1])) end proc

 

 

Download why_extract_not_working.mw

Now when opening the extracted file PSIntFac.m it shows this (in the folder C:/TMP/)

M7R0
I)PSIntFacf*6$%$odeG%"nG6*%%baseG%'intfacG%0subs_Us_by_funcG%"xG%"yG%"MG%"NG%#e
qG6"F0C09%>8$-%#PSG6$9"%(PSBasisG>8&-%$mapG6$f*6#%"uGF06$%)operatorG%&arrowGF0/
-%$rhsG6#9$-%$lhsGFHF0F0F0F4>8%7#-F66$F8F"@$/FM7#%IWe~could~not~find~an~integra
ting~factor.G-%'RETURNG6#FT>8'&FM6#""#>8(&FM6#""$>8)-%%subsG6$F;&FM6#""%>8*-F_o
6$F;&FM6#""&>8+/-%%diffG6$-Fhn6#FYFY-F_o6$/FhnFap*&F]o"""Feo!""-%&printG6#%:For
~the~FOODE~in~the~formG-Fjp6#F\p-Fjp6#%?the~integrating~factor~will~beG>FM-%'no
rmalG6#-F_o6$F;&FM6#FgpF0F0F0F0

It seems Maple kepts the .m file in binary form.   Is it not supposed to convert it to plain text readable form, as the one which shows when using the command print() on the screen?  

Is there another march command to extract the .m files in plain text form? I looked at help of march, but see nothing so far.

If this is how march extractfile is supposed to work, then is there another way to extract in plain text?

in this link   https://maplesoft.com/applications/Preview.aspx?id=123874  there is paper/application 

which is supposed to have Maple package called with(PSsolver);

But when downloading the application (by clicking on the download link) and opening it, it only has one file 

              an_extension_of_prelle-singer_method_and_maple_implementatio.mws

Where will the package (source code) itself PSolver be?  I can't see any other link in the Maple page above to download additional files which might include the package itself.

The worksheet above says this

Before actualy introducing the ideas concerning our program, let us first load it to the Maple section. (Please, put the library file into directory `c:/DirectoryWhereIputtheLibrary`).

I googled and not able to find it also. This was written almost 24 years ago, so trying to contact the author now might not be good idea.

Should not the Maple application be all self contained with all the files needed to run it?

Any one has copy of this package by any chance?

the most paper use another function to get the result and then do substitute i try to get by the way of them but i fail so how about if we can get the results in direct function there is any way for finding thus parameter after substitution of our function in ode?

restart

with(PDEtools)

with(LinearAlgebra)

NULL

with(SolveTools)

undeclare(prime)

`There is no more prime differentiation variable; all derivatives will be displayed as indexed functions`

(1)

"          with(Student[ODEs][Solve]):"

_local(gamma)

Warning, A new binding for the name `gamma` has been created. The global instance of this name is still accessible using the :- prefix, :-`gamma`.  See ?protect for details.

 

ode := beta*U(xi)^2*c^2+(-alpha*c^2+1)*U(xi)+mu^2*c^2*(diff(diff(U(xi), xi), xi)) = 0

beta*U(xi)^2*c^2+(-alpha*c^2+1)*U(xi)+mu^2*c^2*(diff(diff(U(xi), xi), xi)) = 0

(2)

n := 2

2

(3)

F := U(xi) = sum(tanh(xi)^(i-1)*(B[i]*sech(xi)+A[i]*tanh(xi)), i = 1 .. n)+A[0]

U(xi) = B[1]*sech(xi)+A[1]*tanh(xi)+tanh(xi)*(B[2]*sech(xi)+A[2]*tanh(xi))+A[0]

(4)

K1 := eval(ode, F)

beta*(B[1]*sech(xi)+A[1]*tanh(xi)+tanh(xi)*(B[2]*sech(xi)+A[2]*tanh(xi))+A[0])^2*c^2+(-alpha*c^2+1)*(B[1]*sech(xi)+A[1]*tanh(xi)+tanh(xi)*(B[2]*sech(xi)+A[2]*tanh(xi))+A[0])+mu^2*c^2*(B[1]*sech(xi)*tanh(xi)^2-B[1]*sech(xi)*(1-tanh(xi)^2)-2*A[1]*tanh(xi)*(1-tanh(xi)^2)-2*tanh(xi)*(1-tanh(xi)^2)*(B[2]*sech(xi)+A[2]*tanh(xi))+2*(1-tanh(xi)^2)*(-sech(xi)*tanh(xi)*B[2]+A[2]*(1-tanh(xi)^2))+tanh(xi)*(sech(xi)*tanh(xi)^2*B[2]-sech(xi)*(1-tanh(xi)^2)*B[2]-2*A[2]*tanh(xi)*(1-tanh(xi)^2))) = 0

(5)

solve(identity(K1, {xi}), {A[0], A[1], A[2], B[1], B[2]})

Error, (in unknown) incorrect use of identity(<expr>,<name>)

 

Download Find_params.mw

Is there any function that returns a boolean value that tells me if a point is within a polygon or not?

I tried to contact an author using the menu item more->contact autor.

I got the following back from postmaster@maplesoft.com

The IP-adress 199.71.183.16 (domain maplesoft.com) does not match the IP-adress of my mailprovider.

The authentification of the mailprovider works when I send directly from this mailprovider to gmail accounts.

Is this a known issue when sending via maplesoft.com or only temporary?

Is gmail too restrictive?

There seems to be parsing problem with ODESteps. This input diff(y(x),x)=x^2*sqrt(y(x)) -  y(x) gives invalid input error, but diff(y(x),x)=x^2*sqrt(y(x)) does not.  

Everything else the same.

Worksheet below. 

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1841 and is the same as the version installed in this computer, created 2025, January 3, 8:59 hours Pacific Time.`

ode:=diff(y(x),x)=x^2*sqrt(y(x)) -  y(x);
IC:=y(0)=1;
Student:-ODEs:-ODESteps([ode,IC]);

diff(y(x), x) = x^2*y(x)^(1/2)-y(x)

y(0) = 1

Error, (in Student:-ODEs:-Test) invalid input

ode:=diff(y(x),x)=x^2*sqrt(y(x)) ;
IC:=y(0)=1;
Student:-ODEs:-ODESteps([ode,IC])

ode := diff(y(x), x) = x^2*sqrt(y(x))

IC := y(0) = 1

"[[,,"Let's solve"],[,,[(&DifferentialD;)/(&DifferentialD;x) y(x)=x^2 sqrt(y(x)),y(0)=1]],["&bullet;",,"Highest derivative means the order of the ODE is" 1],[,,(&DifferentialD;)/(&DifferentialD;x) y(x)],["&bullet;",,"Solve for the highest derivative"],[,,(&DifferentialD;)/(&DifferentialD;x) y(x)=x^2 sqrt(y(x))],["&bullet;",,"Separate variables"],[,,((&DifferentialD;)/(&DifferentialD;x) y(x))/(sqrt(y(x)))=x^2],["&bullet;",,"Integrate both sides with respect to" x],[,,&int;((&DifferentialD;)/(&DifferentialD;x) y(x))/(sqrt(y(x))) &DifferentialD;x=&int;x^2 &DifferentialD;x+`c__1`],["&bullet;",,"Evaluate integral"],[,,2 sqrt(y(x))=(x^3)/3+`c__1`],["&bullet;",,"Solve for" y(x)],[,,y(x)=1/36 x^6+1/6 x^3 `c__1`+1/4 `c__1`^2],["&bullet;",,"Simplify"],[,,y(x)=((x^3+3 `c__1`)^2)/36],["&bullet;",,"Redefine the integration constant(s)"],[,,y(x)=((x^3+`c__1`)^2)/36],["&bullet;",,"Use initial condition" y(0)=1],[,,1=(`c__1`^2)/36],["&bullet;",,"Solve for" `c__1`],[,,{`c__1`=-6,`c__1`=6}],["&bullet;",,"Remove solutions that don't satisfy the ODE"],[,,`&empty;`],["&bullet;",,"Solution does not satisfy initial condition"]]"

 


 

Download ode_steps_parsing_problem_jan_17_2025.mw

Problem Q15 in the book Parabolic Problems by David Angell and Thomas Britz describes a large circle (LC) and several smaller circles (SCs) which are each tangent to its neighbour SC(s), and externally to LC. All circles are tangent to the x axis and above it.

Section one of this worksheet displays the LC and six of the SCs based on the book's formula for the diameter of the latter in terms of the diameter of the LC and the largest SC, which is determined by the user.

Section two finds and displays that all of the displayed SCs' centers lie on the diameter of a circle closely related to the LC and larger than it.

Can this be proved to be the case for any sizes of the LC and SCs in the same formation as that displayed?

Parabola_Problems_Q15.mw

I need assistance with building the homotopy analysis method to solve the system of odes. here is the attempt to do it. I'm still new to maple restart; # Declare functions for the system PDEtools[declare]([f(x), g(x)], prime = x): # Order of expansion N := 4; # Define series for each function f1(x) := sum(p^i*f[i](x), i = 0..N): f2(x) := sum(p^i*g[i](x), i = 0..N): # Define the system of ODEs using Homotopy HPMEq1 := (1-p)*(diff(f1(x), x$3)) + p*(diff(f1(x), x) + f2(x)): HPMEq2 := (1-p)*(diff(f2(x), x$3)) + p*(diff(f2(x), x) - f1(x)): # Extract coefficients for the system for i from 0 to N do equl[1][i] := coeff(HPMEq1, p, i) = 0: equl[2][i] := coeff(HPMEq2, p, i) = 0: end do: # Define boundary conditions for the system cond= 0, D(f1[0])(5) = 1]: cond = 0, D(f2[0])(0) 1]: for j from 1 to N do cond = 0, D(f1[j])(0) = 0, D(f1[j])(5) , D(f2[j])(0) = 0, D(f2[j])(5) = 0]: end do: # Solve the system iteratively for each order for k from 0 to N do dsolve([equl[1][k], cond[1][k]], f1[k](x)): dsolve([equl[2][k], cond[2][k]], f2[k](x)): end do:

i try to get same result by substituation but i don't know what is mistake after i take second derivative is wronge i don't know how get same result as in paper did can anyone help  to calculate this part is not hard but is complicated ,How calculated second derivative and put in our ode to get the parameters?

restart

with(PDEtools)

with(LinearAlgebra)

NULL

with(SolveTools)

undeclare(prime)

`There is no more prime differentiation variable; all derivatives will be displayed as indexed functions`

(1)

"          with(Student[ODEs][Solve]):"

_local(gamma)

declare(Omega(x, y, t)); declare(U(xi)); declare(u(x, y, t)); declare(Q(xi)); declare(V(xi)); declare(W(xi)); declare(f(xi))

Omega(x, y, t)*`will now be displayed as`*Omega

 

U(xi)*`will now be displayed as`*U

 

u(x, y, t)*`will now be displayed as`*u

 

Q(xi)*`will now be displayed as`*Q

 

V(xi)*`will now be displayed as`*V

 

W(xi)*`will now be displayed as`*W

 

f(xi)*`will now be displayed as`*f

(2)

NULL

ode := -delta*(diff(diff(U(xi), xi), xi))+U(xi)*(w^2-gamma*U(xi)-beta-alpha) = 0

-delta*(diff(diff(U(xi), xi), xi))+U(xi)*(w^2-gamma*U(xi)-beta-alpha) = 0

(3)

ode1 := -delta*(diff(diff(f(xi), xi), xi))+f(xi)*(w^2-gamma*f(xi)-beta-alpha) = 0

-delta*(diff(diff(f(xi), xi), xi))+f(xi)*(w^2-gamma*f(xi)-beta-alpha) = 0

(4)

F := U(xi) = sum(tanh(xi)^(i-1)*(B[i]*sech(xi)+A[i]*tanh(xi)), i = 1 .. n)+A[0]

U(xi) = sum(tanh(xi)^(i-1)*(B[i]*sech(xi)+A[i]*tanh(xi)), i = 1 .. n)+A[0]

(5)

S := U(f(xi)) = sum(cos(f(xi))^(i-1)*(B[i]*sin(f(xi))+A[i]*cos(f(xi))), i = 1 .. n)+A[0]

U(f(xi)) = sum(cos(f(xi))^(i-1)*(B[i]*sin(f(xi))+A[i]*cos(f(xi))), i = 1 .. n)+A[0]

(6)

``

n := 2

2

(7)

eval(ode1, S)

-delta*(diff(diff(f(xi), xi), xi))+f(xi)*(w^2-gamma*f(xi)-beta-alpha) = 0

(8)

Download complex-issue.mw

Maple dsolve hangs (mserver.exe runs with high CPU for long time, had to stop it). 

This question is, why does it hang? As this can indicate internal logic bug.

This question is not why Maple can't solve this ode (taken from old textbook) as not solving an ode is not a bug (even though it should, as Maple is very good in solving ode's) but hanging is a bug.

infolvel shows it hangs when it reaches

<- Abel successful
         equivalence to an Abel ODE successful, Abel ODE has been solved

And stops here. 

Here is worksheet, showing the attempts made, and verifying book solution is correct using Maple with change of variable.

Make sure to save all your work before trying this just to be safe.

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1841 and is the same as the version installed in this computer, created 2025, January 3, 8:59 hours Pacific Time.`

original_ode :=(diff(y(x),x)*x-y(x))*(x-diff(y(x),x)*y(x))=2*diff(y(x),x);

((diff(y(x), x))*x-y(x))*(x-(diff(y(x), x))*y(x)) = 2*(diff(y(x), x))

#infolevel[dsolve]:=5;
dsolve(original_ode); #hangs

restart;

original_ode :=(diff(y(x),x)*x-y(x))*(x-diff(y(x),x)*y(x))=2*diff(y(x),x);
dsolve(original_ode,'implicit'); #hangs

restart;  #ONE SOLUTION IS:

original_ode:=(diff(y(x),x)*x-y(x))*(x-diff(y(x),x)*y(x))=2*diff(y(x),x);
book_sol:=y(x)=sqrt(x^2*c__1+2*c__1/(c__1-1));
odetest(book_sol,original_ode)

((diff(y(x), x))*x-y(x))*(x-(diff(y(x), x))*y(x)) = 2*(diff(y(x), x))

y(x) = (x^2*c__1+2*c__1/(c__1-1))^(1/2)

0

workaround to solve, by change of variables

 

restart;

original_ode :=(diff(y(x),x)*x-y(x))*(x-diff(y(x),x)*y(x))=2*diff(y(x),x);
ode2:=PDEtools:-dchange({x=sqrt(u),y(x)=sqrt(v(u))},original_ode,[v(u),u]):
sol:=dsolve(ode2):
sol:=map(X->eval(X,[v(u)=y(x)^2,u=x^2]),[sol]);
map(X->odetest(X,original_ode),sol)

((diff(y(x), x))*x-y(x))*(x-(diff(y(x), x))*y(x)) = 2*(diff(y(x), x))

[y(x)^2 = x^2+2-2*2^(1/2)*(x^2)^(1/2), y(x)^2 = x^2+2+2*2^(1/2)*(x^2)^(1/2), y(x)^2 = c__1*x^2+2*c__1/(c__1-1)]

[0, 0, 0]

 


 

Download why_dsolve_hangs_jan_17_2025.mw

 

How do I access the Maple Fundamentals guide video? Every time I click on the video, it tells me I must log in to view the video. But there is no where on that page to log in. When I log in to Maple Primes, I can't find the video.

5 6 7 8 9 10 11 Last Page 7 of 2393