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
repository:solar_system_springs [2021/03/31 23:52]
porcaro1 [Answer Key]
repository:solar_system_springs [2021/04/07 23:30]
porcaro1 [Answer Key]
Line 39: Line 39:
     - Case 5: The mass is between the equilibrium and bottom  ​     - Case 5: The mass is between the equilibrium and bottom  ​
   - Create a diagram showing the acceleration and velocity vectors for each of the aforementioned cases.   - Create a diagram showing the acceleration and velocity vectors for each of the aforementioned cases.
-  - Run the [[https://​trinket.io/​glowscript/​bf533ef826 | minimally working code]]. The code allows the user to input the value for the spring constant ($k$) and change the mass of the crate ($m$) using a slider. What problem(s) do you see with the simulation?+  - Run the minimally working code (below). The code allows the user to input the value for the spring constant ($k$) and change the mass of the crate ($m$) using a slider. What problem(s) do you see with the simulation?
  
 Fortunately,​ the code is not entirely complete; you have a fantastic opportunity to fix it! Modify the code to make the spring oscillate appropriately. Also, add some lines of code so that you can change the acceleration due to gravity and perform a check to make sure the value is in the "​down"​ direction (the "​up"​ direction is set as positive). Make sure that the acceleration due to gravity is reported in the window that prints the mass and spring constant. Once you have verified that your code is running properly, complete the following questions. Fortunately,​ the code is not entirely complete; you have a fantastic opportunity to fix it! Modify the code to make the spring oscillate appropriately. Also, add some lines of code so that you can change the acceleration due to gravity and perform a check to make sure the value is in the "​down"​ direction (the "​up"​ direction is set as positive). Make sure that the acceleration due to gravity is reported in the window that prints the mass and spring constant. Once you have verified that your code is running properly, complete the following questions.
Line 160: Line 160:
 ===Handout=== ===Handout===
 ==Pre-coding Questions== ==Pre-coding Questions==
-  - {{:​repository:​freebody1fr.jpg?​nolink&​600|}} +  -  
-  - {{:​repository:​pendulumvectors.png?​nolink&​600|}}+  - 
   - There are 2 major problems with the code:   - There are 2 major problems with the code:
     - The program does not stop, despite there being code alluding to a 20 second run-time (line 5)     - The program does not stop, despite there being code alluding to a 20 second run-time (line 5)
Line 168: Line 168:
 ==Post-coding Questions== ==Post-coding Questions==
   - {{:​repository:​spring_graphs.png?​nolink&​600|}}   - {{:​repository:​spring_graphs.png?​nolink&​600|}}
 +  - When the mass is at the top of its oscillation,​ the velocity is at a minimum and its acceleration is at a maximum (the force of gravity and the force of the compressed spring are pulling and pushing the mass down)
 +  - When the mass is at the equilibrium point, its velocity is at a maximum, and its acceleration is at a minimum (the spring and the force of gravity counteract each other and the net force is 0) 
 +  - When the mass is at the bottom of its acceleration,​ the velocity is at a minimum and the acceleration is at a maximum value (although the force of gravity is still pulling the mass downwards, the force of the stretched spring pulling the mass upwards will result in a net force that causes the same magnitude acceleration as when the spring is at the top of its oscillation)
 +  - Increasing the spring constant affects the stiffness of the spring. The higher the constant, the stiffer the spring is. A higher spring constant results in smaller amplitude for position, but higher amplitudes for velocity and acceleration. Additionally,​ the frequency of the oscillation increases, and therefore the period decreases
 ===Code=== ===Code===
 [[https://​www.glowscript.org/#/​user/​porcaro1/​folder/​RepositoryPrograms/​program/​SolarSystemSprings-Solution | Link]] [[https://​www.glowscript.org/#/​user/​porcaro1/​folder/​RepositoryPrograms/​program/​SolarSystemSprings-Solution | Link]]
  • repository/solar_system_springs.txt
  • Last modified: 2021/04/07 23:30
  • by porcaro1