A Computer Simulation

Oct 25, 2006
11,036
11
91
I'm trying to start off on a project involving simulations. I was brainstorming and thought of a simulation where you could input different numbers such as particle dispersion etc, and see if a full model of a galaxy can be built.

It might take me forever to research and implement, but I want to know if something like this, probably on a smaller scale/ in another way, is technically feasible.
 

irishScott

Lifer
Oct 10, 2006
21,568
3
0
Define "full model."

The bigger it gets, the less possible it gets. To simulate our entire galaxy would take a computer more powerful then the world's current supercomputer.
 
Oct 25, 2006
11,036
11
91
Ah I see. Probably something smaller like a model of a solar system and what different types of cosmic events do to a system.
 

CycloWizard

Lifer
Sep 10, 2001
12,348
1
81
It should be feasible to build a simple model of a solar system where gravity is the only force acting on the planets. I don't think it should be particularly difficult to develop or implement such a model. I doubt a home computer would have much trouble simulating it for the planets/sun alone, but if you want to throw in all the asteroids as individual bodies, good luck.
 
Oct 25, 2006
11,036
11
91
Doubt I would put in every single asteroid in existence. But probably implement the total gravitational field they exert,
 

CycloWizard

Lifer
Sep 10, 2001
12,348
1
81
Originally posted by: tenshodo13
Doubt I would put in every single asteroid in existence. But probably implement the total gravitational field they exert,
Right - that sounds like a good approach for the scope of the model you're looking for.
 

Biftheunderstudy

Senior member
Aug 15, 2006
375
1
81
You might want to look into a program called STARLAB, it does N-Body gravity simulations. Your going to need a good integrator if you do it by hand, one of the more popular methods in gravity simulations is the leap-frog method or kick-drift-kick.

Be wary though, these "simple" calculations can eat up emense computer power. Galaxy sumulations typically take months, star clusters weeks, and solar system models can take days. One time step might not take very long but its when you have to model something over cosmic timescales.

Look into Tremaine et al, he does gravity and orbit simulations.

P.S.

If you have a lot of time and a good graphics card there is a paper out there where they used a graphics card to do N-body gravity. The single 8800gtx outperformed a 4 core xenon system and nearly outperformed a GRAPE system(special purpose supercomputer), it even outlines the code they used to do it.
 

DyslexicHobo

Senior member
Jul 20, 2004
706
1
81
Originally posted by: irishScott
Define "full model."

The bigger it gets, the less possible it gets. To simulate our entire galaxy would take a computer more powerful then the world's current supercomputer.

And also the smaller and more detailed you get, the less possible it gets.

Are you going to treat the planets as particles, with flat surfaces? Are the planets going to have slight physical marks, such as mountains/rivers? Do you wish to simulate each atom in the universe? Do you wish to simulate the individual particles making up those atoms?
 

Gibsons

Lifer
Aug 14, 2001
12,530
35
91
I played a round of golf with a guy who did this for a hobby (retired engineer). He had all the planets (+Pluto!) simulated and liked to predict the paths of larger asteroids over the course of thousands or millions of years. His modeling/projections got more accurate as his time slices for calculating positions got smaller. I think the smallest he got was 0.1 days, and he'd have to let it run for a long time to get his longer range projections. One way he'd check how accurate his modeling was was to run the simulation in reverse. He has a website, I'll see if I can find it.
 

liquid51

Senior member
Oct 14, 2005
284
0
0
What would be cool would be a model of the system with large planetary bodies, sun, etc., but no asteroids etc. Just fill the system with a decent smattering of cosmic debree, let the orbiting bodies and they're gravitational forces "clean up the system" and shape it as they may. See what moons or wondering comets etc. may form.

Note: I haven't the first clue on building such models, I'm just an avid sci-fi reader ;)
 

triacontahedron

