Maple 2024 Questions and Posts

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

In the rectangular Cartesian coordinate system, three straight lines gA, gB, gC are given, which are not all parallel to each other. Another straight line g and the points Oa, Ob, Oc on it are given. A triangle ABC is to be constructed, one of whose vertices lies on gA, gB or gC and the triangle sides a, b and c (or their extensions) each run through Oa, Ob or Oc.
We are looking for the coordinates of the vertices A, B, C.
In a purely constructive solution, the calculation can be omitted.

Hello,

I noticed that the Linearly Implicit Euler method (also known as the Semi-Implicit Euler method) is not available in Maple's built-in ODE solvers. This method is useful for stiff ODEs, where part of the function is treated implicitly (for the linear term) and part is treated explicitly (for the non-linear term).

I know that the Linearly Implicit Euler method is a specialized method that probably does not find enough widespread use to justify its inclusion as a standard feature in Maple, especially given Maple's focus on numerical methods such as Runge-Kutta methods and fully implicit methods for rigid equations.

I’m wondering:

  1. Why isn’t this method included in Maple’s standard set of numerical solvers?
  2. How can I implement this method in my own code in Maple to solve stiff ODEs?

Any guidance or examples of implementation would be greatly appreciated!

Thank you!

Linearly_Implicit_Method.pdf

The usual ODE must be solved:
y´´*(y^3-y)+y´^2 *(y^2+1)=0
"Dangerous places" of the definition domain must be described: Where are the general solution y(x) and its derivatives continuous?

I've been evaluating Threads (since I can use Mutex in it, which is not supported in Grid).

I noticed that when measuring time to evaluate same integral inside thread it takes about 3 times as long as outside thread.

I am using time[real] to measure the time. (is this not the correct way to do this with Threads?)

Still, using threads was faster overall to integrate 10 different integrals than doing these sequentially one by one. 

When integrating 10 _different_ integrals using Threads, the total time was about 19 seconds.  While when done sequentially the overall time was about 50 seconds.  I used different integrals, to make sure Maple does not use result in its cache.

So using Threads was almost 3 times as fast, even when each int() call takes 3 times as long. (Because all the int() calls were done in parallel). 

But It seems there is some overhead to calling library function from inside Thread? (but time is compensated for since everthing is done in parallel now). Is this documented somewhere? It could be, I did not read every help page on Threads. Just started learning in early today.

But my main question is: Why int() takes 3 times as long inside Thread than outside?  I was expecting it to take similar time. Or may be I am not measuring time correctly inside Thread?

