Physics 113: Projectile Motion Simulation with Controls, Functions, and Friction, Assignments of Physics

Instructions for recitation assignment 8 of physics 113, where students are required to add new python concepts such as controls (sliders and buttons), functions, and physics concepts like friction to an incomplete projectile motion simulation. The assignment involves adding a loop to shoot a projectile until its y-position is below zero, introducing an air resistance force, and normalizing the friction deceleration. Students are encouraged to experiment with additional features like changing the target position randomly, adding scoring, creating a human-like target, and adding rocket power.

Typology: Assignments

Pre 2010

Uploaded on 08/18/2009

koofers-user-4y8
koofers-user-4y8 🇺🇸

9 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
PHYSICS 113 Recitation Assignment 8
Name
Recitation Assignment # 8
November 15, 2006
You may complete this in class. However, if you are unable to do so, it is expected that you
complete this for recitation next time.
If you have any questions, please ask.
Note that it is expected that you will look at your previous recitation assignments (and the online
documentation!) to help you understand the assignment. Please refer to these frequently, and try
to understand what the code is actually doing.
New Python Concepts: controls (sliders and buttons), lablels, functions,
New Physics Concepts: Friction
1. I have put a file called prog8 starter.py on the course homepage. Please download it into
your recitation directory.
2. There is a note in the incomplete program where you should add the physics. In particular, I
want you to add a loop which will shoot a projectile with an initial velocity given by ball.v,
until the ball has a y-position lower than zero. In particular, I also want you to have an
acceleration of: gm/s2ˆ
jdue to gravity (where g=9.8 is pre-set into the program, and can
be adjusted). In addition, you want to introduce an air resistence of:
Fr=1
2CρAv2
where Cis a geometric factor (typically between 0.3 and 1, and, ρis the density of the
air, 1.3kg/m3, and Ais the surface area of your object (say 0.01m2for something like a
baseball). In this case, we have a coefficient of:
Fr'0.003kg
mv2
or a friction deceleration of
ar'0.003(meters)1v2
in the opposite direction of the direction of motion.
Note that in this approximation, the mass of the ball never enters into it at all!
Add in the air resistence term as well. The “mu” in your code should be a normalizing factor
such that:
ar'µ×0.003(meters)1v2
3. That’s it! That’s all that’s required. However, if you’d like to have some fun, you may try
some of the following:
pf2

Partial preview of the text

Download Physics 113: Projectile Motion Simulation with Controls, Functions, and Friction and more Assignments Physics in PDF only on Docsity!

PHYSICS 113 – Recitation Assignment 8

Name

Recitation Assignment # 8

November 15, 2006

You may complete this in class. However, if you are unable to do so, it is expected that you complete this for recitation next time.

If you have any questions, please ask.

Note that it is expected that you will look at your previous recitation assignments (and the online documentation!) to help you understand the assignment. Please refer to these frequently, and try to understand what the code is actually doing.

New Python Concepts: controls (sliders and buttons), lablels, functions,

New Physics Concepts: Friction

  1. I have put a file called prog8 starter.py on the course homepage. Please download it into your recitation directory.
  2. There is a note in the incomplete program where you should add the physics. In particular, I want you to add a loop which will shoot a projectile with an initial velocity given by ball.v, until the ball has a y-position lower than zero. In particular, I also want you to have an acceleration of: −gm/s^2 ˆj due to gravity (where g=9.8 is pre-set into the program, and can be adjusted). In addition, you want to introduce an air resistence of:

Fr =

CρAv^2

where C is a geometric factor (typically between 0.3 and 1, and, ρ is the density of the air, ∼ 1. 3 kg/m^3 , and A is the surface area of your object (say 0. 01 m^2 for something like a baseball). In this case, we have a coefficient of:

Fr ' 0. 003

kg m

v^2

or a friction deceleration of ar ' 0 .003(meters)−^1 v^2

in the opposite direction of the direction of motion. Note that in this approximation, the mass of the ball never enters into it at all! Add in the air resistence term as well. The “mu” in your code should be a normalizing factor such that: ar ' μ × 0 .003(meters)−^1 v^2

  1. That’s it! That’s all that’s required. However, if you’d like to have some fun, you may try some of the following:
  • Change the randomization process so that the “target” appears in a random y-position as well as a random distance from the gun.
  • Add a scoring procedure to make this a more interesting game.
  • Change the target to look like a person – (Use the power of VPython to make a cool object.)
  • Add an additional control to give rocket power to the “ball.”