Amateur game dev here,
How difficult would it be to create a simple model of the solar system ? I've only taken pre-calculus so far, but I did learn conic sections. I've been looking at Kepler's law of planetary motion, and I kind of understand the math, but I'm not quite sure how to implement it programmatically. Please share your precious knowledge with me.
depends how simple you want it to be
You need to solve a system of differential equations with initial conditions from the planets. You don't need more than Kepler's laws.
Look up N-body simulation. But it really depends on how complex you want it,
>>7680765
So why does he need to solve them?
>>7680771
Remember that calculation time increases with square of number of particles. Which means that it becomes quickly very computationally demanding.
2D model is good to start with, and good for the solar system
>>7680782
Kepler's laws don't tell you the positions of bodies, only their acceleration. A simple solution exists for 2 bodies only.
And by Kepler's law I mean Newton's law of gravitation. :^ )
>>7680793
He could just simplify it by just calculating each planet's elliptical orbit around the sun.
>>7680806
That's too easy :)
>>7680759
Nasa's GMAT tool is open source and models n body orbital dynamics, aerodynamic forces, and radiation pressure.
Orbiter, open source game, does n-body, not sure about drag & rad pressure.
If you're doing it to learn, awesome. If you need it for a project then recycle.
Shouldn't be that hard, all you need is analytical solution of the 3-body problem which you can easily solve by hand
Just do verlet integration
>>7680759
You do it by setting up a simple simulation of particles obeying newtonian laws, if your initial positions velocities and masses are correct you will have your solar system running in no time.
Basically you avoid calculating what is supposed to happen and instead just put initial rules in place which causes things to unfold by themselves.
>>7680759
Extremely easy. The positions of planetary bodies don't really disturb each other very much, so you can just calculate the two-body solution, put each object on rails in an elliptical path (the orbital parameters for all solar system bodies are publicly available, if you're simulating our solar system particularly), and get 99% accuracy.
You can then do n-body numerical simulations based on, say, the three strongest gravitational fields to get the motions of asteroids, satellites, other small objects, etc. These you can just assume have negligible gravitational pull, so the difficulty of simulation will only go up linearly with the number of bodies.
Best to use a spherical coordinate system instead of a Cartesian one for a project like this.
Reasonably easy as long as you don't need it to be perfectly accurate over the long term. Such models are always chaotic.
Grab a copy of Numerical Recipes.
https://en.wikipedia.org/wiki/Temporal_discretization
https://en.wikipedia.org/wiki/Numerical_methods_for_ordinary_differential_equations
>>7680881
>MATLAB
I fucking hate engineers fuck. Fuck matlab. Who the fuck uses a proprietary language.grfghneoihehirwgh
>>7681567
>>Who the fuck uses a proprietary language
apparently NASA. It's ok mate, I hate it too. Perhaps it will work in Octave?
>>7681113
this