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.0

Champs de vecteurs et intégrales de ligne

Quelques exemples ou considérations autour (ce n'est pas un jeu de mots) du calcul de CFdr\displaystyle \int_\mathcal{C} \mathbf{F} \cdot {\rm d} \mathbf{r}

Exemple

Nous avons considéré l'exemple ci-bas:

Exemple : Soit F(x,y)=yx2+x2e1+xx2+y2e2\mathbf{F}(x,y)=\frac{-y}{x^2+x^2}\mathbf{e}_1 + \frac{x}{x^2+y^2}\mathbf{e}_2. Montrer qu'il existe une fonction f(x,y)f(x,y) telle que F=f\mathbf{F} = \nabla f Soit C1\mathcal{C}_1 la trajectoire sur le cercle x2+y2=1x^2+y^2=1 joignant (1,0)(1,0) à (1,0)(-1,0), vérifiant y0y\geq 0, et C2\mathcal{C}_2 la trajectoire suivant la moitié inférieure du même cercle. Calculer C1Fdr\displaystyle \int_{\mathcal{C}_1} \mathbf{F}\cdot d\mathbf{r} etC2Fdr\displaystyle \int_{\mathcal{C}_2} \mathbf{F}\cdot d\mathbf{r}

Solution : Considérons d'abord la figure ci-bas. On y trouve le champ F\mathbf{F} ainsi que les deux trajectoires.

%display typeset 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

Nous voyons que le long de la trajectoire verte, le champ travaille dans le même sens que le mouvement (l'intégrale sera positive), tandis que le long de la trajectoire rouge, le champ pointe dans la direction contraire (l'intégrale sera négative). Nous avons vu en cours que f(x,y)=arctan(yx)f(x,y) = \arctan\left(\frac{y}{x}\right) est une fonction potentiel de F\mathbf{F}, c'est à dire que F=f\mathbf{F} = \nabla f. Voyons :

var('x,y') f(x,y)=arctan(y/x) f(x,y) F=f.gradient() html('Le champ gradient est $:%s$'%latex(F))
Le champ gradient est

Par ailleurs, nous avons aussi calculé C1Fdr=π\displaystyle \int_{\mathcal{C}_1} \mathbf{F}\cdot d\mathbf{r} = \pi et C2Fdr=π\displaystyle \int_{\mathcal{C}_2} \mathbf{F}\cdot d\mathbf{r} = -\pi.

Remarquons que la fonction potentiel ff n'est pas continue sur la région qui est parcourue par les deux trajectoires C1\mathcal{C}_1 et C2\mathcal{C}_2. Voici des graphiques illustrant ceci,

var('x,y') f(x,y)=arctan(y/x) C=contour_plot(f, (x,-1, 1), (y,-1, 1),fill=True, contours=50,cmap='hot',linestyles='solid',colorbar=True,plot_points=10) Grad=plot_vector_field(f.gradient(),(x,-1,1),(y,-1,1),plot_points=10,color='blue') show(C+Grad, figsize=5) Surf=plot3d(f,(x,-1,1),(y,-1,1), color='blue',opacity=0.65,figsize=5) show(Surf)
Image in a Jupyter notebook