Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You don't need to know the solution to use streamline_plot (I'm using cos(x) to show that your calculations are OK)

var('y')
s=streamline_plot(-sin(x),(x,-10,10),(y,-3,3),plot_points=100)
p=plot(cos(x),(x,-10,10),color='red')
s+p

Or

var('y')
pts = [(0,s) for s in srange(-3,3,0.5)]
s=streamline_plot(-sin(x),(x,-10,10),(y,-3,3),
                  start_points=pts, density=4,plot_points=100)
p=plot(cos(x),(x,-10,10),color='red') 
s+p

If you know the solution you can:

s=contour_plot(y-cos(x),(x,-10,10),(y,-5,5),fill=False,contours=20,linewidths=2)
p=plot(cos(x),(x,-10,10),ymax=5,ymin=-5,color='red')
s+p