nm

11538 Reputation

20 Badges

13 years, 113 days

MaplePrimes Activity


These are replies submitted by nm

@awass 

won't all that junk get added to all worksheets I open whether related to the project or not?

Your code in ini file will not be "added" physically to the worksheet. It is just read and in memory. The procs in your code that you read, are there now to be called if needed.  

If you do not want this option, then just use the other option, which is to add an explicit  read() at top of each worksheet that needs access to the shared code.

To reduce the chance of name conflict, you can put all your shared procs in its own module, so names of your functions to do not conflict with other ones already in the worksheet.

May be call your module my_shared_code and now one needs to explictly add my_shared_code:-foo()  to call function in your module. So no chance of conflict.

I myself do this and do not use the maple ini file and just use .mla and modules in .mpl files and just add it to libname.

But I was just giving you options to look at.

@minhthien2016 

The error you get is because solve itself returned no solution. So decr was NULL.

To make your code more robust, should add a check on result of solve to make sure it worked before using it in the next line.

@janhardo 

I have 2024 version of Maple programming guide. I see one example in 9.2 and that has no call made out from the constructor.

Can you post screen shot of the one you found showing the call?

Which edition of the Maple programming guide that you saw this call?

 

@acer 

Thanks for both answers. +1 for both. I did not know about 'De'

Is there a reason to use 

expr:=y(3)+y(8)+5*(D@@2)(y)(4)+Pi+3*exp(2)+77*D(y)(0)+1/(D@@4)(y)(7);	
indets(expr, And(':-De',Not(typefunc(Not(constant),anything))));

vs. 

indets(expr, And(':-De',typefunc(constant,anything)));

i.e. remove the two `Not`? They both give same answer on this example. So was not sure if there is a subtle reason to use double `Not` that is needed for may be other cases?

V 2025.1

fyi, another software has command called findinstance, which finds the solution for reals. Maple does not have such a command as far as I know. May be future version of Maple can have such a command as it is very useful.

@Kitonum 

Maple simply does not know which branch should be returned.

But an ode can have more than one solution.

And if for some reason Maple does not want to return more than one explicit solution, why not return implicit solution. This is what the textbook does.

The way it is now, a student thinks this ode has no solution and the book is wrong. But the book solution is not wrong.

@janhardo 

I can enlarge screen in windows 11 pro  with Ctrl + Middle mouse wheel ?

unfornuately, this has no effect for me on Linux KDE desktop.

@ecterrab 

someone deleted my question. I find this very rude. 

What if I no longer have record of my question? How could someone just delete someone question like this. If they have comment, they can add comment suggesting to move the question here. This what normal civilized people do.

This is my last post in this forum. I am done and will not post any bugs I find in Maple or ask any questions or answer anything. 

@aroche 

Fyi, I've been testing V 27, but found case where this problem still shows up and not fully fixed. (may be this is not related to same issue that causes the problem in this post?)

