Tutorial II - More VPython

When you are finished the following tutorial you should be able to:

  • create a simple, 3D animated simulation
  • know how to use VPython as a "calculator" and get text output
  • know how to create graphs in VPython

Critical References:

  • On-line reference manual: You can access this at the URL given here or directly from the help menu selection in the VPython browser. Use this reference lots!
  • New User's tutorial: browse through this to get a feel for the structure of VPython programs and how to make and run them.
  • sample VPython program simple_vector.py

 

Tutorial Part One:

Task: Create a VPython program that allows you to create and see a projectile that moves with an initial velocity v = (5, 25,3) m/s in a constant gravitational field g = (0,-9.81,0) m/s 2. The object should have a mass of 12.2 kg and move from its original launch point rinitial = (0,0,0) m to a point at which it once again on the ground. Use the following example to help guide you: trajectory1.py

Questions...

  1. Answer all the questions that you see as comments in the code for the program trajectory1.py (there are 6 of them)
  2. Finish writing the code for part one and either e-mail it to me (preferred) or print it off.

 

Tutorial Part Two: Getting Print Output

Task: Study the code trajectory2.py and add the necessary lines of code to your program to allow you to print out the following information: time, vertical position of the ball and speed of the ball. Make sure you explain how you got the speed - this is not the same as velocity!

Questions...

  1. Finish writing the code for part one and either e-mail it to me (preferred) or print it off.

Tutorial Part Three: Getting Graphical Output

Task: Study the code trajectory3.py and add the necessary lines of code to your program to allow you to graph the following information: time vs vertical position of the ball and time versus vertical velocity.

Questions...

  1. Finish writing the code for part one and either e-mail it to me (preferred) or print it off.
  2. Explain in detail (and using appropriate bits of the code) how you create a graph in VPython

 

Date Due: Next week Friday

GROUP SUBMISSIONS REQUIRE GREENSHEETS!