Cette partie donne des explications sur la représentation des orbites à partir des...
[pst-eqdf.git] / gravitation / pb_2corps_doc_part3.tex
1
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}
9 \usepackage{animate}
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}}}
13 %timeline
14 \begin{filecontents}{pb2corps.dat}
15 ::0x0
16 ::1
17 ::2
18 ::3
19 ::4
20 ::5
21 ::6
22 ::7
23 ::8
24 ::9
25 ::10
26 ::11
27 ::12
28 ::13
29 ::14
30 ::15
31 ::16
32 ::17
33 ::18
34 ::19
35 ::20
36 ::21
37 ::22
38 ::23
39 ::24
40 ::25
41 ::26
42 ::27
43 ::28
44 ::29
45 ::30
46 ::31
47 ::32
48 ::33
49 ::34
50 ::35
51 ::36
52 ::37
53 ::38
54 ::39
55 ::40
56 ::41
57 ::42
58 ::43
59 ::44
60 ::45
61 ::46
62 ::47
63 ::48
64 ::49
65 ::50
66 ::51
67 ::52
68 ::53
69 ::54
70 ::55
71 ::56
72 ::57
73 ::58
74 ::59
75 ::60
76 ::61
77 ::62
78 ::63
79 ::64
80 ::65
81 ::66
82 ::67
83 ::68
84 ::69
85 ::70
86 ::71
87 ::72
88 ::73
89 ::74
90 ::75
91 ::76
92 ::77
93 ::78
94 ::79
95 ::80
96 ::81
97 ::82
98 ::83
99 ::84
100 ::85
101 ::86
102 ::87
103 ::88
104 ::89
105 ::90
106 ::91
107 ::92
108 ::93
109 ::94
110 ::95
111 ::96
112 ::97
113 ::98
114 ::99
115 ::100
116 ::101
117 ::102
118 ::103
119 ::104
120 ::105
121 ::106
122 ::107
123 ::108
124 ::109
125 ::110
126 ::111
127 ::112
128 ::113
129 ::114
130 ::115
131 ::116
132 ::117
133 ::118
134 ::119
135 ::120
136 ::121
137 ::122
138 ::123
139 ::124
140 ::125
141 ::126
142 ::127
143 ::128
144 ::129
145 ::130
146 ::131
147 ::132
148 ::133
149 ::134
150 ::135
151 ::136
152 ::137
153 ::138
154 ::139
155 ::140
156 ::141
157 ::142
158 ::143
159 ::144
160 ::145
161 ::146
162 ::147
163 ::148
164 ::149
165 ::150
166 ::151
167 ::152
168 ::153
169 ::154
170 ::155
171 ::156
172 ::157
173 ::158
174 ::159
175 ::160
176 ::161
177 ::162
178 ::163
179 ::164
180 ::165
181 ::166
182 ::167
183 ::168
184 ::169
185 ::170
186 ::171
187 ::172
188 ::173
189 ::174
190 ::175
191 ::176
192 ::177
193 ::178
194 ::179
195 ::180
196 ::181
197 ::182
198 ::183
199 ::184
200 ::185
201 ::186
202 ::187
203 ::188
204 ::189
205 ::190
206 ::191
207 ::192
208 ::193
209 ::194
210 ::195
211 ::196
212 ::197
213 ::198
214 ::199
215 ::200
216 \end{filecontents}
217 \title{Gravitation : le problème des deux corps avec PSTricks\\ partie 3}
218 \date{6 juillet 2\,012}
219 \begin{document}
220 \maketitle
221 \section{Mouvements dans le repère du centre de masse}
222 D'abord un petit rappel des documents précédents :
223
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.
225 \begin{center}
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
230 /xr0 x02 x01 sub def
231 /yr0 y02 y01 sub def
232 /M1 3 def
233 /M2 1 def
234 /Mt M1 M2 add 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}%
237 \pnode(0,0){O}
238 \pnode(!x01 y01){M1}
239 \pnode(!x02 y02){M2}
240 \pnode(!xG0 yG0){C}
241 \pscircle[fillstyle=solid,fillcolor=red!50](M1){0.21}
242 \pscircle[fillstyle=solid,fillcolor=blue!50](M2){0.07}
243 \psdot(C)
244 \psline[linestyle=dotted](M1)(M2)
245 \psline[linestyle=dashed](M2)(O)(M1)
246 \psline{<->}(5,0)(0,0)(0,6)
247 \uput[dl](O){$O$}
248 \uput[r](0,5.8){$y$}
249 \uput[u](4.8,0){$x$}
250 \uput[l](0,5.8){$\mathcal{R}$}
251 \uput{0.22}[l](M1){$M_1$}
252 \uput{0.1}[u](M2){$M_2$}
253 \uput[u](C){$C$}
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}$}}
258 \end{pspicture}
259 \end{center}
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 :
261 \[
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}
263 \]
264 La loi de Newton appliquée à chacune des particules s'écrit :
265 \[
266 m_1\frac{\mathrm{d}^2\overrightarrow{r}}{\mathrm{d}t^2}=\hphantom{-}\mathcal{G}\frac{m_1m_2}{r^3}\overrightarrow{r}
267 \]
268 \[
269 m_2\frac{\mathrm{d}^2\overrightarrow{r}}{\mathrm{d}t^2}=-\mathcal{G}\frac{m_1m_2}{r^3}\overrightarrow{r}
270 \]
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 :
272 \[
273 \left\{
274 \begin{array}[m]{l}
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)
279 \end{array}
280 \right.
281 \]
282
283 % x y x' y'
284 % y[0] y[1] y[2] y[3]
285 \def\FictifAlg{%
286 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 :
290 \begin{verbatim}
291 % 0 1 2 3 4 5 6 7
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{%
295 y[2]|y[3]|%
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|%
298 y[6]|y[7]|%
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}
301 \end{verbatim}
302 Les conditions initiales, positions et vitesses respectives des deux corps, déterminent l'évolution du système.
303 \begin{verbatim}
304 \def\InitCond{x01 y01 v0x1 v0y1 x02 y02 v0x2 v0y2}
305 \end{verbatim}
306 Elles sont définies dans l'environnement \verb+\begin{pspicture}+ :
307 \begin{verbatim}
308 \pstVerb{
309 /x01 2 def
310 /y01 2 def
311 /v0x1 .2 def
312 /v0y1 0.25 def
313 /x02 -3 def
314 /y02 0 def
315 /v0x2 -0.25 def
316 /v0y2 -0.5 def
317 /M1 3 def
318 /M2 1 def
319 }%
320 \end{verbatim}
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}.
322 \begin{verbatim}
323 \rput(-2,0){\psPrintValue[decimals=4]{periode}\hphantom{00000}s}
324 \end{verbatim}
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.
326 %% 0 1 2 3 4 5 6 7
327 %% x1 y1 x'1 y'1 x2 y2 x'2 y'2
328 \def\GravAlgIIcorps{%
329 y[2]|y[3]|%
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|%
332 y[6]|y[7]|%
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}
335 %\newpage
336
337 Dans $\mathcal{R}$ la position de $C$ est déterminée par la relation :
338 \[
339 \overrightarrow{OC}=\frac{m_1\overrightarrow{OM_1}+m_2\overrightarrow{OM_2}}{m_1+m_2}
340 \]
341 Avec les conventions utilisées les coordonnées de $C$ seront calculées en postscript ainsi :
342 \begin{verbatim}
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
345 \end{verbatim}
346
347 Dans le repère $\mathcal{R}^*$ lié au centre de masse, les coordonnées des deux points se calculent par :
348
349 \[
350 \left\{
351 \begin{array}[m]{l}
352 x^*_1=x_1-x_C\\
353 y^*_1=x_1-y_C\\
354 x^*_2=x_2-x_C\\
355 y^*_2=y_2-y_C\\
356 \end{array}
357 \right.
358 \]
359 Ce qui en postscript s'écrira :
360 \begin{verbatim}
361 y[0] % abscisse de M1
362 M1 y[0] mul M2 y[4] mul add M1 M2 add div % abscisse de C
363 sub
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
366 sub
367 \end{verbatim}
368 \begin{verbatim}
369 y[4] % abscisse de M2
370 M1 y[0] mul M2 y[4] mul add M1 M2 add div % abscisse de C
371 sub
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
374 sub
375 \end{verbatim}
376
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+ :
378 \begin{verbatim}
379 /Mt M1 M2 add def
380 \end{verbatim}
381 \begin{verbatim}
382 plotfuncx=y 0 get
383 y 4 get M2 mul
384 y 0 get M1 mul add
385 Mt div sub ,
386 plotfuncy=1 get
387 y 1 get
388 M1 mul
389 y 5 get M2 mul add
390 Mt div sub,
391 \end{verbatim}
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 :
393 \begin{verbatim}
394 % 0 1 2 3 4 5 6 7
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
397 \end{verbatim}
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}.
399
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.
401 \begin{center}
402 \begin{pspicture}(-6,-8)(3,3)
403 \pstVerb{
404 /arccos {
405 dup
406 dup mul neg 1 add sqrt
407 exch
408 atan
409 } def
410 /G 1 def
411 /x01 2 def
412 /y01 2 def
413 /v0x1 .2 def
414 /v0y1 0.25 def
415 /x02 -3 def
416 /y02 0 def
417 /v0x2 -0.25 def
418 /v0y2 -0.5 def
419 /M1 3 def
420 /M2 1 def
421 /Mt M1 M2 add def
422 /mu M1 M2 mul M1 M2 add div def % masse réduite
423 /K G Mt mul def
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
429 /K2 M1 Mt div def
430 % conditions initiales pour le point réduit
431 /xr0 x02 x01 sub def
432 /yr0 y02 y01 sub def
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
442 def
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
448 % phase
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
462 % periode
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
467 }%
468 %% 0 1 2 3 4 5 6 7
469 %% x1 y1 x'1 y'1 x2 y2 x'2 y'2
470 \def\InitCond{ x01 y01 v0x1 v0y1 x02 y02 v0x2 v0y2}
471 \psset{method=rk4}
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,
487 plotfuncx=y 0 get
488 y 4 get M2 mul
489 y 0 get M1 mul add
490 Mt div sub ,
491 plotfuncy=1 get
492 y 1 get
493 M1 mul
494 y 5 get M2 mul add
495 Mt div sub,
496 tabname=XY1G,
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,
502 plotfuncx=y 4 get
503 y 4 get M2 mul
504 y 0 get M1 mul add
505 Mt div sub ,
506 plotfuncy=5 get
507 y 1 get M1 mul
508 y 5 get M2 mul add
509 Mt div sub,
510 tabname=XY2G,
511 saveData,filename=XY2G.dat
512 ]{0}{41.07}{\InitCond}{\GravAlgIIcorps}
513 \listplot[unit=1,linecolor=blue]{XY2G aload pop}
514 % centre de masse
515 %\psequadiff[plotpoints=1000,algebraic,
516 % plotfuncx=y dup 0 get M1 mul exch
517 % 4 get M2 mul add
518 % Mt div,
519 % plotfuncy=dup 1 get M1 mul exch
520 % 5 get M2 mul add
521 % Mt div,
522 % tabname=XGYG
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}
529 \psdots(M01)(M02)
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}
536 \end{pspicture}
537 \end{center}
538 %\end{document}
539 La partie suivante est une animation en \textit{temps réel}.
540
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 :
542 \begin{verbatim}
543 \psequadiff[plotpoints=1000,algebraic,
544 plotfuncx=y 0 get
545 y 4 get M2 mul
546 y 0 get M1 mul add
547 Mt div sub ,
548 plotfuncy=1 get
549 y 1 get
550 M1 mul
551 y 5 get M2 mul add
552 Mt div sub,
553 tabname=XY1G,
554 saveData,filename=XY1G.dat
555 ]{0}{41.07}{\InitCond}{\GravAlgIIcorps}
556 \end{verbatim}
557 Cette option est ensuite désactivée. Pour l'animation, les fichiers sont lus et les données placées dans un tableau.
558 \begin{verbatim}
559 \pstVerb{/XY1 [(XYM1.dat) run] def
560 /XY2 [(XYM2.dat) run] def
561 \end{verbatim}
562 On pourra, éventuellement, tracer un segment joignant les deux corps en activant la ligne :
563 \begin{verbatim}
564 %\psline[linestyle=dashed,linecolor=white](!X1 Y1)(!X2 Y2)
565 \end{verbatim}
566
567 \newpage
568 \section{L'animation}
569 \begin{center}
570 \pstVerb{/XY1 [(XY1G.dat) run] def
571 /XY2 [(XY2G.dat) run] def
572 }%
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)
582 \newframe
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
588 }%
589 %\psdot(!X1 Y1)
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)
593 }
594 \end{animateinline}
595 \end{center}
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 :
598 \[
599 \left\{
600 \begin{array}[m]{l}
601 x_{2/1}=x_2-x_1\\
602 y_{2/1}=y_2-y_1
603 \end{array}
604 \right.
605 \]
606 \begin{verbatim}
607 % 0 1 2 3 4 5 6 7
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
612 \end{verbatim}
613
614 \begin{verbatim}
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,
619 tabname=XY21,
620 saveData,filename=XY21.dat
621 ]{0}{41.07}{\InitCond}{\GravAlgIIcorps}
622 \end{verbatim}
623 \begin{center}
624 \begin{pspicture}(-7,-9)(3,3)
625 \pstVerb{
626 /arccos {
627 dup
628 dup mul neg 1 add sqrt
629 exch
630 atan
631 } def
632 /G 1 def
633 /x01 2 def
634 /y01 2 def
635 /v0x1 .2 def
636 /v0y1 0.25 def
637 /x02 -3 def
638 /y02 0 def
639 /v0x2 -0.25 def
640 /v0y2 -0.5 def
641 /M1 3 def
642 /M2 1 def
643 /Mt M1 M2 add def
644 /mu M1 M2 mul M1 M2 add div def % masse réduite
645 /K G Mt mul def
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
651 /K2 M1 Mt div def
652 % conditions initiales pour le point réduit
653 /xr0 x02 x01 sub def
654 /yr0 y02 y01 sub def
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
664 def
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
670 % phase
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
684 % periode
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
689 }%
690 %% 0 1 2 3 4 5 6 7
691 %% x1 y1 x'1 y'1 x2 y2 x'2 y'2
692 \def\InitCond{ x01 y01 v0x1 v0y1 x02 y02 v0x2 v0y2}
693 \psset{method=rk4}
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,
699 tabname=XY21,
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}
718 \end{pspicture}
719 \end{center}
720 Le mouvement de $M_1$ par rapport à $M_2$ :
721 \begin{verbatim}
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,
726 tabname=XY12,
727 saveData,filename=XY12.dat
728 ]{0}{41.07}{\InitCond}{\GravAlgIIcorps}
729 \end{verbatim}
730 \begin{center}
731 \begin{pspicture}(-3,-2)(8,8)
732 \pstVerb{
733 /arccos {
734 dup
735 dup mul neg 1 add sqrt
736 exch
737 atan
738 } def
739 /G 1 def
740 /x01 2 def
741 /y01 2 def
742 /v0x1 .2 def
743 /v0y1 0.25 def
744 /x02 -3 def
745 /y02 0 def
746 /v0x2 -0.25 def
747 /v0y2 -0.5 def
748 /M1 3 def
749 /M2 1 def
750 /Mt M1 M2 add def
751 /mu M1 M2 mul M1 M2 add div def % masse réduite
752 /K G Mt mul def
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
758 /K2 M1 Mt div def
759 % conditions initiales pour le point réduit
760 /xr0 x02 x01 sub def
761 /yr0 y02 y01 sub def
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
771 def
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
777 % phase
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
791 % periode
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
796 }%
797 %% 0 1 2 3 4 5 6 7
798 %% x1 y1 x'1 y'1 x2 y2 x'2 y'2
799 \def\InitCond{ x01 y01 v0x1 v0y1 x02 y02 v0x2 v0y2}
800 \psset{method=rk4}
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,
806 % tabname=XY21,
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,
814 tabname=XY12,
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}
828 \end{pspicture}
829 \end{center}
830 \section{Animation du mouvement de $M_1$ par rapport à $M_2$}
831 \begin{center}
832 \pstVerb{/XY12 [(XY12.dat) run] def
833 }%
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}
842 \newframe
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
846 }%
847 \pscircle*[linecolor=red](!X1 Y1){0.3}
848 }
849 \end{animateinline}
850 \end{center}
851 \end{document}

Licence Creative Commons Les fichiers de Syracuse sont mis à disposition (sauf mention contraire) selon les termes de la
Licence Creative Commons Attribution - Pas d’Utilisation Commerciale - Partage dans les Mêmes Conditions 4.0 International.