Two Dimensional Harmonic Motion: Difference between revisions
Line 55: | Line 55: | ||
====The Swinging Spring==== | ====The Swinging Spring==== | ||
Given the forces we derived above, it is fairly straightforward to plug these into a numerical simulator along with a set of initial conditions. [https://colab.research.google.com/drive/1Mn8IuAWj8hxFDJMKWPYZ0z5er_B2k9of This] does it using the numpy code described in [[Predicting Change in multiple dimensions]]. | |||
==Examples== | ==Examples== |
Revision as of 15:00, 11 July 2019
Main Idea
Mathematical Method
Two examples of harmonic motion in multiple dimensions will be considered: the pendulum and the swinging spring-mass system. In both cases, there exists the force of gravity pointing downwards, and another force pointed towards the center of rotation. We will not consider the analytic methods of solving these problems (for the first steps in doing so, see Centripetal Force and Curving Motion). Instead, we will define the forces present, and then implement an iterative model.
The Pendulum
The simpler of the two cases is the pendulum. In this scenario, we neglect air resistance, and have a mass attached to a rod of negligible mass with a fixed length [math]\displaystyle{ R }[/math]. We will treat the pivot point as the origin of the system, so that no coordinate conversions are necessary when computing angles. The force from the rod is a constraint force, meaning that it acts exactly to ensure the mass always stays on the arc of equal distance to the pivot point. For this to occur, it is necessary that the force directed towards the center always be the centripetal force necessary to maintain that arc, which is defined as a force pointed towards the pivot point with a magnitude
[math]\displaystyle{ |F_c| = \frac{v^2}{r} }[/math]
The situation is complicated by the fact that gravity is present. Gravity is defined as always:
[math]\displaystyle{ \vec{F}_g = -mg \hat{y} }[/math]
Now, let us imagine the situation, illustrated in this figure:
- Insert figure here ***
We release the pendulum from height [math]\displaystyle{ h }[/math] at an angle [math]\displaystyle{ \theta_0 }[/math]. At this point, its velocity will be zero, so the centripetal force must equal zero. However, gravity must still be present, so there must be some pendulum force to cancel gravity's radial component. From this we know its magnitude must be
[math]\displaystyle{ F_p (t) = mg\cos(\theta)+\frac{mv^2}{R} }[/math]
Now all we need to do is use trigonometry to determine the forces in the x and y direction:
[math]\displaystyle{ F_x = - F_p\sin(\theta) = -(mg\cos(\theta)\sin(\theta) + \frac{mv^2}{R}) }[/math]
Note the negative direction, because of how we have oriented our angles. Next, we have the slightly more complicated expression
[math]\displaystyle{ F_y = F_p\cos(\theta)-mg = mg\cos^2(\theta) + \frac{mv^2}{R}\cos(\theta) - mg }[/math]
Plugging these in to a numerical simulator will allow us to arrive at our desired answer.
The Swinging Spring
This problems is both more and less complicated than the one above. On the one hand, the force from the spring is not a centripetal restraining force, and so it will be more complicated to write out. On the other hand, it is conceptually easier to work with, because all we have to do is consider the two base forces and implement them, rather than thinking about the nature of the net force. First, gravity will stay the same as above, which should not be surprising. Next, we need to implement the spring force, as described in Simple Harmonic Motion and Iterative Prediction of Spring-Mass System. The Hookeian spring is governed by the equation
[math]\displaystyle{ \vec{F}_s = -k(\vec{r}-\vec{r}_0) }[/math]
This means that we define the rest length of the spring, then compute the current deviation of the spring from that rest length in order to determine the force. The force will always be directed along the axis of the spring, which in this cases means radially from the pivot point, as above (we will be assuming the spring stays straight - real springs will also have some curvature, but this can get very complicated). Given this, when the spring is at some angle [math]\displaystyle{ \theta }[/math], defined as above, we can determine our forces to be:
[math]\displaystyle{ \vec{F}_x =\vec{F}_s \cdot \hat{x} = k (\vec{r}-r_0\hat{r})\cdot\hat{x} }[/math]
This notation may be confusing, since it uses the inner product notation. This is meant to indicate that not only is the magnitude of [math]\displaystyle{ \vec{F}_s }[/math] important, but so is its sign. In the code, this is easy to implement, but notationally it is more difficult. One could explicitly write the equation out with trigonometric functions as
[math]\displaystyle{ \vec{F}_x = -|k (\vec{r}-r_0\hat{r})|(Sign((\vec{r}-r_0\hat{r})))\sin(\theta)\hat{x} }[/math]
but as you can see, it starts to get very clumsy, so instead this page will stick with vector notation. The coefficient sign is positive because we have one negative from the definition of a Hookeian spring, and another from our coordinate system (see above). Notice as well, the definition of the equilibrium point was made explicit, as we define it as being the point along the radial vector from the pivot to the object, with distance from the pivot of [math]\displaystyle{ r_0 }[/math]. The force in the y direction is slightly more complicated, but follow similarly:
[math]\displaystyle{ \vec{F}_y = \vec{F}_s\cdot\hat{y} -mg\hat{y} = -k(\vec{r}-r_0\hat{r})\cdot\hat{y} - mg\hat{y} }[/math]
Computational Method
The Pendulum
Given the forces we derived above, it is fairly straightforward to plug these into a numerical simulator along with a set of initial conditions. This does it using the numpy code described in Predicting Change in multiple dimensions.
The Swinging Spring
Given the forces we derived above, it is fairly straightforward to plug these into a numerical simulator along with a set of initial conditions. This does it using the numpy code described in Predicting Change in multiple dimensions.
Examples
Simple Example
Middling Example
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.
The simplest example of a spring mass system is one that moves in only one-direction.
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 <1.2, 0.8, -0.2> m/s at an initial position of <-0.3, 0.7, 0.2> 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.
Step 1: Calculate Initial Momentum The initial momentum is simply the product of the mass and velocity of the object.
[math]\displaystyle{ {\vec{p}_{i}} = {{m}\cdot\vec{v}_{i}} }[/math]
[math]\displaystyle{ {\vec{p}_{i}} = {{1.4kg}\cdot{\lt 1.2, 0.8, -0.2\gt m/s}} = {\lt 1.68, 1.12, -0.28\gt Ns} }[/math]
Step 2: Calculate Force of Gravity
[math]\displaystyle{ {\vec{F}_{grav}} = {m}{\lt 0, -g, 0\gt } }[/math]
[math]\displaystyle{ {\vec{F}_{grav}} = {1.4kg}\cdot{\lt 0, -9.8, 0\gt m/s/s} = {\lt 0, -13.72, 0\gt N} }[/math]
Step 3: Calculate Force of Spring
[math]\displaystyle{ {\vec{F}_{spring}} = {-k}{(\vec{L}_{mag}-\vec{L}_{0})} \cdot {\hat{L}} }[/math]
The magnitude of L is equal to the square root of the squares of it's individual components
[math]\displaystyle{ {\hat{L}} = {\sqrt{ {{L}_{x}}^{2} + {{L}_{y}}^{2} + {{L}_{z}}^{2} }} }[/math]
[math]\displaystyle{ {\hat{L}} = {\sqrt{ {-0.3}^{2} + {0.7}^{2} + {0.2}^{2} }} = {\sqrt{0.62}} }[/math]
The unit vector of L ([math]\displaystyle{ {\hat{L}} }[/math]) is equal to L divided by its magnitude
[math]\displaystyle{ {\lVert\vec{L}\rVert} = {\frac{\vec{L}}{{\lVert\vec{L}\rVert}}} }[/math]
[math]\displaystyle{ {\lVert\vec{L}\rVert} = {\frac{\lt -0.3, 0.7, 0.2\gt m }{\sqrt{0.62}}} }[/math]
Substituting these values into Hooke's Law, then gives the force exerted by the spring:
[math]\displaystyle{ {\vec{F}_{spring}} = {-k}{(\lVert\vec{L}\rVert-\vec{L}_{0})} \cdot {\hat{L}} }[/math]
[math]\displaystyle{ {\vec{F}_{spring}} = {-120 N/m}{(\sqrt{0.62} m - {0.5 m})} \cdot {\frac{\lt -0.3, 0.7, 0.2\gt m }{\sqrt{0.62}}} }[/math]
[math]\displaystyle{ {\vec{F}_{spring}} = {\lt 12.83316, -29.94405, -8.55544\gt N} }[/math]
Step 4: Caculate Net Force"
The net force can be calculated by summing these two forces.
[math]\displaystyle{ {\vec{F}_{net}} = {\vec{F}_{grav} +{\vec{F}_{spring}}} }[/math]
[math]\displaystyle{ {\vec{F}_{net}} = {\lt 0, -13.72, 0\gt N} +{\lt 12.83316, -29.94405, -8.55544\gt N} = {\lt 12.83316, -16.22405, -8.55544\gt N} }[/math]
Step 5: Update Momentum
Using the momentum update formula, calculate the momentum of the mass at the end of the given time step.
[math]\displaystyle{ {\vec{p}_{f} = \vec{p}_{i} + \vec{F}_{net}{Δt}} }[/math]
[math]\displaystyle{ {\vec{p}_{f} = {\lt 1.68, 1.12, -0.28\gt Ns} + {\lt 12.83316, -16.22405, -8.55544\gt N}\cdot{0.005s} = { Ns}} }[/math]
[math]\displaystyle{ {\vec{p}_{f} = {\lt 1.7442, 1.0389 ,-0.3611\gt Ns}} }[/math]
Step 4: Calculate Velocity
[math]\displaystyle{ {\vec{v}_{f}} = \frac{\vec{p}_{f}}{m} }[/math]
[math]\displaystyle{ {\vec{v}_{f}} =\frac{\lt 1.7442, 1.0389 ,-0.3611\gt Ns}{1.4kg} = {\lt 1.2458, 0.7421, -0.2579\gt m/s} }[/math]
Step 5: State Answer
After 0.005 seconds, the mass is moving with velocity <1.25, 0.74, -0.26> m/s