catastrofe

1171 days ago by Marnix.VanDaele

reset() var('x r h ') p1=implicit_plot3d(h+r*x-x^3==0, (r,-3,5), (h,-3,3),(x,-3,3),color='red') p2=implicit_plot3d(r-1, (r,-3,5), (h,-3,3),(x,-3,3),color='blue') p3=implicit_plot3d(h-2, (-r,-3,5), (h,-3,3),(x,-3,3),color='green') p=p1+p2+p3 show(p,axes_labels=['r','h','x']) # p.save('i.bmp') 
       
reset() var('r h') r=-2 p1=implicit_plot(h+r*x-x^3==0, (h,-3,3), (x,-3,3),fill=true,fillcolor='pink',color='red',axes_labels=['$h$','$x$']) p=p1 if r>0: p2=implicit_plot(h+r*x-x^3==0, (h,-2/3*sqrt(1/3)*r^(3/2), 2/3*sqrt(1/3)*r^(3/2)), (x,-sqrt(r/3),sqrt(r/3)), fill=true,fillcolor='pink',color='red',linestyle='dashed') p=p1+p2 end arr1=arrow((-2.5,2.5), (-2.5,2),color='black',width=1) arr2=arrow((2.5,-2.5), (2.5,-2),color='black',width=1) show(p+arr1+arr2) 
       
reset() var ('r') h=0.5; p1=implicit_plot(h+r*x-x^3==0, (r,-3,3), (x,-3,3),fill=true,fillcolor='pink',color='red',axes_labels=['$r$','$x$']) p2=implicit_plot(h+r*x-x^3==0, (r,3*(1/2)^(2/3)*(abs(h))^(1/3),3), (x,-(1/2)^(1/3)*(abs(h))^(1/3),(1/2)^(1/3)*(abs(h))^(1/3)), fill=true,fillcolor='pink',color='red',linestyle='dashed') arr1=arrow((-2.5,2.5), (-2.5,2),color='black',width=1) arr2=arrow((2.5,-2.5), (2.5,-2),color='black',width=1) show(p1+p2+arr1+arr2) 
       
# dit hoort bij het voorbeeld van de insectenplaag r= 2*x^3/(1+x^2)^2 k= 2*x^3/(x^2-1) p=parametric_plot([k/10,5*r], (x, 1.0001, 45),fill=true,fillcolor='lightblue',color='blue',axes_labels=['$k$','$r$']) p.show(xmin=0, xmax=8, ymin=0, ymax=3.5)