Debian Codegraph @

texmf-dist/doc/generic/pst-ode/examples/particle.tex

raw
1 \documentclass{article}
2 \usepackage{pst-ode,pst-3dplot}
3 \usepackage[T1]{fontenc}
4 \usepackage[latin1]{inputenc}%
5
6 \begin{document}
7 \begin{center}
8 \psset{unit=0.74cm,Alpha=40,Beta=20}
9 \begin{pspicture}(-10,-2)(6,13)
10 \newpsstyle{vecteurA}{arrowinset=0.1,arrowsize=0.15,linecolor={[rgb]{0 0.5 1}}}
11 \pstVerb{
12 /wc 5 def
13 /tau 5 def
14 /vx 20 def
15 /vz 2 def
16 }
17 \pstODEsolve[algebraic]{particleXYZ}{0 1 2}{0}{25}{1000}{0 0 0 vx 0 vz}{
18 y[3] | y[4] | y[5] | wc*y[4] - y[3]/tau | -wc*y[3] - y[4]/tau | -y[5]/tau
19 }
20 \listplotThreeD{particleXYZ}
21 \pstThreeDNode(0,0,0){O}
22 \pstThreeDNode(0,0,1){Z}
23 \pstThreeDNode(1,0,0){X}
24 \pstThreeDNode(0,1,0){Y}
25 \pstThreeDNode(-5,-9,0){A}
26 \pstThreeDNode(-5,-9,10){B}
27 \pstThreeDNode(-5,2,10){C}
28 \pstThreeDNode(-5,2,0){D}
29 \pstThreeDNode(5,-9,0){E}
30 \pstThreeDNode(5,-9,10){F}
31 \pstThreeDNode(5,2,10){G}
32 \pstThreeDNode(5,2,0){H}
33 \pstThreeDNode(0,0,0){M0}
34 \pstThreeDNode(vx 5 div,0,vz 5 div){V}
35 \pstThreeDNode(vx 5 div,0,0){Vx}
36 {\psset{linestyle=dashed}
37 \pspolygon(A)(B)(C)(D)
38 \pspolygon(E)(F)(G)(H)
39 \psline(A)(E)
40 \psline(B)(F)
41 \psline(D)(H)
42 \psline(C)(G)}%
43 \psline[linecolor=red]{->}(M0)(V)
44 \psline[linecolor=cyan]{->}(M0)(Vx)
45 \uput{0.1}[l](V){\red$\overrightarrow{v}_0$}
46 {\psset{linestyle=solid,linecolor=red}
47 \psline[style=vecteurA]{->}(O)(X)
48 \psline[style=vecteurA]{->}(O)(Y)
49 \psline[style=vecteurA]{->}(O)(Z)}%
50 \uput[u](Z){$z$}
51 \uput[dl](X){$x$}
52 \uput[r](Y){$y$}
53 \end{pspicture}
54 \end{center}
55 \end{document}