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
}
217 \title{Gravitation : le problème des deux corps avec PSTricks\\ partie
3}
218 \date{6 juillet
2\,
012}
221 \section{Mouvements dans le repère du centre de masse
}
222 D'abord un petit rappel des documents précédents :
224 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.
226 \begin{pspicture
}(-
3,-
1)(
5,
6)
227 \psgrid[subgriddiv=
0,gridcolor=lightgray,griddots=
10,gridlabels=
0pt
]%
228 \pstVerb{/x01 -
2 def /y01
1 def
229 /x02
5 def /y02
4 def
235 /xG0 x01 M1 mul x02 M2 mul add Mt div def
236 /yG0 y01 M1 mul y02 M2 mul add Mt div def
}%
241 \pscircle[fillstyle=solid,fillcolor=red!
50](M1)
{0.21}
242 \pscircle[fillstyle=solid,fillcolor=blue!
50](M2)
{0.07}
244 \psline[linestyle=dotted
](M1)(M2)
245 \psline[linestyle=dashed
](M2)(O)(M1)
246 \psline{<->
}(
5,
0)(
0,
0)(
0,
6)
250 \uput[l
](
0,
5.8)
{$
\mathcal{R
}$
}
251 \uput{0.22}[l
](M1)
{$M_1$
}
252 \uput{0.1}[u
](M2)
{$M_2$
}
254 \pcline[offset=
5pt,linestyle=none
](M1)(M2)
255 \ncput*
[nrot=:U
]{$r$
}
256 \rput(M1)
{\psline[style=vecteurC
]{->
}(!xr0
5 div yr0
5 div)
\uput[u
](!xr0
10 div yr0
10 div)
{$
\overrightarrow{F
}_
{2/
1}$
}}
257 \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}$
}}
260 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 :
262 \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
}
264 La loi de Newton appliquée à chacune des particules s'écrit :
266 m_1
\frac{\mathrm{d
}^
2\overrightarrow{r
}}{\mathrm{d
}t^
2}=
\hphantom{-
}\mathcal{G
}\frac{m_1m_2
}{r^
3}\overrightarrow{r
}
269 m_2
\frac{\mathrm{d
}^
2\overrightarrow{r
}}{\mathrm{d
}t^
2}=-
\mathcal{G
}\frac{m_1m_2
}{r^
3}\overrightarrow{r
}
271 Sachant que $r=
\sqrt{(x_
{2}-x_
{1})^
2+(y_
{2}-y_
{1})^
2}$, nous obtenons un système de quatre équations différentielles :
275 \ddot{x_1
}=
\hphantom{-
}\mathcal{G
}\displaystyle\frac{m_2
}{r^
3}(x_2-x_1)\\
[1em
]
276 \ddot{y_1
}=
\hphantom{-
}\mathcal{G
}\displaystyle\frac{m_2
}{r^
3}(y_2-y_1)\\
[1em
]
277 \ddot{x_2
}=-
\mathcal{G
}\displaystyle\frac{m_1
}{r^
3}(x_2-x_1)\\
[1em
]
278 \ddot{y_2
}=-
\mathcal{G
}\displaystyle\frac{m_1
}{r^
3}(y_2-y_1)
284 % y[0] y[1] y[2] y[3]
287 -(M1+M2)*y
[0]/(y
[0]^
2+y
[1]^
2)^
1.5|
%
288 -(M1+M2)*y
[1]/(y
[0]^
2+y
[1]^
2)^
1.5}
289 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 :
292 % y[0] y[1] y[2] y[3] y[4] y[5] y[6] y[7]
293 % x1 y1 x'1 y'1 x2 y2 x'2 y'2
294 \def\GravAlgIIcorps{%
296 M2*(y
[4]-y
[0])/((y
[4]-y
[0])^
2+(y
[5]-y
[1])^
2)^
1.5|
%
297 M2*(y
[5]-y
[1])/((y
[4]-y
[0])^
2+(y
[5]-y
[1])^
2)^
1.5|
%
299 M1*(y
[0]-y
[4])/((y
[4]-y
[0])^
2+(y
[5]-y
[1])^
2)^
1.5|
%
300 M1*(y
[1]-y
[5])/((y
[4]-y
[0])^
2+(y
[5]-y
[1])^
2)^
1.5}
302 Les conditions initiales, positions et vitesses respectives des deux corps, déterminent l'évolution du système.
304 \def\InitCond{x01 y01 v0x1 v0y1 x02 y02 v0x2 v0y2
}
306 Elles sont définies dans l'environnement
\verb+
\begin{pspicture
}+ :
321 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
}.
323 \rput(-
2,
0)
{\psPrintValue[decimals=
4]{periode
}\hphantom{00000}s
}
325 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.
327 %% x1 y1 x'1 y'1 x2 y2 x'2 y'2
328 \def\GravAlgIIcorps{%
330 M2*(y
[4]-y
[0])/((y
[4]-y
[0])^
2+(y
[5]-y
[1])^
2)^
1.5|
%
331 M2*(y
[5]-y
[1])/((y
[4]-y
[0])^
2+(y
[5]-y
[1])^
2)^
1.5|
%
333 M1*(y
[0]-y
[4])/((y
[4]-y
[0])^
2+(y
[5]-y
[1])^
2)^
1.5|
%
334 M1*(y
[1]-y
[5])/((y
[4]-y
[0])^
2+(y
[5]-y
[1])^
2)^
1.5}
337 Dans $
\mathcal{R
}$ la position de $C$ est déterminée par la relation :
339 \overrightarrow{OC
}=
\frac{m_1
\overrightarrow{OM_1
}+m_2
\overrightarrow{OM_2
}}{m_1+m_2
}
341 Avec les conventions utilisées les coordonnées de $C$ seront calculées en postscript ainsi :
343 M1 y
[0] mul M2 y
[4] mul add M1 M2 add div
% abscisse de C
344 M1 y
[1] mul M2 y
[5] mul add M1 M2 add div
% ordonnée de C
347 Dans le repère $
\mathcal{R
}^*$ lié au centre de masse, les coordonnées des deux points se calculent par :
359 Ce qui en postscript s'écrira :
361 y
[0] % abscisse de M1
362 M1 y
[0] mul M2 y
[4] mul add M1 M2 add div
% abscisse de C
364 y
[1] % ordonnée de M1
365 M1 y
[1] mul M2 y
[5] mul add M1 M2 add div
% ordonnée de C
369 y
[4] % abscisse de M2
370 M1 y
[0] mul M2 y
[4] mul add M1 M2 add div
% abscisse de C
372 y
[5] % ordonnée de M2
373 M1 y
[1] mul M2 y
[5] mul add M1 M2 add div
% ordonnée de C
377 Les deux options
\texttt{[plotfuncx
]} et
\texttt{[plotfuncy
]} permettent justement de faire les calculs nécessaires à ce changement de repère.
\texttt{Mt
} désignant la masse totale calculée dans la variable
\verb+
\pstVerb+ :
392 Par défaut, c'est la variable de la fonction étudiée, ici le temps $t$, qui est notée
\texttt{x
}, qui est placée en abscisse. Toutes les grandeurs calculées :
395 % y[0] y[1] y[2] y[3] y[4] y[5] y[6] y[7]
396 % x1 y1 x'1 y'1 x2 y2 x'2 y'2
398 sont placées(empilées) dans un tableau noté
\texttt{y
}, c'est donc dans ce tableau qu'il faut
\textit{aller à la pêche
} avec l'instruction
\textsf{postscript
} \texttt{get
}.
400 Ainsi |
\texttt{y
0 get
}| donne :
\texttt{y
[0]} soit
\texttt{x1
}, |
\texttt{y
1 get
}| donne :
\texttt{y
[1]} soit
\texttt{y1
} etc.
402 \begin{pspicture
}(-
6,-
8)(
3,
3)
406 dup mul neg
1 add sqrt
422 /mu M1 M2 mul M1 M2 add div def
% masse réduite
424 /xG0 M1 x01 mul M2 x02 mul add M1 M2 add div def
425 /yG0 M1 y01 mul M2 y02 mul add M1 M2 add div def
426 /vG0x M1 v0x1 mul M2 v0x2 mul add M1 M2 add div def
427 /vG0y M1 v0y1 mul M2 v0y2 mul add M1 M2 add div def
428 /K1 M2 Mt div neg def
430 % conditions initiales pour le point réduit
433 /theta_0 yr0 xr0 atan def
434 /r0 xr0 dup mul yr0 dup mul add sqrt def
435 /v0xr v0x2 v0x1 sub def
436 /v0yr v0y2 v0y1 sub def
437 /v0r_2 v0xr dup mul v0yr dup mul add def
438 % constante des aires
439 /Cste xr0 v0yr mul yr0 v0xr mul sub def
% Cste des aires
440 /Energie
0.5 mu mul v0r_2 mul
% 1/2 mv^2
441 G M1 M2 mul mul r0 div sub
443 /par Cste dup mul K div def
% p
444 /exc
2 Cste dup mul mul Energie mul mu div K dup mul div
1 add sqrt def
% e
445 /a_2 par
1 exc dup mul sub div def
% demi-grand axe
446 /b_2 a_2
1 exc dup mul sub sqrt mul def
% demi-petit axe
447 /c_2 a_2 exc mul def
% distance focale
449 /Phi theta_0 par r0 div
1 sub exc div arccos sub def
450 /rP par
1 exc add div def
451 /rA par
1 exc sub div def
452 % vitesses à l'apogée et au périgée
453 /vA G Mt mul
2 rA div
1 a_2 div sub mul sqrt def
454 /vP G Mt mul
2 rP div
1 a_2 div sub mul sqrt def
455 % positions du périgée et de l'apogée
456 /xP rP Phi cos mul def
457 /yP rP Phi sin mul def
458 /xA rA Phi cos mul neg def
459 /yA rA Phi sin mul neg def
460 /xW xA xP add
2 div def
461 /yW yA yP add
2 div def
463 /periode
6.28 a_2
3 exp G div Mt div sqrt mul def
464 /radius
{par
1 exc t Phi sub cos mul add div
} def
465 /xE
{radius t cos mul
} def
466 /yE
{radius t sin mul
}def
469 %% x1 y1 x'1 y'1 x2 y2 x'2 y'2
470 \def\InitCond{ x01 y01 v0x1 v0y1 x02 y02 v0x2 v0y2
}
472 \psgrid[subgriddiv=
0,gridcolor=lightgray,griddots=
10,gridlabels=
0pt
](-
6,-
8)(
3,
3)
%
473 % mouvement de M2 par rapport à M1
474 %\psequadiff[plotpoints=1000,algebraic,
475 % plotfuncx=y dup 4 get exch 0 get sub ,
476 % plotfuncy=dup 5 get exch 1 get sub,
477 % tabname=XY1]{0}{22.7}{\InitCond}{\GravAlgIIcorps}
478 %\listplot[unit=1,linecolor=green]{XY1 aload pop}
479 % mouvement de M1 par rapport à M2
480 %\psequadiff[plotpoints=1000,algebraic,
481 % plotfuncx=y dup 0 get exch 4 get sub ,
482 % plotfuncy=dup 1 get exch 5 get sub,
483 % tabname=XY2]{0}{22.7}{\InitCond}{\GravAlgIIcorps}
484 %\listplot[unit=1,linecolor=magenta]{XY2 aload pop}
485 % mouvement de M1 par rapport à G
486 \psequadiff[plotpoints=
1000,algebraic,
497 saveData,filename=XY1G.dat
498 ]{0}{41.07}{\InitCond}{\GravAlgIIcorps}
499 \listplot[unit=
1,linecolor=red
]{XY1G aload pop
}
500 % mouvement de M2 par rapport à G
501 \psequadiff[plotpoints=
1000,algebraic,
511 saveData,filename=XY2G.dat
512 ]{0}{41.07}{\InitCond}{\GravAlgIIcorps}
513 \listplot[unit=
1,linecolor=blue
]{XY2G aload pop
}
515 %\psequadiff[plotpoints=1000,algebraic,
516 % plotfuncx=y dup 0 get M1 mul exch
519 % plotfuncy=dup 1 get M1 mul exch
523 % ,saveData,filename=XYG.dat
524 % ]{0}{120}{\InitCond}{\GravAlgIIcorps}
525 %\listplot[unit=1,linecolor=cyan]{XGYG aload pop}
526 \pnode(!x01 xG0 sub y01 yG0 sub)
{M01
}
527 \pnode(!x02 xG0 sub y02 yG0 sub)
{M02
}
528 %\pnode(!xG0 yG0){G0}
530 %\psdot[linecolor=cyan](G0)
531 \rput(M01)
{\psline[unit=
5,linecolor=red
]{->
}(!v0x1 vG0x sub v0y1 vG0y sub)
}
532 \rput(M02)
{\psline[unit=
5,linecolor=blue
]{->
}(!v0x2 vG0x sub v0y2 vG0y sub)
}
533 %\rput(G0){\psline[unit=5]{->}(!vG0x vG0y)}
534 \psline{<->
}(
3,
0)(
0,
0)(
0,
3)
535 \rput(-
2,
2)
{\psPrintValue[decimals=
4]{periode
}\hphantom{0000000}s
}
539 La partie suivante est une animation en
\textit{temps réel
}.
541 Pour faciliter les calculs les positions successives des deux corps ont été enregistrées, avec l'option
\texttt{saveData
}, dans deux fichiers. Voici pour le premier :
543 \psequadiff[plotpoints=
1000,algebraic,
554 saveData,filename=XY1G.dat
555 ]{0}{41.07}{\InitCond}{\GravAlgIIcorps}
557 Cette option est ensuite désactivée. Pour l'animation, les fichiers sont lus et les données placées dans un tableau.
559 \pstVerb{/XY1
[(XYM1.dat) run
] def
560 /XY2
[(XYM2.dat) run
] def
562 On pourra, éventuellement, tracer un segment joignant les deux corps en activant la ligne :
564 %\psline[linestyle=dashed,linecolor=white](!X1 Y1)(!X2 Y2)
568 \section{L'animation
}
570 \pstVerb{/XY1
[(XY1G.dat) run
] def
571 /XY2
[(XY2G.dat) run
] def
573 \def\nFrames{200}% 200 images
574 \begin{animateinline
}[controls,loop,timeline=pb2corps.dat,
%
575 begin=
{\begin{pspicture
}(-
6,-
8)(
3,
3)
},
576 end=
{\end{pspicture
}}]{20}% 20 images/s
577 \psframe*
[linecolor=
{[cmyk
]{1 1 0 0.7}}](-
6,-
8)(
3,
3)
578 \psgrid[subgriddiv=
0,gridcolor=white,griddots=
10,gridlabels=
0pt
]%
579 \listplot[linecolor=gray
]{XY1 aload pop
}
580 \listplot[linecolor=gray
]{XY2 aload pop
}
581 \psdot[linecolor=yellow,dotstyle=+
](
0,
0)
583 \multiframe{\nFrames}{i=
0+
10}{% 1 point sur 10
584 \pstVerb{/X1 XY1
\i\space get def
585 /Y1 XY1
\i\space 1 add get def
586 /X2 XY2
\i\space get def
587 /Y2 XY2
\i\space 1 add get def
590 \pscircle*
[linecolor=red
](!X1 Y1)
{0.3}
591 \pscircle*
[linecolor=blue!
50](!X2 Y2)
{0.1}
592 %\psline[linestyle=dashed,linecolor=white](!X1 Y1)(!X2 Y2)
596 \section{Mouvement d'un corps par rapport à l'autre
}
597 Étudions le mouvement de $M_2$ par rapport à $M_1$. Dans un repère lié à $M_1$ les coordonnées de $M_2$ s'expriment par :
608 % y[0] y[1] y[2] y[3] y[4] y[5] y[6] y[7]
609 % x1 y1 x'1 y'1 x2 y2 x'2 y'2
610 y
[4] y
[0] sub
% x2 - x1
611 y
[5] y
[1] sub
% y2 - y1
615 % mouvement de M2 par rapport à M1
616 \psequadiff[plotpoints=
1000,algebraic,
617 plotfuncx=y dup
4 get exch
0 get sub ,
618 plotfuncy=dup
5 get exch
1 get sub,
620 saveData,filename=XY21.dat
621 ]{0}{41.07}{\InitCond}{\GravAlgIIcorps}
624 \begin{pspicture
}(-
7,-
9)(
3,
3)
628 dup mul neg
1 add sqrt
644 /mu M1 M2 mul M1 M2 add div def
% masse réduite
646 /xG0 M1 x01 mul M2 x02 mul add M1 M2 add div def
647 /yG0 M1 y01 mul M2 y02 mul add M1 M2 add div def
648 /vG0x M1 v0x1 mul M2 v0x2 mul add M1 M2 add div def
649 /vG0y M1 v0y1 mul M2 v0y2 mul add M1 M2 add div def
650 /K1 M2 Mt div neg def
652 % conditions initiales pour le point réduit
655 /theta_0 yr0 xr0 atan def
656 /r0 xr0 dup mul yr0 dup mul add sqrt def
657 /v0xr v0x2 v0x1 sub def
658 /v0yr v0y2 v0y1 sub def
659 /v0r_2 v0xr dup mul v0yr dup mul add def
660 % constante des aires
661 /Cste xr0 v0yr mul yr0 v0xr mul sub def
% Cste des aires
662 /Energie
0.5 mu mul v0r_2 mul
% 1/2 mv^2
663 G M1 M2 mul mul r0 div sub
665 /par Cste dup mul K div def
% p
666 /exc
2 Cste dup mul mul Energie mul mu div K dup mul div
1 add sqrt def
% e
667 /a_2 par
1 exc dup mul sub div def
% demi-grand axe
668 /b_2 a_2
1 exc dup mul sub sqrt mul def
% demi-petit axe
669 /c_2 a_2 exc mul def
% distance focale
671 /Phi theta_0 par r0 div
1 sub exc div arccos sub def
672 /rP par
1 exc add div def
673 /rA par
1 exc sub div def
674 % vitesses à l'apogée et au périgée
675 /vA G Mt mul
2 rA div
1 a_2 div sub mul sqrt def
676 /vP G Mt mul
2 rP div
1 a_2 div sub mul sqrt def
677 % positions du périgée et de l'apogée
678 /xP rP Phi cos mul def
679 /yP rP Phi sin mul def
680 /xA rA Phi cos mul neg def
681 /yA rA Phi sin mul neg def
682 /xW xA xP add
2 div def
683 /yW yA yP add
2 div def
685 /periode
6.28 a_2
3 exp G div Mt div sqrt mul def
686 /radius
{par
1 exc t Phi sub cos mul add div
} def
687 /xE
{radius t cos mul
} def
688 /yE
{radius t sin mul
}def
691 %% x1 y1 x'1 y'1 x2 y2 x'2 y'2
692 \def\InitCond{ x01 y01 v0x1 v0y1 x02 y02 v0x2 v0y2
}
694 \psgrid[subgriddiv=
0,gridcolor=lightgray,griddots=
10,gridlabels=
0pt
](-
7,-
9)(
3,
3)
%
695 % mouvement de M2 par rapport à M1
696 \psequadiff[plotpoints=
1000,algebraic,
697 plotfuncx=y dup
4 get exch
0 get sub ,
698 plotfuncy=dup
5 get exch
1 get sub,
700 saveData,filename=XY21.dat
701 ]{0}{41.07}{\InitCond}{\GravAlgIIcorps}
702 \listplot[unit=
1,linecolor=green
]{XY21 aload pop
}
703 % mouvement de M1 par rapport à M2
704 %\psequadiff[plotpoints=1000,algebraic,
705 % plotfuncx=y dup 0 get exch 4 get sub ,
706 % plotfuncy=dup 1 get exch 5 get sub,
707 % tabname=XY2]{0}{22.7}{\InitCond}{\GravAlgIIcorps}
708 %\listplot[unit=1,linecolor=magenta]{XY2 aload pop}
709 \pnode(!x02 x01 sub y02 y01 sub)
{M021
}
710 \pscircle*
[linecolor=red
](
0,
0)
{0.3}
711 \pscircle*
[linecolor=blue!
50](M021)
{0.1}
712 \uput[r
](M021)
{$(t_0)$
}
713 \psdot(M021)
\uput[l
](M021)
{$M_
{2/
1}$
}
714 \rput(M021)
{\psline[unit=
5,linecolor=blue
]{->
}(!v0x2 v0x1 sub v0y2 v0y1 sub)
}
715 \uput{0.3}[d
](
0,
0)
{$M_1(
0)$
}
716 \psline{<->
}(
3,
0)(
0,
0)(
0,
3)
717 \rput(-
2,
2)
{\psPrintValue[decimals=
4]{periode
}\hphantom{0000000}s
}
720 Le mouvement de $M_1$ par rapport à $M_2$ :
722 % mouvement de M1 par rapport à M1
723 \psequadiff[plotpoints=
1000,algebraic,
724 plotfuncx=y dup
0 get exch
4 get sub ,
725 plotfuncy=dup
1 get exch
5 get sub,
727 saveData,filename=XY12.dat
728 ]{0}{41.07}{\InitCond}{\GravAlgIIcorps}
731 \begin{pspicture
}(-
3,-
2)(
8,
8)
735 dup mul neg
1 add sqrt
751 /mu M1 M2 mul M1 M2 add div def
% masse réduite
753 /xG0 M1 x01 mul M2 x02 mul add M1 M2 add div def
754 /yG0 M1 y01 mul M2 y02 mul add M1 M2 add div def
755 /vG0x M1 v0x1 mul M2 v0x2 mul add M1 M2 add div def
756 /vG0y M1 v0y1 mul M2 v0y2 mul add M1 M2 add div def
757 /K1 M2 Mt div neg def
759 % conditions initiales pour le point réduit
762 /theta_0 yr0 xr0 atan def
763 /r0 xr0 dup mul yr0 dup mul add sqrt def
764 /v0xr v0x2 v0x1 sub def
765 /v0yr v0y2 v0y1 sub def
766 /v0r_2 v0xr dup mul v0yr dup mul add def
767 % constante des aires
768 /Cste xr0 v0yr mul yr0 v0xr mul sub def
% Cste des aires
769 /Energie
0.5 mu mul v0r_2 mul
% 1/2 mv^2
770 G M1 M2 mul mul r0 div sub
772 /par Cste dup mul K div def
% p
773 /exc
2 Cste dup mul mul Energie mul mu div K dup mul div
1 add sqrt def
% e
774 /a_2 par
1 exc dup mul sub div def
% demi-grand axe
775 /b_2 a_2
1 exc dup mul sub sqrt mul def
% demi-petit axe
776 /c_2 a_2 exc mul def
% distance focale
778 /Phi theta_0 par r0 div
1 sub exc div arccos sub def
779 /rP par
1 exc add div def
780 /rA par
1 exc sub div def
781 % vitesses à l'apogée et au périgée
782 /vA G Mt mul
2 rA div
1 a_2 div sub mul sqrt def
783 /vP G Mt mul
2 rP div
1 a_2 div sub mul sqrt def
784 % positions du périgée et de l'apogée
785 /xP rP Phi cos mul def
786 /yP rP Phi sin mul def
787 /xA rA Phi cos mul neg def
788 /yA rA Phi sin mul neg def
789 /xW xA xP add
2 div def
790 /yW yA yP add
2 div def
792 /periode
6.28 a_2
3 exp G div Mt div sqrt mul def
793 /radius
{par
1 exc t Phi sub cos mul add div
} def
794 /xE
{radius t cos mul
} def
795 /yE
{radius t sin mul
}def
798 %% x1 y1 x'1 y'1 x2 y2 x'2 y'2
799 \def\InitCond{ x01 y01 v0x1 v0y1 x02 y02 v0x2 v0y2
}
801 \psgrid[subgriddiv=
0,gridcolor=lightgray,griddots=
10,gridlabels=
0pt
](-
3,-
2)(
8,
9)
%
802 % mouvement de M2 par rapport à M1
803 %\psequadiff[plotpoints=1000,algebraic,
804 % plotfuncx=y dup 4 get exch 0 get sub ,
805 % plotfuncy=dup 5 get exch 1 get sub,
807 % saveData,filename=XY21.dat
808 % ]{0}{41.07}{\InitCond}{\GravAlgIIcorps}
809 %\listplot[unit=1,linecolor=green]{XY21 aload pop}
810 % mouvement de M1 par rapport à M2
811 \psequadiff[plotpoints=
1000,algebraic,
812 plotfuncx=y dup
0 get exch
4 get sub ,
813 plotfuncy=dup
1 get exch
5 get sub,
815 saveData,filename=XY12.dat
816 ]{0}{41.07}{\InitCond}{\GravAlgIIcorps}
817 \listplot[unit=
1,linecolor=magenta
]{XY12 aload pop
}
818 \pnode(!x01 x02 sub y01 y02 sub)
{M012
}
819 \pscircle*
[linecolor=red
](M012)
{0.3}
820 \pscircle*
[linecolor=blue!
50](
0,
0)
{0.1}
821 \uput{0.3}[r
](M012)
{$(t_0)$
}
822 \uput[d
](
0,
0)
{$M_2(
0)$
}
823 \psdot(M012)
\uput{0.3}[l
](M012)
{$M_
{1/
2}$
}
824 \rput(M012)
{\psline[unit=
5,linecolor=red
]{->
}(!v0x1 v0x2 sub v0y1 v0y2 sub)
}
825 %\rput(G0){\psline[unit=5]{->}(!vG0x vG0y)}
826 \psline{<->
}(
3,
0)(
0,
0)(
0,
3)
827 \rput(-
2,
2)
{\psPrintValue[decimals=
4]{periode
}\hphantom{0000000}s
}
830 \section{Animation du mouvement de $M_1$ par rapport à $M_2$
}
832 \pstVerb{/XY12
[(XY12.dat) run
] def
834 \def\nFrames{199}% 199 images au lieu de 200 ?
835 \begin{animateinline
}[controls,loop,timeline=pb2corps.dat,
%
836 begin=
{\begin{pspicture
}(-
3,-
2)(
8,
10)
},
837 end=
{\end{pspicture
}}]{20}% 20 images/s
838 \psframe*
[linecolor=
{[cmyk
]{1 1 0 0.7}}](-
3,-
2)(
8,
10)
839 \psgrid[subgriddiv=
0,gridcolor=white,griddots=
10,gridlabels=
0pt
]%
840 \listplot[linecolor=gray
]{XY12 aload pop
}
841 \pscircle*
[linecolor=blue!
50](
0,
0)
{0.1}
843 \multiframe{\nFrames}{i=
0+
10}{% 1 point sur 10
844 \pstVerb{/X1 XY12
\i\space get def
845 /Y1 XY12
\i\space 1 add get def
847 \pscircle*
[linecolor=red
](!X1 Y1)
{0.3}