Attached test worksheet.

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 1815. The version installed in this computer is 1813 created 2024, September 28, 18:14 hours Pacific Time, found in the directory C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib\`

libname;

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

restart;

 

doall := proc(mutex_to_use,my_id,T::list)
  local s::string;
  local current_time;
  
  print("mutex is ",mutex_to_use," my id is ",my_id);
  current_time:=time[real]();
  int(T[my_id],x,method=_RETURNVERBOSE);
  print("thread ",my_id," time to integrate is ",time[real]()-current_time);  
 
end proc:

#file_id:=fopen(cat(currentdir(),"/log.txt"),WRITE);

mutex_to_use := Threads[Mutex][Create]();
T:=[sin(2*x)/(a^2+b^2*cos(x)^2),
    sin(3*x)/(a^2+b^2*cos(x)^2),
    sin(4*x)/(a^2+b^2*cos(x)^2),
    sin(5*x)/(a^2+b^2*cos(x)^2),
    sin(6*x)/(a^2+b^2*cos(x)^2),
    sin(7*x)/(a^2+b^2*cos(x)^2),
    sin(8*x)/(a^2+b^2*cos(x)^2),
    sin(9*x)/(a^2+b^2*cos(x)^2),
    sin(10*x)/(a^2+b^2*cos(x)^2),
    sin(11*x)/(a^2+b^2*cos(x)^2)];
print("time=",Calendar:-Format( Calendar:-Today(), "EEEE, MMMM dd, yyyy GG 'at' hh:mm:ss a" ));  
Threads[Wait]( seq( Threads[Create]( doall(mutex_to_use,i,T)), i=1..10)):
print("time=",Calendar:-Format( Calendar:-Today(), "EEEE, MMMM dd, yyyy GG 'at' hh:mm:ss a" ));  
#fclose(file_id);
Threads[Mutex][Destroy]( mutex_to_use );

2

[sin(2*x)/(a^2+b^2*cos(x)^2), sin(3*x)/(a^2+b^2*cos(x)^2), sin(4*x)/(a^2+b^2*cos(x)^2), sin(5*x)/(a^2+b^2*cos(x)^2), sin(6*x)/(a^2+b^2*cos(x)^2), sin(7*x)/(a^2+b^2*cos(x)^2), sin(8*x)/(a^2+b^2*cos(x)^2), sin(9*x)/(a^2+b^2*cos(x)^2), sin(10*x)/(a^2+b^2*cos(x)^2), sin(11*x)/(a^2+b^2*cos(x)^2)]

"time=", "Wednesday, October 02, 2024 AD at 11:08:15 PM"

"mutex is ", 2, " my id is ", 1

"mutex is ", 2, " my id is ", 2

"mutex is ", 2, " my id is ", 3

"mutex is ", 2, " my id is ", 4

"mutex is ", 2, " my id is ", 5

"mutex is ", 2, " my id is ", 6

"mutex is ", 2, " my id is ", 10

"mutex is ", 2, " my id is ", 8

"mutex is ", 2, " my id is ", 7

"mutex is ", 2, " my id is ", 9

"thread ", 7, " time to integrate is ", 15.192

"thread ", 1, " time to integrate is ", 16.540

"thread ", 3, " time to integrate is ", 18.185

"thread ", 5, " time to integrate is ", 18.354

"thread ", 10, " time to integrate is ", 18.367

"thread ", 2, " time to integrate is ", 18.416

"thread ", 9, " time to integrate is ", 18.544

"thread ", 6, " time to integrate is ", 18.581

"thread ", 8, " time to integrate is ", 18.604

"thread ", 4, " time to integrate is ", 18.603

"time=", "Wednesday, October 02, 2024 AD at 11:08:34 PM"

restart;

T:=[sin(2*x)/(a^2+b^2*cos(x)^2),
    sin(3*x)/(a^2+b^2*cos(x)^2),
    sin(4*x)/(a^2+b^2*cos(x)^2),
    sin(5*x)/(a^2+b^2*cos(x)^2),
    sin(6*x)/(a^2+b^2*cos(x)^2),
    sin(7*x)/(a^2+b^2*cos(x)^2),
    sin(8*x)/(a^2+b^2*cos(x)^2),
    sin(9*x)/(a^2+b^2*cos(x)^2),
    sin(10*x)/(a^2+b^2*cos(x)^2),
    sin(11*x)/(a^2+b^2*cos(x)^2)]:

print("time=",Calendar:-Format( Calendar:-Today(), "EEEE, MMMM dd, yyyy GG 'at' hh:mm:ss a" ));  
for item in T do
  current_time:=time[real]():
  int(item,x,method=_RETURNVERBOSE):
  print(" time to integrate is ",time[real]()-current_time);
od:
print("time=",Calendar:-Format( Calendar:-Today(), "EEEE, MMMM dd, yyyy GG 'at' hh:mm:ss a" ));  

"time=", "Wednesday, October 02, 2024 AD at 11:09:03 PM"

" time to integrate is ", 4.869

" time to integrate is ", 4.897

" time to integrate is ", 4.744

" time to integrate is ", 5.049

" time to integrate is ", 4.622

" time to integrate is ", 5.186

" time to integrate is ", 4.694

" time to integrate is ", 5.184

" time to integrate is ", 4.790

" time to integrate is ", 5.138

"time=", "Wednesday, October 02, 2024 AD at 11:09:52 PM"

 


 

Download why_int_timing_different_in_thread.mw

 

How to make Maple not use result of int() on same function it solved before? (this is for testing something else I am doing, and I will not use this in my main code).

I am trying to make some tests to compare things, and I'd like Maple to not remember last result.

But calling forget(int), it still seems to have remembered result it found before.

I also tried

         forget(int,forgetpermanent=true, subfunctions=true, reinitialize=true);

I do not ofcourse want to call restart in middle of loop.

Is there a way to make Maple forget result it obtained, in this example, from int()?

interface(version);

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

restart;

int_1:=sin(3*x)/(a^2+b^2*cos(x)^2);
int_2:=sin(4*x)/(a^2+b^2*cos(x)^2);

sin(3*x)/(a^2+b^2*cos(x)^2)

sin(4*x)/(a^2+b^2*cos(x)^2)

#first time it is slow
T:=time[real]():
int(int_1,x,method=_RETURNVERBOSE):
print("time used is ",time[real]()-T);

"time used is ", 9.477

T:=time[real](): #now it remembered last result
int(int_1,x,method=_RETURNVERBOSE):
print("time used is ",time[real]()-T);

"time used is ", 0.1e-2

forget(int); #this has no effect. It still complete much faster than first time

 

T:=time[real]():
int(int_1,x,method=_RETURNVERBOSE):
print("time used is ",time[real]()-T);

"time used is ", 0.95e-1

forget(int,forgetpermanent=true, subfunctions=true, reinitialize=true); #also this had no effect

T:=time[real]():
int(int_1,x,method=_RETURNVERBOSE):
print("time used is ",time[real]()-T);

"time used is ", 0.47e-1

#lets try different integral, now it is slow since new integral
T:=time[real]():
int(int_2,x,method=_RETURNVERBOSE):
print("time used is ",time[real]()-T);

"time used is ", 4.810

 


 

Download how_to_forget_without_restart.mw

 

It is probably not possible to use mutex with Grid. But I see no other option. 

I need to create a number of nodes in Grid to do parallel processing. But need to also make critical section around few places during execution  in the code (for example, writing to common file, or update SQLite db).

Grid package does not seem to have a command to do this. I found that the Threads package have mutex which is exactly what I wanted in order to make critical section.

But all my attempts to use mutex in the Grid fail. When I make mutex and pass it to Grid:-Launch call to be used by each node, I keep getting errors when it is used inside the node.

I do not know if I am just not passing it correctly, or simply Mutex is not supported in Grid. I tried many things, and none have worked.

If it is not supported, what other mechanism are there to allow one to synchronize access to some shared resource, so only one node is using at a time?

Grid has Wait and Barrier and WaitForFirst, but I do not see how these can be used for this.

Without the ability to be able to create critical section, then Grid package will not work for me.

Below is worksheet I have been using. I hope I am just making silly mistake in using the mutex with Grid.

ps. I prefer to use Grid and not Threads package to do parallel processing.

pps. I can see why mutex would not work in Grid, since mutex is process specific entity, and Grid uses completely separate processes for each node. So it will not work to use for synchronization between separate processes. But what else to use in Maple for this?

interface(version);

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

restart;

currentdir("C:/tmp"); #change as needed

"G:\public_html\my_notes\solving_ODE\current_version\tests\DB_with_GRID"

doall := proc(userData::list,mutex_to_use)
  local s::string, me:=Grid:-MyNode();
  local PROBLEM_ID::posint;
  local file_id;
  
  PROBLEM_ID:=userData[me+1];
  print("mutex is ",mutex_to_use);
  s:=cat("I'm node ",String(me)," of ",String(Grid:-NumNodes())," I will be processing problem ", String(PROBLEM_ID));
  print(s);

  
  file_id:=fopen(cat(currentdir(),"/log.txt"),APPEND);

  #I need to make sure only ONE node writes to this file
  #so not to lose buffer data
  
  Threads[Mutex][Lock]( mutex_to_use );
  fprintf(file_id,"%s\n",s);
  Threads[Mutex][Unlock]( mutex_to_use );
  
  
  fclose(file_id);
  Grid:-Barrier(); #wait here for all nodes to complete
end proc:

file_id:=fopen(cat(currentdir(),"/log.txt"),WRITE);

0

mutex_to_use := Threads[Mutex][Create]();
print("mutex created is ",mutex_to_use);
userData:=[$1..10];
Grid:-Launch(doall,codeargs=[userData,mutex_to_use],numnodes=5);
fclose(file_id);
Threads[Mutex][Destroy]( mutex_to_use );

2

"mutex created is ", 2

[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

"mutex is ", 2

"I'm node 4 of 5 I will be processing problem 5"

"mutex is ", 2

"I'm node 1 of 5 I will be processing problem 2"

Error, (in Threads:-Mutex:-Lock) invalid identifier given, no mutex with id %1

Error, (in Threads:-Mutex:-Lock) invalid identifier given, no mutex with id %1

"mutex is ", 2

"I'm node 2 of 5 I will be processing problem 3"

Error, (in Threads:-Mutex:-Lock) invalid identifier given, no mutex with id %1

"mutex is ", 2

"mutex is ", 2

"I'm node 3 of 5 I will be processing problem 4"

Error, (in Threads:-Mutex:-Lock) invalid identifier given, no mutex with id %1

"I'm node 0 of 5 I will be processing problem 1"

Error, (in Threads:-Mutex:-Lock) invalid identifier given, no mutex with id %1

 

 


 

Download using_mutex_in_grid.mw

 

I never used the Maple Grid package. I've been learning it in the last few hrs and it looks nice and could be something I can use to speed my very slow script.

I am trying to see if I can use it to do parallel processing instead of using Batch script and calling cmaple.exe manually to solve one problem at a time sequentially.

I got basic flow working in the example below. Basically it goes like this.

Call Grid:-Lauach to run 10 separate Maple processes in parallel. From help, Grid will run 10 separate server.exe's.

Passing the function to run the list of problems to processes.

At the of the function, when it is done solving the 10 problems, there is Barrier. So when all 10 nodes are completed, this run is done.

Then I repeate this, passing the next 10 problems to solve and so on.

The only thing I am not clear on from help if I should worry about node 0 or just treat it as any other node in terms of using it to solve a problem or not. It seems node 0 is special. So do I need to check if node 0 is the one being run and not use it?

Could someome who knows Grid package better please check and review this code and see if they find any issues with it? As I will be basing all my tests on this frame work if I find it speed things. 

From this basic test, it seems to work ok for all nodes, including node 0. 

doall := proc()
  local i, me:=Grid:-MyNode();
  local PROBLEM_ID::posint;
  global userData;

  PROBLEM_ID:=userData[me+1];
  print("I'm node ",me," of ",Grid:-NumNodes()," I will be processing problem ", PROBLEM_ID);     
  Grid:-Barrier(); #wait here untill all nodes are done
end proc:
 

userData:=[$1..10];
Grid:-Launch(doall,numnodes=10,imports=['userData']);

[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

"I'm node ", 1, " of ", 10, " I will be processing problem ", 2

"I'm node ", 2, " of ", 10, " I will be processing problem ", 3

"I'm node ", 0, " of ", 10, " I will be processing problem ", 1

"I'm node ", 3, " of ", 10, " I will be processing problem ", 4

"I'm node ", 6, " of ", 10, " I will be processing problem ", 7

"I'm node ", 9, " of ", 10, " I will be processing problem ", 10

"I'm node ", 8, " of ", 10, " I will be processing problem ", 9

"I'm node ", 4, " of ", 10, " I will be processing problem ", 5

"I'm node ", 7, " of ", 10, " I will be processing problem ", 8

"I'm node ", 5, " of ", 10, " I will be processing problem ", 6

userData:=[$11..20];
Grid:-Launch(doall,numnodes=10,imports=['userData']);

[11, 12, 13, 14, 15, 16, 17, 18, 19, 20]

"I'm node ", 2, " of ", 10, " I will be processing problem ", 13

"I'm node ", 4, " of ", 10, " I will be processing problem ", 15

"I'm node ", 1, " of ", 10, " I will be processing problem ", 12

"I'm node ", 3, " of ", 10, " I will be processing problem ", 14

"I'm node ", 5, " of ", 10, " I will be processing problem ", 16

"I'm node ", 0, " of ", 10, " I will be processing problem ", 11

"I'm node ", 6, " of ", 10, " I will be processing problem ", 17

"I'm node ", 7, " of ", 10, " I will be processing problem ", 18

"I'm node ", 9, " of ", 10, " I will be processing problem ", 20

"I'm node ", 8, " of ", 10, " I will be processing problem ", 19

userData:=[$21..30];
Grid:-Launch(doall,numnodes=10,imports=['userData']);

[21, 22, 23, 24, 25, 26, 27, 28, 29, 30]

"I'm node ", 3, " of ", 10, " I will be processing problem ", 24

"I'm node ", 8, " of ", 10, " I will be processing problem ", 29

"I'm node ", 4, " of ", 10, " I will be processing problem ", 25

"I'm node ", 0, " of ", 10, " I will be processing problem ", 21

"I'm node ", 1, " of ", 10, " I will be processing problem ", 22

"I'm node ", 5, " of ", 10, " I will be processing problem ", 26

"I'm node ", 9, " of ", 10, " I will be processing problem ", 30

"I'm node ", 2, " of ", 10, " I will be processing problem ", 23

"I'm node ", 7, " of ", 10, " I will be processing problem ", 28

"I'm node ", 6, " of ", 10, " I will be processing problem ", 27

userData:=[$31..40];
Grid:-Launch(doall,numnodes=10,imports=['userData']);

[31, 32, 33, 34, 35, 36, 37, 38, 39, 40]

"I'm node ", 5, " of ", 10, " I will be processing problem ", 36

"I'm node ", 6, " of ", 10, " I will be processing problem ", 37

"I'm node ", 1, " of ", 10, " I will be processing problem ", 32

"I'm node ", 7, " of ", 10, " I will be processing problem ", 38

"I'm node ", 3, " of ", 10, " I will be processing problem ", 34

"I'm node ", 4, " of ", 10, " I will be processing problem ", 35

"I'm node ", 2, " of ", 10, " I will be processing problem ", 33

"I'm node ", 8, " of ", 10, " I will be processing problem ", 39

"I'm node ", 9, " of ", 10, " I will be processing problem ", 40

"I'm node ", 0, " of ", 10, " I will be processing problem ", 31

 

 

Download using_GRID.mw

Currently I run my Maple script in a LOOP which calls cmaple.exe to solve one problem at a time.

So each iteration starts one cmaple.exe and waits for it to finish. Then next iteration repeates this for the next problem. i.e. starts new cmaple.exe process.

So it is sequential process and it can take 5-6 days or more to finish all the problems I have. Running 24 hrs per day.

I am thinking if I can run more than one cmaple.exe at same time, I could change this to have each script process say 10 problems at a time in one cmaple.exe, and have 100 such scripts running at same time. This will speed things a lot.

But this means I need to be able to run 100 cmaple.exe at same time.

I googled to see if there is a limit or any license issues/limitations in running that many cmaple.exe's at same time on same PC, but could not find anything.

Is there a limit in Maple itself to how many cmaple.exe can be running on same PC at same time?

There is no shared files or resources between these scripts, so each solving of a problem is independent. Only shared resource is Maple itself.

Maple 2024.1 

On my journey of discovery in the Maple world, which is new to me, I have now looked at the linear algebra packages. I am less interested in numerics than in symbolic calculations using matrices. I would like to illustrate this with the following task:

Let A be any regular (n; n) matrix over the real numbers for natural n. The regular (n; n) matrix X that solves the equation

X - A^(-1)*X*A = 0 for each A is to be determined. In this, A^(-1) is the inverse of A. Is there perhaps a symbolic solution for a specifically chosen n?

The solution to this old exercise is known. X is every real multiple of the unit/identity matrix, i.e. the main diagonal is occupied by a constant and all other matrix elements are zero.

I thought I had post with collection showing timelimit still hangs in Maple. But can't find it searching. I wanted to add this to it.

If someone finds such post, please let me know and I will append this to that post and delete this.

I just found another example where int() hangs all of Maple, using timelimit. I put timelimit of 30 seconds. After 2 hrs it is still running.

Maple 2024.1 on windows 10. This shows clearly that timelimit in Maple still does not work when It was supposed to have been fixed in Maple 2021?

For me, if there is anything that will make me stop using Maple for good, it is this timelimit issue.

Because with timelimit not working all the time, my program keeps hanging. It is not possible to do antything then. Having to keep checking if the program is still running or have hanged and restarting it is not a way to develop software.

Software that have been in development for almost 45 years now like Maple, should have figured by now how to implement timelimit that works. 

Note that, with smaller timelimit it is possible it will  not hang, because longer time limit makes it end in the code path which causes the hang. When I tried 5 seconds for example instead of 30 second, it did not hang With 30 it does. so if you try it and it does not hang, please increase the timelimit a little and it will surely hang. Just make sure to do restart each time, since Maple remembers last result.

maple's server.exe was running at full cpu also.

 

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

libname;

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

restart;

M:=-6*(3^(1/2)*(27*R^2-4)^(1/2)-9*R)^(1/3)/(-6*(3^(1/2)*(27*R^2-4)^(1/2)-9*R)^(1/3)*R+(-6*I*3^(1/6)-2*3^(2/3))*2^(1/3)+2^(2/3)*(I*3^(5/6)-3^(1/3))*(3^(1/2)*(27*R^2-4)^(1/2)-9*R)^(2/3));
try #this hangs
    timelimit(40,int(M,R));
    print("finished with no timeout");
catch:
    print("waiting for timeout");
end try;

-6*(3^(1/2)*(27*R^2-4)^(1/2)-9*R)^(1/3)/(-6*(3^(1/2)*(27*R^2-4)^(1/2)-9*R)^(1/3)*R+(-(6*I)*3^(1/6)-2*3^(2/3))*2^(1/3)+2^(2/3)*(I*3^(5/6)-3^(1/3))*(3^(1/2)*(27*R^2-4)^(1/2)-9*R)^(2/3))

 

 

Download int_hangs_with_timelimit.mw

 

Update OCT 10, 2024

This is another example showing hang in Maple 2024.1 using timelimit. So adding it to this collection. I had large collection of such problems but not able to find it now.

I was trying to verify this solution (which could very well be wrong) on ode with IC. timelimit hangs when I added assumptions as shown. Used 10,20,30 seconds, and so on. all hang. Waited and waited. 

Does it hang on other systems? I am using Windows 10 and Maple 2024.1 with 128 GB RAM on fast CPU.


 

sol:=y(x) = -8/9*x-11/9+1/9*arcsin(1/103*2509^(1/2)*tan(1/5*(x+5/2509*2509^(1/2)*arctan(1/2509*2509^(1/2)*(103*tan(37)+90*sec(37)))-1)*2509^(1/2))*(90*2509^(1/2)*tan(1/5*(x+5/2509*2509^(1/2)*arctan(1/2509*2509^(1/2)*(103*tan(37)+90*sec(37)))-1)*2509^(1/2))-103*(2509*tan(1/5*(x+5/2509*2509^(1/2)*arctan(1/2509*2509^(1/2)*(103*tan(37)+90*sec(37)))-1)*2509^(1/2))^2+2509)^(1/2))/(2509*tan(1/5*(x+5/2509*2509^(1/2)*arctan(1/2509*2509^(1/2)*(103*tan(37)+90*sec(37)))-1)*2509^(1/2))^2+10609)-90/103):
ode:=5*diff(y(x),x) = 7+10*sin(8*x+9*y(x)+11):
IC:=y(1) = 2:
func:=y(x);

y(x)

try
    timelimit(30,`assuming`([odetest(sol,[ode, op(IC)],func)],[positive, func::positive]));
catch:
    print("timed out OK");
end try;
print("After try/catch");

 

Download time_limit_hang_example_oct_10_2024.mw

I would like to officially offer $1,000 prize for any one who can solve the timelimit hanging problem in Maple. Will send you personal check of this amount if you find why it hangs and provide fix to use that I can verify works.

Bernoulli first order ode has form as show in wikipedia  and also on Maple own site as

Notice that it is P(x)*y above and not P(x)* y^(-1) so the y(x) must be linear in that term.   But when I give Maple this ode

ode:=diff(y(x),x) + x*y(x)^(-1)= y(x)^(-1);

Which is clearly not of the form above, it solves it as Bernoulli.  In the above ode, P(x) is x and Q(x) is 1 and n is -1.

The ode advisor correctly said it is separable. But trace shows it used Bernoulli. Also when asking it to solve it as Bernoulli, it does.

What Am I missing here?  Is it not wrong for Maple to use Bernoulli method on this ode which is not Bernoulli?

Worksheet below

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 1805 and is the same as the version installed in this computer, created 2024, September 3, 11:35 hours Pacific Time.`

