GS 2000/Math - Collins
Lab 13
Fun with Motion

This has nothing to do with matrices.

In this lab we will use the Projectile Motion Simulator and
an Orbit Simulator to study the motion of objects under the 
effects of the forces of gravity and other forces.

Download the Simulators

   Startup MATLAB.

   Click on the link for shotsim.m (Projectile Simulator)
   Click on the link for orbit.m (Orbit Simulator)

   You can either use "Save As..." to save this in the work folder,
   or copy and paste it into a MATLAB m-file and save it in the
   work folder.  The names must be shotsim.m and orbit.m

Running the Projectile Simulator

   Just type


   and you will get a window with a area for a graph and several fields
   and buttons at the bottom.  To run a simulation, fill in the values
   for the fields and then click on "Fire!".  After a brief calculation
   you will see the results on the graph.

   The title will show the Range (distance travelled in the x-direction)
   and Total Flight Time.

   Try the Simulator with various values.  See what the difference
   is when drag is included and when it is not. (Use Drag values of
   0.05 or less).

   Try the Cartoon Effect: set the Drag to 0.2, then the path is
   almost like the effect of gravity you see in cartoons.

   For more fun, set the Drag to 0.1 and the Wind to -10.

Assignment: Accuracy and Distance

   The Accuracy Challenge is to reach a range of exactly 100 ft. under
   various conditions: (If a value is not specified, you can adjust it
   to reach the desired range)

   a.  Drag = 0, Wind = 0 
   b.  Y0 = 100, Drag = 0, Wind = 0
   c.  Drag = 0.01, Wind = 0
   d.  Y0 = 100, Drag = 0.01, Wind = -10

   The Distance Challenge is to see how far you can fire under various
   conditions.  You can only adjust the Angle:

   For all of these, take Y0 = 100 and Veloctiy = 100.

   a. Drag = 0, Wind = 0
   b. Drag = 0, Wind = -10
   c. Drag = 0.01, Wind = 0
   d. Drag = 0.01, Wind = -10

   Mail me the
   values you used for each case.

Running the Orbit Simulator

   Just type


   and you will get a window with several fields you can fill out and
   two buttons.  To run a simulation, fill in the values
   for the fields and then click on "Go".  You will then see your
   objects in orbit.

   Wait until the simulation stops before you click in a window
   If you have any trouble, you can always quit (hit Close) and run it

   Explanation of Fields

      The fields in the upper-left-corner are for the ship.
      You can specify its initial position (X0,Y0) and initial
      Velocity and Angle (in degrees).  You can also specify
      the time-steps between calculations (leave it at 0.5 unless
      the results look too jumpy) and the total time of the
      simulation (start with 500, and increase it to see more).

      The big block of fields on the right are for the other objects:
      Planets.  You can use up to 10 planets for your ship to move around.
      For each planet you specify its radius (1 = radius of Earth),
      and its x and y position.  If you want it to move according to
      the law of gravity, you can make it movable (click on the button)
      and enter an initial velocity and angle.

      If the radius field is blank, then only the planets before that
      planet will be used.

   Try the Simulator with various values to get comfortable with
   how it works.


   1. Use 1 planet, earth sized and start on the surface.  See what
      the smallest velocity you can use to get around the planet once.
      (On the surface: X0=10,Y0=0).

   2. Use 1 planet, earth sized and start away from it.  Try to get
      starting values which produce an orbit.  If it doesn't make it
      all the way around, increase the max time.  Your orbit probably won't
      connect back to itself, but it might.

   3. Use 2 planets with the spaceship between them.  Try to get the ship to
      oscillate up and down, between the planets.

   4. Use 2 planets.  Try to get the spaceship to make an orbit like a 
      Figure 8.

   5. Use 2 planets, one smaller.  Make the smaller one moveable (like the
      Moon around the Earth).  Experiment with the spaceship to see if you
      can get some semi-stable orbits.

   6. Challenge Same set up as 5.  Start on the larger planet, go
      out past the smaller planet and then come back and crash on the
      backside of the smaller planet.

   7. Super Challenge Use up to 10 planets, have the spaceships path
      spell out your name.
Last Modified: July 10, 2001