Junior Member
Feb 23, 2007
14
0
0
It all depends on times scale and precision you want to achieve. Generally speaking you can model orbits of 100-200 bodies on a modern computer within reasonable time and with ok accuracy. By modeling I mean that you calculate 2 body interaction of all possible pairs at each step. But here is the trick there is no need to calculate influence of all planets, moons , asteroids on each other. For example what is the influence of all asteroids in the asteroid belt on earth orbit? The answer is almost 0 Why ? because it is said on wikipedia that : "The total mass of the Asteroid belt is estimated to be 3.0-3.6×1021 kilograms, which is 4% of the Earth's Moon. Of that total mass, one-third is accounted for by Ceres alone." Not only this the asteroid belt contains thousands of bodies that means that Earth can not "see" individual asteroid in this mess. BUT if you want to calculate an orbit for say millions of year with 10 miles precision you have to calculate earth-asteroid interaction exactly which is impossible afaik. On long time scales even bigger problems occur, you have to take into account such things as tidal waves, relativistic effects and even decrease in solar mass due to radiation. In practice what you need to do is take say Neptune and Earth , write down gravitational force for them , look how much they would pull each other on time scales that you want to consider and then decide if this distance is interesting for you or it is too small to take into account. You should do this estimates for all bodies and effects you think are important. At the end of the day I bet you will discover that you want to calculate interactions of only big planets and calculate trajectories of asteroids moving in the gravitational field of these planets.

About galaxy (I am not an expert in astrophysics so what I am going to say might be half true) No sane astrophysicist would calculate motion of individual stars in the milky way just because there are 200 billion stars there. What most of them do i think threating the problem as fluid dynamics. That is breaking up galaxy into cubes with say 10 light years across, then they calculate density of matter inside such cells and finally trajectories of these cells. It is probably doable on a modern computer if you take cell of size 1000 ly then the problem becomes 2d because the thikness of milky way is about 1k ly. You can estimate radial distribution of stars in the galaxy. BUT here is the problem: you can not apply Newton's law to this system, the most obvious reason is that gravitational field propagates with the speed of light so it would take 1000 year for gravity to travel just through your elemental cell. As you can see problem is not in calculations but learning all this astrophysics stuff (i am not an astrophysicist and have little idea on where to start).

If you want to model something the most interesting part is figuring out what is important and learning new stuff. After this it is an exercise in programming.
 
Oct 25, 2006
11,036
11
91
My project is supposed to just represent planets and stars as dots of varying size on a window, and see how the dots react to each other's influences after millions of years. I've looked up other simulators, and though it was interesting what parameters could affect things.

I've got no problem in letting a simulator run for a long time.


Anyway, the Fluid Dynamics approach seems like a interesting way to approach this. I was going to try this on Java, but it seems like a lot of people have different ways to approach this problem.

It's not too surprising that a Graphics card is faster, considering the Processor on a graphics chip is faster than a desktop processor. I wonder If they can do the processing jointly


 

Biftheunderstudy

Senior member
Aug 15, 2006
375
1
81
For something like Solar sizes you won't need a hydrodynamics code. SPH and others can take a VERY long time just to code and a lot of people spend graduate degrees on designing and implementing such code. For instance a proffessor I know does SPH (smoothed particle hydrodynamics) to model the collapse of a star forming disk to watch planet formation, this is done with typically 100k particles and done on a supercomputer. I suggest you start small, write an N-body gravity code to solve the 2-body problem, you'll find this will take some time to get running properly. Then uprgrade to N-bodies. Keep things in simple units like taking G=1 and velocities 0-1 etc as this will make things much easier to interperet. If you want to make the bodies have extended mass that could be a little trickier, have to include tides and the like.


P.S.
GPU processors aren't faster than desktop computers, nor are they multicore/multiprocessor. They are however more efficient at what they are designed to do, the fact that they can be retrofitted to do N-body gravity is quite a feat on its own. When they beat a desktop its not too surprising, when they get within an order of magnitude of a GRAPE that is surprising.
 

f95toli

Golden Member
Nov 21, 2002
1,547
0
0
A few years ago I saw an article about an astrophysicist who had build the "fastest computer in the world" for this kind of simulations. The reason it was so fast was because the ONLY thing it could do was to simulate galaxies.
It was essentially a purpose built "parallell computer" built from a lot of DSP chips and FPGAs.

 

engineereeyore

Platinum Member
Jul 23, 2005
2,070
0
0
I'm currently working on an FPGA implementation for doing dynamic load balancing on N-body problems, specifically Molecular Dynamics. This would be very similar to what you are wanting to do with the solar system. I also wrote a C++ simulator of our hardware design. So it's not impossible to do, but even with that many elements, doing it for the period you suggested would take a while. I can do 10,000 atoms over 1 second of time (using pair list) and it takes quite a while (step size of about .5 microseconds). Depending on the precision you want and the number of bodies, you could create a simulator that would take 1 day to 20 months. All depends on how good you want it to be.