Question: why using same plot generated x and y ranges in DEtools:-DEplot command do not always display the solution fully?

I use plot(sol,...) to plot solution of ode. I do not give x or y ranges and let Maple figure the best values. Then use the command 

T:=rhs~(indets(p, identical("originalview")=anything))[];    

To extract the x and y ranges used and then use these in the command DEtools:-DEplot(....)

The plot() command shows the solution plot fully (in this example below, the left and right sides).

But the  DEtools:-DEplot(....) only shows part of the solution on top of the slope field arrows.  Even though the same x and y ranges is used.

I found that if I increase the y range for the DEtools:-DEplot(....) by a little bit, now the full solution shows, which is same as plot command generated.

Since I am doing all this in code, without looking, I am first plotting the solution using plot() and then use the ranges generated for DEtools:-DEplot(....).

If I do not use the y range in DEtools:-DEplot(....) but only use the x range, sometimes it works and sometimes Maple gives warnings. (depending on the solution). So I am  back to using the ranges generated by plot() command to be safe.

Here is an example to show this problem

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

Now the x and y ranges used above is extraced

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

#gives

      T := [-9.94999999999999929 .. 9.94999999999999929, 
        -32.6629164062620561 .. 332.469298224442980]


                 from_x := -9.94999999999999929
                  to_x := 9.94999999999999929
                 from_y := -32.6629164062620561
                  to_y := 332.469298224442980

These are used in the DEplot

DEtools:-DEplot(ode,[y(x)],x=from_x..to_x,y=from_y ..to_y ,[IC],
                'dirfield'=[15,15],
                'labels'=[x,y(x)],
                'axes' = 'boxed',                
                'arrows'='smalltwo', #'curve', 
                'color' = 'blue',#color of arrows
                'linecolor'='red'#color of solution
                );

Notice how the solution (red line) is truncated.  It turns out in this case adding say 10% to the y range, it now shows the solution like this

DEtools:-DEplot(ode,[y(x)],x=from_x..to_x,y=from_y-(0.1*abs(from_y)) ..to_y ,[IC],
                'dirfield'=[15,15],
                'labels'=[x,y(x)],
                'axes' = 'boxed',                
                'arrows'='smalltwo', #'curve', 
                'color' = 'blue',#color of arrows
                'linecolor'='red'#color of solution
                );

But I do not know if this trick will work for each example. 

As I said, I can not give the y range to DEplot, then in this example, it will now show the full solution. But I have examples where this can cause warnings.

The question is, why giving same y range used by plot to DEplot cause the solution (red line) to truncate? Why one has to increase the y range to make it show the full solution?

Is there a better method that the above to make DEplot show full solution same as plot() does? 

Maple 2025.2

ps. I just tried upload the worksheet and now it works! it looks like mapleprimes web site is fixed.
 

interface(version);

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

ode:=diff(y(x),x) = x*(x^2+9)^(1/2);
IC:=y(-4) = 0;

diff(y(x), x) = x*(x^2+9)^(1/2)

y(-4) = 0

sol:=dsolve([ode,IC]);

y(x) = (1/3)*(x^2+9)^(3/2)-125/3

p:=plot(rhs(sol),'axes'='boxed','labels'=[x,y(x)],'axis'=['gridlines'=['color'='lightblue']],'color' = 'red');

 

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

[-9.94999999999999929 .. 9.94999999999999929, -32.6629164062620561 .. 332.469298224442980]

-9.94999999999999929

9.94999999999999929

-32.6629164062620561

332.469298224442980

DEtools:-DEplot(ode,[y(x)],x=from_x..to_x,y=from_y ..to_y ,[IC],
                'dirfield'=[15,15],
                'labels'=[x,y(x)],
                'axes' = 'boxed',                
                'arrows'='smalltwo', #'curve',
                'color' = 'blue',#color of arrows
                'linecolor'='red'#color of solution
                );

DEtools:-DEplot(ode,[y(x)],x=from_x..to_x,y=from_y-(0.1*abs(from_y)) ..to_y ,[IC],
                'dirfield'=[15,15],
                'labels'=[x,y(x)],
                'axes' = 'boxed',                
                'arrows'='smalltwo', #'curve',
                'color' = 'blue',#color of arrows
                'linecolor'='red'#color of solution
                );

 


 

Download example_phase_plot.mw

Please Wait...