nm

11693 Reputation

20 Badges

13 years, 155 days

MaplePrimes Activity


These are replies submitted by nm

@acer 

thanks. obsrange=false worked well. No need to adjust y range any more. I did not know about it.  As for plots:-odeplot help says it is used to plot solution from dsolve with numeric option. Which I do not use.

I can't find example now where DEtools:-DEplot was giving warnings when no y-range is used. If I find one will update.

As for rangesonly  I used it before, but for some reason I replaced it sometime ago. I do not know why. May be later was better. I have no comment to say why

   try 
        #T:=plottools:-getdata(p,'rangesonly');
        T:=rhs~(indets(p, identical("originalview")=anything))[];      
    catch:
     ....

It could be that originalview gave "better" values. I do not remember. It was few years ago.

Update

Found an example where using rhs~(indets(p, identical("originalview")=anything)) works better than plottools:-getdata(p,'rangesonly'); and this is probably why I changed to it.

In this example, using getdata(p,'rangesonly'); gives much larger y range than "originalview".

interface(version);

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

ode:=diff(y(x),x) = 1/x^2;
IC:=y(1) = 5;
sol:=dsolve([ode,IC]);
p:=plot(rhs(sol),'axes'='boxed','labels'=[x,y(x)],'axis'=['gridlines'=['color'='lightblue']],'color' = 'red');

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

y(1) = 5

y(x) = -1/x+6

 

 

T:=rhs~(indets(p, identical("originalview")=anything))[];     
from_x := op(1,T[1]);
to_x   := op(2,T[1]);
from_y := op(1,T[2]);        
to_y   := op(2,T[2]);

[-.1000000000 .. .2500000000, -30. .. 40.]

-.1000000000

.2500000000

-30.

40.

T:=plottools:-getdata(p,'rangesonly');    
from_x := op(1,T[1]);
to_x   := op(2,T[1]);
from_y := op(1,T[2]);        
to_y   := op(2,T[2]);  

[-0.991250000006402843e-1 .. .249125000002095476, -496789.511752721155 .. 711542.165524577722]

-0.991250000006402843e-1

.249125000002095476

-496789.511752721155

711542.165524577722

 

 

Download difference_in_plottools_getdate.mw

@acer 

I am using https. 

I have not changed anything on my end. Using same link and same steps I always did. Only now can't upload worksheet anymore.

@janhardo 

Sorry, I do not understand what you mean by the solution is to use https://www.mapleprimes.com  ?

I was on https://www.mapleprimes.com and opened new question and when I click the green arrow, not able to upload worksheet. Once I click the "upload" button, it gives this error security message and kicks me out.

What exactly should I change in these steps?

@FDS 

Try this. Use worksheet mode (not document mode) and remove all the libs you have in your libname, keeping only Physics, Support and Maple main library.

i,e, do this in new worksheet (based on what you showed, only the first 3 libs)

restart;

#new cell

libname:=libname[1],libname[2],libname[3];
ode:=x*y(x)*diff(y(x),x)^2+(a+x^2-y(x))*diff(y(x),x)-y(x)*x=0;

And see if this makes any difference.  If not, then I do not know why you are getting these errors. Maybe support could help.

@KonstantinW 

"Now I can install and use 2025.2 without issues?"

No, what I meant is first install Maple 2025.2, then install Physics using the menu (which you call the cloud). Then close Maple and restart it. Now all should be OK. You will have Physics update package installed.

So do the Physics installation on 2025.2 itself.

This for me worked. But I am using windows 10. I do not know if there is issue using windows 11 or not.

I've had same problem after updating to Maple 2025.2.

For very first time, after installing 2025.2, I had to install Physis from menue. See How-To-Install-Physics-Updates-Package

Then it works. Make sure to close all Maple after that.

Once Physics is installed first time using menu method, you can then use the command Physics:-Version(latest) from inside the worksheet to update it in the future.

But not first time after a new release of Maple.

I do not know why it says for you that latest physics is installed on your computer. This sounds like just a bug in how it checks.

Btw, when I first installed 2025.2 and used Physics:-Version(), for me on windows 10, it just said

  `The "Physics Updates" package is not available for the version of Maple under development`

And not what you show. i.e. only this message. No error messages.

Strange that you are getting error messages as you show. It could be because you are using windows 11. I am using windows 10.  Do not know.

Anyway, Try to install Physics update from the menu and see if this works for you.

@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

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