Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168754
Image: ubuntu2004
# Let's look at the examples on the worksheet first. var('x,y') plot_vector_field((sin(x),cos(y)),(x,-pi,pi),(y,-pi,pi))
g = x^2 + x*y plot_vector_field(g.gradient(),(x,-2,2),(y,-2,2))
# Here's the same plot, except we show some of the level curves of g on the same axes. # Note how all the gradient vectors are perpendicular to the level curves. plot_vector_field(g.gradient(),(x,-2,2),(y,-2,2)) +\ contour_plot(g,(x,-2,2),(y,-2,2),fill=False,plot_points=100,contours=20,cmap='winter')
# Another example similar to the above, with sunnier contours. var('x,y') h = e^x*cos(y) plot_vector_field(h.gradient(),(x,-1,0.5),(y,0,2*pi)) +\ contour_plot(h,(x,-1,0.5),(y,0,2*pi),fill=False,plot_points=100,contours=15,cmap='autumn')