🚀Simple Physics simulations

Release Language

Collection of physics programs done for the INFO2058/2059 courses, given by Pr. Boigelot and Bertrand Cornélusse, ULiège. The final mark for the projects is 15/20 for the mechanics section and 20/20 for the electromagnetism section.

Note : No copying (even partial) of this code within the scope of the INFO2058/2059 course will be tolerated.

⚙️Mecanics

  • spaceship.py : Spaceship simulation. The program simulate the thurst of a spaceship and the gravity exercised by a planet on the spaceship.
    Balistic gameplay

    • Press Left/Right to adjust the ship nozzle orientation.
    • Press Up to light up the nozzle.
    • Press Left-click to add a planet.
    • Press Right-click to remove a planet.
    • Press Q to quit.
  • gesture.py : Vertical gesture detection program. The acceleration in shown in red, the velocity in green. A vertical and slow gesture from bottom to top to bottom increases the counter.
    Gesture detection example

  • complex_movement.py : Simulation of the movement of a mobile object. The simulation takes place on a curve with frictions tkane into account and with an initial high potential energy position.
    Complex movement simulation

  • balistic.py : Balistic simulation calculating the right timing to drop a bomb on a target. The y velocity and acceleration is shown in the top left of the screen.
    Balistic gameplay

    • Press A to drop a bomb automatically (the plane should no be moved on the Y axis after being armed).
    • Press B to drop a bomb manually.
  • balistic1.py : Balistic simulation calculating the right timing to fire a projectile on a target.
    Balistic gameplay

    • Press Right-click to position the red indicator.
    • Press A to initialize the automatic fire.
    • Press Left-click to fire.
    • Alternatively, press Up/Down to adjust initial speed, Left/Right to adjust the canon position to try and aim for the indicator.

⚡Electromagnetism

  • field.py : Simulation displaying the electrical field between electrical charges. Red is positive, Black is negative.
    Field between two charges

    • Press Left-click to add a positive charge.
    • Press Right-click to add a negative charge.
    • Press Middle-click to remove a charge.
  • mobile_charge.py : Simulation of the trajectory of a mobile negative charge between fixed charges. The potential and kinetic energy of the mobile charge and the mouse position are shown in the top left of the screen.
    Field between fixed and mobile charges

    • Press Left-click to add a positive charge.
    • Press Right-click to add a negative charge.
    • Press Middle-click to remove a charge.
    • Press N to place a mobile charge.
  • cyclotron.py : Simulation of the trajectory of a mobile positive charge in a cyclotron. The magnetic field is facing outward from the screen.
    Field between fixed and mobile charges

    • Press Up to increase the vertical component of the electrical field.
    • Press Down to decrease the vertical component of the electrical field.
    • Press PgUp to increase the magnetic field.
    • Press PgDn to decrease the magnetic field.
    • Press C to automatically handle the magnetic and electrical fields to create a cyclotron.
    • Press Spacebar to reset the simulation.
  • motor.py : Simulation of a direct current motor. The motor is composed at its center of a rotor of 1000 spires. The stator is composed of two permanent magnets, the magnetic field go from left to right. The winding inductance is not taken into account.
    Direct current motor simulation

    • Press Spacebar to close the circuit.

Credits