libname;

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

restart;

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

diff(y(x), x)+x/y(x) = 1/y(x)

y(1) = 0

[_separable]

infolevel[dsolve]:=5;

5

dsolve(ode,y(x));  #why this says it solved it as Bernoulli ?

Methods for first order ODEs:

--- Trying classification methods ---

trying a quadrature

trying 1st order linear

trying Bernoulli

<- Bernoulli successful

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

dsolve(ode,y(x),[Bernoulli])

Classification methods on request

Methods to be used are: [Bernoulli]

----------------------------

* Tackling ODE using method: Bernoulli

--- Trying classification methods ---

trying Bernoulli

<- Bernoulli successful

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

 

 

Download why_this_ode_bernullli_sept_15_2024.mw

I am now running eveything in cmaple.exe for number of reasons. But I find the plot generated do not show grid lines as it does in worksheet (GUI). 

Below is worksheet I used, and below that the .mpl file used for command line with the command used.
 

interface(version);

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

restart;

plot(x, x=0..1, axis=[gridlines=[10, color=blue]]);

 


 

Download why_no_grid_in_cmaple_sept_15_2024.mw

Here is the T.mpl file

currentdir("C:/tmp");  #change as needed

#the following commnad below export a plot to a file

plotsetup(ps, plotoutput="t.ps",plotoptions=`color,noborder`);

