Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168747
Image: ubuntu2004
# Execute this first to serve notice that we need a lot of variables! var('x,y,z,t,r,a,b') FS = 8
F(x,y) = (1/2,-3/2) plot_vector_field( F(x,y), (x,-3,3), (y,-3,3), figsize=[FS,FS])
G(x,y) = (x,y) plot_vector_field( G(x,y), (x,-3,3), (y,-3,3), figsize=[FS,FS])
H(x,y) = (-y,x) plot_vector_field( H(x,y), (x,-3,3), (y,-3,3), figsize=[FS,FS])
K(x,y) = (x, x) plot_vector_field( K(x,y), (x,-3,3), (y,-3,3), figsize=[FS,FS])
L(x,y) = (-x/(x^2+y^2)^(3/2), -y/(x^2+y^2)^(3/2)) plot_vector_field( L(x,y), (x,-3,3), (y,-3,3), figsize=[FS,FS])
Q(x,y) = (x*(x-1), y*(y-1)) plot_vector_field( Q(x,y), (x,-3,3), (y,-3,3), figsize=[FS,FS])
## Flow lines of H H(x,y) = (-y,x) HPlot = plot_vector_field( H(x,y), (x,-3,3), (y,-3,3), figsize=[FS,FS]) P = [ parametric_plot( (r*cos(t)-sin(t),r*sin(t)+cos(t)), (t,0,2*pi), color="red", figsize=[FS,FS]) for r in range(0,4)] HPlot+P[0]+P[1]+P[2]+P[3]
## The gradient field J(x,y)=(y,x) and its flow lines, which are hyperbolas (including some degenerate ones). ## (Ignore the terrible programming style.) J(x,y) = (y,x) JPlot = plot_vector_field( J(x,y), (x,-3,3), (y,-3,3), figsize=[FS,FS]) a=1; b=-0.4; Q0 = parametric_plot( (a*exp(t)+b*exp(-t),a*exp(t)-b*exp(-t)), (t,-2,1), color="red", figsize=[FS,FS]) a=-1; b=-0.4; Q1 = parametric_plot( (a*exp(t)+b*exp(-t),a*exp(t)-b*exp(-t)), (t,-2,1), color="red", figsize=[FS,FS]) a=0.3; b=-0.4; Q2 = parametric_plot( (a*exp(t)+b*exp(-t),a*exp(t)-b*exp(-t)), (t,-2,2), color="red", figsize=[FS,FS]) a=0; b=-0.4; Q3 = parametric_plot( (a*exp(t)+b*exp(-t),a*exp(t)-b*exp(-t)), (t,-2,2), color="red", figsize=[FS,FS]) a=-0.3; b=-0.4; Q4 = parametric_plot( (a*exp(t)+b*exp(-t),a*exp(t)-b*exp(-t)), (t,-2,2), color="red", figsize=[FS,FS]) a=-1; b=0.4; Q5 = parametric_plot( (a*exp(t)+b*exp(-t),a*exp(t)-b*exp(-t)), (t,-2,1), color="red", figsize=[FS,FS]) a=1; b=0.4; Q6 = parametric_plot( (a*exp(t)+b*exp(-t),a*exp(t)-b*exp(-t)), (t,-2,1), color="red", figsize=[FS,FS]) a=0.3; b=0.4; Q7 = parametric_plot( (a*exp(t)+b*exp(-t),a*exp(t)-b*exp(-t)), (t,-2,2), color="red", figsize=[FS,FS]) a=0; b=0.4; Q8 = parametric_plot( (a*exp(t)+b*exp(-t),a*exp(t)-b*exp(-t)), (t,-2,2), color="red", figsize=[FS,FS]) a=-0.3; b=0.4; Q9 = parametric_plot( (a*exp(t)+b*exp(-t),a*exp(t)-b*exp(-t)), (t,-2,2), color="red", figsize=[FS,FS]) JPlot+Q0+Q1+Q2+Q3+Q4+Q5+Q6+Q7+Q8+Q9