Yukterez

Gravity & Charge, 6 Body Simulator

Feb 18th, 2019 (edited)
112
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (* |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| *)
  2. (* ||| Mathematica Syntax || yukterez.net || 6 Body Newtonian Mass & Charge Simulator ||| *)
  3. (* |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| *)
  4.  
  5. ClearAll["Global`*"]; ClearAll["Local`*"];
  6. Needs["DifferentialEquations`NDSolveProblems`"];
  7. Needs["DifferentialEquations`NDSolveUtilities`"];
  8.  
  9. Amp = 1; kg = 1; m = 1; sek = 1; km = 1000 m; (* SI Einheiten *)
  10.  
  11. mt1 = {"StiffnessSwitching", Method-> {"ExplicitRungeKutta", Automatic}};
  12. mt2 = {"ImplicitRungeKutta", "DifferenceOrder"-> 20};
  13. mt3 = {"EquationSimplification"-> "Residual"};
  14. mt0 = Automatic;
  15. mta = mt2;
  16. wp = MachinePrecision;
  17.  
  18. (* Plot Optionen *)
  19.  
  20. Tmax = 300 sek;
  21. tMax = Min[Tmax, plunge];
  22. trail = 300 sek;
  23. point = 0.015;
  24. thk = 0.004;
  25. plotrange = 1.2 m {{-1, +1}, {-1, +1}, {-1, +1}};
  26. viewpoint = {40, 30, 20};
  27. imagesize = 430;
  28. startpos = 0;
  29.  
  30. (* Konstanten *)
  31.  
  32. G = 667384/10^16 m^3/kg/sek^2;
  33. Λ = 11056*^-56/m^2;
  34. ε0 = 8854187817*^-21 Amp^2 sek^4/kg/m^3;
  35. c = 299792458 m/sek;
  36. Au = 149597870700 m;
  37. dy = 24*3600 sek;
  38. yr = 36525*dy/100;
  39.  
  40. (* Körper 1 *)
  41.  
  42. m1 = 1*^6 kg;
  43. q1 = 0 Amp sek;
  44.  
  45. x1x = 1*^-16 m;
  46. y1y = 0 m;
  47. z1z = 0 m;
  48.  
  49. v1x = 0 m/sek;
  50. v1y = 0 m/sek;
  51. v1z = 0 m/sek;
  52.  
  53. (* Körper 2 *)
  54.  
  55. m2 = 1000 kg;
  56. q2 = 0 Amp sek;
  57.  
  58. x2x = 0.2 m;
  59. y2y = 0 m;
  60. z2z = 0 m;
  61.  
  62. v2x = 0 m/sek;
  63. v2y = 0 m/sek;
  64. v2z = Abs@Sqrt[G m1/x2x];
  65.  
  66. (* Körper 3 *)
  67.  
  68. m3 = 100000 kg;
  69. q3 = 0 Amp sek;
  70.  
  71. x3x = 0 m;
  72. y3y = 0.4 m;
  73. z3z = 0 m;
  74.  
  75. v3x = Abs@Sqrt[G (m1+m2)/y3y];
  76. v3y = 0 m/sek;
  77. v3z = 0 m/sek;
  78.  
  79. (* Körper 4 *)
  80.  
  81. m4 = 10000 kg;
  82. q4 = 0 Amp sek;
  83.  
  84. x4x = 0 m;
  85. y4y = 0 m;
  86. z4z = 0.6 m;
  87.  
  88. v4x = Sqrt[1/2] Abs@Sqrt[G (m1+m2+m3)/z4z];
  89. v4y = Sqrt[1/2] Abs@Sqrt[G (m1+m2+m3)/z4z];
  90. v4z = 0 m/sek;
  91.  
  92. (* Körper 5 *)
  93.  
  94. m5 = 50000 kg;
  95. q5 = 0 Amp sek;
  96.  
  97. x5x = -0.8 m;
  98. y5y = 0 m;
  99. z5z = 0 m;
  100.  
  101. v5x = 0 m/sek;
  102. v5y = Abs@Sqrt[G (m1+m2+m3+m4)/x5x];
  103. v5z = 0 m/sek;
  104.  
  105. (* Körper 6 *)
  106.  
  107. m6 = 10000 kg;
  108. q6 = 0 Amp sek;
  109.  
  110. x6x = 0 m;
  111. y6y = -1 m;
  112. z6z = 0 m;
  113.  
  114. v6x = Sqrt[1/2] Abs@Sqrt[G (m1+m2+m3+m4+m5)/y6y];
  115. v6y = 0 m/sek;
  116. v6z = Sqrt[1/2] Abs@Sqrt[G (m1+m2+m3+m4+m5)/y6y];
  117.  
  118. (* Differentialgleichung *)
  119.  
  120. nds=NDSolve[{
  121.  
  122. x1'[t] == vx1[t], y1'[t] == vy1[t], z1'[t] == vz1[t],
  123. x2'[t] == vx2[t], y2'[t] == vy2[t], z2'[t] == vz2[t],
  124. x3'[t] == vx3[t], y3'[t] == vy3[t], z3'[t] == vz3[t],
  125. x4'[t] == vx4[t], y4'[t] == vy4[t], z4'[t] == vz4[t],
  126. x5'[t] == vx5[t], y5'[t] == vy5[t], z5'[t] == vz5[t],
  127. x6'[t] == vx6[t], y6'[t] == vy6[t], z6'[t] == vz6[t],
  128.  
  129. vx1'[t] ==
  130. (G m2 (x2[t]-x1[t]))/Sqrt[((x2[t]-x1[t])^2+(y2[t]-y1[t])^2+(z2[t]-z1[t])^2)^3]+
  131. (G m3 (x3[t]-x1[t]))/Sqrt[((x3[t]-x1[t])^2+(y3[t]-y1[t])^2+(z3[t]-z1[t])^2)^3]+
  132. (G m4 (x4[t]-x1[t]))/Sqrt[((x4[t]-x1[t])^2+(y4[t]-y1[t])^2+(z4[t]-z1[t])^2)^3]+
  133. (G m5 (x5[t]-x1[t]))/Sqrt[((x5[t]-x1[t])^2+(y5[t]-y1[t])^2+(z5[t]-z1[t])^2)^3]+
  134. (G m6 (x6[t]-x1[t]))/Sqrt[((x6[t]-x1[t])^2+(y6[t]-y1[t])^2+(z6[t]-z1[t])^2)^3]+
  135. If[q1 == 0, 0,
  136. (-q1*q2/(4Pi ε0 )/m1 (x2[t]-x1[t]))/Sqrt[((x2[t]-x1[t])^2+(y2[t]-y1[t])^2+(z2[t]-z1[t])^2)^3]+
  137. (-q1*q3/(4Pi ε0 )/m1 (x3[t]-x1[t]))/Sqrt[((x3[t]-x1[t])^2+(y3[t]-y1[t])^2+(z3[t]-z1[t])^2)^3]+
  138. (-q1*q4/(4Pi ε0 )/m1 (x4[t]-x1[t]))/Sqrt[((x4[t]-x1[t])^2+(y4[t]-y1[t])^2+(z4[t]-z1[t])^2)^3]+
  139. (-q1*q5/(4Pi ε0 )/m1 (x5[t]-x1[t]))/Sqrt[((x5[t]-x1[t])^2+(y5[t]-y1[t])^2+(z5[t]-z1[t])^2)^3]+
  140. (-q1*q6/(4Pi ε0 )/m1 (x6[t]-x1[t]))/Sqrt[((x6[t]-x1[t])^2+(y6[t]-y1[t])^2+(z6[t]-z1[t])^2)^3]]+
  141. Λ*c^2*x1[t]^2/Sqrt[x1[t]^2+y1[t]^2+z1[t]^2],
  142.  
  143. vy1'[t] ==
  144. (G m2 (y2[t]-y1[t]))/Sqrt[((x2[t]-x1[t])^2+(y2[t]-y1[t])^2+(z2[t]-z1[t])^2)^3]+
  145. (G m3 (y3[t]-y1[t]))/Sqrt[((x3[t]-x1[t])^2+(y3[t]-y1[t])^2+(z3[t]-z1[t])^2)^3]+
  146. (G m4 (y4[t]-y1[t]))/Sqrt[((x4[t]-x1[t])^2+(y4[t]-y1[t])^2+(z4[t]-z1[t])^2)^3]+
  147. (G m5 (y5[t]-y1[t]))/Sqrt[((x5[t]-x1[t])^2+(y5[t]-y1[t])^2+(z5[t]-z1[t])^2)^3]+
  148. (G m6 (y6[t]-y1[t]))/Sqrt[((x6[t]-x1[t])^2+(y6[t]-y1[t])^2+(z6[t]-z1[t])^2)^3]+
  149. If[q1 == 0, 0,
  150. (-q1*q2/(4Pi ε0 )/m1 (y2[t]-y1[t]))/Sqrt[((x2[t]-x1[t])^2+(y2[t]-y1[t])^2+(z2[t]-z1[t])^2)^3]+
  151. (-q1*q3/(4Pi ε0 )/m1 (y3[t]-y1[t]))/Sqrt[((x3[t]-x1[t])^2+(y3[t]-y1[t])^2+(z3[t]-z1[t])^2)^3]+
  152. (-q1*q4/(4Pi ε0 )/m1 (y4[t]-y1[t]))/Sqrt[((x4[t]-x1[t])^2+(y4[t]-y1[t])^2+(z4[t]-z1[t])^2)^3]+
  153. (-q1*q5/(4Pi ε0 )/m1 (y5[t]-y1[t]))/Sqrt[((x5[t]-x1[t])^2+(y5[t]-y1[t])^2+(z5[t]-z1[t])^2)^3]+
  154. (-q1*q6/(4Pi ε0 )/m1 (y6[t]-y1[t]))/Sqrt[((x6[t]-x1[t])^2+(y6[t]-y1[t])^2+(z6[t]-z1[t])^2)^3]]+
  155. Λ*c^2*y1[t]^2/Sqrt[x1[t]^2+y1[t]^2+z1[t]^2],
  156.  
  157. vz1'[t] ==
  158. (G m2 (z2[t]-z1[t]))/Sqrt[((x2[t]-x1[t])^2+(y2[t]-y1[t])^2+(z2[t]-z1[t])^2)^3]+
  159. (G m3 (z3[t]-z1[t]))/Sqrt[((x3[t]-x1[t])^2+(y3[t]-y1[t])^2+(z3[t]-z1[t])^2)^3]+
  160. (G m4 (z4[t]-z1[t]))/Sqrt[((x4[t]-x1[t])^2+(y4[t]-y1[t])^2+(z4[t]-z1[t])^2)^3]+
  161. (G m5 (z5[t]-z1[t]))/Sqrt[((x5[t]-x1[t])^2+(y5[t]-y1[t])^2+(z5[t]-z1[t])^2)^3]+
  162. (G m6 (z6[t]-z1[t]))/Sqrt[((x6[t]-x1[t])^2+(y6[t]-y1[t])^2+(z6[t]-z1[t])^2)^3]+
  163. If[q1 == 0, 0,
  164. (-q1*q2/(4Pi ε0 )/m1 (z2[t]-z1[t]))/Sqrt[((x2[t]-x1[t])^2+(y2[t]-y1[t])^2+(z2[t]-z1[t])^2)^3]+
  165. (-q1*q3/(4Pi ε0 )/m1 (z3[t]-z1[t]))/Sqrt[((x3[t]-x1[t])^2+(y3[t]-y1[t])^2+(z3[t]-z1[t])^2)^3]+
  166. (-q1*q4/(4Pi ε0 )/m1 (z4[t]-z1[t]))/Sqrt[((x4[t]-x1[t])^2+(y4[t]-y1[t])^2+(z4[t]-z1[t])^2)^3]+
  167. (-q1*q5/(4Pi ε0 )/m1 (z5[t]-z1[t]))/Sqrt[((x5[t]-x1[t])^2+(y5[t]-y1[t])^2+(z5[t]-z1[t])^2)^3]+
  168. (-q1*q6/(4Pi ε0 )/m1 (z6[t]-z1[t]))/Sqrt[((x6[t]-x1[t])^2+(y6[t]-y1[t])^2+(z6[t]-z1[t])^2)^3]]+
  169. Λ*c^2*z1[t]^2/Sqrt[x1[t]^2+y1[t]^2+z1[t]^2],
  170.  
  171. vx2'[t] ==
  172. (G m1 (x1[t]-x2[t]))/Sqrt[((x1[t]-x2[t])^2+(y1[t]-y2[t])^2+(z1[t]-z2[t])^2)^3]+
  173. (G m3 (x3[t]-x2[t]))/Sqrt[((x3[t]-x2[t])^2+(y3[t]-y2[t])^2+(z3[t]-z2[t])^2)^3]+
  174. (G m4 (x4[t]-x2[t]))/Sqrt[((x4[t]-x2[t])^2+(y4[t]-y2[t])^2+(z4[t]-z2[t])^2)^3]+
  175. (G m5 (x5[t]-x2[t]))/Sqrt[((x5[t]-x2[t])^2+(y5[t]-y2[t])^2+(z5[t]-z2[t])^2)^3]+
  176. (G m6 (x6[t]-x2[t]))/Sqrt[((x6[t]-x2[t])^2+(y6[t]-y2[t])^2+(z6[t]-z2[t])^2)^3]+
  177. If[q2 == 0, 0,
  178. (-q2*q1/(4Pi ε0 )/m2 (x1[t]-x2[t]))/Sqrt[((x1[t]-x2[t])^2+(y1[t]-y2[t])^2+(z1[t]-z2[t])^2)^3]+
  179. (-q2*q3/(4Pi ε0 )/m2 (x3[t]-x2[t]))/Sqrt[((x3[t]-x2[t])^2+(y3[t]-y2[t])^2+(z3[t]-z2[t])^2)^3]+
  180. (-q2*q4/(4Pi ε0 )/m2 (x4[t]-x2[t]))/Sqrt[((x4[t]-x2[t])^2+(y4[t]-y2[t])^2+(z4[t]-z2[t])^2)^3]+
  181. (-q2*q5/(4Pi ε0 )/m2 (x5[t]-x2[t]))/Sqrt[((x5[t]-x2[t])^2+(y5[t]-y2[t])^2+(z5[t]-z2[t])^2)^3]+
  182. (-q2*q6/(4Pi ε0 )/m2 (x6[t]-x2[t]))/Sqrt[((x6[t]-x2[t])^2+(y6[t]-y2[t])^2+(z6[t]-z2[t])^2)^3]]+
  183. Λ*c^2*x2[t]^2/Sqrt[x2[t]^2+y2[t]^2+z2[t]^2],
  184.  
  185. vy2'[t] ==
  186. (G m1 (y1[t]-y2[t]))/Sqrt[((x1[t]-x2[t])^2+(y1[t]-y2[t])^2+(z1[t]-z2[t])^2)^3]+
  187. (G m3 (y3[t]-y2[t]))/Sqrt[((x3[t]-x2[t])^2+(y3[t]-y2[t])^2+(z3[t]-z2[t])^2)^3]+
  188. (G m4 (y4[t]-y2[t]))/Sqrt[((x4[t]-x2[t])^2+(y4[t]-y2[t])^2+(z4[t]-z2[t])^2)^3]+
  189. (G m5 (y5[t]-y2[t]))/Sqrt[((x5[t]-x2[t])^2+(y5[t]-y2[t])^2+(z5[t]-z2[t])^2)^3]+
  190. (G m6 (y6[t]-y2[t]))/Sqrt[((x6[t]-x2[t])^2+(y6[t]-y2[t])^2+(z6[t]-z2[t])^2)^3]+
  191. If[q2 == 0, 0,
  192. (-q2*q1/(4Pi ε0 )/m2 (y1[t]-y2[t]))/Sqrt[((x1[t]-x2[t])^2+(y1[t]-y2[t])^2+(z1[t]-z2[t])^2)^3]+
  193. (-q2*q3/(4Pi ε0 )/m2 (y3[t]-y2[t]))/Sqrt[((x3[t]-x2[t])^2+(y3[t]-y2[t])^2+(z3[t]-z2[t])^2)^3]+
  194. (-q2*q4/(4Pi ε0 )/m2 (y4[t]-y2[t]))/Sqrt[((x4[t]-x2[t])^2+(y4[t]-y2[t])^2+(z4[t]-z2[t])^2)^3]+
  195. (-q2*q5/(4Pi ε0 )/m2 (y5[t]-y2[t]))/Sqrt[((x5[t]-x2[t])^2+(y5[t]-y2[t])^2+(z5[t]-z2[t])^2)^3]+
  196. (-q2*q6/(4Pi ε0 )/m2 (y6[t]-y2[t]))/Sqrt[((x6[t]-x2[t])^2+(y6[t]-y2[t])^2+(z6[t]-z2[t])^2)^3]]+
  197. Λ*c^2*y2[t]^2/Sqrt[x2[t]^2+y2[t]^2+z2[t]^2],
  198.  
  199. vz2'[t] ==
  200. (G m1 (z1[t]-z2[t]))/Sqrt[((x2[t]-x1[t])^2+(y2[t]-y1[t])^2+(z2[t]-z1[t])^2)^3]+
  201. (G m3 (z3[t]-z2[t]))/Sqrt[((x3[t]-x2[t])^2+(y3[t]-y2[t])^2+(z3[t]-z2[t])^2)^3]+
  202. (G m4 (z4[t]-z2[t]))/Sqrt[((x4[t]-x2[t])^2+(y4[t]-y2[t])^2+(z4[t]-z2[t])^2)^3]+
  203. (G m5 (z5[t]-z2[t]))/Sqrt[((x5[t]-x2[t])^2+(y5[t]-y2[t])^2+(z5[t]-z2[t])^2)^3]+
  204. (G m6 (z6[t]-z2[t]))/Sqrt[((x6[t]-x2[t])^2+(y6[t]-y2[t])^2+(z6[t]-z2[t])^2)^3]+
  205. If[q2 == 0, 0,
  206. (-q2*q1/(4Pi ε0 )/m2 (z1[t]-z2[t]))/Sqrt[((x2[t]-x1[t])^2+(y2[t]-y1[t])^2+(z2[t]-z1[t])^2)^3]+
  207. (-q2*q3/(4Pi ε0 )/m2 (z3[t]-z2[t]))/Sqrt[((x3[t]-x2[t])^2+(y3[t]-y2[t])^2+(z3[t]-z2[t])^2)^3]+
  208. (-q2*q4/(4Pi ε0 )/m2 (z4[t]-z2[t]))/Sqrt[((x4[t]-x2[t])^2+(y4[t]-y2[t])^2+(z4[t]-z2[t])^2)^3]+
  209. (-q2*q5/(4Pi ε0 )/m2 (z5[t]-z2[t]))/Sqrt[((x5[t]-x2[t])^2+(y5[t]-y2[t])^2+(z5[t]-z2[t])^2)^3]+
  210. (-q2*q6/(4Pi ε0 )/m2 (z6[t]-z2[t]))/Sqrt[((x6[t]-x2[t])^2+(y6[t]-y2[t])^2+(z6[t]-z2[t])^2)^3]]+
  211. Λ*c^2*z2[t]^2/Sqrt[x2[t]^2+y2[t]^2+z2[t]^2],
  212.  
  213. vx3'[t] ==
  214. (G m1 (x1[t]-x3[t]))/Sqrt[((x1[t]-x3[t])^2+(y1[t]-y3[t])^2+(z1[t]-z3[t])^2)^3]+
  215. (G m2 (x2[t]-x3[t]))/Sqrt[((x2[t]-x3[t])^2+(y2[t]-y3[t])^2+(z2[t]-z3[t])^2)^3]+
  216. (G m4 (x4[t]-x3[t]))/Sqrt[((x4[t]-x3[t])^2+(y4[t]-y3[t])^2+(z4[t]-z3[t])^2)^3]+
  217. (G m5 (x5[t]-x3[t]))/Sqrt[((x5[t]-x3[t])^2+(y5[t]-y3[t])^2+(z5[t]-z3[t])^2)^3]+
  218. (G m6 (x6[t]-x3[t]))/Sqrt[((x6[t]-x3[t])^2+(y6[t]-y3[t])^2+(z6[t]-z3[t])^2)^3]+
  219. If[q3 == 0, 0,
  220. (-q3*q1/(4Pi ε0 )/m3 (x1[t]-x3[t]))/Sqrt[((x1[t]-x3[t])^2+(y1[t]-y3[t])^2+(z1[t]-z3[t])^2)^3]+
  221. (-q3*q2/(4Pi ε0 )/m3 (x2[t]-x3[t]))/Sqrt[((x2[t]-x3[t])^2+(y2[t]-y3[t])^2+(z2[t]-z3[t])^2)^3]+
  222. (-q3*q4/(4Pi ε0 )/m3 (x4[t]-x3[t]))/Sqrt[((x4[t]-x3[t])^2+(y4[t]-y3[t])^2+(z4[t]-z3[t])^2)^3]+
  223. (-q3*q5/(4Pi ε0 )/m3 (x5[t]-x3[t]))/Sqrt[((x5[t]-x3[t])^2+(y5[t]-y3[t])^2+(z5[t]-z3[t])^2)^3]+
  224. (-q3*q6/(4Pi ε0 )/m3 (x6[t]-x3[t]))/Sqrt[((x6[t]-x3[t])^2+(y6[t]-y3[t])^2+(z6[t]-z3[t])^2)^3]]+
  225. Λ*c^2*x3[t]^2/Sqrt[x3[t]^2+y3[t]^2+z3[t]^2],
  226.  
  227. vy3'[t] ==
  228. (G m1 (y1[t]-y3[t]))/Sqrt[((x1[t]-x3[t])^2+(y1[t]-y3[t])^2+(z1[t]-z3[t])^2)^3]+
  229. (G m2 (y2[t]-y3[t]))/Sqrt[((x2[t]-x3[t])^2+(y2[t]-y3[t])^2+(z2[t]-z3[t])^2)^3]+
  230. (G m4 (y4[t]-y3[t]))/Sqrt[((x4[t]-x3[t])^2+(y4[t]-y3[t])^2+(z4[t]-z3[t])^2)^3]+
  231. (G m5 (y5[t]-y3[t]))/Sqrt[((x5[t]-x3[t])^2+(y5[t]-y3[t])^2+(z5[t]-z3[t])^2)^3]+
  232. (G m6 (y6[t]-y3[t]))/Sqrt[((x6[t]-x3[t])^2+(y6[t]-y3[t])^2+(z6[t]-z3[t])^2)^3]+
  233. If[q3 == 0, 0,
  234. (-q3*q1/(4Pi ε0 )/m3 (y1[t]-y3[t]))/Sqrt[((x1[t]-x3[t])^2+(y1[t]-y3[t])^2+(z1[t]-z3[t])^2)^3]+
  235. (-q3*q2/(4Pi ε0 )/m3 (y2[t]-y3[t]))/Sqrt[((x2[t]-x3[t])^2+(y2[t]-y3[t])^2+(z2[t]-z3[t])^2)^3]+
  236. (-q3*q4/(4Pi ε0 )/m3 (y4[t]-y3[t]))/Sqrt[((x4[t]-x3[t])^2+(y4[t]-y3[t])^2+(z4[t]-z3[t])^2)^3]+
  237. (-q3*q5/(4Pi ε0 )/m3 (y5[t]-y3[t]))/Sqrt[((x5[t]-x3[t])^2+(y5[t]-y3[t])^2+(z5[t]-z3[t])^2)^3]+
  238. (-q3*q6/(4Pi ε0 )/m3 (y6[t]-y3[t]))/Sqrt[((x6[t]-x3[t])^2+(y6[t]-y3[t])^2+(z6[t]-z3[t])^2)^3]]+
  239. Λ*c^2*y3[t]^2/Sqrt[x3[t]^2+y3[t]^2+z3[t]^2],
  240.  
  241. vz3'[t] ==
  242. (G m1 (z1[t]-z3[t]))/Sqrt[((x1[t]-x3[t])^2+(y1[t]-y3[t])^2+(z1[t]-z3[t])^2)^3]+
  243. (G m2 (z2[t]-z3[t]))/Sqrt[((x2[t]-x3[t])^2+(y2[t]-y3[t])^2+(z2[t]-z3[t])^2)^3]+
  244. (G m4 (z4[t]-z3[t]))/Sqrt[((x4[t]-x3[t])^2+(y4[t]-y3[t])^2+(z4[t]-z3[t])^2)^3]+
  245. (G m5 (z5[t]-z3[t]))/Sqrt[((x5[t]-x3[t])^2+(y5[t]-y3[t])^2+(z5[t]-z3[t])^2)^3]+
  246. (G m6 (z6[t]-z3[t]))/Sqrt[((x6[t]-x3[t])^2+(y6[t]-y3[t])^2+(z6[t]-z3[t])^2)^3]+
  247. If[q3 == 0, 0,
  248. (-q3*q1/(4Pi ε0 )/m3 (z1[t]-z3[t]))/Sqrt[((x1[t]-x3[t])^2+(y1[t]-y3[t])^2+(z1[t]-z3[t])^2)^3]+
  249. (-q3*q2/(4Pi ε0 )/m3 (z2[t]-z3[t]))/Sqrt[((x2[t]-x3[t])^2+(y2[t]-y3[t])^2+(z2[t]-z3[t])^2)^3]+
  250. (-q3*q4/(4Pi ε0 )/m3 (z4[t]-z3[t]))/Sqrt[((x4[t]-x3[t])^2+(y4[t]-y3[t])^2+(z4[t]-z3[t])^2)^3]+
  251. (-q3*q5/(4Pi ε0 )/m3 (z5[t]-z3[t]))/Sqrt[((x5[t]-x3[t])^2+(y5[t]-y3[t])^2+(z5[t]-z3[t])^2)^3]+
  252. (-q3*q6/(4Pi ε0 )/m3 (z6[t]-z3[t]))/Sqrt[((x6[t]-x3[t])^2+(y6[t]-y3[t])^2+(z6[t]-z3[t])^2)^3]]+
  253. Λ*c^2*z3[t]^2/Sqrt[x3[t]^2+y3[t]^2+z3[t]^2],
  254.  
  255. vx4'[t] ==
  256. (G m1 (x1[t]-x4[t]))/Sqrt[((x1[t]-x4[t])^2+(y1[t]-y4[t])^2+(z1[t]-z4[t])^2)^3]+
  257. (G m2 (x2[t]-x4[t]))/Sqrt[((x2[t]-x4[t])^2+(y2[t]-y4[t])^2+(z2[t]-z4[t])^2)^3]+
  258. (G m3 (x3[t]-x4[t]))/Sqrt[((x3[t]-x4[t])^2+(y3[t]-y4[t])^2+(z3[t]-z4[t])^2)^3]+
  259. (G m5 (x5[t]-x4[t]))/Sqrt[((x5[t]-x4[t])^2+(y5[t]-y4[t])^2+(z5[t]-z4[t])^2)^3]+
  260. (G m6 (x6[t]-x4[t]))/Sqrt[((x6[t]-x4[t])^2+(y6[t]-y4[t])^2+(z6[t]-z4[t])^2)^3]+
  261. If[q4 == 0, 0,
  262. (-q4*q1/(4Pi ε0 )/m4 (x1[t]-x4[t]))/Sqrt[((x1[t]-x4[t])^2+(y1[t]-y4[t])^2+(z1[t]-z4[t])^2)^3]+
  263. (-q4*q2/(4Pi ε0 )/m4 (x2[t]-x4[t]))/Sqrt[((x2[t]-x4[t])^2+(y2[t]-y4[t])^2+(z2[t]-z4[t])^2)^3]+
  264. (-q4*q3/(4Pi ε0 )/m4 (x3[t]-x4[t]))/Sqrt[((x3[t]-x4[t])^2+(y3[t]-y4[t])^2+(z3[t]-z4[t])^2)^3]+
  265. (-q4*q5/(4Pi ε0 )/m4 (x5[t]-x4[t]))/Sqrt[((x5[t]-x4[t])^2+(y5[t]-y4[t])^2+(z5[t]-z4[t])^2)^3]+
  266. (-q4*q6/(4Pi ε0 )/m4 (x6[t]-x4[t]))/Sqrt[((x6[t]-x4[t])^2+(y6[t]-y4[t])^2+(z6[t]-z4[t])^2)^3]]+
  267. Λ*c^2*x4[t]^2/Sqrt[x4[t]^2+y4[t]^2+z4[t]^2],
  268.  
  269. vy4'[t] ==
  270. (G m1 (y1[t]-y4[t]))/Sqrt[((x1[t]-x4[t])^2+(y1[t]-y4[t])^2+(z1[t]-z4[t])^2)^3]+
  271. (G m2 (y2[t]-y4[t]))/Sqrt[((x2[t]-x4[t])^2+(y2[t]-y4[t])^2+(z2[t]-z4[t])^2)^3]+
  272. (G m3 (y3[t]-y4[t]))/Sqrt[((x3[t]-x4[t])^2+(y3[t]-y4[t])^2+(z3[t]-z4[t])^2)^3]+
  273. (G m5 (y5[t]-y4[t]))/Sqrt[((x5[t]-x4[t])^2+(y5[t]-y4[t])^2+(z5[t]-z4[t])^2)^3]+
  274. (G m6 (y6[t]-y4[t]))/Sqrt[((x6[t]-x4[t])^2+(y6[t]-y4[t])^2+(z6[t]-z4[t])^2)^3]+
  275. If[q4 == 0, 0,
  276. (-q4*q1/(4Pi ε0 )/m4 (y1[t]-y4[t]))/Sqrt[((x1[t]-x4[t])^2+(y1[t]-y4[t])^2+(z1[t]-z4[t])^2)^3]+
  277. (-q4*q2/(4Pi ε0 )/m4 (y2[t]-y4[t]))/Sqrt[((x2[t]-x4[t])^2+(y2[t]-y4[t])^2+(z2[t]-z4[t])^2)^3]+
  278. (-q4*q3/(4Pi ε0 )/m4 (y3[t]-y4[t]))/Sqrt[((x3[t]-x4[t])^2+(y3[t]-y4[t])^2+(z3[t]-z4[t])^2)^3]+
  279. (-q4*q5/(4Pi ε0 )/m4 (y5[t]-y4[t]))/Sqrt[((x5[t]-x4[t])^2+(y5[t]-y4[t])^2+(z5[t]-z4[t])^2)^3]+
  280. (-q4*q6/(4Pi ε0 )/m4 (y6[t]-y4[t]))/Sqrt[((x6[t]-x4[t])^2+(y6[t]-y4[t])^2+(z6[t]-z4[t])^2)^3]]+
  281. Λ*c^2*y4[t]^2/Sqrt[x4[t]^2+y4[t]^2+z4[t]^2],
  282.  
  283. vz4'[t] ==
  284. (G m1 (z1[t]-z4[t]))/Sqrt[((x1[t]-x4[t])^2+(y1[t]-y4[t])^2+(z1[t]-z4[t])^2)^3]+
  285. (G m2 (z2[t]-z4[t]))/Sqrt[((x2[t]-x4[t])^2+(y2[t]-y4[t])^2+(z2[t]-z4[t])^2)^3]+
  286. (G m3 (z3[t]-z4[t]))/Sqrt[((x3[t]-x4[t])^2+(y3[t]-y4[t])^2+(z3[t]-z4[t])^2)^3]+
  287. (G m5 (z5[t]-z4[t]))/Sqrt[((x5[t]-x4[t])^2+(y5[t]-y4[t])^2+(z5[t]-z4[t])^2)^3]+
  288. (G m6 (z6[t]-z4[t]))/Sqrt[((x6[t]-x4[t])^2+(y6[t]-y4[t])^2+(z6[t]-z4[t])^2)^3]+
  289. If[q4 == 0, 0,
  290. (-q4*q1/(4Pi ε0 )/m4 (z1[t]-z4[t]))/Sqrt[((x1[t]-x4[t])^2+(y1[t]-y4[t])^2+(z1[t]-z4[t])^2)^3]+
  291. (-q4*q2/(4Pi ε0 )/m4 (z2[t]-z4[t]))/Sqrt[((x2[t]-x4[t])^2+(y2[t]-y4[t])^2+(z2[t]-z4[t])^2)^3]+
  292. (-q4*q3/(4Pi ε0 )/m4 (z3[t]-z4[t]))/Sqrt[((x3[t]-x4[t])^2+(y3[t]-y4[t])^2+(z3[t]-z4[t])^2)^3]+
  293. (-q4*q5/(4Pi ε0 )/m4 (z5[t]-z4[t]))/Sqrt[((x5[t]-x4[t])^2+(y5[t]-y4[t])^2+(z5[t]-z4[t])^2)^3]+
  294. (-q4*q6/(4Pi ε0 )/m4 (z6[t]-z4[t]))/Sqrt[((x6[t]-x4[t])^2+(y6[t]-y4[t])^2+(z6[t]-z4[t])^2)^3]]+
  295. Λ*c^2*z4[t]^2/Sqrt[x4[t]^2+y4[t]^2+z4[t]^2],
  296.  
  297. vx5'[t] ==
  298. (G m1 (x1[t]-x5[t]))/Sqrt[((x1[t]-x5[t])^2+(y1[t]-y5[t])^2+(z1[t]-z5[t])^2)^3]+
  299. (G m2 (x2[t]-x5[t]))/Sqrt[((x2[t]-x5[t])^2+(y2[t]-y5[t])^2+(z2[t]-z5[t])^2)^3]+
  300. (G m3 (x3[t]-x5[t]))/Sqrt[((x3[t]-x5[t])^2+(y3[t]-y5[t])^2+(z3[t]-z5[t])^2)^3]+
  301. (G m4 (x4[t]-x5[t]))/Sqrt[((x4[t]-x5[t])^2+(y4[t]-y5[t])^2+(z4[t]-z5[t])^2)^3]+
  302. (G m6 (x6[t]-x5[t]))/Sqrt[((x6[t]-x5[t])^2+(y6[t]-y5[t])^2+(z6[t]-z5[t])^2)^3]+
  303. If[q5 == 0, 0,
  304. (-q5*q1/(4Pi ε0 )/m5 (x1[t]-x5[t]))/Sqrt[((x1[t]-x5[t])^2+(y1[t]-y5[t])^2+(z1[t]-z5[t])^2)^3]+
  305. (-q5*q2/(4Pi ε0 )/m5 (x2[t]-x5[t]))/Sqrt[((x2[t]-x5[t])^2+(y2[t]-y5[t])^2+(z2[t]-z5[t])^2)^3]+
  306. (-q5*q3/(4Pi ε0 )/m5 (x3[t]-x5[t]))/Sqrt[((x3[t]-x5[t])^2+(y3[t]-y5[t])^2+(z3[t]-z5[t])^2)^3]+
  307. (-q5*q4/(4Pi ε0 )/m5 (x4[t]-x5[t]))/Sqrt[((x4[t]-x5[t])^2+(y4[t]-y5[t])^2+(z4[t]-z5[t])^2)^3]+
  308. (-q5*q6/(4Pi ε0 )/m5 (x6[t]-x5[t]))/Sqrt[((x6[t]-x5[t])^2+(y6[t]-y5[t])^2+(z6[t]-z5[t])^2)^3]]+
  309. Λ*c^2*x5[t]^2/Sqrt[x5[t]^2+y5[t]^2+z5[t]^2],
  310.  
  311. vy5'[t] ==
  312. (G m1 (y1[t]-y5[t]))/Sqrt[((x1[t]-x5[t])^2+(y1[t]-y5[t])^2+(z1[t]-z5[t])^2)^3]+
  313. (G m2 (y2[t]-y5[t]))/Sqrt[((x2[t]-x5[t])^2+(y2[t]-y5[t])^2+(z2[t]-z5[t])^2)^3]+
  314. (G m3 (y3[t]-y5[t]))/Sqrt[((x3[t]-x5[t])^2+(y3[t]-y5[t])^2+(z3[t]-z5[t])^2)^3]+
  315. (G m4 (y4[t]-y5[t]))/Sqrt[((x4[t]-x5[t])^2+(y4[t]-y5[t])^2+(z4[t]-z5[t])^2)^3]+
  316. (G m6 (y6[t]-y5[t]))/Sqrt[((x6[t]-x5[t])^2+(y6[t]-y5[t])^2+(z6[t]-z5[t])^2)^3]+
  317. If[q5 == 0, 0,
  318. (-q5*q1/(4Pi ε0 )/m5 (y1[t]-y5[t]))/Sqrt[((x1[t]-x5[t])^2+(y1[t]-y5[t])^2+(z1[t]-z5[t])^2)^3]+
  319. (-q5*q2/(4Pi ε0 )/m5 (y2[t]-y5[t]))/Sqrt[((x2[t]-x5[t])^2+(y2[t]-y5[t])^2+(z2[t]-z5[t])^2)^3]+
  320. (-q5*q3/(4Pi ε0 )/m5 (y3[t]-y5[t]))/Sqrt[((x3[t]-x5[t])^2+(y3[t]-y5[t])^2+(z3[t]-z5[t])^2)^3]+
  321. (-q5*q4/(4Pi ε0 )/m5 (y4[t]-y5[t]))/Sqrt[((x4[t]-x5[t])^2+(y4[t]-y5[t])^2+(z4[t]-z5[t])^2)^3]+
  322. (-q5*q6/(4Pi ε0 )/m5 (y6[t]-y5[t]))/Sqrt[((x6[t]-x5[t])^2+(y6[t]-y5[t])^2+(z6[t]-z5[t])^2)^3]]+
  323. Λ*c^2*y5[t]^2/Sqrt[x5[t]^2+y5[t]^2+z5[t]^2],
  324.  
  325. vz5'[t] ==
  326. (G m1 (z1[t]-z5[t]))/Sqrt[((x1[t]-x5[t])^2+(y1[t]-y5[t])^2+(z1[t]-z5[t])^2)^3]+
  327. (G m2 (z2[t]-z5[t]))/Sqrt[((x2[t]-x5[t])^2+(y2[t]-y5[t])^2+(z2[t]-z5[t])^2)^3]+
  328. (G m3 (z3[t]-z5[t]))/Sqrt[((x3[t]-x5[t])^2+(y3[t]-y5[t])^2+(z3[t]-z5[t])^2)^3]+
  329. (G m4 (z4[t]-z5[t]))/Sqrt[((x4[t]-x5[t])^2+(y4[t]-y5[t])^2+(z4[t]-z5[t])^2)^3]+
  330. (G m6 (z6[t]-z5[t]))/Sqrt[((x6[t]-x5[t])^2+(y6[t]-y5[t])^2+(z6[t]-z5[t])^2)^3]+
  331. If[q5 == 0, 0,
  332. (-q5*q1/(4Pi ε0 )/m5 (z1[t]-z5[t]))/Sqrt[((x1[t]-x5[t])^2+(y1[t]-y5[t])^2+(z1[t]-z5[t])^2)^3]+
  333. (-q5*q2/(4Pi ε0 )/m5 (z2[t]-z5[t]))/Sqrt[((x2[t]-x5[t])^2+(y2[t]-y5[t])^2+(z2[t]-z5[t])^2)^3]+
  334. (-q5*q3/(4Pi ε0 )/m5 (z3[t]-z5[t]))/Sqrt[((x3[t]-x5[t])^2+(y3[t]-y5[t])^2+(z3[t]-z5[t])^2)^3]+
  335. (-q5*q4/(4Pi ε0 )/m5 (z4[t]-z5[t]))/Sqrt[((x4[t]-x5[t])^2+(y4[t]-y5[t])^2+(z4[t]-z5[t])^2)^3]+
  336. (-q5*q6/(4Pi ε0 )/m5 (z6[t]-z5[t]))/Sqrt[((x6[t]-x5[t])^2+(y6[t]-y5[t])^2+(z6[t]-z5[t])^2)^3]]+
  337. Λ*c^2*z5[t]^2/Sqrt[x5[t]^2+y5[t]^2+z5[t]^2],
  338.  
  339. vx6'[t] ==
  340. (G m1 (x1[t]-x6[t]))/Sqrt[((x1[t]-x6[t])^2+(y1[t]-y6[t])^2+(z1[t]-z6[t])^2)^3]+
  341. (G m2 (x2[t]-x6[t]))/Sqrt[((x2[t]-x6[t])^2+(y2[t]-y6[t])^2+(z2[t]-z6[t])^2)^3]+
  342. (G m3 (x3[t]-x6[t]))/Sqrt[((x3[t]-x6[t])^2+(y3[t]-y6[t])^2+(z3[t]-z6[t])^2)^3]+
  343. (G m4 (x4[t]-x6[t]))/Sqrt[((x4[t]-x6[t])^2+(y4[t]-y6[t])^2+(z4[t]-z6[t])^2)^3]+
  344. (G m5 (x5[t]-x6[t]))/Sqrt[((x5[t]-x6[t])^2+(y5[t]-y6[t])^2+(z5[t]-z6[t])^2)^3]+
  345. If[q6 == 0, 0,
  346. (-q6*q1/(4Pi ε0 )/m6 (x1[t]-x6[t]))/Sqrt[((x1[t]-x6[t])^2+(y1[t]-y6[t])^2+(z1[t]-z6[t])^2)^3]+
  347. (-q6*q2/(4Pi ε0 )/m6 (x2[t]-x6[t]))/Sqrt[((x2[t]-x6[t])^2+(y2[t]-y6[t])^2+(z2[t]-z6[t])^2)^3]+
  348. (-q6*q3/(4Pi ε0 )/m6 (x3[t]-x6[t]))/Sqrt[((x3[t]-x6[t])^2+(y3[t]-y6[t])^2+(z3[t]-z6[t])^2)^3]+
  349. (-q6*q4/(4Pi ε0 )/m6 (x4[t]-x6[t]))/Sqrt[((x4[t]-x6[t])^2+(y4[t]-y6[t])^2+(z4[t]-z6[t])^2)^3]+
  350. (-q6*q5/(4Pi ε0 )/m6 (x5[t]-x6[t]))/Sqrt[((x5[t]-x6[t])^2+(y5[t]-y6[t])^2+(z5[t]-z6[t])^2)^3]]+
  351. Λ*c^2*x6[t]^2/Sqrt[x6[t]^2+y6[t]^2+z6[t]^2],
  352.  
  353. vy6'[t] ==
  354. (G m1 (y1[t]-y6[t]))/Sqrt[((x1[t]-x6[t])^2+(y1[t]-y6[t])^2+(z1[t]-z6[t])^2)^3]+
  355. (G m2 (y2[t]-y6[t]))/Sqrt[((x2[t]-x6[t])^2+(y2[t]-y6[t])^2+(z2[t]-z6[t])^2)^3]+
  356. (G m3 (y3[t]-y6[t]))/Sqrt[((x3[t]-x6[t])^2+(y3[t]-y6[t])^2+(z3[t]-z6[t])^2)^3]+
  357. (G m4 (y4[t]-y6[t]))/Sqrt[((x4[t]-x6[t])^2+(y4[t]-y6[t])^2+(z4[t]-z6[t])^2)^3]+
  358. (G m5 (y5[t]-y6[t]))/Sqrt[((x5[t]-x6[t])^2+(y5[t]-y6[t])^2+(z5[t]-z6[t])^2)^3]+
  359. If[q6 == 0, 0,
  360. (-q6*q1/(4Pi ε0 )/m6 (y1[t]-y6[t]))/Sqrt[((x1[t]-x6[t])^2+(y1[t]-y6[t])^2+(z1[t]-z6[t])^2)^3]+
  361. (-q6*q2/(4Pi ε0 )/m6 (y2[t]-y6[t]))/Sqrt[((x2[t]-x6[t])^2+(y2[t]-y6[t])^2+(z2[t]-z6[t])^2)^3]+
  362. (-q6*q3/(4Pi ε0 )/m6 (y3[t]-y6[t]))/Sqrt[((x3[t]-x6[t])^2+(y3[t]-y6[t])^2+(z3[t]-z6[t])^2)^3]+
  363. (-q6*q4/(4Pi ε0 )/m6 (y4[t]-y6[t]))/Sqrt[((x4[t]-x6[t])^2+(y4[t]-y6[t])^2+(z4[t]-z6[t])^2)^3]+
  364. (-q6*q5/(4Pi ε0 )/m6 (y5[t]-y6[t]))/Sqrt[((x5[t]-x6[t])^2+(y5[t]-y6[t])^2+(z5[t]-z6[t])^2)^3]]+
  365. Λ*c^2*y6[t]^2/Sqrt[x6[t]^2+y6[t]^2+z6[t]^2],
  366.  
  367. vz6'[t] ==
  368. (G m1 (z1[t]-z6[t]))/Sqrt[((x1[t]-x6[t])^2+(y1[t]-y6[t])^2+(z1[t]-z6[t])^2)^3]+
  369. (G m2 (z2[t]-z6[t]))/Sqrt[((x2[t]-x6[t])^2+(y2[t]-y6[t])^2+(z2[t]-z6[t])^2)^3]+
  370. (G m3 (z3[t]-z6[t]))/Sqrt[((x3[t]-x6[t])^2+(y3[t]-y6[t])^2+(z3[t]-z6[t])^2)^3]+
  371. (G m4 (z4[t]-z6[t]))/Sqrt[((x4[t]-x6[t])^2+(y4[t]-y6[t])^2+(z4[t]-z6[t])^2)^3]+
  372. (G m5 (z5[t]-z6[t]))/Sqrt[((x5[t]-x6[t])^2+(y5[t]-y6[t])^2+(z5[t]-z6[t])^2)^3]+
  373. If[q6 == 0, 0,
  374. (-q6*q1/(4Pi ε0 )/m6 (z1[t]-z6[t]))/Sqrt[((x1[t]-x6[t])^2+(y1[t]-y6[t])^2+(z1[t]-z6[t])^2)^3]+
  375. (-q6*q2/(4Pi ε0 )/m6 (z2[t]-z6[t]))/Sqrt[((x2[t]-x6[t])^2+(y2[t]-y6[t])^2+(z2[t]-z6[t])^2)^3]+
  376. (-q6*q3/(4Pi ε0 )/m6 (z3[t]-z6[t]))/Sqrt[((x3[t]-x6[t])^2+(y3[t]-y6[t])^2+(z3[t]-z6[t])^2)^3]+
  377. (-q6*q4/(4Pi ε0 )/m6 (z4[t]-z6[t]))/Sqrt[((x4[t]-x6[t])^2+(y4[t]-y6[t])^2+(z4[t]-z6[t])^2)^3]+
  378. (-q6*q5/(4Pi ε0 )/m6 (z5[t]-z6[t]))/Sqrt[((x5[t]-x6[t])^2+(y5[t]-y6[t])^2+(z5[t]-z6[t])^2)^3]]+
  379. Λ*c^2*z6[t]^2/Sqrt[x6[t]^2+y6[t]^2+z6[t]^2],
  380.  
  381. x1[0] == x1x, y1[0] == y1y, z1[0] == z1z,
  382. x2[0] == x2x, y2[0] == y2y, z2[0] == z2z,
  383. x3[0] == x3x, y3[0] == y3y, z3[0] == z3z,
  384. x4[0] == x4x, y4[0] == y4y, z4[0] == z4z,
  385. x5[0] == x5x, y5[0] == y5y, z5[0] == z5z,
  386. x6[0] == x6x, y6[0] == y6y, z6[0] == z6z,
  387.  
  388. vx1[0] == v1x, vy1[0] == v1y, vz1[0] == v1z,
  389. vx2[0] == v2x, vy2[0] == v2y, vz2[0] == v2z,
  390. vx3[0] == v3x, vy3[0] == v3y, vz3[0] == v3z,
  391. vx4[0] == v4x, vy4[0] == v4y, vz4[0] == v4z,
  392. vx5[0] == v5x, vy5[0] == v5y, vz5[0] == v5z,
  393. vx6[0] == v6x, vy6[0] == v6y, vz6[0] == v6z},
  394.  
  395. {x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6, z1, z2, z3, z4, z5, z6,
  396. vx1, vx2, vx3, vx4, vx5, vx6, vy1, vy2, vy3, vy4, vy5, vy6, vz1, vz2, vz3, vz4, vz5, vz6},
  397.  
  398. {t, 0, Tmax},
  399.  
  400. WorkingPrecision-> wp,
  401. MaxSteps-> Infinity,
  402. Method-> mta,
  403. InterpolationOrder-> All,
  404. StepMonitor :> (laststep=plunge; plunge=t;
  405. stepsize=plunge-laststep;), Method->{"EventLocator",
  406. "Event" :> (If[stepsize<1*^-4, 0, 1])}];
  407.  
  408. (* Position, Geschwindigkeit *)
  409.  
  410. f2p[t_]={{x1[t], y1[t], z1[t]}, {x2[t], y2[t], z2[t]}, {x3[t], y3[t], z3[t]}, {x4[t], y4[t], z4[t]}, {x5[t], y5[t], z5[t]}, {x6[t], y6[t], z6[t]}}/.nds[[1]];
  411. f2v[t_]={{vx1[t], vy1[t], vz1[t]}, {vx2[t], vy2[t], vz2[t]}, {vx3[t], vy3[t], vz3[t]}, {vx4[t], vy4[t], vz4[t]}, {vx5[t], vy5[t], vz5[t]}, {vx6[t], vy6[t], vz6[t]}}/.nds[[1]];
  412. swp[t_]=(m1 Evaluate[f2p[t][[1]]]+m2 Evaluate[f2p[t][[2]]]+m3 Evaluate[f2p[t][[3]]]+m4 Evaluate[f2p[t][[4]]]+m5 Evaluate[f2p[t][[5]]]+m6 Evaluate[f2p[t][[6]]])/(m1+m2+m3+m4+m5+m6);
  413.  
  414. (* Formatierung *)
  415.  
  416. s[text_]=Style[text, FontSize->11];
  417. sw[text_]=Style[text, White, FontSize->11];
  418. colorfunc[n_]=Function[{x, y, z, t},
  419. Hue[0, n, 0.5,
  420. If[Tmax<0, Max[Min[(+T+(-t+trail))/trail, 1], 0],
  421. Max[Min[(-T+(t+trail))/trail, 1], 0]]]];
  422.  
  423. (* Animation *)
  424.  
  425. Do[Print[Rasterize[
  426. Grid[{{
  427. Show[
  428.  
  429. If[T == 0, {},
  430.  
  431. ParametricPlot3D[Evaluate[f2p[t]],
  432. {t, Max[0, T-trail], T},
  433.  
  434. PlotStyle->{
  435. {Thickness[thk], Red},
  436. {Thickness[thk], Blue},
  437. {Thickness[thk], Green},
  438. {Thickness[thk], Magenta},
  439. {Thickness[thk], Cyan},
  440. {Thickness[thk], Orange}},
  441.  
  442. PlotRange->plotrange, AspectRatio->1, MaxRecursion->15, Axes->True, ImageSize->imagesize]],
  443.  
  444. Graphics3D[
  445. If[startpos==1, {
  446. {PointSize[2point/3], Lighter[Red], Point[{x1x, y1y, z1z}]},
  447. {PointSize[2point/3], Lighter[Blue], Point[{x2x, y2y, z2z}]},
  448. {PointSize[2point/3], Lighter[Green], Point[{x3x, y3y, z3z}]},
  449. {PointSize[2point/3], Lighter[Magenta], Point[{x4x, y4y, z4z}]},
  450. {PointSize[2point/3], Lighter[Cyan], Point[{x5x, y5y, z5z}]},
  451. {PointSize[2point/3], Lighter[Orange], Point[{x6x, y6y, z6z}]}
  452. }, {}],
  453.  
  454. PlotRange->plotrange, AspectRatio->1, Axes->True, ImageSize->imagesize],
  455.  
  456. Graphics3D[{PointSize[point], Red, Point[Evaluate[f2p[T]][[1]]]}],
  457. Graphics3D[{PointSize[point], Blue, Point[Evaluate[f2p[T]][[2]]]}],
  458. Graphics3D[{PointSize[point], Green, Point[Evaluate[f2p[T]][[3]]]}],
  459. Graphics3D[{PointSize[point], Magenta, Point[Evaluate[f2p[T]][[4]]]}],
  460. Graphics3D[{PointSize[point], Cyan, Point[Evaluate[f2p[T]][[5]]]}],
  461. Graphics3D[{PointSize[point], Orange, Point[Evaluate[f2p[T]][[6]]]}],
  462.  
  463. ViewPoint->viewpoint]},
  464.  
  465. { },
  466. {s["t"->N[T]], sw[1/2]},
  467. { },
  468. {s["p1{x,y,z}"-> Evaluate[f2p[T][[1]]]], sw[1/2]},
  469. {s["v1{x,y,z}"-> Evaluate[f2v[T][[1]]]], sw[1/2]},
  470. {s["v1{total}"->{Evaluate[Chop@Norm[f2v[T][[1]]]]}], sw[1/2]},
  471. { },
  472. {s["p2{x,y,z}"-> Evaluate[f2p[T][[2]]]], sw[1/2]},
  473. {s["v2{x,y,z}"-> Evaluate[f2v[T][[2]]]], sw[1/2]},
  474. {s["v2{total}"->{Evaluate[Chop@Norm[f2v[T][[2]]]]}], sw[1/2]},
  475. { },
  476. {s["p3{x,y,z}"-> Evaluate[f2p[T][[3]]]], sw[1/2]},
  477. {s["v3{x,y,z}"-> Evaluate[f2v[T][[3]]]], sw[1/2]},
  478. {s["v3{total}"->{Evaluate[Chop@Norm[f2v[T][[3]]]]}], sw[1/2]},
  479. { },
  480. {s["p4{x,y,z}"-> Evaluate[f2p[T][[4]]]], sw[1/2]},
  481. {s["v4{x,y,z}"-> Evaluate[f2v[T][[4]]]], sw[1/2]},
  482. {s["v4{total}"->{Evaluate[Chop@Norm[f2v[T][[4]]]]}], sw[1/2]},
  483. { },
  484. {s["p5{x,y,z}"-> Evaluate[f2p[T][[5]]]], sw[1/2]},
  485. {s["v5{x,y,z}"-> Evaluate[f2v[T][[5]]]], sw[1/2]},
  486. {s["v5{total}"->{Evaluate[Chop@Norm[f2v[T][[5]]]]}], sw[1/2]},
  487. { },
  488. {s["p6{x,y,z}"-> Evaluate[f2p[T][[6]]]], sw[1/2]},
  489. {s["v6{x,y,z}"-> Evaluate[f2v[T][[6]]]], sw[1/2]},
  490. {s["v6{total}"->{Evaluate[Chop@Norm[f2v[T][[6]]]]}], sw[1/2]},
  491. { },
  492. {s["ps{x,y,z}"-> swp[T]], sw[1/2]},
  493. {s["vs{x,y,z}"-> swp'[T]], sw[1/2]},
  494. {s["vs{total}"->{Chop@Norm[swp'[T]]}], sw[1/2]}
  495. }, Alignment->Left]]],
  496.  
  497. (* Zeitregler *)
  498.  
  499. {T, 0, tMax, tMax/5}]
  500.  
  501. (* Export als HTML Dokument *)
  502. (* Export["dateiname.html", EvaluationNotebook[], "GraphicsOutput" -> "PNG"] *)
  503. (* Export direkt als Bildsequenz *)
  504. (* ParallelDo[Export["dateiname" <> ToString[T] <> ".png", Rasterize[...] ], {T, 0, 10, 5}] *)
  505.  
  506.  
  507.  
  508.  
  509.  
RAW Paste Data