Question: How do I contact points with a line (point plot)

Hello,

I am solving eq1 and then plot it using odeplot. Then I am extracting data from odeplot using op[1,1]. From that I only care about  one point so I am using pt[1] := dt[1]([1, 2]); then I ploted it using pointplot. I run a do loop and at the end I am ploting all the points.

My code works fine but I am trying to have a line contacting each points. I tried  style=line but it did not work.

How can I have a line contacting each points on my final plot (which is display([pl[1], seq(allpl[k], k = 1 .. 3)])) ?

This is my code:

> restart; with(DEtools); with(plots);
> with(DEtools); with(plots);
> A := 0.2e-1; B := 10^(-5); k := 0;
> eq1 := diff(X(t), t) = -(A+B*X(t))*X(t);

> ic[1] := X(365*k) = 1000;
> s[1] := dsolve({eq1, ic[1]}, X(t), range = 0 .. .365, numeric);
> p[1] := odeplot(s[1], [[t, X(t)]], t = 0 .. .365);
> dt[1] := op([1, 1], p[1]);
> pt[1] := dt[1]([1, 2]);
> pl[1] := pointplot(pt[1], axes = boxed);
> for k to 3 do
tk := 365*k;
A := rhs(s[k](tk)[2]);
ic[k+1] := X(tk) = 500.*A;
s[k+1] := dsolve({eq1, ic[k+1]}, X(t), range = tk .. 2*tk, numeric);
p[k+1] := odeplot(s[k+1], [[t, X(t)]], t = tk .. 2*tk);
dt[k+1] := op([1, 1], p[k+1]);
pt[k+1] := dt[k+1]([1, 2]);
pl[k+1] := pointplot(pt[k+1], axes = boxed);
allpl[k] := display([pl[k+1]])
end do;
> display([pl[1], seq(allpl[k], k = 1 .. 3)]);

 

Thank you

Please Wait...