Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168733
Image: ubuntu2004
# 2d vector plot f(x,y)=(1.25*x-0.25*x*y, 0.05*x*y-0.1*y) show(plot_vector_field(f, (x, 0, 10), (y, 0, 10)))
# 3d vector plot g(x,y,z)=(x,y,z) show(plot_vector_field3d(g, (x,-3,3),(y,-3,3),(z,-3,3)))
# interactive sin plot @interact def fun(a=(0,5),b=(0,5)): show(plot(sin(a*x)+sin(b*x),(x,0,10)))
# interactive vector plot @interact def fun(r=(1,4), a=(0.01,0.5), c=(0.01,0.5), d=(0.01,0.5)): f(x,y)=(r*x - a*x*y, a*c*x*y - d*y) show(plot_vector_field(f,(x,0,10),(y,0,10)))
from sage.calculus.desolvers import desolve_odeint N=var("N") t=srange(0,100,0.01) log_sol=desolve_odeint(0.1*N*(1-N/1000.0), 10, t, N) list_plot(zip(t,log_sol))
x,y=var('x,y') f=[x*(1-y),-y*(1-x)] t=srange(0,20,0.01) sol=desolve_odeint(f,[0.5,2],t,[x,y]) p1=list_plot(zip(t,sol[:,0])) p2=list_plot(zip(t,sol[:,1]), color="red") show(p1+p2)
list_plot(zip(sol[:,0],sol[:,1]))