# Simulate and visualize a solar planet's motion?

Posted 23 days ago
225 Views
|
4 Replies
|
0 Total Likes
|
 I want to simulate Solar Planet's motion with mathematica, so I typed like this. But there were some errors.I can't figure out what is wrong and how to fix it.
4 Replies
Sort By:
Posted 23 days ago
 Inside Graphics the object should be gathered within curly brackets: Graphics[{....}].
Posted 23 days ago
 You did not put the curly braces. After the correction, we get the desired animation G = 1; M = 1; \[Omega][r_] := Sqrt[G*M/r^3]; t0 = 4*Pi; Animate[Graphics[{Red, Disk[{0, 0}, .2], Blue, Disk[{Cos[\[Omega][1]*t], Sin[\[Omega][1]*t]}, .1], Brown, Disk[{1.52*Cos[\[Omega][1.52]*t], 1.52*Sin[\[Omega][1.52]*t]}, .1], Black, Line[{{0, 0}, {Cos[\[Omega][1]*t], Sin[\[Omega][1]*t]}}], Line[{{Cos[\[Omega][1]*t], Sin[\[Omega][1]*t]}, {1.52*Cos[\[Omega][1.52]*t], 1.52*Sin[\[Omega][1.52]*t]}}]}, PlotRange -> {{-2, 2}, {-2, 2}}], {t, 0, t0}] 
Posted 22 days ago
 Thank you very much.
Posted 23 days ago
 Dear @Hojun Lee, Welcome to Wolfram Community! Please make sure you know the rules: https://wolfr.am/READ-1STPlease do not post code as images.The rules explain how to format your code properly. If you do not format code, it may become corrupted and useless to other members. Please EDIT your post and make sure code blocks start on a new paragraph and look framed and colored like this. int = Integrate[1/(x^3 - 1), x]; Map[Framed, int, Infinity] 
Community posts can be styled and formatted using the Markdown syntax.