Question: DEplot losses slope line when changing the ode's

I am plotting phase plot of two first order ode's.

I noticed when added +t to one ode, the plot generated losses all the slope fields. Any one knows why and if this is just limitation of DEplot or if there is a way to workaround it. 

THis worksheet has first example showing expected output, then second example where +t was added first ode. Now same code generates plot will all the slope field gone.


 

interface(version);

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

sys:=[diff(x(t),t)+diff(y(t),t) = x(t)+y(t), 2*diff(x(t),t)+diff(y(t),t) = 2*x(t)+3*y(t)];
DEtools:-DEplot(sys,[x(t), y(t)],
        t = 0 .. 200,x = -1000 .. 1000,y = -1000 .. 1000,
        [[x(0)=1, y(0)=2]],
        labels = [x(t), y(t)],
        linecolor =red,arrowsize = 1.5,axes = boxed,
        color = 'magnitude[legacy]')

[diff(x(t), t)+diff(y(t), t) = x(t)+y(t), 2*(diff(x(t), t))+diff(y(t), t) = 2*x(t)+3*y(t)]

#added +t to the RHS of one ode. Everything else the same.
sys_2:=[diff(x(t),t)+diff(y(t),t) = x(t)+y(t)+t, 2*diff(x(t),t)+diff(y(t),t) = 2*x(t)+3*y(t)];
DEtools:-DEplot(sys_2,[x(t), y(t)],
        t = 0 .. 200,x = -1000 .. 1000,y = -1000 .. 1000,
        [[x(0)=1, y(0)=2]],
        labels = [x(t), y(t)],
        linecolor =red,arrowsize = 1.5,axes = boxed,
        color = 'magnitude[legacy]')

[diff(x(t), t)+diff(y(t), t) = x(t)+y(t)+t, 2*(diff(x(t), t))+diff(y(t), t) = 2*x(t)+3*y(t)]

dsolve([op(sys),x(0)=1, y(0)=2]);

{x(t) = 3*exp(t)-2*exp(-t), y(t) = 2*exp(-t)}

dsolve([op(sys_2),x(0)=1, y(0)=2]);

{x(t) = 4*exp(t)-4*exp(-t)+1-3*t, y(t) = 4*exp(-t)-2+2*t}

 


 

Download strange_DEplot.mw

update

if someone is interested, I found Maple has builtin function to check if system of ode's is autonomous or not. So changed my code to check first. Here is how to check:


 

interface(version);

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

restart;

sys:=[diff(x(t),t)+diff(y(t),t) = x(t)+y(t), 2*diff(x(t),t)+diff(y(t),t) = 2*x(t)+3*y(t)];
if DEtools:-autonomous(sys,[x(t),y(t)],t) then
    DEtools:-DEplot(sys,[x(t), y(t)],
        t = 0 .. 200,x = -1000 .. 1000,y = -1000 .. 1000,
        [[x(0)=1, y(0)=2]],
        labels = [x(t), y(t)],
        linecolor =red,arrowsize = 1.5,axes = boxed,
        color = 'magnitude[legacy]');
else
  print("WARNING, non-autonomous system. Will not do phase plot");
fi;

[diff(x(t), t)+diff(y(t), t) = x(t)+y(t), 2*(diff(x(t), t))+diff(y(t), t) = 2*x(t)+3*y(t)]

#added +t to the RHS of one ode. Everything else the same.
sys_2:=[diff(x(t),t)+diff(y(t),t) = x(t)+y(t)+t, 2*diff(x(t),t)+diff(y(t),t) = 2*x(t)+3*y(t)];
if DEtools:-autonomous(sys_2,[x(t),y(t)],t) then
   DEtools:-DEplot(sys_2,[x(t), y(t)],
        t = 0 .. 200,x = -1000 .. 1000,y = -1000 .. 1000,
        [[x(0)=1, y(0)=2]],
        labels = [x(t), y(t)],
        linecolor =red,arrowsize = 1.5,axes = boxed,
        color = 'magnitude[legacy]');
else
  print("WARNING, non-autonomous system. Will not do phase plot");
fi;

[diff(x(t), t)+diff(y(t), t) = x(t)+y(t)+t, 2*(diff(x(t), t))+diff(y(t), t) = 2*x(t)+3*y(t)]

"WARNING, non-autonomous system. Will not do phase plot"

 


 

Download strange_DEplot_V2.mw

 

 

 

Please Wait...