Question: How to plot vector fields?

restart;

with(Physics):with(plots):with(DETools):

sys := {diff(r(t),t)=p(t)/m,
diff(p(t),t)=l^2/(m*r(t)^3)-n*k*r(t)^(n-1),
diff(phi(t),t)=l/(m*r(t)^2)};

{diff(p(t), t) = l^2/(m*r(t)^3)-n*k*r(t)^(n-1), diff(phi(t), t) = l/(m*r(t)^2), diff(r(t), t) = p(t)/m}

(1)

sys1:=subs({n=1,k=1},sys);

{diff(p(t), t) = l^2/(m*r(t)^3)-1, diff(phi(t), t) = l/(m*r(t)^2), diff(r(t), t) = p(t)/m}

(2)

conv:=plottools:-transform((a,b)->[a*cos(b),a*sin(b)]):

p1:=DEplot(sys1,[r(t),phi(t)],t=0..30,r=0..10,phi=0..2*Pi,stepsize=0.01);

Error, (in DEtools/DEplot) system must have same number of dependent variables as DE's.

 

plots:-display([conv(p1)],axiscoordinates=polar);

Error, (in conv) invalid argument

 

 


Could you help how to fix the code?

Download DEplot_v1.mw

Please Wait...