Iterative Prediction of Spring-Mass System: Difference between revisions
Line 356: | Line 356: | ||
</div></div> | </div></div> | ||
===Middling Example=== | |||
Now let us consider the above scenario and introduce a dissipative force of <math> \vec{F}_d = -b\vec{v} </math>, and set <math> b = 1 kg/s </math>. What will be the position at a time of <math> 0.2 s </math> now? | |||
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px; overflow:auto;"> | |||
<div style="font-weight:bold;line-height:1.6;">Solution</div> | |||
<div class="mw-collapsible-content"> | |||
We begin by recognizing that, presuming we use the same time steps, the first six steps stay exactly the same. Thus, if you have already done the simple level problem, we can perform only the second iteration. We will thus have initial conditions <math> x = -1.398 m </math> and <math> v = 1.02 m/s </math>. Now, let's compute the force, beginning with gravity: | |||
<math> \vec{F}_g = m\vec{g} = (1 kg)\cdot(-9.8 m/s^2) = -9.8 N </math> | |||
This naturally is unchanged. Next, | |||
<math> \vec{F}_s = -(40 N/m)\cdot((-1.398 m)-(1.0 m)) = 15.92 N </math> | |||
This too has stayed unchanged from the previous version of the problem, though one should note that for further iterations it will start to vary as well. Finally, we come to the difference: | |||
<math> \vec{F}_d = -(1 kg/s)\cdot(1.02 m/s) = -1.02 N </math> | |||
Note that here we are using the initial velocity to compute force. This is not strictly accurate, since the velocity is changing over the duration of the timestep, but since the final velocity depends on this force, it grows very complicated to account for this behavior, but achieving a more accurate answer with coarser time steps would require use of these techniques. We will not worry so much about this, however, and simply use this simplification. Thus we have our net force | |||
<math> \vec{F}_{net} = -9.8 N + 15.92 N - 1.02 N = 5.1 N </math> | |||
We now proceed as normal, computing | |||
<math> \vec{p}_f = \vec{p}_i + \vec{F}_{net} \Delta t = 1.02 Ns + (5.1 N)(0.1 s) = 1.53 Ns </math> | |||
<math> \vec{v}_f = \vec{v}_i + \frac{\vec{F}_{net}}{m} \Delta t = \frac{\vec{p}_f}{m} = 1.53 m/s </math> | |||
<math> x_f = x_i + v \cdot \Delta t = -1.398 m + (1.53 m/s)(0.1 s) = -1.245 m </math> | |||
This is, as expected, a shorter distance traveled than in the case without dissipation, since the system has been slowed down somewhat by the resistance. | |||
</div></div> | |||
===Difficult Example=== | ===Difficult Example=== |
Revision as of 17:52, 20 June 2019
claimed by kgiles7
The Main Idea
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's future motion.
A Mathematical Model
The page Fundamentals of Iterative Prediction with Varying Force lays out the general methods of iterative prediction, but a brief recapitulation is provided here. he Momentum Principle provides a mathematical basis for the repeated calculations needed to predicts the system's future motion. The most useful form of this equation for predicting future motion is referred to as the momentum update form, and can be derived by rearranging the Momentum Principle as shown below:
[math]\displaystyle{ \Delta p = \vec{F}_{net}\Delta t }[/math]
[math]\displaystyle{ \vec{p}_{f} - \vec{p}_{i} = \vec{F}_{net}\Delta t }[/math]
[math]\displaystyle{ \vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}\Delta t }[/math]
[math]\displaystyle{ \vec{v}_{f} = \frac{\vec{p}_f}{m} }[/math]
[math]\displaystyle{ \vec{r}_{f} = \vec{r}_{i} + \vec{v}_{avg}\Delta t }[/math]
Damping
We know from our observations of say a pendulum swinging or a spring bobbing that it's periodic motion eventually dies out. This is because dissipative forces prevalent such as air resistance, friction, fluid drag, etc. reduce the net energy of the system by dissipating it into the surroundings. A formal derivation of the equations of motion for a damped system will not be considered here, but it is very straightforward to add damping to our computational model. Whenever we calculate the net force on the mass during the iterative process, all we have to do now is add a dissipative force. For air resistance, the standard formula is
[math]\displaystyle{ \vec{F} = -0.5CAρv^2\hat{v} }[/math]
More frequently though, when we talk about the damped harmonic oscillator, we will discuss this force[1] [2] :
[math]\displaystyle{ \vec{F} = -b\vec{v} }[/math]
where b is the damping constant. The important difference between the two is that in the latter the force has a linear relationship to [math]\displaystyle{ \vec{v} }[/math]. There are three types of damping, depending on the coefficient, and labelled by how quickly the system damps out (reaches equilibrium). If the coefficient is small relative to the mass and spring constant, then the oscillator will be under damped, and still have some oscillatory behavior. If it is large relative to the mass and spring constant, the oscillator will be over damped, meaning that there will be no oscillations, but the system will take longer to arrive at an equilibrium because it has been slowed down by the dissipation. The fastest time of decay is when the system is critically damped, which occurs when [math]\displaystyle{ b^2 = 4mk }[/math]. The figure below illustrates these three possibilities, and is generated using the numpy based code from the Computational Methods section below.
Gravity
Introducing gravity to our model of spring mass systems is fairly straightforward (actually solving for it is somewhat more complicated, and we will only do so with computational methods described below). One simply adds the standard gravitational force [math]\displaystyle{ F = mg }[/math] to the force equations one has already. The most important point is to always remember which way is down: if your spring is hung upside down, then you may have chosen to define the origin at the equilibrium point and [math]\displaystyle{ +x }[/math] as being the downward direction, in which case you must take care to ensure that the sign of gravity corresponds.
A Computational Model
By definition, iterative prediction requires repeated calculations. This is extremely tedious to do by hand, so it is greatly preferable to perform them with a computer. Two programs are presented which perform these calculations.
An implementation of iterative motion for a spring system which feels gravitational force is provided in VPython here. The operative portion of the code is copied in the collapsible below (note, if one wishes to use this code, it will be necessary to include the proper import statements, which may be found at the link).
A second implementation using Numpy may be found here.
Examples
Simple Example

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 10 kg mass is released from rest while the spring is stretched downward to a length of 1.5 m, what is it's position after 0.2 seconds? The mass oscillates vertically, as shown to the right.
Middling Example
Now let us consider the above scenario and introduce a dissipative force of [math]\displaystyle{ \vec{F}_d = -b\vec{v} }[/math], and set [math]\displaystyle{ b = 1 kg/s }[/math]. What will be the position at a time of [math]\displaystyle{ 0.2 s }[/math] now?
Difficult Example
This problem will use a numerical simulation such as those described in the Computational Methods section. The notebook includes the code snippets to work this solution, though it is also helpful to investigate the process of writing one's own code.
We will consider the case of the driven oscillator from a strictly numerical point of view (if you wish to see a more thorough description of the problem, the Feynman Lectures [3] sections 21-24 cover this entire topic in great detail). Consider a system with a mass of [math]\displaystyle{ 4 kg }[/math] attached to a spring with spring constant of [math]\displaystyle{ k = 100 N/m }[/math]. Assume that it is horizontal, such that gravity does not act upon it, and start by assuming there is no dissipative force.
Connectedness
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.
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.
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.
See also
Predicting Change in multiple dimensions
Fundamentals of Iterative Prediction with Varying Force
Length and Stiffness of an Interatomic Bond
External links
Interactive Spring-Mass Simulator
References
- ↑ https://ocw.mit.edu/courses/mathematics/18-03sc-differential-equations-fall-2011/unit-ii-second-order-constant-coefficient-linear-equations/damped-harmonic-oscillators/MIT18_03SCF11_s13_2text.pdf
- ↑ http://www.feynmanlectures.caltech.edu/I_24.html
- ↑ http://www.feynmanlectures.caltech.edu/I_toc.html