<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.physicsbook.gatech.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kgiles7</id>
	<title>Physics Book - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://www.physicsbook.gatech.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kgiles7"/>
	<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/Special:Contributions/Kgiles7"/>
	<updated>2026-04-29T06:23:12Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.7</generator>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14864</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14864"/>
		<updated>2015-12-05T19:32:06Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
  velocity = (-0.1, 0.2, 0.4)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin calculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using [http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For complete visual code, click [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 10 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that VPython or a similar program be used for such repetitive calculations in order to save time and reduce the likelihood of mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Middling Example===&lt;br /&gt;
&lt;br /&gt;
A semi-challenging problem, such as the one below, will often require you to perform vector calculations.  However, the same steps as the easy example above still apply.  Pay careful attention to signs as you solve these types of problems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of relaxed length 0.5 m with spring constant 120 N/m attached to the ceiling. If a 1.4 kg mass is released with an initial velocity of &amp;lt;1.2, 0.8, -0.2&amp;gt; m/s at an initial position of &amp;lt;-0.3, 0.7, 0.2&amp;gt; m, what is the velocity of the block after 0.005 seconds?  Consider the point of attachment on the spring to the ceiling to be the origin. Only one iteration is necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Calculate Initial Momentum&#039;&#039;&#039;&lt;br /&gt;
The initial momentum is simply the product of the mass and velocity of the object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{1.4kg}\cdot{&amp;lt;1.2, 0.8, -0.2&amp;gt; m/s}} = {&amp;lt;1.68, 1.12, -0.28&amp;gt; Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Force of Gravity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {m}{&amp;lt;0, -g, 0&amp;gt;}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {1.4kg}\cdot{&amp;lt;0, -9.8, 0&amp;gt; m/s/s} = {&amp;lt;0, -13.72, 0&amp;gt; N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Calculate Force of Spring&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-k}{(\vec{L}_{mag}-\vec{L}_{0})} \cdot {\hat{L}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The magnitude of L is equal to the square root of the squares of it&#039;s individual components&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\hat{L}} = {\sqrt{  {{L}_{x}}^{2} + {{L}_{y}}^{2} + {{L}_{z}}^{2} }}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\hat{L}} = {\sqrt{  {-0.3}^{2} + {0.7}^{2} + {0.2}^{2} }} = {\sqrt{0.62}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The unit vector of L (&amp;lt;math&amp;gt;{\hat{L}}&amp;lt;/math&amp;gt;) is equal to &#039;&#039;&#039;L&#039;&#039;&#039; divided by its magnitude&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; {\lVert\vec{L}\rVert} = {\frac{\vec{L}}{{\lVert\vec{L}\rVert}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; {\lVert\vec{L}\rVert} = {\frac{&amp;lt;-0.3, 0.7, 0.2&amp;gt; m }{\sqrt{0.62}}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substituting these values into Hooke&#039;s Law, then gives the force exerted by the spring:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-k}{(\lVert\vec{L}\rVert-\vec{L}_{0})} \cdot {\hat{L}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-120 N/m}{(\sqrt{0.62} m - {0.5 m})} \cdot {\frac{&amp;lt;-0.3, 0.7, 0.2&amp;gt; m }{\sqrt{0.62}}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {&amp;lt;12.83316, -29.94405, -8.55544&amp;gt; N} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Caculate Net Force&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {&amp;lt;0, -13.72, 0&amp;gt; N} +{&amp;lt;12.83316, -29.94405, -8.55544&amp;gt; N} = {&amp;lt;12.83316, -16.22405, -8.55544&amp;gt; N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {&amp;lt;1.68, 1.12, -0.28&amp;gt; Ns} + {&amp;lt;12.83316, -16.22405, -8.55544&amp;gt; N}\cdot{0.005s} = {  Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {&amp;lt;1.7442, 1.0389 ,-0.3611&amp;gt; Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Calculate Velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f}} = \frac{\vec{p}_{f}}{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f}} =\frac{&amp;lt;1.7442, 1.0389 ,-0.3611&amp;gt; Ns}{1.4kg} = {&amp;lt;1.2458, 0.7421, -0.2579&amp;gt; m/s}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.005 seconds, the mass is moving with velocity &amp;lt;1.25, 0.74, -0.26&amp;gt; m/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult Example===&lt;br /&gt;
&lt;br /&gt;
Very difficult iterative motion problems likely require several calculation loops to be performed.  Thus, it is recommended that a computer program, such as VPython, is used to solve these.  For general instructions on how to do this, please see above in this article, under the heading &#039;&#039;A Computational Model&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
While you may not need to precisely calculate the motion of spring-mass systems on a daily basis, understanding their behavior has led to the invention of many useful items.  Among these are mattresses, clocks, and the suspension on cars.  &lt;br /&gt;
&lt;br /&gt;
However, the concept of iterative prediction applies to far more than masses on springs, as the concepts of physics apply far beyond textbook problems.  By thinking in small enough time increments, the behavior of any system can be understood. &lt;br /&gt;
&lt;br /&gt;
For example, in chemical engineering,  entire processes can be broken down into simpler pieces and analyzed.  These processes could then be modeled in order to predict future behavior.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Conservation_of_Momentum Conservation of Momentum]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Predicting_Change_in_multiple_dimensions Predicting Change in Multiple Dimensions]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Derivation_of_the_Momentum_Principle Derivation of Momentum Principle]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Momentum_Principle Momentum Principle]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Analytical_Prediction Analytical Prediction]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Net_Force Net Force]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Young%27s_Modulus Young&#039;s Modulus]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Tension Tension]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Length_and_Stiffness_of_an_Interatomic_Bond Length and Stiffness of Interatomic Bond]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
[https://phet.colorado.edu/sims/mass-spring-lab/mass-spring-lab_en.html Interactive Spring-Mass Simulator]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Momentum]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14856</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14856"/>
		<updated>2015-12-05T19:29:34Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: /* Connectedness */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
  velocity = (-0.1, 0.2, 0.4)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin calculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using [http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For complete visual code, click [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 10 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that VPython or a similar program be used for such repetitive calculations in order to save time and reduce the likelihood of mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Middling Example===&lt;br /&gt;
&lt;br /&gt;
A semi-challenging problem, such as the one below, will often require you to perform vector calculations.  However, the same steps as the easy example above still apply.  Pay careful attention to signs as you solve these types of problems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of relaxed length 0.5 m with spring constant 120 N/m attached to the ceiling. If a 1.4 kg mass is released with an initial velocity of &amp;lt;1.2, 0.8, -0.2&amp;gt; m/s at an initial position of &amp;lt;-0.3, 0.7, 0.2&amp;gt; m, what is the velocity of the block after 0.005 seconds?  Consider the point of attachment on the spring to the ceiling to be the origin. Only one iteration is necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Calculate Initial Momentum&#039;&#039;&#039;&lt;br /&gt;
The initial momentum is simply the product of the mass and velocity of the object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{1.4kg}\cdot{&amp;lt;1.2, 0.8, -0.2&amp;gt; m/s}} = {&amp;lt;1.68, 1.12, -0.28&amp;gt; Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Force of Gravity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {m}{&amp;lt;0, -g, 0&amp;gt;}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {1.4kg}\cdot{&amp;lt;0, -9.8, 0&amp;gt; m/s/s} = {&amp;lt;0, -13.72, 0&amp;gt; N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Calculate Force of Spring&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-k}{(\vec{L}_{mag}-\vec{L}_{0})} \cdot {\hat{L}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The magnitude of L is equal to the square root of the squares of it&#039;s individual components&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\hat{L}} = {\sqrt{  {{L}_{x}}^{2} + {{L}_{y}}^{2} + {{L}_{z}}^{2} }}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\hat{L}} = {\sqrt{  {-0.3}^{2} + {0.7}^{2} + {0.2}^{2} }} = {\sqrt{0.62}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The unit vector of L (&amp;lt;math&amp;gt;{\hat{L}}&amp;lt;/math&amp;gt;) is equal to &#039;&#039;&#039;L&#039;&#039;&#039; divided by its magnitude&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; {\lVert\vec{L}\rVert} = {\frac{\vec{L}}{{\lVert\vec{L}\rVert}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; {\lVert\vec{L}\rVert} = {\frac{&amp;lt;-0.3, 0.7, 0.2&amp;gt; m }{\sqrt{0.62}}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substituting these values into Hooke&#039;s Law, then gives the force exerted by the spring:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-k}{(\lVert\vec{L}\rVert-\vec{L}_{0})} \cdot {\hat{L}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-120 N/m}{(\sqrt{0.62} m - {0.5 m})} \cdot {\frac{&amp;lt;-0.3, 0.7, 0.2&amp;gt; m }{\sqrt{0.62}}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {&amp;lt;12.83316, -29.94405, -8.55544&amp;gt; N} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Caculate Net Force&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {&amp;lt;0, -13.72, 0&amp;gt; N} +{&amp;lt;12.83316, -29.94405, -8.55544&amp;gt; N} = {&amp;lt;12.83316, -16.22405, -8.55544&amp;gt; N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {&amp;lt;1.68, 1.12, -0.28&amp;gt; Ns} + {&amp;lt;12.83316, -16.22405, -8.55544&amp;gt; N}\cdot{0.005s} = {  Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {&amp;lt;1.7442, 1.0389 ,-0.3611&amp;gt; Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Calculate Velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f}} = \frac{\vec{p}_{f}}{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f}} =\frac{&amp;lt;1.7442, 1.0389 ,-0.3611&amp;gt; Ns}{1.4kg} = {&amp;lt;1.2458, 0.7421, -0.2579&amp;gt; m/s}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.005 seconds, the mass is moving with velocity &amp;lt;1.25, 0.74, -0.26&amp;gt; m/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult Example===&lt;br /&gt;
&lt;br /&gt;
Very difficult iterative motion problems likely require several calculation loops to be performed.  Thus, it is recommended that a computer program, such as VPython, is used to solve these.  For general instructions on how to do this, please see above in this article, under the heading &#039;&#039;A Computational Model&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
While you may not need to precisely calculate the motion of spring-mass systems on a daily basis, understanding their behavior has led to the invention of many useful items.  Among these are mattresses, clocks, and the suspension on cars.  &lt;br /&gt;
&lt;br /&gt;
However, the concept of iterative prediction applies to far more than masses on springs, as the concepts of physics apply far beyond textbook problems.  By thinking in small enough time increments, the behavior of any system can be understood. &lt;br /&gt;
&lt;br /&gt;
For example, in chemical engineering,  entire processes can be broken down into simpler pieces and analyzed.  These processes could then be modeled in order to predict future behavior.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Conservation_of_Momentum Conservation of Momentum]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Predicting_Change_in_multiple_dimensions Predicting Change in Multiple Dimensions]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Derivation_of_the_Momentum_Principle Derivation of Momentum Principle]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Momentum_Principle Momentum Principle]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Analytical_Prediction Analytical Prediction]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Net_Force Net Force]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Young%27s_Modulus Young&#039;s Modulus]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Tension Tension]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Length_and_Stiffness_of_an_Interatomic_Bond Length and Stiffness of Interatomic Bond]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
[https://phet.colorado.edu/sims/mass-spring-lab/mass-spring-lab_en.html Interactive Spring-Mass Simulator]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Momentum]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14336</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14336"/>
		<updated>2015-12-05T17:10:07Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: /* Further reading */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
  velocity = (-0.1, 0.2, 0.4)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin calculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using [http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For complete visual code, click [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 10 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that VPython or a similar program be used for such repetitive calculations in order to save time and reduce the likelihood of mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Middling Example===&lt;br /&gt;
&lt;br /&gt;
A semi-challenging problem, such as the one below, will often require you to perform vector calculations.  However, the same steps as the easy example above still apply.  Pay careful attention to signs as you solve these types of problems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of relaxed length 0.5 m with spring constant 120 N/m attached to the ceiling. If a 1.4 kg mass is released with an initial velocity of &amp;lt;1.2, 0.8, -0.2&amp;gt; m/s at an initial position of &amp;lt;-0.3, 0.7, 0.2&amp;gt; m, what is the velocity of the block after 0.005 seconds?  Consider the point of attachment on the spring to the ceiling to be the origin. Only one iteration is necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Calculate Initial Momentum&#039;&#039;&#039;&lt;br /&gt;
The initial momentum is simply the product of the mass and velocity of the object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{1.4kg}\cdot{&amp;lt;1.2, 0.8, -0.2&amp;gt; m/s}} = {&amp;lt;1.68, 1.12, -0.28&amp;gt; Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Force of Gravity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {m}{&amp;lt;0, -g, 0&amp;gt;}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {1.4kg}\cdot{&amp;lt;0, -9.8, 0&amp;gt; m/s/s} = {&amp;lt;0, -13.72, 0&amp;gt; N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Calculate Force of Spring&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-k}{(\vec{L}_{mag}-\vec{L}_{0})} \cdot {\hat{L}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The magnitude of L is equal to the square root of the squares of it&#039;s individual components&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\hat{L}} = {\sqrt{  {{L}_{x}}^{2} + {{L}_{y}}^{2} + {{L}_{z}}^{2} }}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\hat{L}} = {\sqrt{  {-0.3}^{2} + {0.7}^{2} + {0.2}^{2} }} = {\sqrt{0.62}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The unit vector of L (&amp;lt;math&amp;gt;{\hat{L}}&amp;lt;/math&amp;gt;) is equal to &#039;&#039;&#039;L&#039;&#039;&#039; divided by its magnitude&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; {\lVert\vec{L}\rVert} = {\frac{\vec{L}}{{\lVert\vec{L}\rVert}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; {\lVert\vec{L}\rVert} = {\frac{&amp;lt;-0.3, 0.7, 0.2&amp;gt; m }{\sqrt{0.62}}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substituting these values into Hooke&#039;s Law, then gives the force exerted by the spring:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-k}{(\lVert\vec{L}\rVert-\vec{L}_{0})} \cdot {\hat{L}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-120 N/m}{(\sqrt{0.62} m - {0.5 m})} \cdot {\frac{&amp;lt;-0.3, 0.7, 0.2&amp;gt; m }{\sqrt{0.62}}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {&amp;lt;12.83316, -29.94405, -8.55544&amp;gt; N} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Caculate Net Force&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {&amp;lt;0, -13.72, 0&amp;gt; N} +{&amp;lt;12.83316, -29.94405, -8.55544&amp;gt; N} = {&amp;lt;12.83316, -16.22405, -8.55544&amp;gt; N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {&amp;lt;1.68, 1.12, -0.28&amp;gt; Ns} + {&amp;lt;12.83316, -16.22405, -8.55544&amp;gt; N}\cdot{0.005s} = {  Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {&amp;lt;1.7442, 1.0389 ,-0.3611&amp;gt; Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Calculate Velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f}} = \frac{\vec{p}_{f}}{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f}} =\frac{&amp;lt;1.7442, 1.0389 ,-0.3611&amp;gt; Ns}{1.4kg} = {&amp;lt;1.2458, 0.7421, -0.2579&amp;gt; m/s}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.005 seconds, the mass is moving with velocity &amp;lt;1.25, 0.74, -0.26&amp;gt; m/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult Example===&lt;br /&gt;
&lt;br /&gt;
Very difficult iterative motion problems likely require several calculation loops to be performed.  Thus, it is recommended that a computer program, such as VPython, is used to solve these.  For general instructions on how to do this, please see above in this article, under the heading &#039;&#039;A Computational Model&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Conservation_of_Momentum Conservation of Momentum]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Predicting_Change_in_multiple_dimensions Predicting Change in Multiple Dimensions]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Derivation_of_the_Momentum_Principle Derivation of Momentum Principle]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Momentum_Principle Momentum Principle]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Analytical_Prediction Analytical Prediction]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Net_Force Net Force]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Young%27s_Modulus Young&#039;s Modulus]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Tension Tension]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Length_and_Stiffness_of_an_Interatomic_Bond Length and Stiffness of Interatomic Bond]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
[https://phet.colorado.edu/sims/mass-spring-lab/mass-spring-lab_en.html Interactive Spring-Mass Simulator]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Momentum]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14330</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14330"/>
		<updated>2015-12-05T17:08:30Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
  velocity = (-0.1, 0.2, 0.4)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin calculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using [http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For complete visual code, click [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 10 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that VPython or a similar program be used for such repetitive calculations in order to save time and reduce the likelihood of mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Middling Example===&lt;br /&gt;
&lt;br /&gt;
A semi-challenging problem, such as the one below, will often require you to perform vector calculations.  However, the same steps as the easy example above still apply.  Pay careful attention to signs as you solve these types of problems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of relaxed length 0.5 m with spring constant 120 N/m attached to the ceiling. If a 1.4 kg mass is released with an initial velocity of &amp;lt;1.2, 0.8, -0.2&amp;gt; m/s at an initial position of &amp;lt;-0.3, 0.7, 0.2&amp;gt; m, what is the velocity of the block after 0.005 seconds?  Consider the point of attachment on the spring to the ceiling to be the origin. Only one iteration is necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Calculate Initial Momentum&#039;&#039;&#039;&lt;br /&gt;
The initial momentum is simply the product of the mass and velocity of the object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{1.4kg}\cdot{&amp;lt;1.2, 0.8, -0.2&amp;gt; m/s}} = {&amp;lt;1.68, 1.12, -0.28&amp;gt; Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Force of Gravity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {m}{&amp;lt;0, -g, 0&amp;gt;}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {1.4kg}\cdot{&amp;lt;0, -9.8, 0&amp;gt; m/s/s} = {&amp;lt;0, -13.72, 0&amp;gt; N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Calculate Force of Spring&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-k}{(\vec{L}_{mag}-\vec{L}_{0})} \cdot {\hat{L}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The magnitude of L is equal to the square root of the squares of it&#039;s individual components&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\hat{L}} = {\sqrt{  {{L}_{x}}^{2} + {{L}_{y}}^{2} + {{L}_{z}}^{2} }}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\hat{L}} = {\sqrt{  {-0.3}^{2} + {0.7}^{2} + {0.2}^{2} }} = {\sqrt{0.62}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The unit vector of L (&amp;lt;math&amp;gt;{\hat{L}}&amp;lt;/math&amp;gt;) is equal to &#039;&#039;&#039;L&#039;&#039;&#039; divided by its magnitude&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; {\lVert\vec{L}\rVert} = {\frac{\vec{L}}{{\lVert\vec{L}\rVert}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; {\lVert\vec{L}\rVert} = {\frac{&amp;lt;-0.3, 0.7, 0.2&amp;gt; m }{\sqrt{0.62}}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substituting these values into Hooke&#039;s Law, then gives the force exerted by the spring:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-k}{(\lVert\vec{L}\rVert-\vec{L}_{0})} \cdot {\hat{L}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-120 N/m}{(\sqrt{0.62} m - {0.5 m})} \cdot {\frac{&amp;lt;-0.3, 0.7, 0.2&amp;gt; m }{\sqrt{0.62}}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {&amp;lt;12.83316, -29.94405, -8.55544&amp;gt; N} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Caculate Net Force&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {&amp;lt;0, -13.72, 0&amp;gt; N} +{&amp;lt;12.83316, -29.94405, -8.55544&amp;gt; N} = {&amp;lt;12.83316, -16.22405, -8.55544&amp;gt; N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {&amp;lt;1.68, 1.12, -0.28&amp;gt; Ns} + {&amp;lt;12.83316, -16.22405, -8.55544&amp;gt; N}\cdot{0.005s} = {  Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {&amp;lt;1.7442, 1.0389 ,-0.3611&amp;gt; Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Calculate Velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f}} = \frac{\vec{p}_{f}}{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f}} =\frac{&amp;lt;1.7442, 1.0389 ,-0.3611&amp;gt; Ns}{1.4kg} = {&amp;lt;1.2458, 0.7421, -0.2579&amp;gt; m/s}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.005 seconds, the mass is moving with velocity &amp;lt;1.25, 0.74, -0.26&amp;gt; m/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult Example===&lt;br /&gt;
&lt;br /&gt;
Very difficult iterative motion problems likely require several calculation loops to be performed.  Thus, it is recommended that a computer program, such as VPython, is used to solve these.  For general instructions on how to do this, please see above in this article, under the heading &#039;&#039;A Computational Model&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Conservation_of_Momentum Conservation of Momentum]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Predicting_Change_in_multiple_dimensions Predicting Change in Multiple Dimensions]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Derivation_of_the_Momentum_Principle Derivation of Momentum Principle]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Momentum_Principle Momentum Principle]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Analytical_Prediction Analytical Prediction]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Net_Force Net Force]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Young%27s_Modulus Young&#039;s Modulus]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Tension Tension]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Length_and_Stiffness_of_an_Interatomic_Bond Length and Stiffness of Interatomic Bond]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
[https://phet.colorado.edu/sims/mass-spring-lab/mass-spring-lab_en.html Interactive Spring-Mass Simulator]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Momentum]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14324</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14324"/>
		<updated>2015-12-05T17:06:29Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
  velocity = (-0.1, 0.2, 0.4)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin calculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using [http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For complete visual code, click [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 10 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that VPython or a similar program be used for such repetitive calculations in order to save time and reduce the likelihood of mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Middling Example===&lt;br /&gt;
&lt;br /&gt;
A semi-challenging problem, such as the one below, will often require you to perform vector calculations.  However, the same steps as the easy example above still apply.  Pay careful attention to signs as you solve these types of problems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of relaxed length 0.5 m with spring constant 120 N/m attached to the ceiling. If a 1.4 kg mass is released with an initial velocity of &amp;lt;1.2, 0.8, -0.2&amp;gt; m/s at an initial position of &amp;lt;-0.3, 0.7, 0.2&amp;gt; m, what is the velocity of the block after 0.005 seconds?  Consider the point of attachment on the spring to the ceiling to be the origin. Only one iteration is necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Calculate Initial Momentum&#039;&#039;&#039;&lt;br /&gt;
The initial momentum is simply the product of the mass and velocity of the object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{1.4kg}\cdot{&amp;lt;1.2, 0.8, -0.2&amp;gt; m/s}} = {&amp;lt;1.68, 1.12, -0.28&amp;gt; Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Force of Gravity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {m}{&amp;lt;0, -g, 0&amp;gt;}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {1.4kg}\cdot{&amp;lt;0, -9.8, 0&amp;gt; m/s/s} = {&amp;lt;0, -13.72, 0&amp;gt; N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Calculate Force of Spring&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-k}{(\vec{L}_{mag}-\vec{L}_{0})} \cdot {\hat{L}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The magnitude of L is equal to the square root of the squares of it&#039;s individual components&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\hat{L}} = {\sqrt{  {{L}_{x}}^{2} + {{L}_{y}}^{2} + {{L}_{z}}^{2} }}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\hat{L}} = {\sqrt{  {-0.3}^{2} + {0.7}^{2} + {0.2}^{2} }} = {\sqrt{0.62}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The unit vector of L (&amp;lt;math&amp;gt;{\hat{L}}&amp;lt;/math&amp;gt;) is equal to &#039;&#039;&#039;L&#039;&#039;&#039; divided by its magnitude&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; {\lVert\vec{L}\rVert} = {\frac{\vec{L}}{{\lVert\vec{L}\rVert}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; {\lVert\vec{L}\rVert} = {\frac{&amp;lt;-0.3, 0.7, 0.2&amp;gt; m }{\sqrt{0.62}}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substituting these values into Hooke&#039;s Law, then gives the force exerted by the spring:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-k}{(\lVert\vec{L}\rVert-\vec{L}_{0})} \cdot {\hat{L}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-120 N/m}{(\sqrt{0.62} m - {0.5 m})} \cdot {\frac{&amp;lt;-0.3, 0.7, 0.2&amp;gt; m }{\sqrt{0.62}}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {&amp;lt;12.83316, -29.94405, -8.55544&amp;gt; N} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Caculate Net Force&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {&amp;lt;0, -13.72, 0&amp;gt; N} +{&amp;lt;12.83316, -29.94405, -8.55544&amp;gt; N} = {&amp;lt;12.83316, -16.22405, -8.55544&amp;gt; N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {&amp;lt;1.68, 1.12, -0.28&amp;gt; Ns} + {&amp;lt;12.83316, -16.22405, -8.55544&amp;gt; N}\cdot{0.005s} = {  Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {&amp;lt;1.7442, 1.0389 ,-0.3611&amp;gt; Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Calculate Velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f}} = \frac{\vec{p}_{f}}{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f}} =\frac{&amp;lt;1.7442, 1.0389 ,-0.3611&amp;gt; Ns}{1.4kg} = {&amp;lt;1.2458, 0.7421, -0.2579&amp;gt; m/s}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.005 seconds, the mass is moving with velocity &amp;lt;1.25, 0.74, -0.26&amp;gt; m/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult Example===&lt;br /&gt;
&lt;br /&gt;
Very difficult iterative motion problems likely require several calculation loops to be performed.  Thus, it is recommended that a computer program, such as VPython, is used to solve these.  For general instructions on how to do this, please see above in this article, under the heading &#039;&#039;A Computational Model&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Conservation_of_Momentum Conservation of Momentum]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Predicting_Change_in_multiple_dimensions Predicting Change in Multiple Dimensions]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Derivation_of_the_Momentum_Principle Derivation of Momentum Principle]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Momentum_Principle Momentum Principle]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Analytical_Prediction Analytical Prediction]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Net_Force Net Force]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Young%27s_Modulus Young&#039;s Modulus]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Tension Tension]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Length_and_Stiffness_of_an_Interatomic_Bond Length and Stiffness of Interatomic Bond]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
[https://phet.colorado.edu/sims/mass-spring-lab/mass-spring-lab_en.html Interactive Spring-Mass Simulator]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category: Momentum]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14312</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14312"/>
		<updated>2015-12-05T17:01:43Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: /* Middling Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
  velocity = (-0.1, 0.2, 0.4)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin calculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using [http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For complete visual code, click [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 10 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that VPython or a similar program be used for such repetitive calculations in order to save time and reduce the likelihood of mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Middling Example===&lt;br /&gt;
&lt;br /&gt;
A semi-challenging problem, such as the one below, will often require you to perform vector calculations.  However, the same steps as the easy example above still apply.  Pay careful attention to signs as you solve these types of problems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of relaxed length 0.5 m with spring constant 120 N/m attached to the ceiling. If a 1.4 kg mass is released with an initial velocity of &amp;lt;1.2, 0.8, -0.2&amp;gt; m/s at an initial position of &amp;lt;-0.3, 0.7, 0.2&amp;gt; m, what is the velocity of the block after 0.005 seconds?  Consider the point of attachment on the spring to the ceiling to be the origin. Only one iteration is necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Calculate Initial Momentum&#039;&#039;&#039;&lt;br /&gt;
The initial momentum is simply the product of the mass and velocity of the object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{1.4kg}\cdot{&amp;lt;1.2, 0.8, -0.2&amp;gt; m/s}} = {&amp;lt;1.68, 1.12, -0.28&amp;gt; Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Force of Gravity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {m}{&amp;lt;0, -g, 0&amp;gt;}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {1.4kg}\cdot{&amp;lt;0, -9.8, 0&amp;gt; m/s/s} = {&amp;lt;0, -13.72, 0&amp;gt; N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Calculate Force of Spring&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-k}{(\vec{L}_{mag}-\vec{L}_{0})} \cdot {\hat{L}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The magnitude of L is equal to the square root of the squares of it&#039;s individual components&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\hat{L}} = {\sqrt{  {{L}_{x}}^{2} + {{L}_{y}}^{2} + {{L}_{z}}^{2} }}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\hat{L}} = {\sqrt{  {-0.3}^{2} + {0.7}^{2} + {0.2}^{2} }} = {\sqrt{0.62}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The unit vector of L (&amp;lt;math&amp;gt;{\hat{L}}&amp;lt;/math&amp;gt;) is equal to &#039;&#039;&#039;L&#039;&#039;&#039; divided by its magnitude&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; {\lVert\vec{L}\rVert} = {\frac{\vec{L}}{{\lVert\vec{L}\rVert}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; {\lVert\vec{L}\rVert} = {\frac{&amp;lt;-0.3, 0.7, 0.2&amp;gt; m }{\sqrt{0.62}}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substituting these values into Hooke&#039;s Law, then gives the force exerted by the spring:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-k}{(\lVert\vec{L}\rVert-\vec{L}_{0})} \cdot {\hat{L}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-120 N/m}{(\sqrt{0.62} m - {0.5 m})} \cdot {\frac{&amp;lt;-0.3, 0.7, 0.2&amp;gt; m }{\sqrt{0.62}}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {&amp;lt;12.83316, -29.94405, -8.55544&amp;gt; N} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Caculate Net Force&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {&amp;lt;0, -13.72, 0&amp;gt; N} +{&amp;lt;12.83316, -29.94405, -8.55544&amp;gt; N} = {&amp;lt;12.83316, -16.22405, -8.55544&amp;gt; N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {&amp;lt;1.68, 1.12, -0.28&amp;gt; Ns} + {&amp;lt;12.83316, -16.22405, -8.55544&amp;gt; N}\cdot{0.005s} = {  Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {&amp;lt;1.7442, 1.0389 ,-0.3611&amp;gt; Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Calculate Velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f}} = \frac{\vec{p}_{f}}{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f}} =\frac{&amp;lt;1.7442, 1.0389 ,-0.3611&amp;gt; Ns}{1.4kg} = {&amp;lt;1.2458, 0.7421, -0.2579&amp;gt; m/s}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.005 seconds, the mass is moving with velocity &amp;lt;1.25, 0.74, -0.26&amp;gt; m/s&lt;br /&gt;
&lt;br /&gt;
===Difficult Example===&lt;br /&gt;
&lt;br /&gt;
Very difficult iterative motion problems likely require several calculation loops to be performed.  Thus, it is recommended that a computer program, such as VPython, is used to solve these.  For general instructions on how to do this, please see above in this article, under the heading &#039;&#039;A Computational Model&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
[https://phet.colorado.edu/sims/mass-spring-lab/mass-spring-lab_en.html Interactive Spring-Mass Simulator]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category: Momentum]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14297</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14297"/>
		<updated>2015-12-05T16:52:54Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: /* Middling Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
  velocity = (-0.1, 0.2, 0.4)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin calculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using [http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For complete visual code, click [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 10 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that VPython or a similar program be used for such repetitive calculations in order to save time and reduce the likelihood of mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Middling Example===&lt;br /&gt;
&lt;br /&gt;
A semi-challenging problem, such as the one below, will often require you to perform vector calculations.  However, the same steps as the easy example above still apply.  Pay careful attention to signs as you solve these types of problems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of relaxed length 0.5 m with spring constant 120 N/m attached to the ceiling. If a 1.4 kg mass is released with an initial velocity of &amp;lt;1.2, 0.8, -0.2&amp;gt; m/s at an initial position of &amp;lt;-0.3, 0.7, 0.2&amp;gt; m, what is the velocity of the block after 0.005 seconds?  Consider the point of attachment on the spring to the ceiling to be the origin. Only one iteration is necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Calculate Initial Momentum&#039;&#039;&#039;&lt;br /&gt;
The initial momentum is simply the product of the mass and velocity of the object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{1.4kg}\cdot{&amp;lt;1.2, 0.8, -0.2&amp;gt; m/s}} = {&amp;lt;1.68, 1.12, -0.28&amp;gt; Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Force of Gravity&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {m}{&amp;lt;0, -g, 0&amp;gt;}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {1.4kg}\cdot{&amp;lt;0, -9.8, 0&amp;gt; m/s/s} = {&amp;lt;0, -13.72, 0&amp;gt; N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Calculate Force of Spring&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-k}{(\vec{L}_{mag}-\vec{L}_{0})} \cdot {\hat{L}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The magnitude of L is equal to the square root of the squares of it&#039;s individual components&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\hat{L}} = {\sqrt{  {{L}_{x}}^{2} + {{L}_{y}}^{2} + {{L}_{z}}^{2} }}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\hat{L}} = {\sqrt{  {-0.3}^{2} + {0.7}^{2} + {0.2}^{2} }} = {\sqrt{0.62}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The unit vector of L (&amp;lt;math&amp;gt;{\hat{L}}&amp;lt;/math&amp;gt;) is equal to &#039;&#039;&#039;L&#039;&#039;&#039; divided by its magnitude&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; {\lVert\vec{L}\rVert} = {\frac{\vec{L}}{{\lVert\vec{L}\rVert}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; {\lVert\vec{L}\rVert} = {\frac{&amp;lt;-0.3, 0.7, 0.2&amp;gt; m }{\sqrt{0.62}}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substituting these values into Hooke&#039;s Law, then gives the force exerted by the spring:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-k}{(\lVert\vec{L}\rVert-\vec{L}_{0})} \cdot {\hat{L}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-120 N/m}{(\sqrt{0.62} m - {0.5 m})} \cdot {\frac{&amp;lt;-0.3, 0.7, 0.2&amp;gt; m }{\sqrt{0.62}}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {&amp;lt;12.83316, -29.94405, -8.55544&amp;gt; N} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
===Difficult Example===&lt;br /&gt;
&lt;br /&gt;
Very difficult iterative motion problems likely require several calculation loops to be performed.  Thus, it is recommended that a computer program, such as VPython, is used to solve these.  For general instructions on how to do this, please see above in this article, under the heading &#039;&#039;A Computational Model&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
[https://phet.colorado.edu/sims/mass-spring-lab/mass-spring-lab_en.html Interactive Spring-Mass Simulator]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category: Momentum]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14283</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14283"/>
		<updated>2015-12-05T16:43:00Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: /* Middling Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
  velocity = (-0.1, 0.2, 0.4)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin calculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using [http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For complete visual code, click [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 10 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that VPython or a similar program be used for such repetitive calculations in order to save time and reduce the likelihood of mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Middling Example===&lt;br /&gt;
&lt;br /&gt;
A semi-challenging problem, such as the one below, will often require you to perform vector calculations.  However, the same steps as the easy example above still apply.  Pay careful attention to signs as you solve these types of problems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of relaxed length 0.5 m with spring constant 1200 N/m attached to the ceiling. If a 1.4 kg mass is released with an initial velocity of &amp;lt;1.2, 0.8, -0.2&amp;gt; m/s at an initial position of &amp;lt;-0.3, 0.7, 0.2&amp;gt; m, what is the velocity of the block after 0.005 seconds?  Consider the point of attachment on the spring to the ceiling to be the origin. Only one iteration is necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The initial momentum is simply the product of the mass and velocity of the object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{1.4kg}\cdot{&amp;lt;1.2, 0.8, -0.2&amp;gt; m/s}} = {&amp;lt;1.68, 1.12, -0.28&amp;gt; Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {m}{&amp;lt;0, -g, 0&amp;gt;}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {1.4kg}\cdot{&amp;lt;0, -9.8, 0&amp;gt; m/s/s} = {&amp;lt;0, -13.72, 0&amp;gt; N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-k}{(\vec{L}_{mag}-\vec{L}_{0})} \cdot {\hat{L}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The magnitude of L is equal to the square root of the squares of it&#039;s individual components&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\hat{L}} = {\sqrt{  {{L}_{x}}^{2} + {{L}_{y}}^{2} + {{L}_{z}}^{2} }}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The unit vector of L (&amp;lt;math&amp;gt;{\hat{L}}&amp;lt;/math&amp;gt;) is equal to &#039;&#039;&#039;L&#039;&#039;&#039; divided by its magnitude&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; {\lVert\vec{L}\rVert} = {\frac{\vec{L}}{{\lVert\vec{L}\rVert}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-k}{(\lVert\vec{L}\rVert-\vec{L}_{0})} \cdot {\hat{L}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    l = ball.pos - ceiling.pos&lt;br /&gt;
    s = l.mag - L0&lt;br /&gt;
    lhat = l/l.mag&lt;br /&gt;
    fspring = ks * s * -lhat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
===Difficult Example===&lt;br /&gt;
&lt;br /&gt;
Very difficult iterative motion problems likely require several calculation loops to be performed.  Thus, it is recommended that a computer program, such as VPython, is used to solve these.  For general instructions on how to do this, please see above in this article, under the heading &#039;&#039;A Computational Model&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
[https://phet.colorado.edu/sims/mass-spring-lab/mass-spring-lab_en.html Interactive Spring-Mass Simulator]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category: Momentum]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14259</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14259"/>
		<updated>2015-12-05T16:30:30Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
  velocity = (-0.1, 0.2, 0.4)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin calculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using [http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For complete visual code, click [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 10 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that VPython or a similar program be used for such repetitive calculations in order to save time and reduce the likelihood of mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Middling Example===&lt;br /&gt;
&lt;br /&gt;
A semi-challenging problem, such as the one below, will often require you to perform vector calculations.  However, the same steps as the easy example above still apply.  Pay careful attention to signs as you solve these types of problems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of relaxed length 0.5 m with spring constant 1200 N/m attached to the ceiling. If a 1.4 kg mass is released with an initial velocity of &amp;lt;1.2, 0.8, -0.2&amp;gt; m/s at an initial position of &amp;lt;-0.3, 0.7, 0.2&amp;gt; m, what is the velocity of the block after 0.005 seconds?  Consider the point of attachment on the spring to the ceiling to be the origin. Only one iteration is necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The initial momentum is simply the product of the mass and velocity of the object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{1.4kg}\cdot{&amp;lt;1.2, 0.8, -0.2&amp;gt; m/s}} = {&amp;lt;1.68, 1.12, -0.28&amp;gt; Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {m}{&amp;lt;0, -g, 0&amp;gt;}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {1.4kg}\cdot{&amp;lt;0, -9.8, 0&amp;gt; m/s/s} = {&amp;lt;0, -13.72, 0&amp;gt; N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-k}{(\vec{L}-\vec{L}_{0})} \cdot {\vec{L}_{magnitude}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring} = {-1200N/m}\cdot{&amp;lt;0, 0, 0&amp;gt; m} - {&amp;lt;0, -9.8, 0&amp;gt; m} = {20 N}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    l = ball.pos - ceiling.pos&lt;br /&gt;
    s = l.mag - L0&lt;br /&gt;
    lhat = l/l.mag&lt;br /&gt;
    fspring = ks * s * -lhat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
===Difficult Example===&lt;br /&gt;
&lt;br /&gt;
Very difficult iterative motion problems likely require several calculation loops to be performed.  Thus, it is recommended that a computer program, such as VPython, is used to solve these.  For general instructions on how to do this, please see above in this article, under the heading &#039;&#039;A Computational Model&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
[https://phet.colorado.edu/sims/mass-spring-lab/mass-spring-lab_en.html Interactive Spring-Mass Simulator]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category: Momentum]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14255</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14255"/>
		<updated>2015-12-05T16:27:25Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: /* Middling Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
  velocity = (-0.1, 0.2, 0.4)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin calculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using [http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For complete visual code, click [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 10 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that VPython or a similar program be used for such repetitive calculations in order to save time and reduce the likelihood of mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Middling Example===&lt;br /&gt;
&lt;br /&gt;
A semi-challenging problem, such as the one below, will often require you to perform vector calculations.  However, the same steps as the easy example above still apply.  Pay careful attention to signs as you solve these types of problems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of relaxed length 0.5 m with spring constant 1200 N/m attached to the ceiling. If a 1.4 kg mass is released with an initial velocity of &amp;lt;1.2, 0.8, -0.2&amp;gt; m/s at an initial position of &amp;lt;-0.3, 0.7, 0.2&amp;gt; m, what is the velocity of the block after 0.005 seconds?  Consider the point of attachment on the spring to the ceiling to be the origin. Only one iteration is necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The initial momentum is simply the product of the mass and velocity of the object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{1.4kg}\cdot{&amp;lt;1.2, 0.8, -0.2&amp;gt; m/s}} = {&amp;lt;1.68, 1.12, -0.28&amp;gt; Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {m}{&amp;lt;0, -g, 0&amp;gt;}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {1.4kg}\cdot{&amp;lt;0, -9.8, 0&amp;gt; m/s/s} = {&amp;lt;0, -13.72, 0&amp;gt; N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-k}{(\vec{L}-\vec{L}_{0})} \cdot &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\frac{{\vec{L}}{\vec{L}}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring} = {-1200N/m}\cdot{&amp;lt;0, 0, 0&amp;gt; m} - {&amp;lt;0, -9.8, 0&amp;gt; m} = {20 N}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    l = ball.pos - ceiling.pos&lt;br /&gt;
    s = l.mag - L0&lt;br /&gt;
    lhat = l/l.mag&lt;br /&gt;
    fspring = ks * s * -lhat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
===Difficult Example===&lt;br /&gt;
&lt;br /&gt;
Very difficult iterative motion problems likely require several calculation loops to be performed.  Thus, it is recommended that a computer program, such as VPython, is used to solve these.  For general instructions on how to do this, please see above in this article, under the heading &#039;&#039;A Computational Model&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
[https://phet.colorado.edu/sims/mass-spring-lab/mass-spring-lab_en.html Interactive Spring-Mass Simulator]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category: Momentum]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14249</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14249"/>
		<updated>2015-12-05T16:21:00Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: /* Middling Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
  velocity = (-0.1, 0.2, 0.4)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin calculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using [http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For complete visual code, click [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 10 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that VPython or a similar program be used for such repetitive calculations in order to save time and reduce the likelihood of mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Middling Example===&lt;br /&gt;
&lt;br /&gt;
A semi-challenging problem, such as the one below, will often require you to perform vector calculations.  However, the same steps as the easy example above still apply.  Pay careful attention to signs as you solve these types of problems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of relaxed length 0.5 m with spring constant 1200 N/m attached to the ceiling. If a 1.4 kg mass is released with an initial velocity of &amp;lt;1.2, 0.8, -0.2&amp;gt; m/s at an initial position of &amp;lt;-0.3, 0.7, 0.2&amp;gt; m, what is the velocity of the block after 0.005 seconds?  Consider the point of attachment on the spring to the ceiling to be the origin. Only one iteration is necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The initial momentum is simply the product of the mass and velocity of the object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{1.4kg}\cdot{&amp;lt;1.2, 0.8, -0.2&amp;gt; m/s}} = {&amp;lt;1.68, 1.12, -0.28&amp;gt; Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {m}{&amp;lt;0, -g, 0&amp;gt;}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {1.4kg}\cdot{&amp;lt;0, -9.8, 0&amp;gt; m/s/s} = {&amp;lt;0, -13.72, 0&amp;gt; N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring} = {-k}{(\vec{L}_{0}-\vec{L})}&lt;br /&gt;
&lt;br /&gt;
 \cdot \frac{\vec{L}}}{\vec{{{math|1={{!}}x{{!}}}}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring} = {-1200N/m}\cdot{&amp;lt;0, 0, 0&amp;gt; m} - {&amp;lt;0, -9.8, 0&amp;gt; m} = {20 N}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    l = ball.pos - ceiling.pos&lt;br /&gt;
    s = l.mag - L0&lt;br /&gt;
    lhat = l/l.mag&lt;br /&gt;
    fspring = ks * s * -lhat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
===Difficult Example===&lt;br /&gt;
&lt;br /&gt;
Very difficult iterative motion problems likely require several calculation loops to be performed.  Thus, it is recommended that a computer program, such as VPython, is used to solve these.  For general instructions on how to do this, please see above in this article, under the heading &#039;&#039;A Computational Model&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
[https://phet.colorado.edu/sims/mass-spring-lab/mass-spring-lab_en.html Interactive Spring-Mass Simulator]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category: Momentum]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14248</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14248"/>
		<updated>2015-12-05T16:19:59Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: /* Middling Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
  velocity = (-0.1, 0.2, 0.4)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin calculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using [http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For complete visual code, click [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 10 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that VPython or a similar program be used for such repetitive calculations in order to save time and reduce the likelihood of mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Middling Example===&lt;br /&gt;
&lt;br /&gt;
A semi-challenging problem, such as the one below, will often require you to perform vector calculations.  However, the same steps as the easy example above still apply.  Pay careful attention to signs as you solve these types of problems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of relaxed length 0.5 m with spring constant 1200 N/m attached to the ceiling. If a 1.4 kg mass is released with an initial velocity of &amp;lt;1.2, 0.8, -0.2&amp;gt; m/s at an initial position of &amp;lt;-0.3, 0.7, 0.2&amp;gt; m, what is the velocity of the block after 0.005 seconds?  Consider the point of attachment on the spring to the ceiling to be the origin. Only one iteration is necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The initial momentum is simply the product of the mass and velocity of the object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{1.4kg}\cdot{&amp;lt;1.2, 0.8, -0.2&amp;gt; m/s}} = {&amp;lt;1.68, 1.12, -0.28&amp;gt; Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {m}{&amp;lt;0, -g, 0&amp;gt;}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {1.4kg}\cdot{&amp;lt;0, -9.8, 0&amp;gt; m/s/s} = {&amp;lt;0, -13.72, 0&amp;gt; N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-k}{(\vec{L}_{0}-\vec{L})} \cdot \frac{\vec{L}}}{\vec{{{math|1={{!}}x{{!}}}}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring} = {-1200N/m}\cdot{&amp;lt;0, 0, 0&amp;gt; m} - {&amp;lt;0, -9.8, 0&amp;gt; m} = {20 N}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    l = ball.pos - ceiling.pos&lt;br /&gt;
    s = l.mag - L0&lt;br /&gt;
    lhat = l/l.mag&lt;br /&gt;
    fspring = ks * s * -lhat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
===Difficult Example===&lt;br /&gt;
&lt;br /&gt;
Very difficult iterative motion problems likely require several calculation loops to be performed.  Thus, it is recommended that a computer program, such as VPython, is used to solve these.  For general instructions on how to do this, please see above in this article, under the heading &#039;&#039;A Computational Model&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
[https://phet.colorado.edu/sims/mass-spring-lab/mass-spring-lab_en.html Interactive Spring-Mass Simulator]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category: Momentum]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14243</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=14243"/>
		<updated>2015-12-05T16:16:44Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
  velocity = (-0.1, 0.2, 0.4)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin calculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using [http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For complete visual code, click [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 10 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that VPython or a similar program be used for such repetitive calculations in order to save time and reduce the likelihood of mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Middling Example===&lt;br /&gt;
&lt;br /&gt;
A semi-challenging problem, such as the one below, will often require you to perform vector calculations.  However, the same steps as the easy example above still apply.  Pay careful attention to signs as you solve these types of problems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.&lt;br /&gt;
&lt;br /&gt;
Consider a massless spring of relaxed length 0.5 m with spring constant 1200 N/m attached to the ceiling. If a 1.4 kg mass is released with an initial velocity of &amp;lt;1.2, 0.8, -0.2&amp;gt; m/s at an initial position of &amp;lt;-0.3, 0.7, 0.2&amp;gt; m, what is the velocity of the block after 0.005 seconds?  Consider the point of attachment on the spring to the ceiling to be the origin. Only one iteration is necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The initial momentum is simply the product of the mass and velocity of the object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{1.4kg}\cdot{&amp;lt;1.2, 0.8, -0.2&amp;gt; m/s}} = {&amp;lt;1.68, 1.12, -0.28&amp;gt; Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {m}{&amp;lt;0, -g, 0&amp;gt;}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {1.4kg}\cdot{&amp;lt;0, -9.8, 0&amp;gt; m/s/s} = {&amp;lt;0, -13.72, 0&amp;gt; N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-k}{(\vec{L}_{0}-\vec{L})}\cdot\frac{\vec{L}}}{\vec{{{math|1={{!}}x{{!}}}{&amp;amp;Delta;t&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-1200N/m}\cdot{&amp;lt;0, 0, 0&amp;gt;m-&amp;lt;0, -9.8, 0&amp;gt;m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    l = ball.pos - ceiling.pos&lt;br /&gt;
    s = l.mag - L0&lt;br /&gt;
    lhat = l/l.mag&lt;br /&gt;
    fspring = ks * s * -lhat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult Example===&lt;br /&gt;
&lt;br /&gt;
Very difficult iterative motion problems likely require several calculation loops to be performed.  Thus, it is recommended that a computer program, such as VPython, is used to solve these.  For general instructions on how to do this, please see above in this article, under the heading &#039;&#039;A Computational Model&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
[https://phet.colorado.edu/sims/mass-spring-lab/mass-spring-lab_en.html Interactive Spring-Mass Simulator]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category: Momentum]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12744</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12744"/>
		<updated>2015-12-04T22:22:30Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: /* History */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
  velocity = (-0.1, 0.2, 0.4)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin calculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using [http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For complete visual code, click [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
[https://phet.colorado.edu/sims/mass-spring-lab/mass-spring-lab_en.html Interactive Spring-Mass Simulator]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category: Momentum]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12743</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12743"/>
		<updated>2015-12-04T22:22:04Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
  velocity = (-0.1, 0.2, 0.4)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin calculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using [http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For complete visual code, click [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
[https://phet.colorado.edu/sims/mass-spring-lab/mass-spring-lab_en.html Interactive Spring-Mass Simulator]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category: Momentum]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12740</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12740"/>
		<updated>2015-12-04T22:21:29Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: /* External links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
  velocity = (-0.1, 0.2, 0.4)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin Caculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using [http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For complete visual code, click [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
[https://phet.colorado.edu/sims/mass-spring-lab/mass-spring-lab_en.html Interactive Spring-Mass Simulator]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category: Momentum]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12737</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12737"/>
		<updated>2015-12-04T22:20:42Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
  velocity = (-0.1, 0.2, 0.4)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin Caculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using [http://www.physicsbook.gatech.edu/Hooke%27s_Law Hooke&#039;s Law]:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For complete visual code, click [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
[https://phet.colorado.edu/sims/mass-spring-lab/mass-spring-lab_en.html Interactive Spring-Mass System Visualizer]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category: Momentum]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12727</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12727"/>
		<updated>2015-12-04T22:10:48Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
  velocity = (-0.1, 0.2, 0.4)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin Caculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using Hooke&#039;s Law:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For complete visual code, click [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12724</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12724"/>
		<updated>2015-12-04T22:09:59Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
  velocity = (-0.1, 0.2, 0.4)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin Caculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using Hooke&#039;s Law:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12722</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12722"/>
		<updated>2015-12-04T22:09:20Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
  velocity = (0.1, 0.1, 0.1)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin Caculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using Hooke&#039;s Law:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12721</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12721"/>
		<updated>2015-12-04T22:08:56Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOfoRrXwx here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
  velocity = (0.1, 0.1, 0.1)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin Caculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using Hooke&#039;s Law:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12714</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12714"/>
		<updated>2015-12-04T22:06:48Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1#.VmIOTIRrXww here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
  velocity = (0.1, 0.1, 0.1)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin Caculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using Hooke&#039;s Law:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12711</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12711"/>
		<updated>2015-12-04T22:05:58Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program, which includes some visual aspects not described below, can be viewed [https://trinket.io/embed/glowscript/472155afa1 here].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
  velocity = (0.1, 0.1, 0.1)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin Caculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using Hooke&#039;s Law:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12281</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12281"/>
		<updated>2015-12-04T18:48:20Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program can be viewed [https://trinket.io/embed/glowscript/472155afa1 here]&lt;br /&gt;
&lt;br /&gt;
As with manual iterations, the computational steps are identical:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
  velocity = (0.1, 0.1, 0.1)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin Caculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using Hooke&#039;s Law:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
 fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
 fnet = fspring + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
 ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;---) Update visual&lt;br /&gt;
&lt;br /&gt;
Update position of spring and trail of ball&lt;br /&gt;
&lt;br /&gt;
 spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
 trail.append(pos=ball.pos)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12280</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12280"/>
		<updated>2015-12-04T18:47:29Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program can be viewed [https://trinket.io/embed/glowscript/472155afa1 here]&lt;br /&gt;
&lt;br /&gt;
As with manual iterations, the computational steps are identical:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  g = 9.8            ##gravitational constant&lt;br /&gt;
  mball = .5         ##mass of ball&lt;br /&gt;
  L0 = 0.3           ##relaxed length of spring&lt;br /&gt;
  ks = 50             ## spring constant (in N/m)&lt;br /&gt;
  deltat = .001     ## time step&lt;br /&gt;
  t = 0               ## initial time = 0 seconds&lt;br /&gt;
  velocity = (0.1, 0.1, 0.1)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 ball.p = mball*velocity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin Caculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 while t &amp;lt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using Hooke&#039;s Law:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
Calculate the gravitational force&lt;br /&gt;
&lt;br /&gt;
    fgrav = mball*vector(0, -g, 0)&lt;br /&gt;
&lt;br /&gt;
Calculate the net force&lt;br /&gt;
&lt;br /&gt;
    feet = fsprinf + fgrav&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apply the momentum principle&lt;br /&gt;
&lt;br /&gt;
     ball.p = ball.p + fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    ball.v = ball.p/mball&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    ball.pos = ball.pos + ball.v*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
  t = t + delta t&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;---) Update visual&lt;br /&gt;
&lt;br /&gt;
Update position of spring and trail of ball&lt;br /&gt;
&lt;br /&gt;
    spring.axis = ball.pos - ceiling.pos&lt;br /&gt;
    trail.append(pos=ball.pos)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VPython will continue iterating through the calculations included in the loop until the terminating condition is met.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12273</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12273"/>
		<updated>2015-12-04T18:40:41Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program can be viewed [https://trinket.io/embed/glowscript/472155afa1 here]&lt;br /&gt;
&lt;br /&gt;
As with manual iterations, the computational steps are identical:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;g = 9.8&#039;&#039;              ##gravitational constant&lt;br /&gt;
  &#039;&#039;mball = .5&#039;&#039;         ##mass of ball&lt;br /&gt;
  &#039;&#039;L0 = 0.3&#039;&#039;            ##relaxed length of spring&lt;br /&gt;
  &#039;&#039;ks = 50&#039;&#039;             ## spring constant (in N/m)&lt;br /&gt;
  &#039;&#039;deltat = .001&#039;&#039;     ## time step&lt;br /&gt;
  &#039;&#039;t = 0&#039;&#039;                  ## initial time = 0 seconds&lt;br /&gt;
  &#039;&#039;velocity = (0.1, 0.1, 0.1)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
&lt;br /&gt;
The initial position of the ball is indicated here.  An arbitrary size and color have been assigned.&lt;br /&gt;
&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
&lt;br /&gt;
The spring is attached to the ceiling, as indicated by &amp;quot;pos=ceiling.pos&amp;quot;.  Again, an arbitrary color and size, as well as number of coils have been assigned to it.&lt;br /&gt;
&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos), so the next line of code should be included as well.&lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;spring.axis = ball.pos - ceiling.pos&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Find the initial momentum by calculating the product of the velocity vector and mass of the ball.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;ball.p = mball*velocity&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Begin Caculation loop&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will include all equations that must be repeated.  Begin by specifying a terminating condition for the loop.  This usually consists of an end time, but does not have to.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;while t &amp;lt; 10&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Calculate the spring force using Hooke&#039;s Law:&lt;br /&gt;
&lt;br /&gt;
 l = ball.pos - ceiling.pos       ## calculate the length of the spring&lt;br /&gt;
 s = l.mag - L0                        ## stretch (s) is equal to the difference in the length of the spring (l) and the relaxed length (L0)&lt;br /&gt;
 lhat = l/l.mag                         ## determine L(hat)&lt;br /&gt;
 fspring = ks * s * -lhat          ##apply Hooke&#039;s Law&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12247</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12247"/>
		<updated>2015-12-04T18:28:14Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program can be viewed [https://trinket.io/embed/glowscript/472155afa1 here]&lt;br /&gt;
&lt;br /&gt;
As with manual iterations, the computational steps are identical:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;g = 9.8&#039;&#039;              ##gravitational constant&lt;br /&gt;
  &#039;&#039;mball = .5&#039;&#039;         ##mass of ball&lt;br /&gt;
  &#039;&#039;L0 = 0.3&#039;&#039;            ##relaxed length of spring&lt;br /&gt;
  &#039;&#039;ks = 50&#039;&#039;             ## spring constant (in N/m)&lt;br /&gt;
  &#039;&#039;deltat = .001&#039;&#039;     ## time step&lt;br /&gt;
  &#039;&#039;t = 0&#039;&#039;                  ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos).&lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;spring.axis = ball.pos - ceiling.pos&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial position and initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;ball.p = mball*vector&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12246</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12246"/>
		<updated>2015-12-04T18:27:12Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular text to the right the hashtag (#) on each line are explanatory notes that are not part of the code. The complete program can be viewed [https://trinket.io/embed/glowscript/472155afa1 here]&lt;br /&gt;
&lt;br /&gt;
As with manual iterations, the computational steps are identical:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;g = 9.8&#039;&#039;              ##gravitational constant&lt;br /&gt;
  &#039;&#039;mball = .5&#039;&#039;         ##mass of ball&lt;br /&gt;
  &#039;&#039;L0 = 0.3&#039;&#039;            ##relaxed length of spring&lt;br /&gt;
  &#039;&#039;ks = 50&#039;&#039;             ## spring constant (in N/m)&lt;br /&gt;
  &#039;&#039;deltat = .001&#039;&#039;     ## time step&lt;br /&gt;
  &#039;&#039;t = 0&#039;&#039;                  ## initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Create objects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create visual representations of the spring and mass attached to it&lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;ceiling = box(pos=vec(0,0,0), size=vec(0.2,0.01,0.2))&lt;br /&gt;
  ball = sphere(pos=vec(-.1,-.1,-.1), radius=0.025, color=color.orange)&lt;br /&gt;
  spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The spring should extend from the point of attachment (ceiling,pos) to the position of the ball (ball.pos).&lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;spring.axis = ball.pos - ceiling.pos&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial position and initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12239</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12239"/>
		<updated>2015-12-04T18:20:24Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular (non-italic) text to the right on each line are explanatory notes that are not part of the code. The complete program can be viewed [https://trinket.io/embed/glowscript/472155afa1 here]&lt;br /&gt;
&lt;br /&gt;
As with manual iterations, the computational steps are identical:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;g = 9.8&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;mball = .5&#039;&#039;     # mass of ball&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;L0 = 0.3&#039;&#039;      # relaxed length of spring&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;ks = 50&#039;&#039;     # spring constant (in N/m)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;deltat = .001&#039;&#039;     # time step&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;t = 0&#039;&#039;       # initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Calculate initial position and initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12236</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12236"/>
		<updated>2015-12-04T18:19:58Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
The text in italics is valid Python code. Notes in regular (non-italic) text to the right on each line are explanatory notes that are not part of the code. The complete program can be viewed [https://trinket.io/embed/glowscript/472155afa1 here]&lt;br /&gt;
&lt;br /&gt;
As with manual iterations, the computational steps are identical:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The required variables will vary depending on the problem but a general example is provided below:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;g = 9.8&#039;&#039;&lt;br /&gt;
&#039;&#039;mball = .5&#039;&#039;     # mass of ball&lt;br /&gt;
&#039;&#039;L0 = 0.3&#039;&#039;      # relaxed length of spring&lt;br /&gt;
&#039;&#039;ks = 50&#039;&#039;     # spring constant (in N/m)&lt;br /&gt;
&#039;&#039;deltat = .001&#039;&#039;     # time step&lt;br /&gt;
&#039;&#039;t = 0&#039;&#039;       # initial time = 0 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Calculate initial position and initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12228</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12228"/>
		<updated>2015-12-04T18:14:22Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
As with manual iterations, the computational steps are identical:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Determine initial parameters and constants&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Calculate initial position and initial momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Calculate initial forces acting on system, and sum to find net force&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4) Update object&#039;s momentum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5) Update object&#039;s velocity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6) Update object&#039;s position&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7) Update time&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;8) Repeat calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://trinket.io/embed/glowscript/472155afa1 Click here for GlowScript model]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12072</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12072"/>
		<updated>2015-12-04T17:25:06Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
As with manual iterations, the computational steps are identical:&lt;br /&gt;
&lt;br /&gt;
1) Determine initial parameters (including placement of origin, magnitude of time step, etc) and constants (spring constant, gravitational constant, etc)&lt;br /&gt;
&lt;br /&gt;
2) Calculate initial position and initial momentum&lt;br /&gt;
&lt;br /&gt;
3) Calculate initial forces acting on system, and sum to find net force&lt;br /&gt;
&lt;br /&gt;
4) Update object&#039;s momentum&lt;br /&gt;
&lt;br /&gt;
5) Update object&#039;s velocity&lt;br /&gt;
&lt;br /&gt;
6) Update object&#039;s position&lt;br /&gt;
&lt;br /&gt;
7) Update time &lt;br /&gt;
&lt;br /&gt;
8) Repeat calculations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://trinket.io/embed/glowscript/472155afa1 Click here for GlowScript model]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12069</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12069"/>
		<updated>2015-12-04T17:24:08Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
As with manual iterations, the computational steps are identical:&lt;br /&gt;
&lt;br /&gt;
1) Determine initial parameters (including placement of origin, magnitude of time step, etc) and constants (spring constant, gravitational constant, etc)&lt;br /&gt;
&lt;br /&gt;
2) Calculate initial position and initial momentum&lt;br /&gt;
&lt;br /&gt;
3) Calculate initial forces acting on system, and sum to find net force&lt;br /&gt;
&lt;br /&gt;
4) Update object&#039;s momentum&lt;br /&gt;
&lt;br /&gt;
5) Update object&#039;s velocity&lt;br /&gt;
&lt;br /&gt;
6) Update object&#039;s position&lt;br /&gt;
&lt;br /&gt;
7) Update time &lt;br /&gt;
&lt;br /&gt;
8) Repeat calculations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://trinket.io/embed/glowscript/472155afa1 Click here for GlowScript model]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12065</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12065"/>
		<updated>2015-12-04T17:22:15Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax, as coding requires variables and calculations to be written in a specific format that varies depending on the program used.  In the following discussion, VPython will be used to illustrate a computational model of iterative prediction of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
As with manual iterations, the computational steps are identical:&lt;br /&gt;
&lt;br /&gt;
1) Determine initial parameters (including placement of origin, magnitude of time step, etc)&lt;br /&gt;
&lt;br /&gt;
--[[User:Kgiles7|Kgiles7]] ([[User talk:Kgiles7|talk]]) 12:22, 4 December 2015 (EST)jsnd&lt;br /&gt;
&lt;br /&gt;
2) Calculate initial position and initial momentum&lt;br /&gt;
&lt;br /&gt;
3) Calculate initial forces acting on system, and sum to find net force&lt;br /&gt;
&lt;br /&gt;
4) Update object&#039;s momentum&lt;br /&gt;
&lt;br /&gt;
5) Update object&#039;s velocity&lt;br /&gt;
&lt;br /&gt;
6) Update object&#039;s position&lt;br /&gt;
&lt;br /&gt;
7) Update time &lt;br /&gt;
&lt;br /&gt;
8) Repeat calculations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://trinket.io/embed/glowscript/472155afa1 Click here for GlowScript model]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12063</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12063"/>
		<updated>2015-12-04T17:20:01Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax.&lt;br /&gt;
&lt;br /&gt;
As with manual iterations, the computational steps are identical:&lt;br /&gt;
&lt;br /&gt;
1) Determine initial parameters (including placement of origin, magnitude of time step, etc)&lt;br /&gt;
&lt;br /&gt;
2) Calculate initial position and initial momentum&lt;br /&gt;
&lt;br /&gt;
3) Calculate initial forces acting on system, and sum to find net force&lt;br /&gt;
&lt;br /&gt;
4) Update object&#039;s momentum&lt;br /&gt;
&lt;br /&gt;
5) Update object&#039;s velocity&lt;br /&gt;
&lt;br /&gt;
6) Update object&#039;s position&lt;br /&gt;
&lt;br /&gt;
7) Update time &lt;br /&gt;
&lt;br /&gt;
8) Repeat calculations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://trinket.io/embed/glowscript/472155afa1 Click here for GlowScript model]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12054</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12054"/>
		<updated>2015-12-04T17:12:39Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax.&lt;br /&gt;
&lt;br /&gt;
As with manual iterations, the computational steps are identical:&lt;br /&gt;
&lt;br /&gt;
1) Determine initial parameters (including placement of origin, magnitude of time step, etc)&lt;br /&gt;
&lt;br /&gt;
2) Calculate initial position and initial momentum&lt;br /&gt;
&lt;br /&gt;
3) Calculate initial forces acting on system, and sum to find net force&lt;br /&gt;
&lt;br /&gt;
4) Update object&#039;s momentum&lt;br /&gt;
&lt;br /&gt;
5) Update object&#039;s velocity&lt;br /&gt;
&lt;br /&gt;
6) Update object&#039;s position&lt;br /&gt;
&lt;br /&gt;
7) Update time &lt;br /&gt;
&lt;br /&gt;
8) Repeat calculations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://trinket.io/embed/glowscript/fe23193453 Click here for GlowScript model]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12052</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=12052"/>
		<updated>2015-12-04T17:12:12Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
By definition, iterative prediction requires repeated calculations.  Computations that require significant time and attention to detail when performed by hand can be done incredibly quickly and accurately by a computer model.&lt;br /&gt;
&lt;br /&gt;
Coding iterative prediction is very similar to writing equations by hand.  The same approach is used; the largest difference arises in syntax.&lt;br /&gt;
&lt;br /&gt;
As with manual iterations, the computational steps are identical:&lt;br /&gt;
&lt;br /&gt;
1) Determine initial parameters (including placement of origin, magnitude of time step, etc)&lt;br /&gt;
2) Calculate initial position and initial momentum&lt;br /&gt;
3) Calculate initial forces acting on system, and sum to find net force&lt;br /&gt;
4) Update object&#039;s momentum&lt;br /&gt;
5) Update object&#039;s velocity&lt;br /&gt;
6) Update object&#039;s position&lt;br /&gt;
7) Update time &lt;br /&gt;
8) Repeat calculations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://trinket.io/embed/glowscript/fe23193453 Click here for GlowScript model]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6871</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6871"/>
		<updated>2015-12-01T23:08:13Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
[https://trinket.io/embed/glowscript/fe23193453 Click here for GlowScript model]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6869</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6869"/>
		<updated>2015-12-01T23:07:25Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
[&amp;lt;https://trinket.io/embed/glowscript/fe23193453 Click here for GlowScript model]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6866</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6866"/>
		<updated>2015-12-01T23:06:31Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
[&amp;lt;iframe src=&amp;quot;https://trinket.io/embed/glowscript/fe23193453&amp;quot; width=&amp;quot;100%&amp;quot; height=&amp;quot;356&amp;quot; frameborder=&amp;quot;0&amp;quot; marginwidth=&amp;quot;0&amp;quot; marginheight=&amp;quot;0&amp;quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6864</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6864"/>
		<updated>2015-12-01T23:06:00Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;iframe src=&amp;quot;https://trinket.io/embed/glowscript/fe23193453&amp;quot; width=&amp;quot;100%&amp;quot; height=&amp;quot;356&amp;quot; frameborder=&amp;quot;0&amp;quot; marginwidth=&amp;quot;0&amp;quot; marginheight=&amp;quot;0&amp;quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6838</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6838"/>
		<updated>2015-12-01T22:56:32Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6837</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6837"/>
		<updated>2015-12-01T22:55:53Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6834</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6834"/>
		<updated>2015-12-01T22:55:17Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling, in the vertical direction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6828</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6828"/>
		<updated>2015-12-01T22:49:57Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
Short Description of Topic&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling, in the vertical direction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; While calculations can be performed manually, as above, it is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6822</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6822"/>
		<updated>2015-12-01T22:49:02Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
Short Description of Topic&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling, in the vertical direction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; It is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6818</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6818"/>
		<updated>2015-12-01T22:48:26Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
Short Description of Topic&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
Be sure to show all steps in your solution and include diagrams whenever possible&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 12: State Answer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After 0.2 seconds, the mass is at a position of 1.23 m below the ceiling, in the vertical direction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A Note on Iterations:&#039;&#039;&#039; It is advisable for more advanced problems that a computer model or similar program be used for such repetitive calculations in order to save time and reduce mathematical errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6803</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6803"/>
		<updated>2015-12-01T22:43:12Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
Short Description of Topic&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
Be sure to show all steps in your solution and include diagrams whenever possible&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Set Parameters&#039;&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate Initial Values&#039;&#039;&#039;&lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6797</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6797"/>
		<updated>2015-12-01T22:41:14Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
Short Description of Topic&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
Be sure to show all steps in your solution and include diagrams whenever possible&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 1: Set Parameters&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 2: Calculate Initial Values&#039;&#039; &lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6793</id>
		<title>Iterative Prediction of Spring-Mass System</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Iterative_Prediction_of_Spring-Mass_System&amp;diff=6793"/>
		<updated>2015-12-01T22:40:44Z</updated>

		<summary type="html">&lt;p&gt;Kgiles7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by kgiles7&lt;br /&gt;
&lt;br /&gt;
Short Description of Topic&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
&lt;br /&gt;
A simple spring-mass system is a basic illustration of the momentum principle.  The principle of conservation of momentum can be repeatedly applied to predict the system&#039;s future motion.&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
&lt;br /&gt;
The Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system&#039;s future motion.  The most useful form of this equation for predicting future motion is referred to as the &#039;&#039;momentum update form&#039;&#039;, and can be derived by rearranging the Momentum Principle as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;&amp;lt;math&amp;gt;{{&amp;amp;Delta;p}_{system}} = {\vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;In order to update the object&#039;s velocity and position, similar equations can be used.  Together, they can be used to model the future motion of a spring-mass system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Velocity Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Update Formula&#039;&#039;&#039;:  &amp;lt;math&amp;gt;{\vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
Be sure to show all steps in your solution and include diagrams whenever possible&lt;br /&gt;
&lt;br /&gt;
===Simple Example===&lt;br /&gt;
&lt;br /&gt;
[[File:Simple harmonic oscillator.gif|right|frame|vertical spring-mass system]]&lt;br /&gt;
&lt;br /&gt;
The simplest example of a spring mass system is one that moves in only one-direction.  Consider a massless spring of length 1.0 m with spring constant 40 N/m. If a 1 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it&#039;s position after 0.2 seconds?  The mass oscillates vertically, as shown to the right.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 1: Set Parameters&#039;&#039;&lt;br /&gt;
Before we begin, we must set some parameters that allow the problem to be solved.  Since all movement is in the vertical direction, no vector calculation is needed.  However, careful attention must be paid to the direction associated with the object&#039;s movement and the forces acting on it.  For ease in calculations, assume the origin is the point of attachment of the spring to the ceiling above.  AS is customary, the positive y-direction will be up, and the negative-y, down.&lt;br /&gt;
Additionally, the time step used for each iteration must be small enough that we can assume a constant velocity over the interval, but not so large that solving the problem becomes incredibly time-consuming.  An appropriately small time step here is approximately 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 2: Calculate Initial Values&#039;&#039; &lt;br /&gt;
Begin by calculating the object&#039;s initial momentum and the sum of the forces acting on it.  The initial momentum is simply the product of the initial velocity, which is 0 m/s, as the object is released &#039;&#039;from rest&#039;&#039;.  The forces acting on the mass are the gravitational force exerted by the Earth and the tension exerted by the spring.  The net force can be calculated by summing these two forces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{i}} = {{10kg}\cdot{0m/s}} = {0 Ns}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {mg}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{grav}} = {10kg}\cdot{-9.8 m/s/s} = {-9.8 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.5m} = {20 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{20 N} = {10.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 3: Update Momentum (Iteration 1)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {0Ns} + {10.2N}\cdot{0.1s} = {1.02Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 4: Update Velocity (Iteration 1)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.02N}{1 kg}}{0.1s} = {0.102m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 5: Update Position (Iteration 1)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the position update formula, calculate the position of the mass at the end of the given time step.  The average velocity used below is the velocity of the mass at the end of the time step.  As with all simplifying assumptions, this measurement is not exact.  However, it allows for a close enough approximation that the results derived are still valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.5m} + {0.102m/s}{0.1s} = {-1.398m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 6: Update Time (Iteration 1)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {\vec{t}_{i}}  + {&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{t}_{f}}  = {0s}  + {0.1s} = {0.1s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 7: Repeat Calculations&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Repeat the above calculations using the &amp;quot;Iteration Round 1 Final Values&amp;quot; (calculated above) as the &amp;quot;Iteration Round 2 Initial Values&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 8: Update Forces (Iteration 2)&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
The gravitational force on the mass remains constant, and does not need to be recalculated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-kx}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{spring}} = {-40N/m}\cdot{1.0m-1.398m} = {15.92 N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{F}_{net}} = {-9.8N} +{15.92 N} = {6.12N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 9: Update Momentum (Iteration 2)&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{p}_{f} = {1.02Ns} + {6.12N}\cdot{0.1s} = {1.632Ns}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 10: Update Velocity (Iteration 2)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = \vec{v}_{i} + \frac{\vec{F}_{net}}{m}}{&amp;amp;Delta;t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{v}_{f} = {0m/s} + \frac{1.632N}{1 kg}}{0.1s} = {0.1632m/s} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 11: Update Position (Iteration 2)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {\vec{r}_{i} + \vec{v}_{avg}{&amp;amp;Delta;t}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\vec{r}_{f}} = {-1.398m} + {0.1632m/s}{0.1s} = {-1.2348m}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
#How is this topic connected to something that you are interested in?&lt;br /&gt;
#How is it connected to your major?&lt;br /&gt;
#Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore?  How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Kgiles7</name></author>
	</entry>
</feed>