Homework #1: ODE's & Particle Dynamics

Due on Thursday, Sept. 22, 2022



(10pt) Problem A: Ballistic Motion

Given a location of a gun at (0,0,0), write an 3D artillery simulator that can take in the mass of the projectile, amount of powder, the azimuth and elevation of the gun barrel. Use the amount of powder and the mass of the projectile to determine the muzzle velocity. Account for gravity and air friction. Assume that one kilogram of powder produces 10,000 newtons of force. Assume instantaneous acceleration as a result of the powder going off. Air friction coefficient is constant. Set it to be 50 kg/s initially. The gun and target are both on the X-Z plane.


(15pt) Problem B: Spring-Mass Simulator

A spring hands vertically in its equilibrium or resting position. Given a user-defined mass m attached to the spring with the spring constant k, not stretched at first. Simulate the motion of the spring and mass under the effects of spring and gravitational forces. Assume the mass is 5 kg and k = 15 kg/s^2. Then, set the mass to be 10 kg and k = 20 kg/s^2.


For both problems, you'll need to write at least two functions (Euler's method vs. Mid-point or 4th order Runge-Kutta) for integration and compare their numerical accuracy and stability. Which function is more accurate? Which one is more stable? Which one is more efficient?


This assignment will be graded based upon:

  • Correctness of the implementations (50%)
  • UI & other SE factors (20%)
  • Other features (analysis, etc.) (30%)