Maple 2024 Questions and Posts

These are Posts and Questions associated with the product, Maple 2024

Dear all, in Maple Help exists the documentation of how to use the OpenMaple API Library. But I didn't found a link where to download the necessary libraries. I found e.g. the library maple-0.17.4.jar but it doesn't contain com.maplesoft.openmaple.*

http://www.java2s.com/example/jar/m/maple-index.html

Tahnks for help

We have just released an update to Maple. Maple 2024.1 includes improvements to the math engine, PDF export, the Physics package, command completion, and more. As always, we recommend that all Maple 2024 users install this update. In particular, please note that this update includes fixes to ODESteps and simplifying integrals, as reported on Maple Primes. Thanks for helping us, and other users, by letting us know!

At the same time, we have also released an update to MapleSim. MapleSim 2024.1.1 includes improvements to FMU import/export, plotting, co-simulation, and more, as well as enhancements to the Web Handling Library.

These updates are available through Tools>Check for Updates in Maple or MapleSim, and are also available from the Download Product Updates section of our web site, where you can find more details.

What is the command to stopat and showstat the proc  DEtools:-odeadvisor ?

I tried

ode:=y(x)*(2*x^2*y(x)^3+3)+x*(x^2*y(x)^3-1)*diff(y(x),x)=0;
DEtools:-odeadvisor(ode);

showstat(`DEtools/odeadvisor`);

showstat(`ODEtools/odeadvisor`);

And few other variations. It works on other proc's  such as

stopat(`ODEtools/symtest`); 
stopat(`ODEtools/test`); 
stopat(`ODEtools/normal/expanded`); 
stopat(`ODEtools/odepde`); 

But I was never able to figure the name for `DEtools:-odeadvisor`

Is there a general method to determine the correct name to use for printing or stopping at Maple command code to see it?

For me, it seems like trial and error process. For example DEtools:-command   becmes ODEtools:-command to stop at. Notice the extra O needed for tracing or printing. Do not know why extra O is needed. But showstat(`DEtools/symtest`); gives error, and showstat(`ODEtools/symtest`); works even though the command itself has no O.

So my question is, what would be the command to stop at DEtools:-odeadvisor? Is there a place to read more about how to find the correct path to give so do not have to guess?

Maple 2024

Maple gives type of this first order ode as _homogeneous, `class C`, but it is also dAlembert ode.

When asking it to solve as  dAlembert using the method option, it solves it.

But it returns singular solution which is wrong as it does not satisfy the IC. Singular solution should also satisfy IC like particular solutions do.

Is this a bug or Am I overlooking something?

Should not the solution returned satisfy the IC even though method used is not listed from odeadvisor?
 

