183_notes:modeling_with_vpython

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
183_notes:modeling_with_vpython [2022/11/14 15:42] valen176183_notes:modeling_with_vpython [2022/12/01 19:39] (current) valen176
Line 7: Line 7:
 ==== Lecture Video ==== ==== Lecture Video ====
  
-{{youtube>IEA2hgB6bdE?large}}+{{youtube>vzof--LEJw4?large}}
  
  
Line 16: Line 16:
   - **Objects** - Each program that you write is modeling the motion of some physical objects. So you will need to set up and place those objects in the scene. A big list of objects is [[http://vpython.org/contents/docs/primitives.html|available online]].   - **Objects** - Each program that you write is modeling the motion of some physical objects. So you will need to set up and place those objects in the scene. A big list of objects is [[http://vpython.org/contents/docs/primitives.html|available online]].
   - **Parameters & Initial Conditions** - Each program will have associated physical quantities for one or more of the objects in the scene. These might be the object's mass, velocity, momentum, etc. The selection of these parameters and initial conditions depends on the problem you are trying to solve (and are often informed by analytical calculations).   - **Parameters & Initial Conditions** - Each program will have associated physical quantities for one or more of the objects in the scene. These might be the object's mass, velocity, momentum, etc. The selection of these parameters and initial conditions depends on the problem you are trying to solve (and are often informed by analytical calculations).
-  - **Time conditions** - The initial time and time step are needed in each program. The time step is particularly important because it controls how often the calculations occur. Typically, [[183_notes:springmotion#modeling_motion_with_spring_forces|the more frequent the calculations are, the more accurate the solutions will be]]. But there's a tradeoff; the computer has to do more calculations -- making the program run longer.+  - **Time conditions** - The initial time and time step are needed in each program. The time step is particularly important because it controls how often the calculations occur. Typically, [[183_notes:springmotion#modeling_motion_with_spring_forces|the more frequent the calculations are, the more accurate the solutions will be]]. But there's a tradeoff; the computer has to do more calculations -- making the program take longer to run.
   - **Calculation loop** - Your job in mechanics is to predict or explain the motion of systems and the calculation loop is where that happens. In the loop is where the [[183_notes:iterativepredict|iterative prediction of motion]] really plays out. In any calculation loop you will,   - **Calculation loop** - Your job in mechanics is to predict or explain the motion of systems and the calculation loop is where that happens. In the loop is where the [[183_notes:iterativepredict|iterative prediction of motion]] really plays out. In any calculation loop you will,
     * [[183_notes:momentum_principle#net_force|Calculate all the forces acting on the system, and determine the net force.]]     * [[183_notes:momentum_principle#net_force|Calculate all the forces acting on the system, and determine the net force.]]
     * [[183_notes:motionpredict|Update the momentum using this net force.]]     * [[183_notes:motionpredict|Update the momentum using this net force.]]
     * [[183_notes:displacement_and_velocity#predicting_the_motion_of_objects|Update the position using this new momentum (velocity).]]      * [[183_notes:displacement_and_velocity#predicting_the_motion_of_objects|Update the position using this new momentum (velocity).]] 
 +
 +Note that in this example, the cart was moving at constant velocity, so we didn't need to do much step 4 above. In future weeks, there will be examples of how to use Glowscript to model motion when there is nonzero net force.
  
 <code python videoexample.py> <code python videoexample.py>
Line 43: Line 45:
          
     t = t + dt     t = t + dt
-print('t = ', t) +print('t = ', t, 's')
-    +
 </code> </code>
  • 183_notes/modeling_with_vpython.1668440526.txt.gz
  • Last modified: 2022/11/14 15:42
  • by valen176