2 \documentclass{article
}
3 \usepackage[a4paper,margin=
2cm
]{geometry
}
4 \usepackage[T1]{fontenc}
5 \usepackage[latin1]{inputenc}%
6 \usepackage[garamond
]{mathdesign
}
7 \usepackage{pst-eqdf,pst-node,pst-tools
}
8 \usepackage{array,amsmath
}
10 \newpsstyle{vecteurA
}{arrowinset=
0.05,arrowsize=
0.1,linecolor=
{[rgb
]{1 0.5 0}}}
11 \newpsstyle{vecteurB
}{arrowinset=
0.05,arrowsize=
0.1,linecolor=
{[rgb
]{0 0.5 1}}}
12 \newpsstyle{vecteurC
}{arrowinset=
0.1,arrowsize=
0.2,linecolor=
{[rgb
]{1 0 0}}}
14 \begin{filecontents
}{pb2corps.dat
}
218 \title{Gravitation : le problème des deux corps avec PSTricks\\ partie
2}
219 \date{5 juillet
2\,
012}
222 \section{Mouvements dans le repère inertiel
}
223 On considère un système de deux corps en interaction gravitationnelle $M_1$ de masse $m_1$ et $M_2$ de masse $m_2$ dans le repère galiléen
\textit{inertiel
} $
\mathcal{R
}$. Ils sont supposés ponctuels.
225 \begin{pspicture
}(-
3,-
1)(
5,
6)
226 \psgrid[subgriddiv=
0,gridcolor=lightgray,griddots=
10,gridlabels=
0pt
]%
227 \pstVerb{/x01 -
2 def /y01
1 def
228 /x02
5 def /y02
4 def
234 /xG0 x01 M1 mul x02 M2 mul add Mt div def
235 /yG0 y01 M1 mul y02 M2 mul add Mt div def
}%
240 \pscircle[fillstyle=solid,fillcolor=red!
50](M1)
{0.21}
241 \pscircle[fillstyle=solid,fillcolor=blue!
50](M2)
{0.07}
243 \psline[linestyle=dotted
](M1)(M2)
244 \psline[linestyle=dashed
](M2)(O)(M1)
245 \psline{<->
}(
5,
0)(
0,
0)(
0,
6)
249 \uput[l
](
0,
5.8)
{$
\mathcal{R
}$
}
250 \uput{0.22}[l
](M1)
{$M_1$
}
251 \uput{0.1}[u
](M2)
{$M_2$
}
253 \pcline[offset=
5pt,linestyle=none
](M1)(M2)
254 \ncput*
[nrot=:U
]{$r$
}
255 \rput(M1)
{\psline[style=vecteurC
]{->
}(!xr0
5 div yr0
5 div)
\uput[u
](!xr0
10 div yr0
10 div)
{$
\overrightarrow{F
}_
{2/
1}$
}}
256 \rput(M2)
{\psline[style=vecteurC
]{->
}(!xr0
5 div neg yr0
5 div neg)
\uput[u
](!xr0
10 div neg yr0
10 div neg)
{$
\overrightarrow{F
}_
{1/
2}$
}}
259 On note $
\overrightarrow{r
}=
\overrightarrow{M_1M_2
}$. $M_2$ subit de la part de $M_1$ une force attractive $
\overrightarrow{F
}_
{1/
2}$ et réciproquement $M_1$ subit de la part de $M_2$ une force attractive $
\overrightarrow{F
}_
{2/
1}$ telles que :
261 \overrightarrow{F
}_
{1/
2}=-
\mathcal{G
}\frac{m_1m_2
}{r^
3}\overrightarrow{r
}\quad \overrightarrow{F
}_
{2/
1}=+
\mathcal{G
}\frac{m_1m_2
}{r^
3}\overrightarrow{r
}
263 La loi de Newton appliquée à chacune des particules s'écrit :
265 m_1
\frac{\mathrm{d
}^
2\overrightarrow{r
}}{\mathrm{d
}t^
2}=
\hphantom{-
}\mathcal{G
}\frac{m_1m_2
}{r^
3}\overrightarrow{r
}
268 m_2
\frac{\mathrm{d
}^
2\overrightarrow{r
}}{\mathrm{d
}t^
2}=-
\mathcal{G
}\frac{m_1m_2
}{r^
3}\overrightarrow{r
}
270 Sachant que $r=
\sqrt{(x_
{2}-x_
{1})^
2+(y_
{2}-y_
{1})^
2}$, nous obtenons un système de quatre équations différentielles :
274 \ddot{x_1
}=
\hphantom{-
}\mathcal{G
}\displaystyle\frac{m_2
}{r^
3}(x_2-x_1)\\
[1em
]
275 \ddot{y_1
}=
\hphantom{-
}\mathcal{G
}\displaystyle\frac{m_2
}{r^
3}(y_2-y_1)\\
[1em
]
276 \ddot{x_2
}=-
\mathcal{G
}\displaystyle\frac{m_1
}{r^
3}(x_2-x_1)\\
[1em
]
277 \ddot{y_2
}=-
\mathcal{G
}\displaystyle\frac{m_1
}{r^
3}(y_2-y_1)
283 % y[0] y[1] y[2] y[3]
286 -(M1+M2)*y
[0]/(y
[0]^
2+y
[1]^
2)^
1.5|
%
287 -(M1+M2)*y
[1]/(y
[0]^
2+y
[1]^
2)^
1.5}
288 Voici comment placer sur la pile les différentes variables, ainsi que le système d'équations en notation algébrique. Il faut retenir la notation utilisée pour représenter les variables en fonction de leurs positions respectives sur la pile :
291 % y[0] y[1] y[2] y[3] y[4] y[5] y[6] y[7]
292 % x1 y1 x'1 y'1 x2 y2 x'2 y'2
293 \def\GravAlgIIcorps{%
295 M2*(y
[4]-y
[0])/((y
[4]-y
[0])^
2+(y
[5]-y
[1])^
2)^
1.5|
%
296 M2*(y
[5]-y
[1])/((y
[4]-y
[0])^
2+(y
[5]-y
[1])^
2)^
1.5|
%
298 M1*(y
[0]-y
[4])/((y
[4]-y
[0])^
2+(y
[5]-y
[1])^
2)^
1.5|
%
299 M1*(y
[1]-y
[5])/((y
[4]-y
[0])^
2+(y
[5]-y
[1])^
2)^
1.5}
301 Les conditions initiales, positions et vitesses respectives des deux corps, déterminent l'évolution du système.
303 \def\InitCond{x01 y01 v0x1 v0y1 x02 y02 v0x2 v0y2
}
305 Elles sont définies dans l'environnement
\verb+
\begin{pspicture
}+ :
320 Dans cette même variable
\verb+
\pstVerb+, il est utile de faire d'autres calculs, comme la période du mouvement afin de bien choisir l'intervalle de temps sur lequel on dessine les trajectoires. Les calculs s'effectuent en
\textsf{postscript
} et l'affichage du résultat utilise, par exemple, le package
\textsf{pst-tools
}.
322 \rput(-
2,
0)
{\psPrintValue[decimals=
4]{periode
}\hphantom{00000}s
}
324 On désactivera cette ligne par \% au début, une fois la période connue. Dans l'exemple proposé $T=
41,
0688\,
\mathrm{s
}$. On étudie le mouvement sur trois périodes environ.
326 %% x1 y1 x'1 y'1 x2 y2 x'2 y'2
327 \def\GravAlgIIcorps{%
329 M2*(y
[4]-y
[0])/((y
[4]-y
[0])^
2+(y
[5]-y
[1])^
2)^
1.5|
%
330 M2*(y
[5]-y
[1])/((y
[4]-y
[0])^
2+(y
[5]-y
[1])^
2)^
1.5|
%
332 M1*(y
[0]-y
[4])/((y
[4]-y
[0])^
2+(y
[5]-y
[1])^
2)^
1.5|
%
333 M1*(y
[1]-y
[5])/((y
[4]-y
[0])^
2+(y
[5]-y
[1])^
2)^
1.5}
336 % conditions initiales pour le point réduit
337 \def\InitCondred{ xr0 yr0 v0xr v0yr
}
338 \begin{pspicture
}(-
4,-
5)(
12,
12)
342 dup mul neg
1 add sqrt
358 /mu M1 M2 mul M1 M2 add div def
% masse réduite
360 /xG0 M1 x01 mul M2 x02 mul add M1 M2 add div def
361 /yG0 M1 y01 mul M2 y02 mul add M1 M2 add div def
362 /vG0x M1 v0x1 mul M2 v0x2 mul add M1 M2 add div def
363 /vG0y M1 v0y1 mul M2 v0y2 mul add M1 M2 add div def
364 /K1 M2 Mt div neg def
366 % conditions initiales pour le point réduit
369 /theta_0 yr0 xr0 atan def
370 /r0 xr0 dup mul yr0 dup mul add sqrt def
371 /v0xr v0x2 v0x1 sub def
372 /v0yr v0y2 v0y1 sub def
373 /v0r_2 v0xr dup mul v0yr dup mul add def
374 % constante des aires
375 /Cste xr0 v0yr mul yr0 v0xr mul sub def
% Cste des aires
376 /Energie
0.5 mu mul v0r_2 mul
% 1/2 mv^2
377 G M1 M2 mul mul r0 div sub
379 /par Cste dup mul K div def
% p
380 /exc
2 Cste dup mul mul Energie mul mu div K dup mul div
1 add sqrt def
% e
381 /a_2 par
1 exc dup mul sub div def
% demi-grand axe
382 /b_2 a_2
1 exc dup mul sub sqrt mul def
% demi-petit axe
383 /c_2 a_2 exc mul def
% distance focale
385 /Phi theta_0 par r0 div
1 sub exc div arccos sub def
386 /rP par
1 exc add div def
387 /rA par
1 exc sub div def
388 % vitesses à l'apogée et au périgée
389 /vA G Mt mul
2 rA div
1 a_2 div sub mul sqrt def
390 /vP G Mt mul
2 rP div
1 a_2 div sub mul sqrt def
391 % positions du périgée et de l'apogée
392 /xP rP Phi cos mul def
393 /yP rP Phi sin mul def
394 /xA rA Phi cos mul neg def
395 /yA rA Phi sin mul neg def
396 /xW xA xP add
2 div def
397 /yW yA yP add
2 div def
399 /periode
6.28 a_2
3 exp G div Mt div sqrt mul def
400 /radius
{par
1 exc t Phi sub cos mul add div
} def
401 /xE
{radius t cos mul
} def
402 /yE
{radius t sin mul
}def
405 %% x1 y1 x'1 y'1 x2 y2 x'2 y'2
406 \def\InitCondred{ x0 y0 v0x v0y
}
407 \def\InitCond{ x01 y01 v0x1 v0y1 x02 y02 v0x2 v0y2
}
409 \psgrid[subgriddiv=
0,gridcolor=lightgray,griddots=
10,gridlabels=
8pt
](-
4,-
4)(
12,
12)
%
410 \psequadiff[whichabs=
0,whichord=
1,
411 plotpoints=
1000,algebraic,
413 % ,saveData,filename=XYM1.dat
414 ]{0}{120}{\InitCond}{\GravAlgIIcorps}
415 \listplot[unit=
1,linecolor=red
]{X1Y1 aload pop
}
416 \psequadiff[whichabs=
4,whichord=
5,
417 plotpoints=
1000,algebraic,
419 % ,saveData,filename=XYM2.dat
420 ]{0}{120}{\InitCond}{\GravAlgIIcorps}
421 \listplot[unit=
1,linecolor=blue
]{X2Y2 aload pop
}
422 % mouvement de M2 par rapport à M1
423 %\psequadiff[plotpoints=1000,algebraic,
424 % plotfuncx=y dup 4 get exch 0 get sub ,
425 % plotfuncy=dup 5 get exch 1 get sub,
426 % tabname=XY1]{0}{22.7}{\InitCond}{\GravAlgIIcorps}
427 %\listplot[unit=1,linecolor=green]{XY1 aload pop}
428 % mouvement de M1 par rapport à M2
429 %\psequadiff[plotpoints=1000,algebraic,
430 % plotfuncx=y dup 0 get exch 4 get sub ,
431 % plotfuncy=dup 1 get exch 5 get sub,
432 % tabname=XY2]{0}{22.7}{\InitCond}{\GravAlgIIcorps}
433 %\listplot[unit=1,linecolor=magenta]{XY2 aload pop}
434 % mouvement de M1 par rapport à G
435 %\psequadiff[plotpoints=1000,algebraic,
445 % tabname=XY3]{0}{22.7}{\InitCond}{\GravAlgIIcorps}
446 %\listplot[unit=1]{XY3 aload pop}
447 % mouvement de M2 par rapport à G
448 %\psequadiff[plotpoints=1000,algebraic,
457 % tabname=XY4]{0}{22.7}{\InitCond}{\GravAlgIIcorps}
458 %\listplot[unit=1,linecolor=red]{XY4 aload pop}
460 \psequadiff[plotpoints=
1000,algebraic,
461 plotfuncx=y dup
0 get M1 mul exch
464 plotfuncy=dup
1 get M1 mul exch
468 % ,saveData,filename=XYG.dat
469 ]{0}{120}{\InitCond}{\GravAlgIIcorps}
470 \listplot[unit=
1,linecolor=cyan
]{XGYG aload pop
}
471 \pnode(!x01 y01)
{M01
}
472 \pnode(!x02 y02)
{M02
}
475 \psdot[linecolor=cyan
](G0)
476 \rput(M01)
{\psline[unit=
5,linecolor=red
]{->
}(!v0x1 v0y1)
}
477 \rput(M02)
{\psline[unit=
5,linecolor=blue
]{->
}(!v0x2 v0y2)
}
478 \rput(G0)
{\psline[unit=
5]{->
}(!vG0x vG0y)
}
479 \psline{<->
}(
12,
0)(
0,
0)(
0,
12)
480 \rput(-
2,
0)
{\psPrintValue[decimals=
4]{periode
}\hphantom{00000}s
}
483 La partie suivante est une animation en
\textit{temps réel
}, ce qui permet de visualiser l'effet de fronde (accélération), lorsque les deux corps passent au voisinage l'un de l'autre.
485 Pour faciliter les calculs les positions successives des deux corps et du centre de masse ont été enregistrées dans trois fichiers. Voici pour le premier :
487 \psequadiff[whichabs=
0,whichord=
1,
488 plotpoints=
1000,algebraic,
490 saveData,filename=XYM1.dat
]{0}{120}{\InitCond}{\GravAlgIIcorps}
492 Cette option est ensuite désactivée. Pour l'animation, les fichiers sont lus et les données placées dans un tableau.
494 \pstVerb{/XY1
[(XYM1.dat) run
] def
495 /XY2
[(XYM2.dat) run
] def
496 /XYG
[(XYG.dat) run
] def
}%
498 On pourra tracer un segment joignant les deux corps en activant la ligne :
500 %\psline[linestyle=dashed,linecolor=white](!X1 Y1)(!X2 Y2)
504 \section{L'animation : version
1}
506 \pstVerb{/XY1
[(XYM1.dat) run
] def
507 /XY2
[(XYM2.dat) run
] def
508 /XYG
[(XYG.dat) run
] def
}%
509 \def\nFrames{200}% 200 images
510 \begin{animateinline
}[controls,loop,timeline=pb2corps.dat,
%
511 begin=
{\begin{pspicture
}(-
4,-
5)(
13,
12)
},
512 end=
{\end{pspicture
}}]{10}% 10 images/s
513 \psframe*(-
4,-
5)(
13,
12)
514 \psgrid[subgriddiv=
0,gridcolor=white,griddots=
10,gridlabels=
0pt
]%
515 \listplot[linecolor=gray
]{XY1 aload pop
}
516 \listplot[linecolor=gray
]{XY2 aload pop
}
517 \listplot[linecolor=gray
]{XYG aload pop
}
519 \multiframe{\nFrames}{i=
0+
10,I=
2+
10}{% 1 point sur 10
520 \pstVerb{/X1 XY1
\i\space get def
521 /Y1 XY1
\i\space 1 add get def
522 /X2 XY2
\i\space get def
523 /Y2 XY2
\i\space 1 add get def
524 /XG XYG
\i\space get def
525 /YG XYG
\i\space 1 add get def
528 \pscircle*
[linecolor=red
](!X1 Y1)
{0.3}
529 \pscircle*
[linecolor=blue!
50](!X2 Y2)
{0.1}
530 \pscircle*
[linecolor=yellow
](!XG YG)
{0.05}
531 %\psline[linestyle=dashed,linecolor=white](!X1 Y1)(!X2 Y2)
536 \section{L'animation : version
2}
538 \pstVerb{/XY1
[(XYM1.dat) run
] def
539 /XY2
[(XYM2.dat) run
] def
540 /XYG
[(XYG.dat) run
] def
}%
541 \def\nFrames{200}% 200 images
542 \begin{animateinline
}[controls,loop,timeline=pb2corps.dat,
%
543 begin=
{\begin{pspicture
}(-
4,-
5)(
13,
12)
},
544 end=
{\end{pspicture
}}]{10}% 10 images/s
545 \psframe*(-
4,-
5)(
13,
12)
546 \psgrid[subgriddiv=
0,gridcolor=white,griddots=
10,gridlabels=
0pt
]%
547 \listplot[linecolor=gray
]{XY1 aload pop
}
548 \listplot[linecolor=gray
]{XY2 aload pop
}
549 \listplot[linecolor=gray
]{XYG aload pop
}
551 \multiframe{\nFrames}{i=
0+
10,I=
2+
10}{% 1 point sur 10
552 \pstVerb{/X1 XY1
\i\space get def
553 /Y1 XY1
\i\space 1 add get def
554 /X2 XY2
\i\space get def
555 /Y2 XY2
\i\space 1 add get def
556 /XG XYG
\i\space get def
557 /YG XYG
\i\space 1 add get def
559 0 2 \I\space {/i exch def
565 0 2 \I\space {/i exch def
571 0 2 \I\space {/i exch def
577 \psgrid[subgriddiv=
0,gridcolor=white,griddots=
10,gridlabels=
0pt
]%
578 \listplot[linecolor=red
]{xy1 aload pop
}
579 \listplot[linecolor=blue!
50]{xy2 aload pop
}
580 \listplot[linecolor=yellow
]{xyG aload pop
}
581 \pscircle*
[linecolor=red
](!X1 Y1)
{0.3}
582 \pscircle*
[linecolor=blue!
50](!X2 Y2)
{0.1}
583 \pscircle*
[linecolor=yellow
](!XG YG)
{0.05}
584 %\psline[linestyle=dashed,linecolor=white](!X1 Y1)(!X2 Y2)