Creating realistic physical solarsystem

Is it possible to create a realistic working model of a solarsystem bassed on physics? Can this be done by placing the physic laws and formulas in the script?

This is not for a game, but for a school project, so it needs to be realistic.

it can be possible in Theory. You can’t just put the formulas into code in the same way that you would in calculations. I have one question, what would this be used for? I asked this because to make this in a game you will have to do some tricks to get it done and make it as optimized as possible.

Depends on what you want to do, there’s this which was done with UDK:Solar System Educational Program - Using UDK - YouTube
You wouldn’t actually be using physics, you’d just have to figure out how to arrange things correctly.