29028

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 1764 and is the same as the version installed in this computer, created 2024, June 28, 12:19 hours Pacific Time.`

restart;

29028

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

diff(y(x), x) = (3*x-y(x)+1)/(3*y(x)-x+5)

y(0) = 0

sol:=dsolve([ode,ic],[dAlembert]); #this solution is singular solution.

y(x) = x-1

odetest(sol,[ode,ic]); #notice, solution do not satisfy IC

[0, 1]

sol2:=dsolve([ode,ic]):
odetest(sol2,[ode,ic]); #this is OK since used default method, not dAlembert

[0, 0]

DEtools:-odeadvisor(ode)

[[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

 


 

Download dsolve_dalembert_july_2_2024.mw

I want to simplify the attached expression by applying the relation \( k_1 + k_2 + k_3 = 0 \).

For instance, the terms \( k_3 + k_1 - k_2 \) become \(-2k_2\) and \( k_1 + k_2 - k_3 \) become \(-2k_3\), etc.

Instead of manually changing each term, I am looking for a systematic method to apply this relation to simplify the given expression.

aabb.mw

How to simplify the expression where each vectors k_i and q has real components, i.e., etc

Only W_i, U_i,j, V_i,j are complex numbers, so conjugate (bar) is applicable for them. How to make declaration, so that all other bars are removed and simplify the expression.

aa.mw

I have used alias for various reasons inside a pagkage. It is useful for coupling old command names to modern ones.

I am trying now to get this to work inside a sub package but no success. Can this be done?

restart

 

pkg:=module()
option package;
export   Sqr, UHG;
alias(XX=Sqr);
#alias(eparm=CirclePramUHG);
Sqr:=proc(x)
   return x^2;
end proc;

 UHG:=module()
          option package;
         
          export
               CircleParmUHG;

alias(eparm=CirclePramUHG);

     CircleParmUHG := proc(T::algebraic, U::algebraic)
       local t, u, P, cp;
         #  P := point;
             t := T*denom(T)*denom(U);
             u := U*denom(T)*denom(U);
         # if P <> NullPoint then
         #   P := 'NullLine';
         #end if;
        if t::numeric and u::numeric and t<>0 and u<>0 then
             cp:=  <u^2 - t^2| 2*u*t| u^2 + t^2>/gcd(gcd(u^2 - t^2, 2*u*t), u^2 + t^2);
          else
             cp:=  <u^2 - t^2| 2*u*t| u^2 + t^2>;
        end if;
        return cp
      end proc;
    end module;
end module;

_m2044017012448

(1)

with(pkg)

[Sqr, UHG]

(2)

Sqr(4)

16

(3)

UHG:-CircleParmUHG(t,u)

[`?`]

(4)

UHG:-eparm(t,u)

Error, eparm is not a command in the pkg:-UHG package

 

with(UHG)

[CircleParmUHG]

(5)

CircleParmUHG(2,7)

Vector[row]([45, 28, 53])

(6)

eparm(2,7)

eparm(2, 7)

(7)

 

XX(3)

9

(8)
 

 

Download 2024-06-29_use_alias_in_a_Sub_Package.mw

Maple formats output depending on typesetting options "extened" and "standard" for the GUI (or interface). An example taken from

restart;
ts_standard:=proc(k::anything)
     interface(typesetting=standard):
     print(k);
     interface(typesetting=extended): 
     NULL;
end proc:
k:=3/8*ln(55/52)+sin(x)+3/4*exp(x);
                    3   /55\            3       
               k := - ln|--| + sin(x) + - exp(x)
                    8   \52/            4       

ts_standard(k);
                               

Why is the input two times returned and why one time as a list?
Somehow the first interface statement is responsible for that.

I am only interested in the reformated input inside the list.
Is it possible to fix the code?

Other observation with typesetting=standard:

restart;
interface(typesetting=standard);
expr:=cos(x)^2;
((x->x)=combine[trig])(expr);
                      

((x->x)=combine[trig])(expr);#subsequent call
                          2   1            1
                    cos(x)  = - cos(2 x) + -
                              2            2

(with Maple 2024.1 this only accurs in Math-1D)
but

restart;
expr:=cos(x)^2;
interface(typesetting=standard);
((x->x)=combine[trig])(expr);
                                      2
                        expr := cos(x) 

                            extended

                          2   1            1
                    cos(x)  = - cos(2 x) + -
                              2            2

I need to check inside typeset to see is something evaluates to 1. I can find if something contains 1 and have been using that. But got caught out last night because I forgot my work around. e.g. 1+H contains 1 and my work around is `1+H` so the check doesn't see the 1. The typeset is always the first item in the list.

restart

 

 

foo:=proc(a,{S::list:=[]})
local i,perp::boolean;
if S<>NULL then
  if (S[1])=1 or S[1]::function and has(`or`(seq (op(S[1]),i=1..nops([op(S[1])]))),1)  then
   #if (S[1])=1 or S[1]::function and `or`(seq (is(op(S[1][i]),1),i=1..nops([op(S[1])])))  then  ;#  not working
   
     perp:=true;print(perp);
    else
     perp:=false;print(perp);
  end if;
end if;
end proc:

foo(6,S=["cat"]);

 

false

(1)

foo(6,S=[1]);

true

(2)

foo(6,S=[typeset("cat=",H/H),align={above,left},color=green]); #good

true

(3)

foo(6,S=[typeset("cat=",H),align={above,left}])

false

(4)

foo(6,S=[typeset("cat=",1+H)],align={above,left},color=green);#want to fix this

 

 

true

(5)

foo(6,S=[typeset("cat=",`1+H`)]); #work around

false

(6)

foo(6,S=[typeset("cat=",`B/(H+1)`)]); #work around

false

(7)

foo(6,S=[typeset("cat=",`B/(H+1)`,"  height =",1)]); #correct

true

(8)

foo(6,S=[typeset("cat=",H^2/((2*H-H)*H),"  height =",`B/(H+1)`)]); #correct

true

(9)

op(typeset("cat=",B/(H+1)));# this would be false

 

"cat=", B/(1+H)

(10)

op(typeset("cat=",H^2/((2*H-H)*H),"  height =",`B/(H+1)`)) ;  # this would be true

 

 

"cat=", 1, "  height =", `B/(H+1)`

(11)
 

 

Download 2024-06-27_Q_check_inside_typeset.mw

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])

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

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

 

 

 

Hi -- I have used this valuable platform many times to ask technical questions, but I am facing a particularly annoying problem in Maple 24 that did not exist in Maple 23. When I work on a Maple sheet and press Shift + Enter to move the cursor to a new line, an unwanted space appears. The issue is that when I use this combination twice on existing Maple sheets to create whitespace, the variable name often gets split up. Additionally, when I try to move back to the previous line to add something, I simply cannot. This issue did not exist in Maple 23 or any version since Maple 15. I have checked Tools > Options under both Display and Interface, but I have not found a solution. Is there a way to eliminate this annoying space?

  I would like to print my help pages to pdf. Is there a way to install A3 paper size. That would help in maintaining the layout as seen on the screen. 

Maybe there is an alternative approach.

First 31 32 33 34 35 36 37 Last Page 33 of 43