Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

My first question: When using desolve_system_rk4(), is there a way to see the plots of the dependent variables vs. the independent variable? Thanks.

x,y,t=var('x y t')

x=function('x',t)

P=desolve_system_rk4([x(1-y),-y(1-x)],[x,y],ics=[0,0.5,2],ivar=t,end_points=20) P=P+desolve_system_rk4([x(1-y),-y(1-x)],[x,y],ics=[0,0.3,2],ivar=t,end_points=20) Q=[ [i,j] for i,j,k in P] LP=list_plot(Q)

Q=[ [j,k] for i,j,k in P]

Q=[ [j,k] for i,j,k in P] LP=list_plot(Q) show(LP) plot(x);plot(y) #Doesn't work

click to hide/show revision 2
No.2 Revision

My first question: When using desolve_system_rk4(), is there a way to see the plots of the dependent variables vs. the independent variable? Thanks.

 x,y,t=var('x y t')

x=function('x',t)

P=desolve_system_rk4([x(1-y),-y(1-x)],[x,y],ics=[0,0.5,2],ivar=t,end_points=20) P=P+desolve_system_rk4([x(1-y),-y(1-x)],[x,y],ics=[0,0.3,2],ivar=t,end_points=20) t') #x=function('x',t) P=desolve_system_rk4([x*(1-y),-y*(1-x)],[x,y],ics=[0,0.5,2],ivar=t,end_points=20) P=P+desolve_system_rk4([x*(1-y),-y*(1-x)],[x,y],ics=[0,0.3,2],ivar=t,end_points=20) Q=[ [i,j] for i,j,k in P] LP=list_plot(Q)

LP=list_plot(Q) # Q=[ [j,k] for i,j,k in P]

P] Q=[ [j,k] for i,j,k in P] LP=list_plot(Q) show(LP) plot(x);plot(y) #Doesn't work

work