p0:=plot(x, x=0..1, axis=[gridlines=[10, color=blue]]):

print(p0); #this will create t.ps in same folder

plotsetup(default); #rest back to default

quit;

 

Now I run the above as follows

"C:\Program Files\Maple 2024\bin.X86_64_WINDOWS\cmaple.exe"   T.mpl

Next I convert t.ps to t.pdf using Adobt PDF pro. The output is this

You see, there are no grid lines. I tried changing the color to BLUE, but it made no difference. Tried difference colors also. nothing worked.

Is there a way to keep the grid lines when using cmaple.exe?

I also attached  t.pdf converted by adobe from the .ps file. Mapleprime will not let me attached t.ps file.

t.pdf

 

 

Is this new error in Maple? I do not have older versions to check.

Solved this ode as series. When calling odetest on it, it gives this error as shown in worksheet below.

Maple 2024.1.

Any work arounds?
 

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 1805 and is the same as the version installed in this computer, created 2024, September 3, 11:35 hours Pacific Time.`

libname;

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

restart;

ode:=-(A/( (1-x)*x^4) - B/( x^4*(1-x)^2)+C/( (1-x)*x^2))*y(x)+1/(1-x)*diff(y(x),x)+diff(y(x),x$2)=0;

-(A/((1-x)*x^4)-B/(x^4*(1-x)^2)+C/((1-x)*x^2))*y(x)+(diff(y(x), x))/(1-x)+diff(diff(y(x), x), x) = 0

Order:=3;
maple_sol:=dsolve(ode,y(x),'series','point'=1);

3

y(x) = c__1*(x-1)^(1-(1-B)^(1/2))*(series(1-((-4*B+A+C)/((1-(1-B)^(1/2))^2+B-1))*(x-1)+((4*A*(1-(1-B)^(1/2))^2-10*B*(1-(1-B)^(1/2))^2+2*C*(1-(1-B)^(1/2))^2+A^2-4*B*A+2*A*C+6*B^2-6*B*C+C^2-4*A+10*B-2*C)/(((1-(1-B)^(1/2))^2+B-1)*((1-(1-B)^(1/2))^2+B+2-2*(1-B)^(1/2))))*(x-1)^2+O((x-1)^3),x = 1,3))+c__2*(x-1)^(1+(1-B)^(1/2))*(series(1-((-4*B+A+C)/((1+(1-B)^(1/2))^2+B-1))*(x-1)+((4*A*(1+(1-B)^(1/2))^2-10*B*(1+(1-B)^(1/2))^2+2*C*(1+(1-B)^(1/2))^2+A^2-4*B*A+2*A*C+6*B^2-6*B*C+C^2-4*A+10*B-2*C)/(((1+(1-B)^(1/2))^2+B-1)*((1+(1-B)^(1/2))^2+B+2+2*(1-B)^(1/2))))*(x-1)^2+O((x-1)^3),x = 1,3))

odetest(maple_sol,ode,'series','point'=1)

Error, (in odetest/series) when calling 'MultiSeries:-multiseries'. Received: 'unable to sort exponents, {(1-B)^(1/2), -(1-B)^(1/2), 1-(1-B)^(1/2), 1+(1-B)^(1/2), 2-(1-B)^(1/2), 2+(1-B)^(1/2), 3-(1-B)^(1/2), 3+(1-B)^(1/2), 4-(1-B)^(1/2), 4+(1-B)^(1/2)}, MultiSeries:-multiseries'

 


 

Download error_odetest_series_sept_14_2024.mw

I have number of worksheets open. I set each to use its own engine.

If I have one worksheet running a long loop that takes hrs to complete, or even if I have cmaple.exe running long script in command line, and then at same time I open new worksheet and type

             Physics:-Version(latest)

Then I always get this error

This is described here

It seems because Maple was busy running another worksheet. I never see this error if I am not running any other thing in Maple at the time. ( I actually try not to update Physics while running something else in Maple, but sometimes I do not notice that I have something else running).

When I wait for my other worksheet to finish, then close all of Maple and reopen Maple, I see the latest version is installed, at least this is what Physics:-Version() now says.

My question is:  Is it safe to do Physics:-Version(latest) even when Maple is busy running  computation in other separate worksheet or even running cmaple.exe from windows command line? Is there any concurrency/locking issue on the Physics library being updated while it is being open by another worksheet or another server.exe running in background?

All this is on windows 10 pro.

As a newbie in Maple2024, my next step is to try to solve a Diophantine equation. Attempts with isolve failed. It is the famous task B3 from the IMO of 1988:

If for integers x and y the fraction (x^2+y^2)/(1+x*y) is a positive integer, then it is actually a square number.

The solution is well known. But I would like to learn how to use Maple using this example and would like some advice.

Best regards, Alfred_F

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