I've posted separate question on this so not to clutter this.
[moderator: It's been deleted, as a duplicate. Put it here, in this same Question, in a new Reply]

@aroche 

Thanks for the quick fix.

But I  was wondering why not have `assuming/restore_previous_state`; be done automatically by Maple internally at the end of timelimit expiration, since this call is now there?

If someone have 100's of calls to timelimit in code in different modules, it means they need to insure and remember to add this call now in the catch clause each time in order to make sure Maple cleans any assumptions still attached to variables.

This is good fix for now, but I think for long term, it will be better if such clean up work is done internally and automatically by Maple. No?

Also, many users will not know about this new call and that they have to do it ( unless they read this post in Mapleprimes)

Will run tests now on V 26. 

Thanks again for the update. very useful. I think this was causing many problems before for me, since I use different assuming all over the place to try to find one which will make odetest verify solutions.

ps. I just found Error, (in type/complex) too many levels of recursion. still shows in V 26 and only when adding Physics:-Setup('assumingusesAssume'=true): but do not know if this is new or not. No time to check older versions.  new quesiton posted on this fyi.

@ecterrab 

Until then, you will be able to just add "`assuming/restore_previous_state`" to the catch branch, as in "try timelimit(...) catch: `assuming/restore_previous_state` end try". 

I wanted to try the above while waiting for official fix in next SupportTools.

So I tried what you suggested, but I see assumptions still stuck to variables after the timelimit(). I expected no assumption to be on these variables.

I must be not typing something right. I made sure to copy exactly what you had.

Can you please provide actual worksheet with this working? Here is my worksheet. I use worksheet mode, not document mde.

interface(version);

`Standard Worksheet Interface, Maple 2025.0, Linux, March 24 2025 Build ID 1909157`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1873 and is the same as the version installed in this computer, created 2025, May 18, 21:44 hours Pacific Time.`

SupportTools:-Version();

`The Customer Support Updates version in the MapleCloud is 25 and is the same as the version installed in this computer, created June 3, 2025, 12:17 hours Eastern Time.`

restart

 

#this shows no assumptions on y(x);
ode:=y(x)*sqrt(1 + diff(y(x), x)^2) - a*y(x)*diff(y(x), x) - a*x = 0:
sol:=-_C4^2 + (-y(x)*sqrt(_C4^2/y(x)^2) + a*x)^2/a^2 + y(x)^2 = 0;
hasassumptions(y(x));
getassumptions(y(x));

-_C4^2+(-y(x)*(_C4^2/y(x)^2)^(1/2)+a*x)^2/a^2+y(x)^2 = 0

false

{}

#now use a command that uses assuming
Physics:-Setup('assumingusesAssume'=true):
try
    timelimit(10,(odetest(sol,ode,y(x)) assuming integer)):
catch:
   print("cought exception, will now call restore state...");
  `assuming/restore_previous_state`;  #is this correct syntax?
end try;

"cought exception, will now call restore state..."

`assuming/restore_previous_state`

hasassumptions(y(x));
getassumptions(y(x));

true

{a::integer, x::integer, (-(-csgn(1/y(x))*a*x+(csgn(1/y(x))^2*a^2*x^2+y(x)^2*a^4+a^4*x^2-y(x)^2*a^2-a^2*x^2)^(1/2))/(a^2-1)+x)::0, ((csgn(1/y(x))*a*x-(csgn(1/y(x))^2*a^2*x^2+y(x)^2*a^4+a^4*x^2-y(x)^2*a^2-a^2*x^2)^(1/2))/(a^2-1)-x)::0, ((csgn(1/y(x))*a*x+(csgn(1/y(x))^2*a^2*x^2+y(x)^2*a^4+a^4*x^2-y(x)^2*a^2-a^2*x^2)^(1/2))/(a^2-1)-x)::0, ((csgn(1/y(x))*a*x+(csgn(1/y(x))^2*a^2*x^2+y(x)^2*a^4+a^4*x^2-y(x)^2*a^2-a^2*x^2)^(1/2))/(a^2-1)+x)::0}

 

 

Download how_to_use_restore_june_3_2025.mw

@aroche 

Thanks for the quick fix. I am running more tests now using V 25...

@aroche 

Thanks for V 23. I did more tests, but I am afraid the bug is still here. Please see worksheet below 

interface(version);

`Standard Worksheet Interface, Maple 2025.0, Linux, March 24 2025 Build ID 1909157`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1873 and is the same as the version installed in this computer, created 2025, May 18, 21:44 hours Pacific Time.`

SupportTools:-Version();

`The Customer Support Updates version in the MapleCloud is 23 and is the same as the version installed in this computer, created June 2, 2025, 12:08 hours Eastern Time.`

restart;

sol:=y(x) = -(LambertW(-exp(-1/2*x))+1)^2+x;
ode:=diff(y(x),x) = (x-y(x))^(1/2);
IC:=y(2) = 2;

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

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

y(2) = 2

odetest(sol,[ode, IC]) assuming x < 1;

Error, (in AndProp:-UseCache) too many levels of recursion

odetest(sol,[ode, IC]);

[-csgn(LambertW(-exp(-(1/2)*x))+1)*LambertW(-exp(-(1/2)*x))-csgn(LambertW(-exp(-(1/2)*x))+1)+LambertW(-exp(-(1/2)*x))+1, 0]

 

 

Download AndProb_still_problem_june_3_2025.mw

When going back to V 21, the problem goes away:

interface(version);

`Standard Worksheet Interface, Maple 2025.0, Linux, March 24 2025 Build ID 1909157`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1873 and is the same as the version installed in this computer, created 2025, May 18, 21:44 hours Pacific Time.`

SupportTools:-Version();

`The Customer Support Updates version in the MapleCloud is 23. The version installed in this computer is 21 created May 28, 2025, 23:36 hours Eastern Time, found in the directory /home/me/maple/toolbox/2025/Maple Customer Support Updates/lib/Maple`

restart;

sol:=y(x) = -(LambertW(-exp(-1/2*x))+1)^2+x;
ode:=diff(y(x),x) = (x-y(x))^(1/2);
IC:=y(2) = 2;

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

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

y(2) = 2

odetest(sol,[ode, IC]) assuming x < 1;

[-csgn(LambertW(-exp(-(1/2)*x))+1)*LambertW(-exp(-(1/2)*x))-csgn(LambertW(-exp(-(1/2)*x))+1)+LambertW(-exp(-(1/2)*x))+1, 0]

odetest(sol,[ode, IC]);

[-csgn(LambertW(-exp(-(1/2)*x))+1)*LambertW(-exp(-(1/2)*x))-csgn(LambertW(-exp(-(1/2)*x))+1)+LambertW(-exp(-(1/2)*x))+1, 0]

 

 

Download AndProb_no_problem_june_3_2025_V21.mw

@MichalKvasnicka 

I understand I can remove the tag. But someone always seems to enjoy adding "duplicate question" tag to many of my questions. I have no idea why.

If question is duplicate, then say where is the duplicate and why it is . This is what happens at stackexchange. 

But doing it like this, while hiding away, I find is very rude and very childish behavior. No explanation and no word given. 

I found a new bug in V 22 which was just released 2-3 hrs ago. And someone already said this is duplicate.

who tagged this as duplicate question? Duplicate of what? THis is new bug in V 22 just found now. How could this be duplicate?

It is very rude to tag question as duplicate like this with no explanation.

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