CPSC150A
Scientific Computing

Assignment 1

Ballistic Simulation

The first electronic programmable computer, ENIAC, was created for performing ballistic calculations for the United States Army. ENIAC was the size of a school bus and weighed 30 tons. A lot has changed over the years, to the point where pocket sized computers (Cell Phones) now have more computational power than the ENIAC. For this assignment, you will use your modern day computer and the turtle module to perform similar calculations.


Details

Using the turtle module, your program should draw a series of 3 concentric circles on the right hand side of the screen. These circles will represent the target that your ballistic simulation will be aiming for.

Your program is going to launch projectiles from the lower left corner of the window. To accomplish this, your program should prompt the user to enter both an initial x component of velocity, and an initial y component of velocity.

Given this information, your program should draw some fixed number of lines segments that will approximate the ballistic trajectory of the launched projectile. Each line segment can be calculated by using the projectile’s current velocity to compute the new location of the projectile (assuming the projectile is traveling in a straight line). Once you compute the new position, you then need to compute the new velocities in the x and y directions. You can do this by simply subtracing the acceleration due to gravity (9.81 m/s2) from the y component of velocity, and adding the acceleration due to wind (Which we will assume for now is 1 m/s2).

Keep in mind that your program does not need to stop when the user hits the target, nor does your program need to stop when the turtle leaves the screen. You simply need to draw some fixed number of line segments to represent the projectile path.


Grading

The assignment will be graded on the following requirements according to the course’s programming assignment rubric.

A functional program will:

Submission

Submit your program as a .py file on the course Inquire page before class on Thursday February 4th.