# How to start simulating physical problems?

I'm quite new to Mathematica, I have version 9. I need to use it to simulate some physical problems. I know the equations (like Maxwell's equations and Newton's laws and so on), but I have no real idea on how to get some nice visual simulating output.

If I have two stars rotating around each other, what is the best way in Mathematica to simulate and display the gravitational vector field of this problem (dynmically depending on the location of the stars)?

Or if I have some charges (not just points, but spheres, for example, ideally with some properties like polarity and permitivity) in an external electric field, how can I calculate and visualise the resulting field and the infleunce of movements and positions of the charges?

Where do I have to start here? Just by hacking the genereral equations that I have on paper into Mathematica I won't get some dynamic output.

I know the basics about Manipulate and on how to enter equations and on how to do some basic calculations (like DSolve). But I have no idea on how to get these things dynamical and visual so that I can just "move around" my stars and charges and see the resulting fields visually and in numbers.

• Have a look here for some nice posts. – b.gates.you.know.what Jan 23 '13 at 13:59
• I suggest starting by just coding a static visual on whatever you want to do, and then start from there. For instance, you could use VectorPlot to make a static plot of the gravitational field of the two starts you mention. Then upload your code along with a specific question of how to do one thing with it (for instance how to make the stars rotate or similar). – jVincent Jan 23 '13 at 14:13
• I implemented a few ideas along these lines in my post at mathematica.stackexchange.com/questions/1900 (the confetti simulation). Although that doesn't fully answer this question, it might give you some ideas about directions to go in. – whuber Jan 23 '13 at 15:33
• This is a very general question. Trying to answer, I realized that there are many answers here that should have the physics tag but don't. But I can't give a meaningful answer until you get more specific and show some code you've tried. – Jens Jan 23 '13 at 17:16
• What about this code from the "Neat examples" section from the Manipulate doc page? Manipulate[ ContourPlot[ q1/Norm[{x, y} - p[]] + q2/Norm[{x, y} - p[]], {x, -2, 2}, {y, -2, 2}, Contours -> 10], {{q1, -1}, -3, 3}, {{q2, 1}, -3, 3}, {{p, {{-1, 0}, {1, 0}}}, {-1, -1}, {1, 1}, Locator}, Deployed -> True] – Sjoerd C. de Vries Jan 23 '13 at 20:14

Now you have something like this: 