The idea of a rail gun came up to us the day before the Hackathon. We figured out it would be a great challenge on the physical side (because we would have to include electromagnetism as well as aerodynamics) and on the programming side (because we would have to model a camera that follows the movement of our projectile).

Also, we figured out this could be cool to just play with a simulation of a rail gun.

Finally we decided to shoot a metal monkey with our cannon, because we wanted to pay respect to this beautiful animal filled with witness and inner peace.

What it does

Our program lets the user play around with almost every parameter used in a rail gun. Then it shoots our lovely monkey Schlader as far as possible.

The user can discover how each parameter affects the shot trajectory and the speed at which Schlader is expelled such as the metal used for the rails, the angle of the cannon or the voltage of the battery.

How we built it

For the maths and physics stuff, everything was coded in python. All of the physics is explained in a pdf available on the website.

For the web interface, it was coded in java script. It included the inputs of all the parameters that can make our shot different and many more features!

Challenges we ran into

Physically speaking, we had to derive many equation to make them fit our needs. Since none of us knew anything about aerodynamics, we had to first understand, then compute all the parameters that would affect our simulation. We also had to find, then solve differential equations that describe the aerodynamics of a sphere.

On the programming side, one of the biggest challenge was to find a camera that would consider all of the complicated cases that the cannon would produce (huge speeds, huge distances, etc.). This was clearly the hardest thing we had to deal with during all of this Hackathon. Also, building the website was complicated at first, because we had to include many graphical elements that didn't like being resized.

The interface had to be manually created. The backgrounds, images of monkeys and sound effects were all created by our team. This was not a simple task.

Accomplishments that we're proud of

To implement air friction was pretty hard, but when we finally got it to work, we were proud to make our simulation a little more realistic.

Also, when we achieved to have a functional camera, we were so hyped because it had taken us many hours of work.

What we learned

It's obvious that we learned a lot about air friction mechanics and displaying projectiles. Also, we gained knowledge on the way that camera works in 2d spaces.

What's next for Railgun Simulation

We are planning to upgrade the graphics of our simulation. Also, we could implement the possibility to use more "types" of drag (such as Newtonian equation) to visualise just how different theories give different results in extreme cases.

Built With

Share this project: