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
Next revision Both sides next revision
repository:cat_toy [2020/04/02 00:14]
porcaro1 [Cat Toy]
repository:cat_toy [2020/04/02 00:46]
porcaro1 [Cat Toy]
Line 52: Line 52:
   - (Optional 1): Add a linear damping effect to your system with a damping coefficient (c).   - (Optional 1): Add a linear damping effect to your system with a damping coefficient (c).
   - (Optional 2): Make your system into a vertical mass-spring system and include the force of gravity in your calculations.   - (Optional 2): Make your system into a vertical mass-spring system and include the force of gravity in your calculations.
 +{{ :​repository:​cattoy.png?​nolink|}}
 ===Working Code=== ===Working Code===
 <code Python [enable_line_numbers="​true",​ highlight_lines_extra="​0"​]>​ <code Python [enable_line_numbers="​true",​ highlight_lines_extra="​0"​]>​
Line 101: Line 101:
     ​     ​
     Fspring=-1*k*s*Lhat     Fspring=-1*k*s*Lhat
-    Fnet=Fspring+    Fnet=Fspring ​#(Linear damping)# -c*block.p/​block.mass
     ​     ​
     block.p = block.p + Fnet*dt     block.p = block.p + Fnet*dt
  • repository/cat_toy.txt
  • Last modified: 2021/04/07 22:43
  • by porcaro1