Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Quelques notebooks SAGE / Python. Équations différentielles ou calcul multivariable.

Project: Calcul Libre
Views: 1413
Image: ubuntu2004
Kernel: SageMath 9.2

Indépendance de la trajectoire ou trajectoires fermées

On considère le champ de vecteurs F(x,y)=(3x2−3,12−3y2)\mathbf{F}(x,y) = (3x^2 - 3, 12-3y^2), et on s'intéresse au travail effectué le long d'une trajectoire fermée C\mathcal{C} (ou le long de deux trajctoires avec mêmes origine / but)

%display typeset var('x,y') f(x,y) = x^3 -3*x-y^3 +12*y xmin, xmax, ymin, ymax = -2.5, 2.5, -2.5, 2.5 Champ = plot_vector_field(f.gradient(), (x,xmin,xmax), (y,xmin,xmax), color= "grey", plot_points = 12) C=contour_plot(f(x,y), (x,xmin,xmax), (y,xmin,xmax), cmap = "Spectral", fill = False, contours = 15, colorbar = True, axes = True, label_inline=True, label_fontsize=8, axes_labels=["$x$","$y$"]) C1 = parametric_plot([-1,t], (t,0,1), color = "red",thickness = 3) C2 = parametric_plot([cos(t), 1+sin(t)], (t,0,pi), color = "red",thickness = 3) C3 = parametric_plot([1,t], (t,-2,1), color = "red",thickness = 3) C4 = parametric_plot([2*t-1,-2*t], (t,0,1), color = "black", thickness = 3 ) show(Champ + C+ C1 + C2 + C3 +C4, aspect_ratio = 1)
Image in a Jupyter notebook
C1 = parametric_plot([-1,t], (t,0,1), color = "red") C2 = parametric_plot([cos(t), 1+sin(t)], (t,0,pi), color = "red") C3 = parametric_plot([1,t], (t,-1,1), color = "red") show(C1 + C2 + C3)
Image in a Jupyter notebook
cm = colormaps.Spectral def c(x,y) : return float((f(x,y) + 24 )/48) S = plot3d(f, (x,xmin,xmax), (y,xmin,xmax), color = (c,cm), viewer = "threejs", opacity = 0.75) T1 = parametric_plot3d([-1,t,0], (t,0,1), color = "red", thickness = 1, linestyle = "dotted") T2 = parametric_plot3d([cos(t), 1+sin(t),0], (t,0,pi), color = "red", thickness = 1) T3 = parametric_plot3d([1,t,0], (t,-2,1), color = "red", thickness = 1) T4 = parametric_plot3d([-1,t,f(-1,t)], (t,0,1), color = "red", thickness = 4) T5 = parametric_plot3d([cos(t), 1 + sin(t), f(cos(t),1+sin(t))], (t,0,pi), color = "red", thickness = 4) T6 = parametric_plot3d([1, t, f(1,t)], (t,-2,1), color = "red", thickness = 4) T7 = parametric_plot3d([2*t-1,-2*t, 0], (t,0,1), color = "black", thickess=1) T8 = parametric_plot3d([2*t-1,-2*t, f(2*t-1,-2*t)], (t,0,1),color = "black", thickess=4) show(S+ T4+T5 + T6 + T8 , aspect_ratio = [4,4,1])
var('x,y,t') Champ=plot_vector_field( (-y/(x^2+y^2), x/(x^2+y^2)), (x, -1.2, 1.2), (y, -1.2, 1.2),color="blue",aspect_ratio=1,plot_points=10,figsize=6) C1=parametric_plot([cos(t),sin(t)],(t,0,pi), color="green", thickness=3) C2=parametric_plot([cos(t),-sin(t)],(t,0,pi), color="red", thickness=3) show(Champ + C1 + C2)
Image in a Jupyter notebook
parametric_plot3d?
parametric_plot3d([-1,t,0], (t,0,1), color = "darkgreen",thickness = 3)