nm

11643 Reputation

20 Badges

13 years, 144 days

MaplePrimes Activity


These are replies submitted by nm

@Preben Alsholm 

Thanks for suggestion. I assume when you say "works", is that it returned sqrt(sin(x)^2) for you?

In this case, It does not work in Maple 2025.2. i.e. it does not return sqrt(sin(x)^) but instead it returns abs(sin(x)) which I do not like it either for readbility.

interface(version);

`Standard Worksheet Interface, Maple 2025.2, Windows 10, November 11 2025 Build ID 1971053`

libname;

"C:\Users\me\maple\toolbox\2025\Physics Updates\lib", "C:\Users\me\maple\toolbox\2025\Maple Customer Support Updates\lib", "C:\Program Files\Maple 2025\lib"

restart;

A:=sqrt(1-cos(x)^2)

(1-cos(x)^2)^(1/2)

simplify(A) assuming x::real;

abs(sin(x))

 

 

Download simplify_dec_3_2025_V2.mw

I understand that simplification is 60% art and 40% math. So getting the right "optimal" looking simplification is not always easy.

But I try to avoid results with csgn, signum and abs in them unless there is no other option ofcourse.

This is because having these show in long expression makes reading the result harder. 

@dharr 

I actually use ps driver with color (see my question above and the example I send to tech support). But was trying 

plottools:-exportplot

But I am afraid this whole workaround is not practical to use. This is all done in code. And the program does not know to draw the grid lines separatly for different plots, since it needs to figure out all these ranges which are now hardcoded in the workaround. So this part needs to be automated. i.e. in Maple UI one can just do

p:=plot(x^3, x = -8 .. 8, color = "blue",axis=[gridlines=[color="red"]]):

And Maple figures out the gridline spacings.

The workaround for this specific example draws the gridline manually using

g := seq(plot(y, x=-8..8, color=red), y=[seq](-500..500, 100)), seq(plot([[x, -500], [x, 500]], color=red), x=[seq](-8..8, 2)):

But how is the code supposed to know what ranges to use to draw the grid lines, as the plots are all different. So unless the program can figure these values on the fly, this approach is not possible to use, unless there is an easy way to figure these out from current plot, and then redraw the plot again using the grid lines.

@sand15 

Thanks for the workaround, but unfortunately this does not work for file .ps (I used png and jpeg as examples, since easier). But in actual application I use .ps then convert the .ps to pdf and then include the pdf in latex since pdf is vector image. Vector graphics are better for display since they do not depend on resolution of device.

So when I changed your code, replacing "test.jpeg" by "test.ps" keeping everthing the same, Maple generated .ps OK, but after converting the .ps to pdf using adobe pdereader PRO, I see no colors at all. The grid lines are there, but all colors are gone.

Attached is the pdf file. 

You can try this yourself and see also.

test.pdf

@acer 

"Just as a check, does it also fail to produce those expected gridlines in the commandline-interface's exported image file if you use another format like bmp or gif?"

On windows 10 pro, it fails for all types including ps

All these produce plot with no grid lines.

"What if you use the command,
    Export( .... )"

It also fails. That is how I had my code first, using export. I was trying 

plottools:-exportplot

Just to see if it will do better. Here is the code using plotsetup I tried

> plotsetup("jpeg", plotoutput="A.jpeg",plotoptions=`color,noborder,gridlines`);
> p:=plot(x^3, x = -8 .. 8, color = "blue",axis=[gridlines=[10,color="red"]]):
> print(p);
>

Same problem. No grid lines. It does not accept "png" for some reason.

I also tried export instead of print

But same problem. No grid lines

 

"It seems to work OK for me in the commandline-interface on Linux"

Are you sure?? I was on linux for 3 months, Maple 2025.1 and could never get it to work, so I moved back to windows. 

Could you show exactly what commands you used on linux cmaple? May be it depends on which version of Linux also. I was using CachyOS (Arch based linux).  I have PC next to me I could install same Linux you used and install Maple trial version and try it to see. 

It also does not work if I run cmaple.exe directly from inside WSL which is running Ubuntu Linux. No grid lines.

May be I am not using the correct command or option somewhere, that is why I asked.

Unable to update for Maple 2025.2 on Linux. Keep getting this error

I tried many times. Also booted PC. No difference.

Do you support Linux Maple for update or just windows?

I downloaded the update Maple 2025.2, but could find no instructions on your web page what to do after downloading the update. All what it says is to click to download the update. But does not say what to do after that.

@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.

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