:

## follow-up on my second blog post

Maple

I'm posting it here to keep a record for myself.

my second blog post, aka "the lost blog post", is here.

Still some way to go. The following still needs to be tweaked case by case. And it can be made more compact too. Are the arrows flying so much faster in the top triangular area or are the arrows not printing where I expected them to ...

```restart;
Digits:=15:

getarrows := proc(x0, y0, xd, yd, T, x1, y1)
local DEsol, tm,j;
interface(warnlevel=0):
DEsol:= dsolve({xd,yd,x(0)=x0,y(0)=y0}, numeric,
events=[[y(t)-y1,halt],[x(t)-x1,halt],[x(t),halt]],
output=procedurelist);
tm:= floor(subs(DEsol(T),t));
seq(subs(DEsol(j), [x(t), y(t)]), j = 0 .. tm)
end proc:
xdot := diff(x(t),t) = x(t)-y(t):
ydot := diff(y(t),t) = y(t)*(1-x(t)):

T := 30:
xmax := 3:
ymax := 3:
DEsol:= dsolve({xdot,ydot,x(0)=1-1e-10,y(0)=1-1e-10},numeric,output=listprocedure):
t1 := fsolve(rhs(DEsol(t)[2])=0.05, t=-100..0);
x0 := rhs(DEsol(t1)[2]);
y0 := rhs(DEsol(t1)[3]);

y0 := [
seq(y0*(1-1e-1*i),i=1..5),
seq(y0*(1+1e-1*i),i=0..5),
seq(y0*(1-1e-2*i),i=1..5),
seq(y0*(1+1e-2*i),i=0..5),
seq(y0*(1-1e-3*i),i=1..5),
seq(y0*(1+1e-3*i),i=0..5),
seq(y0*(1-1e-4*i),i=0..5),
seq(y0*(1+1e-4*i),i=0..5)
]:
init1 := map2(getarrows, x0, y0, xdot, ydot, T, xmax, ymax):

DEsol := dsolve({xdot,ydot,x(0)=1+1e-10,y(0)=1+1e-10},numeric,output=listprocedure):
t1 := fsolve(rhs(DEsol(t)[3])=2, t=-50..-20);
x0 := rhs(DEsol(t1)[2]);
y0 := rhs(DEsol(t1)[3]);

y0 := [
seq(y0*(1-1e-1*i),i=1..5),
seq(y0*(1+1e-1*i),i=0..5),
seq(y0*(1-1e-2*i),i=1..5),
seq(y0*(1+1e-2*i),i=0..5),
seq(y0*(1-1e-3*i),i=1..5),
seq(y0*(1+1e-3*i),i=0..5),
seq(y0*(1-1e-4*i),i=1..5),
seq(y0*(1+1e-4*i),i=0..5)
]:
init2 := map2(getarrows, x0, y0, xdot, ydot, T, xmax, ymax):

init := [op(init1),op(init2)]:

DEtools[DEplot](
{xdot,ydot},
{x(t),y(t)},
t=-20..20,
[[x(0)=0.9999,y(0)=0.9999],[x(0)=1.0001,y(0)=1.0001]],
scene=[x(t),y(t)],
x=0..2, y=0..2.2,
arrows=smalltwo,
dirfield=init,
size=magnitude,
color=magnitude,
linecolor=black,
thickness=2,
numpoints=1000
);

```
```
```

﻿