Advertisement
Guest User

Untitled

a guest
Jul 7th, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.06 KB | None | 0 0
  1. documentclass[border=0pt,10pt,dvipsnames]{standalone}
  2. usepackage{amsmath}
  3. usepackage{pstricks}
  4. usepackage{dashrule}
  5. usepackage{pst-plot}%, pst-math}
  6. usepackage{pst-func}
  7. usepackage{pst-ode}
  8. usepackage{pst-3dplot}
  9. usepackage{pst-solides3d}
  10. usepackage[off]{auto-pst-pdf}
  11. usepackage[nomessages]{fp}
  12. psset{algebraic,unit=2}
  13. usepackage[active,tightpage]{preview}
  14. PreviewBorder=12pt
  15. PreviewEnvironment{pspicture}
  16.  
  17.  
  18.  
  19.  
  20. makeatletter
  21. deflistplotIIID{defpst@par{}pst@object{listplotIIID}}
  22. deflistplotIIID@i#1{%
  23. @nameuse{beginplot@psplotstyle}%
  24. addto@pscode{%
  25. /viewpointXYZ {pst@solides@viewpoint} def
  26. /Decran pst@solides@Decranspace def % distance de l'ecran
  27. viewpointXYZ /ZpointVue ED /YpointVue ED /XpointVue ED
  28. /THETA {YpointVue XpointVue atan} bind def
  29. /PHI {ZpointVue XpointVue dup mul YpointVue dup mul add sqrt atan} bind def
  30. /Dobs {XpointVue dup mul YpointVue dup mul add ZpointVue dup mul add sqrt} bind def
  31. XpointVue YpointVue ZpointVue /viewpoint defpoint3d
  32. /XYZ [#1] def
  33. /@tabXYZ [
  34. 0 3 XYZ length 3 sub {/i exch def
  35. XYZ i get
  36. XYZ i 1 add get
  37. XYZ i 2 add get
  38. 3dto2d
  39. pst@numberpsunit mul exch
  40. pst@numberpsunit mul exch
  41. } for
  42. ] bind def
  43. [ @tabXYZ aload pop
  44. }%
  45. @nameuse{endplot@psplotstyle}}%
  46. makeatother
  47.  
  48.  
  49. defr(#1){0.25*sqrt((9-#1*#1)*(#1*#1+1))}
  50. defrs(#1){-(1/4)*#1*(#1^2-4)/sqrt(-(#1^2-9)*(#1^2+1))}
  51. defrss(#1){-(1/4)*(#1^6-12*#1^4-27*#1^2+36)/((#1^2-9)*(#1^2+1)*sqrt(-(#1^2-9)*(#1^2+1))) }
  52.  
  53.  
  54. begin{document}
  55. begin{pspicture}(-2.1,-1.1)(2.5,1.2)
  56. psset[pst-solides3d]{viewpoint=20 5 20,Decran=20,lightsrc=viewpoint}
  57. defFunction[algebraic]{rot}(t,v){r(t)*sin(v)} {t} {r(t)*cos(v)}
  58. psSolid[object=surfaceparametree,base=-3 3 0 6.28,
  59. inhue=0.01 0.11, hue=0.1 0,
  60. function=rot,linewidth=0.5pt,grid=false,opacity=0.8,ngrid=200 70,
  61. intersectiontype=0,
  62. %% Intersections with planes [a b c d] = ax + by + cz + d = 0
  63. intersectionplan={[0 1 0 0] [0 1 0 -2.828] [0 0 1 0]},
  64. intersectioncolor=(red) (red) (blue),
  65. intersectionlinewidth=1 1]
  66.  
  67. axesIIID(1,3,1)(2,3.5,2)
  68.  
  69. pstODEsolve[algebraic,algebraicOutputFormat]{test}{r(x[2])*sin(x[0])
  70. | x[2] | r(x[2])*cos(x[0])}{0}{14}{2000}{1.57 1 2.8284 0}{ x[1] |
  71. -2*rs(x[2])*x[1]*x[3]/(r(x[2]))| x[3] |
  72. -rss(x[2])*rs(x[2])*x[3]*x[3]/(rs(x[2])*rs(x[2])+1)
  73. +rs(x[2])*r(x[2])*x[1]*x[1]/(rs(x[2])*rs(x[2])+1)}
  74.  
  75. listplotIIID[linecolor=black,linewidth=1pt]{test}
  76.  
  77. pstODEsolve[algebraic,algebraicOutputFormat]{test}{r(x[2])*sin(x[0]) |
  78. x[2] | r(x[2])*cos(x[0])}{0}{2}{500}{1.57 -1 2.8284 0}{ x[1] |
  79. -2*rs(x[2])*x[1]*x[3]/(r(x[2]))| x[3] |
  80. -rss(x[2])*rs(x[2])*x[3]*x[3]/(rs(x[2])*rs(x[2])+1)
  81. +rs(x[2])*r(x[2])*x[1]*x[1]/(rs(x[2])*rs(x[2])+1)}
  82. listplotIIID[linecolor=black,linewidth=1pt]{test}
  83. psSolid[object=point,args=0.75 2.828 0]
  84. end{pspicture}
  85. end{document}
  86.  
  87. documentclass[border=0pt,10pt,dvipsnames,pstricks]{standalone}
  88. usepackage{amsmath}
  89. usepackage{dashrule}
  90. usepackage{pst-plot}%, pst-math}
  91. usepackage{pst-func}
  92. usepackage{pst-ode}
  93. usepackage{pst-3dplot}
  94.  
  95. usepackage{pst-solides3d}
  96. usepackage[nomessages]{fp}
  97. psset{algebraic,unit=2}
  98.  
  99. makeatletter
  100. define@key[psset]{}{valuerange}[1-]{expandafterpst@getrange#1@nil}
  101. defpst@getrange#1-#2@nil{%
  102. ifxrelax#1relax defpst@startvalue{1 }elsedefpst@startvalue{#1 }fi%
  103. ifxrelax#2relax defpst@endvalue{1e32 }elsedefpst@endvalue{#2 }fi%
  104. }
  105. psset{valuerange=1-}
  106.  
  107. deflistplotIIID{defpst@par{}pst@object{listplotIIID}}
  108. deflistplotIIID@i#1{%
  109. @nameuse{beginplot@psplotstyle}%
  110. addto@pscode{%
  111. /viewpointXYZ {pst@solides@viewpoint} def
  112. /Decran pst@solides@Decranspace def % distance de l'ecran
  113. viewpointXYZ /ZpointVue ED /YpointVue ED /XpointVue ED
  114. /THETA {YpointVue XpointVue atan} bind def
  115. /PHI {ZpointVue XpointVue dup mul YpointVue dup mul add sqrt atan} bind def
  116. /Dobs {XpointVue dup mul YpointVue dup mul add ZpointVue dup mul add sqrt} bind def
  117. XpointVue YpointVue ZpointVue /viewpoint defpoint3d
  118. /XYZ [#1] def
  119. /@tabXYZ [
  120. 0 3 XYZ length 3 sub {
  121. /i exch def
  122. XYZ i get
  123. XYZ i 1 add get
  124. XYZ i 2 add get
  125. i 3 div dup /ii ED
  126. pst@startvalue ge {
  127. ii pst@endvalue le {
  128. 3dto2d
  129. pst@numberpsunit mul exch
  130. pst@numberpsunit mul exch
  131. } { pop pop pop } ifelse
  132. }{ pop pop pop } ifelse
  133. } for
  134. ] bind def
  135. [ @tabXYZ aload pop
  136. }%
  137. @nameuse{endplot@psplotstyle}}%
  138. makeatother
  139.  
  140. defr(#1){0.25*sqrt((9-#1*#1)*(#1*#1+1))}
  141. defrs(#1){-(1/4)*#1*(#1^2-4)/sqrt(-(#1^2-9)*(#1^2+1))}
  142. defrss(#1){-(1/4)*(#1^6-12*#1^4-27*#1^2+36)/((#1^2-9)*(#1^2+1)*sqrt(-(#1^2-9)*(#1^2+1))) }
  143.  
  144.  
  145. begin{document}
  146. begin{pspicture}(-2.1,-1.1)(2.5,1.2)
  147. psset[pst-solides3d]{viewpoint=20 5 20,Decran=20,lightsrc=viewpoint}
  148. defFunction[algebraic]{rot}(t,v){r(t)*sin(v)} {t} {r(t)*cos(v)}
  149. %psSolid[object=surfaceparametree,base=-3 3 0 6.28,inhue=0.01 0.11, hue=0.1 0,
  150. % function=rot,linewidth=0.5pt,grid=false,opacity=0.8,ngrid=200 70,
  151. % intersectiontype=0,
  152. % %% Intersections with planes [a b c d] = ax + by + cz + d = 0
  153. % intersectionplan={[0 1 0 0] [0 1 0 -2.828] [0 0 1 0]},
  154. % intersectioncolor=(red) (red) (blue),
  155. % intersectionlinewidth=1 1]
  156.  
  157. axesIIID(1,3,1)(2,3.5,2)
  158.  
  159. pstODEsolve[algebraic,algebraicOutputFormat,%saveData
  160. ]{test}{r(x[2])*sin(x[0])
  161. | x[2] | r(x[2])*cos(x[0])}{0}{14}{2000}{1.57 1 2.8284 0}{ x[1] |
  162. -2*rs(x[2])*x[1]*x[3]/(r(x[2]))| x[3] |
  163. -rss(x[2])*rs(x[2])*x[3]*x[3]/(rs(x[2])*rs(x[2])+1)
  164. +rs(x[2])*r(x[2])*x[1]*x[1]/(rs(x[2])*rs(x[2])+1)}
  165.  
  166. listplotIIID[linewidth=1pt,linecolor=red,valuerange={-50}]{test}
  167. listplotIIID[linewidth=1pt,linecolor=green,valuerange={50-100}]{test}
  168. listplotIIID[linewidth=1pt,linecolor=blue,valuerange={100-}]{test}
  169.  
  170. pstODEsolve[algebraic,algebraicOutputFormat]{test}{
  171. r(x[2])*sin(x[0]) |
  172. x[2] |
  173. r(x[2])*cos(x[0])}{0}{2}{500}{1.57 -1 2.8284 0}{ x[1] |
  174. -2*rs(x[2])*x[1]*x[3]/(r(x[2]))| x[3] |
  175. -rss(x[2])*rs(x[2])*x[3]*x[3]/(rs(x[2])*rs(x[2])+1)
  176. +rs(x[2])*r(x[2])*x[1]*x[1]/(rs(x[2])*rs(x[2])+1)}
  177.  
  178. listplotIIID[linewidth=1pt,linecolor=cyan,valuerange={-50}]{test}
  179. listplotIIID[linewidth=1pt,linecolor=magenta,valuerange={50-100}]{test}
  180. listplotIIID[linewidth=1pt,linecolor=gray,valuerange={100-}]{test}
  181.  
  182. %psSolid[object=point,args=0.75 2.828 0]
  183.  
  184. end{pspicture}
  185.  
  186. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement