PHY321: Work and Energy and Conservation Theorems

Morten Hjorth-Jensen
Department of Physics and Astronomy and Facility for Rare Isotope Beams (FRIB), Michigan State University, USA

January 30-February 3


Plans for the week January 30-February 3

Monday

The work-energy theorem with examples. Discussion of momentum and angular momentum. Reading suggestion: Taylor sections 3.1-3.4 and 4.1-4.3

Lecture via zoom only.

Video of lecture

Wednesday

Examples and conservation of angular momentum, Taylor sections 3.4 and 3.5. Discussion of exercises 5 and 6. This is also the assignment for Friday's session.

Lecture via zoom only.

Video of lecture

Friday

Solution of exercises and discussion of homework 3. We discuss exercises 5 and 6 the first 15 min, see end of these slides.

If you wish to read more about conservative forces or not, Feynman's lectures from 1963 are quite interesting. He states for example that All fundamental forces in nature appear to be conservative. This statement was made while developing his argument that there are no nonconservative forces. You may enjoy the link to Feynman's lecture.

Work, Energy, Momentum and Conservation laws

The systems we studied the first three weeks have shown us how to use Newton’s laws of motion to determine the motion of an object based on the forces acting on it. For some of the cases there is an underlying assumption that we can find an analytical solution to a continuous problem. With a continuous problem we mean a problem where the various variables can take any value within a finite or infinite interval.

Unfortunately, in many cases we cannot find an exact solution to the equations of motion we get from Newton’s second law. The numerical approach, where we discretize the continuous problem, allows us however to study a much richer set of problems. For problems involving Newton's laws and the various equations of motion we encounter, solving the equations numerically, is the standard approach.

It allows us to focus on the underlying forces. Often we end up using the same numerical algorithm for different problems.

Here we introduce a commonly used technique that allows us to find the velocity as a function of position without finding the position as a function of time—an alternate form of Newton’s second law. The method is based on a simple principle: Instead of solving the equations of motion directly, we integrate the equations of motion. Such a method is called an integration method.

This allows us also to introduce the work-energy theorem. This theorem allows us to find the velocity as a function of position for an object even in cases when we cannot solve the equations of motion. This introduces us to the concept of work and kinetic energy, an energy related to the motion of an object.

And finally, we will link the work-energy theorem with the principle of conservation of energy.

The Work-Energy Theorem

Let us define the kinetic energy \( K \) with a given velocity \( \boldsymbol{v} \)

$$ K=\frac{1}{2}mv^2, $$

where \( m \) is the mass of the object we are considering. We assume also that there is a force \( \boldsymbol{F} \) acting on the given object

$$ \boldsymbol{F}=\boldsymbol{F}(\boldsymbol{r},\boldsymbol{v},t), $$

with \( \boldsymbol{r} \) the position and \( t \) the time. In general we assume the force is a function of all these variables. Many of the more central forces in Nature however, depende only on the position. Examples are the gravitational force and the force derived from the Coulomb potential in electromagnetism.

Rewriting the Kinetic Energy

Let us study the derivative of the kinetic energy with respect to time \( t \). Its continuous form is

$$ \frac{dK}{dt}=\frac{1}{2}m\frac{d\boldsymbol{v}\cdot\boldsymbol{v}}{dt}. $$

Using our results from exercise 3 of homework 1, we can write the derivative of a vector dot product as

$$ \frac{dK}{dt}=\frac{1}{2}m\frac{d\boldsymbol{v}\cdot\boldsymbol{v}}{dt}= \frac{1}{2}m\left(\frac{d\boldsymbol{v}}{dt}\cdot\boldsymbol{v}+\boldsymbol{v}\cdot\frac{d\boldsymbol{v}}{dt}\right)=m\frac{d\boldsymbol{v}}{dt}\cdot\boldsymbol{v}. $$

We know also that the acceleration is defined as

$$ \boldsymbol{a}=\frac{\boldsymbol{F}}{m}=\frac{d\boldsymbol{v}}{dt}. $$

We can then rewrite the equation for the derivative of the kinetic energy as

$$ \frac{dK}{dt}=m\frac{d\boldsymbol{v}}{dt}\boldsymbol{v}=\boldsymbol{F}\frac{d\boldsymbol{r}}{dt}, $$

where we defined the velocity as the derivative of the position with respect to time.

Discretizing

Let us now discretize the above equation by letting the instantaneous terms be replaced by a discrete quantity, that is we let \( dK\rightarrow \Delta K \), \( dt\rightarrow \Delta t \), \( d\boldsymbol{r}\rightarrow \Delta \boldsymbol{r} \) and \( d\boldsymbol{v}\rightarrow \Delta \boldsymbol{v} \).

We have then

$$ \frac{\Delta K}{\Delta t}=m\frac{\Delta \boldsymbol{v}}{\Delta t}\boldsymbol{v}=\boldsymbol{F}\frac{\Delta \boldsymbol{r}}{\Delta t}, $$

or by multiplying out \( \Delta t \) we have

$$ \Delta K=\boldsymbol{F}\Delta \boldsymbol{r}. $$

We define this quantity as the work done by the force \( \boldsymbol{F} \) during the displacement \( \Delta \boldsymbol{r} \). If we study the dimensionality of this problem we have mass times length squared divided by time squared, or just dimension energy.

Difference in kinetic energy

If we now define a series of such displacements \( \Delta\boldsymbol{r} \) we have a difference in kinetic energy at a final position \( \boldsymbol{r}_n \) and an initial position \( \boldsymbol{r}_0 \) given by

$$ \Delta K=\frac{1}{2}mv_n^2-\frac{1}{2}mv_0^2=\sum_{i=0}^n\boldsymbol{F}_i\Delta \boldsymbol{r}, $$

where \( \boldsymbol{F}_i \) are the forces acting at every position \( \boldsymbol{r}_i \).

The work done by acting with a force on a set of displacements can then be as expressed as the difference between the initial and final kinetic energies.

This defines the work-energy theorem.

From the discrete version to the continuous version

If we take the limit \( \Delta \boldsymbol{r}\rightarrow 0 \), we can rewrite the sum over the various displacements in terms of an integral, that is

$$ \Delta K=\frac{1}{2}mv_n^2-\frac{1}{2}mv_0^2=\sum_{i=0}^n\boldsymbol{F}_i\Delta \boldsymbol{r}\rightarrow \int_{\boldsymbol{r}_0}^{\boldsymbol{r}_n}\boldsymbol{F}(\boldsymbol{r},\boldsymbol{v},t)d\boldsymbol{r}. $$

This integral defines a path integral since it will depend on the given path we take between the two end points. We will replace the limits with the symbol \( c \) in order to indicate that we take a specific countour in space when the force acts on the system. That is the work \( W_{n0} \) between two points \( \boldsymbol{r}_n \) and \( \boldsymbol{r}_0 \) is labeled as

$$ W_{n0}=\frac{1}{2}mv_n^2-\frac{1}{2}mv_0^2=\int_{c}\boldsymbol{F}(\boldsymbol{r},\boldsymbol{v},t)d\boldsymbol{r}. $$

Note that if the force is perpendicular to the displacement, then the force does not affect the kinetic energy.

Let us now study some examples of forces and how to find the velocity from the integration over a given path.

Thereafter we study how to evaluate an integral numerically.

Studying the Work-energy Theorem numerically

In order to study the work- energy, we will normally need to perform a numerical integration, unless we can integrate analytically. Here we present some of the simpler methods such as the rectangle rule, the trapezoidal rule and higher-order methods like the Simpson family of methods.

Example of an Electron moving along a Surface

As an example, let us consider the following case. We have classical electron which moves in the \( x \)-direction along a surface. The force from the surface is

$$ \boldsymbol{F}(x)=-F_0\sin{(\frac{2\pi x}{b})}\boldsymbol{e}_1. $$

The constant \( b \) represents the distance between atoms at the surface of the material, \( F_0 \) is a constant and \( x \) is the position of the electron.

Using the work-energy theorem we can find the work \( W \) done when moving an electron from a position \( x_0 \) to a final position \( x \) through the integral

$$ W=\int_{x_0}^x \boldsymbol{F}(x')dx' = -\int_{x_0}^x F_0\sin{(\frac{2\pi x'}{b})} dx', $$

which results in

$$ W=\frac{F_0b}{2\pi}\left[\cos{(\frac{2\pi x}{b})}-\cos{(\frac{2\pi x_0}{b})}\right]. $$

Finding the Velocity

If we now use the work-energy theorem we can find the the velocity at a final position \( x \) by setting up the differences in kinetic energies between the final position and the initial position \( x_0 \).

We have that the work done by the force is given by the difference in kinetic energies as

$$ W=\frac{1}{2}m\left(v^2(x)-v^2(x_0)\right)=\frac{F_0b}{2\pi}\left[\cos{(\frac{2\pi x}{b})}-\cos{(\frac{2\pi x_0}{b})}\right], $$

and labeling \( v(x_0)=v_0 \) (and assuming we know the initial velocity) we have

$$ v(x)=\pm \sqrt{v_0^2+\frac{F_0b}{m\pi}\left[\cos{(\frac{2\pi x}{b})}-\cos{(\frac{2\pi x_0}{b})}\right]}, $$

Choosing $x_0=0$m and $v_0=0$m/s we can simplify the above equation to

$$ v(x)=\pm \sqrt{\frac{F_0b}{m\pi}\left[\cos{(\frac{2\pi x}{b})}-1\right]}, $$

Harmonic Oscillations

Another well-known force (and we will derive when we come to Harmonic Oscillations) is the case of a sliding block attached to a wall through a spring. The block is attached to a spring with spring constant \( k \). The other end of the spring is attached to the wall at the origin \( x=0 \). We assume the spring has an equilibrium length \( L_0 \).

The force \( F_x \) from the spring on the block is then

$$ F_x=-k(x-L_0). $$

The position \( x \) where the spring force is zero is called the equilibrium position. In our case this is \( x=L_0 \).

We can now compute the work done by this force when we move our block from an initial position \( x_0 \) to a final position \( x \)

$$ W=\int_{x_0}^{x}F_xdx'=-k\int_{x_0}^{x}(x'-L_0)dx'=\frac{1}{2}k(x_0-L_0)^2-\frac{1}{2}k(x-L_0)^2. $$

If we now bring back the definition of the work-energy theorem in terms of the kinetic energy we have

$$ W=\frac{1}{2}mv^2(x)-\frac{1}{2}mv_0^2=\frac{1}{2}k(x_0-L_0)^2-\frac{1}{2}k(x-L_0)^2, $$

which we rewrite as

$$ \frac{1}{2}mv^2(x)+\frac{1}{2}k(x-L_0)^2=\frac{1}{2}mv_0^2+\frac{1}{2}k(x_0-L_0)^2. $$

What does this mean? The total energy, which is the sum of potential and kinetic energy, is conserved. Wow, this sounds interesting. We will analyze this next week in more detail when we study energy, momentum and angular momentum conservation.

Work-Energy Theorem and Energy Conservation

We have made the observation that energy was conserved for a force which depends only on the position. In particular we considered a force acting on a block attached to a spring with a so-called spring constant \( k \). The other end of the spring was attached to the wall.

The force \( F_x \) from the spring on the block was defined as

$$ F_x=-kx. $$

The work done on the block due to a displacement from a position \( x_0 \) to \( x \)

$$ W=\int_{x_0}^{x}F_xdx'=\frac{1}{2}kx_0^2-\frac{1}{2}kx^2. $$

Conservation of energy

With the definition of the work-energy theorem in terms of the kinetic energy we obtained

$$ W=\frac{1}{2}mv^2(x)-\frac{1}{2}mv_0^2=\frac{1}{2}kx_0^2-\frac{1}{2}kx^2, $$

which we rewrote as

$$ \frac{1}{2}mv^2(x)+\frac{1}{2}kx^2=\frac{1}{2}mv_0^2+\frac{1}{2}kx_0^2. $$

The total energy, which is the sum of potential and kinetic energy, is conserved. We will analyze this interesting result now in more detail when we study energy, momentum and angular momentum conservation.

But before we start with energy conservation, conservative forces and potential energies, we need to revisit our definitions of momentum and angular momentum.

What is a Conservative Force?

A conservative force is a force whose property is that the total work done in moving an object between two points is independent of the taken path. This means that the work on an object under the influence of a conservative force, is independent on the path of the object. It depends only on the spatial degrees of freedom and it is possible to assign a numerical value for the potential at any point. It leads to conservation of energy. The gravitational force is an example of a conservative force.

Two important conditions

First, a conservative force depends only on the spatial degrees of freedom. This is a necessary condition for obtaining a path integral which is independent of path. The important condition for the final work to be independent of the path is that the curl of the force is zero, that is

$$ \boldsymbol{\nabla} \times \boldsymbol{F}=0 $$

Work-energy theorem to show that energy is conserved with a conservative force

The work-energy theorem states that the work done \( W \) by a force \( \boldsymbol{F} \) that moves an object from a position \( \boldsymbol{r}_0 \) to a new position \( \boldsymbol{r}_1 \)

$$ W=\int_{\boldsymbol{r}_0}^{\boldsymbol{r}_1}\boldsymbol{F}\boldsymbol{dr}=\frac{1}{2}mv_1^2-\frac{1}{2}mv_0^2, $$

where \( v_1^2 \) is the velocity squared at a time \( t_1 \) and \( v_0^2 \) the corresponding quantity at a time \( t_0 \). The work done is thus the difference in kinetic energies. We can rewrite the above equation as

$$ \frac{1}{2}mv_1^2=\int_{\boldsymbol{r}_0}^{\boldsymbol{r}_1}\boldsymbol{F}\boldsymbol{dr}+\frac{1}{2}mv_0^2, $$

that is the final kinetic energy is equal to the initial kinetic energy plus the work done by the force over a given path from a position \( \boldsymbol{r}_0 \) at time \( t_0 \) to a final position position \( \boldsymbol{r}_1 \) at a later time \( t_1 \).

Conservation of Momentum

Before we move on however, we need to remind ourselves about important aspects like the linear momentum and angular momentum. After these considerations, we move back to more details about conservatives forces.

Assume we have \( N \) objects, each with velocity \( \boldsymbol{v}_i \) with \( i=1,2,\dots,N \) and mass \( m_i \). The momentum of each object is \( \boldsymbol{p}_i=m\boldsymbol{v}_i \) and the total linear (or mechanical) momentum is defined as

$$ \boldsymbol{P}=\sum_{i=1}^N\boldsymbol{p}_i=\sum_{i=1}^Nm_i\boldsymbol{v}_i, $$

Two objects first

Let us assume we have two objects only that interact with each other and are influenced by an external force.

We define also the total net force acting on object 1 as

$$ \boldsymbol{F}_1^{\mathrm{net}}=\boldsymbol{F}_1^{\mathrm{ext}}+\boldsymbol{F}_{12}, $$

where \( \boldsymbol{F}_1^{\mathrm{ext}} \) is the external force (for example the force due to an electron moving in an electromagnetic field) and \( \boldsymbol{F}_{12} \) is the force between object one and two. Similarly for object 2 we have

$$ \boldsymbol{F}_2^{\mathrm{net}}=\boldsymbol{F}_2^{\mathrm{ext}}+\boldsymbol{F}_{21}. $$

Newton's Third Law

Newton's third law which we met earlier states that for every action there is an equal and opposite reaction. It is more accurately stated as

if two bodies exert forces on each other, these forces are equal in magnitude and opposite in direction.

This means that for two bodies \( i \) and \( j \), if the force on \( i \) due to \( j \) is called \( \boldsymbol{F}_{ij} \), then

$$ \begin{equation} \boldsymbol{F}_{ij}=-\boldsymbol{F}_{ji}. \label{_auto1} \end{equation} $$

For the abovementioned two objects we have thus \( \boldsymbol{F}_{12}=-\boldsymbol{F}_{21} \).

Newton's Second Law and Momentum

With the net forces acting on each object we can now related the momentum to the forces via

$$ \boldsymbol{F}_1^{\mathrm{net}}=m_1\boldsymbol{a}_i=m_1\frac{d\boldsymbol{v}_1}{dt}=\boldsymbol{F}_1^{\mathrm{ext}}+\boldsymbol{F}_{12}, $$

and

$$ \boldsymbol{F}_2^{\mathrm{net}}=m_2\boldsymbol{a}_2=m_2\frac{d\boldsymbol{v}_2}{dt}=\boldsymbol{F}_2^{\mathrm{ext}}+\boldsymbol{F}_{21}. $$

Recalling our definition for the linear momentum we have then

$$ \frac{d\boldsymbol{p}_1}{dt}=\boldsymbol{F}_1^{\mathrm{ext}}+\boldsymbol{F}_{12}, $$

and

$$ \frac{d\boldsymbol{p}_2}{dt}=\boldsymbol{F}_2^{\mathrm{ext}}+\boldsymbol{F}_{21}. $$

The total Momentum

The total momentum \( \boldsymbol{P} \) is defined as the sum of the individual momenta, meaning that we can rewrite

$$ \boldsymbol{F}_1^{\mathrm{net}}+\boldsymbol{F}_2^{\mathrm{net}}=\frac{d\boldsymbol{p}_1}{dt}+\frac{d\boldsymbol{p}_2}{dt}=\frac{d\boldsymbol{P}}{dt}, $$

that is the derivate with respect to time of the total momentum. If we now write the net forces as sums of the external plus internal forces between the objects we have

$$ \frac{d\boldsymbol{P}}{dt}=\boldsymbol{F}_1^{\mathrm{ext}}+\boldsymbol{F}_{12}+\boldsymbol{F}_2^{\mathrm{ext}}+\boldsymbol{F}_{21}=\boldsymbol{F}_1^{\mathrm{ext}}+\boldsymbol{F}_2^{\mathrm{ext}}. $$

The derivative of the total momentum is just the sum of the external forces. If we assume that the external forces are zero and that only internal (here two-body forces) are at play, we obtain the important result that the derivative of the total momentum is zero. This means again that the total momentum is a constant of the motion and conserved quantity. This is a very important result that we will use in many applications to come.

Newton's Second Law

Let us now general to several objects \( N \) and let us also assume that there are no external forces. We will label such a system as an isolated system.

Newton's second law, \( \boldsymbol{F}=m\boldsymbol{a} \), can be written for a particle \( i \) as

$$ \begin{equation} \boldsymbol{F}_i=\sum_{j\ne i}^N \boldsymbol{F}_{ij}=m_i\boldsymbol{a}_i, \label{_auto2} \end{equation} $$

where \( \boldsymbol{F}_i \) (a single subscript) denotes the net force acting on \( i \) from the other objects/particles. Because the mass of \( i \) is fixed and we assume it does not change with time, one can see that

$$ \begin{equation} \boldsymbol{F}_i=\frac{d}{dt}m_i\boldsymbol{v}_i=\sum_{j\ne i}^N\boldsymbol{F}_{ij}. \label{_auto3} \end{equation} $$

Summing over all Objects/Particles

Now, one can sum over all the objects/particles and obtain

$$ \frac{d}{dt}\sum_i m_iv_i=\sum_{ij, i\ne j}^N\boldsymbol{F}_{ij}=0. $$

How did we arrive at the last step? We rewrote the double sum as

$$ \sum_{ij, i\ne j}^N\boldsymbol{F}_{ij}=\sum_i^N\sum_{j>i}\left(\boldsymbol{F}_{ij}+\boldsymbol{F}_{ji}\right), $$

and using Newton's third law which states that \( \boldsymbol{F}_{ij}=-\boldsymbol{F}_{ji} \), we obtain that the net sum over all the two-particle forces is zero when we only consider so-called internal forces. Stated differently, the last step made use of the fact that for every term \( ij \), there is an equivalent term \( ji \) with opposite force. Because the momentum is defined as \( m\boldsymbol{v} \), for a system of particles, we have thus

$$ \begin{equation} \frac{d}{dt}\sum_im_i\boldsymbol{v}_i=0,~~{\rm for~isolated~particles}. \label{_auto4} \end{equation} $$

Conservation of total Momentum

By "isolated" one means that the only force acting on any particle \( i \) are those originating from other particles in the sum, i.e. "no external" forces. Thus, Newton's third law leads to the conservation of total momentum,

$$ \boldsymbol{P}=\sum_i m_i\boldsymbol{v}_i, $$

and we have

$$ \frac{d}{dt}\boldsymbol{P}=0. $$

Example: Rocket Science

Consider a rocket of mass \( M \) moving with velocity \( v \). After a brief instant, the velocity of the rocket is \( v+\Delta v \) and the mass is \( M-\Delta M \). Momentum conservation gives

$$ \begin{eqnarray*} Mv&=&(M-\Delta M)(v+\Delta v)+\Delta M(v-v_e)\\ 0&=&-\Delta Mv+M\Delta v+\Delta M(v-v_e),\\ 0&=&M\Delta v-\Delta Mv_e. \end{eqnarray*} $$

In the second step we ignored the term \( \Delta M\Delta v \) because it is doubly small. The last equation gives

$$ \begin{eqnarray} \Delta v&=&\frac{v_e}{M}\Delta M,\\ \nonumber \frac{dv}{dt}&=&\frac{v_e}{M}\frac{dM}{dt}. \end{eqnarray} $$

Integrating the Equations

Integrating the expression with lower limits \( v_0=0 \) and \( M_0 \), one finds

$$ \begin{eqnarray*} v&=&v_e\int_{M_0}^M \frac{dM'}{M'}\\ v&=&v_e\ln(M/M_0)\\ &=&v_e\ln[(M_0-\alpha t)/M_0]. \end{eqnarray*} $$

Because the total momentum of an isolated system is constant, one can also quickly see that the center of mass of an isolated system is also constant. The center of mass is the average position of a set of masses weighted by the mass,

$$ \begin{equation} \bar{x}=\frac{\sum_im_ix_i}{\sum_i m_i}. \label{_auto5} \end{equation} $$

Rate of Change

The rate of change of \( \bar{x} \) is

$$ \dot{\bar{x}}=\frac{1}{M}\sum_i m_i\dot{x}_i=\frac{1}{M}P_x. $$

Thus if the total momentum is constant the center of mass moves at a constant velocity, and if the total momentum is zero the center of mass is fixed.

Conservation of Angular Momentum

The angular momentum is defined as

$$ \begin{equation} \boldsymbol{L}=\boldsymbol{r}\times\boldsymbol{p}=m\boldsymbol{r}\times\boldsymbol{v}. \label{_auto6} \end{equation} $$

It means that the angular momentum is perpendicular to the plane defined by position \( \boldsymbol{r} \) and the momentum \( \boldsymbol{p} \) via \( \boldsymbol{r}\times \boldsymbol{p} \).

Rate of Change of Angular Momentum

The rate of change of the angular momentum is

$$ \frac{d\boldsymbol{L}}{dt}=m\boldsymbol{v}\times\boldsymbol{v}+m\boldsymbol{r}\times\dot{\boldsymbol{v}}=\boldsymbol{r}\times{\boldsymbol{F}} $$

The first term is zero because \( \boldsymbol{v} \) is parallel to itself, and the second term defines the so-called torque. If \( \boldsymbol{F} \) is parallel to \( \boldsymbol{r} \) then the torque is zero and we say that angular momentum is conserved.

If the force is not radial, \( \boldsymbol{r}\times\boldsymbol{F}\ne 0 \) as above, and angular momentum is no longer conserved,

$$ \begin{equation} \frac{d\boldsymbol{L}}{dt}=\boldsymbol{r}\times\boldsymbol{F}\equiv\boldsymbol{\tau}, \label{_auto7} \end{equation} $$

where \( \boldsymbol{\tau} \) is the torque.

The Torque, Example 1 (hw 4, exercise 4)

Let us assume we have an initial position \( \boldsymbol{r}_0=x_0\boldsymbol{e}_1+y_0\boldsymbol{e}_2 \) at a time \( t_0=0 \). We add now a force in the positive \( x \)-direction

$$ \boldsymbol{F}=F_x\boldsymbol{e}_1=\frac{d\boldsymbol{p}}{dt}, $$

where we used the force as defined by the time derivative of the momentum.

We can use this force (and its pertinent acceleration) to find the velocity via the relation

$$ \boldsymbol{v}(t)=\boldsymbol{v}_0+\int_{t_0}^t\boldsymbol{a}dt', $$

and with \( \boldsymbol{v}_0=0 \) we have

$$ \boldsymbol{v}(t)=\int_{t_0}^t\frac{\boldsymbol{F}}{m}dt', $$

where \( m \) is the mass of the object.

The Torque, Example 1 (hw 4, exercise 4)

Since the force acts only in the \( x \)-direction, we have after integration

$$ \boldsymbol{v}(t)=\frac{\boldsymbol{F}}{m}t=\frac{F_x}{m}t\boldsymbol{e}_1=v_x(t)\boldsymbol{e}_1. $$

The momentum is in turn given by \( \boldsymbol{p}=p_x\boldsymbol{e}_1=mv_x\boldsymbol{e}_1=F_xt\boldsymbol{e}_1 \).

Integrating over time again we find the final position as (note the force depends only on the \( x \)-direction)

$$ \boldsymbol{r}(t)=(x_0+\frac{1}{2}\frac{F_x}{m}t^2) \boldsymbol{e}_1+y_0\boldsymbol{e}_2. $$

There is no change in the position in the \( y \)-direction since the force acts only in the \( x \)-direction.

The Torque, Example 1 (hw 4, exercise 4)

We can now compute the angular momentum given by

$$ \boldsymbol{l}=\boldsymbol{r}\times\boldsymbol{p}=\left[(x_0+\frac{1}{2}\frac{F_x}{m}t^2) \boldsymbol{e}_1+y_0\boldsymbol{e}_2\right]\times F_xt\boldsymbol{e}_1. $$

Computing the cross product we find

$$ \boldsymbol{l}=-y_0F_xt\boldsymbol{e}_3=-y_0F_xt\boldsymbol{e}_z. $$

The torque is the time derivative of the angular momentum and we have

$$ \boldsymbol{\tau}=-y_0F_x\boldsymbol{e}_3=-y_0F_x\boldsymbol{e}_z. $$

The torque is non-zero and angular momentum is not conserved.

The Torque, Example 2

One can write the torque about a given axis, which we will denote as \( \hat{z} \), in polar coordinates, where

$$ \begin{eqnarray} x&=&r\sin\theta\cos\phi,~~y=r\sin\theta\cos\phi,~~z=r\cos\theta, \end{eqnarray} $$

to find the \( z \) component of the torque,

$$ \begin{eqnarray} \tau_z&=&xF_y-yF_x\\ \nonumber &=&-r\sin\theta\left\{\cos\phi \partial_y-\sin\phi \partial_x\right\}V(x,y,z). \end{eqnarray} $$

Chain Rule and Partial Derivatives

One can use the chain rule to write the partial derivative w.r.t. \( \phi \) (keeping \( r \) and \( \theta \) fixed),

$$ \begin{eqnarray} \partial_\phi&=&\frac{\partial x}{\partial\phi}\partial_x+\frac{\partial_y}{\partial\phi}\partial_y +\frac{\partial z}{\partial\phi}\partial_z\\ \nonumber &=&-r\sin\theta\sin\phi\partial_x+\sin\theta\cos\phi\partial_y. \end{eqnarray} $$

Combining the two equations,

$$ \begin{eqnarray} \tau_z&=&-\partial_\phi V(r,\theta,\phi). \end{eqnarray} $$

Thus, if the potential is independent of the azimuthal angle \( \phi \), there is no torque about the \( z \) axis and \( L_z \) is conserved.

System of Isolated Particles

For a system of isolated particles, one can write

$$ \begin{eqnarray} \frac{d}{dt}\sum_i\boldsymbol{L}_i&=&\sum_{i\ne j}\boldsymbol{r}_i\times \boldsymbol{F}_{ij}\\ \nonumber &=&\frac{1}{2}\sum_{ij, i\ne j} \boldsymbol{r}_i\times \boldsymbol{F}_{ij}+\boldsymbol{r}_j\times\boldsymbol{F}_{ji}\\ \nonumber &=&\frac{1}{2}\sum_{ij, i\ne j} (\boldsymbol{r}_i-\boldsymbol{r}_j)\times\boldsymbol{F}_{ij}=0, \end{eqnarray} $$

where the last step used Newton's third law, \( \boldsymbol{F}_{ij}=-\boldsymbol{F}_{ji} \). If the forces between the particles are radial, i.e. \( \boldsymbol{F}_{ij} ~||~ (\boldsymbol{r}_i-\boldsymbol{r}_j) \), then each term in the sum is zero and the net angular momentum is fixed. Otherwise, you could imagine an isolated system that would start spinning spontaneously.

Homework 3, exercises 5 and 6, numerical solution

# let's start by importing useful packages we are familiar with
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline

We will choose the following values

  1. mass \( m=0,2 \) kg
  2. accelleration (gravity) \( g=9.81 \) m/s$^{2}$.
  3. initial position is the height \( h=2 \) m
  4. initial velocities \( v_{x,0}=v_{y,0}=10 \) m/s

You need also to define an initial time and the step size \( \Delta t \). We can define the step size \( \Delta t \) as the difference between any two neighboring values in time (time steps) that we analyze within some range. It can be determined by dividing the interval we are analyzing, which in our case is time \( t_{\mathrm{final}}-t_0 \), by the number of steps we are taking \( (N) \). This gives us a step size \( \Delta t = \dfrac{t_{\mathrm{final}}-t_0}{N} \).

With these preliminaries we are now ready to plot our results from exercise 5.

In setting up our code we need to

  1. Define and obtain all initial values, constants, and time to be analyzed with step sizes as done above (you can use the same values)
  2. Calculate the velocity using \( v_{i+1} = v_{i} + (\Delta t)*a_{i} \)
  3. Calculate the position using \( pos_{i+1} = r_{i} + (\Delta t)*v_{i} \)
  4. Calculate the new acceleration \( a_{i+1} \).
  5. Repeat steps 2-4 for all time steps within a loop.
# Exercise 6, hw3, brute force way with declaration of vx, vy, x and y
# Common imports
import numpy as np
import pandas as pd
from math import *
import matplotlib.pyplot as plt
import os

# Where to save the figures and data files
PROJECT_ROOT_DIR = "Results"
FIGURE_ID = "Results/FigureFiles"
DATA_ID = "DataFiles/"

if not os.path.exists(PROJECT_ROOT_DIR):
    os.mkdir(PROJECT_ROOT_DIR)

if not os.path.exists(FIGURE_ID):
    os.makedirs(FIGURE_ID)

if not os.path.exists(DATA_ID):
    os.makedirs(DATA_ID)

def image_path(fig_id):
    return os.path.join(FIGURE_ID, fig_id)

def data_path(dat_id):
    return os.path.join(DATA_ID, dat_id)

def save_fig(fig_id):
    plt.savefig(image_path(fig_id) + ".png", format='png')

# Output file
outfile = open(data_path("Eulerresults.dat"),'w')

from pylab import plt, mpl
plt.style.use('seaborn')
mpl.rcParams['font.family'] = 'serif'


g = 9.80655 #m/s^2
# The mass and the drag constant D
D = 0.00245 #mass/length   kg/m
m = 0.2 #kg, mass of falling object
DeltaT = 0.001
#set up arrays 
tfinal = 1.4
# set up number of points for all variables
n = ceil(tfinal/DeltaT)
# define scaling constant vT used in analytical solution
vT = sqrt(m*g/D)
# set up arrays for t, a, v, and y and arrays for analytical results
#brute force setting up of arrays for x and y, vx, vy, ax and ay
t = np.zeros(n)
vy = np.zeros(n)
y = np.zeros(n)
vx = np.zeros(n)
x = np.zeros(n)
yanalytic = np.zeros(n)
# Initial conditions, note that these correspond to an object falling in the y-direction only.
vx[0] = 0.0 #m/s
vy[0] = 0.0  #m/s
y[0] = 10.0 #m
x[0] = 0.0 #m
yanalytic[0] = y[0]
# Start integrating using Euler's method
for i in range(n-1):
    # expression for acceleration, note the absolute value and division by mass
# Note: you need to think of the sign for the drag force as function of the velocity vector 
    ax = -D*vx[i]*sqrt(vx[i]**2+vy[i]**2)/m
    ay = -g - D*vy[i]*sqrt(vx[i]**2+vy[i]**2)/m
    # update velocity and position
    vx[i+1] = vx[i] + DeltaT*ax
    x[i+1] = x[i] + DeltaT*vx[i]
    vy[i+1] = vy[i] + DeltaT*ay
    y[i+1] = y[i] + DeltaT*vy[i]
    # update time to next time step and compute analytical answer
    t[i+1] = t[i] + DeltaT
    yanalytic[i+1] = y[0]-(vT*vT/g)*log(cosh(g*t[i+1]/vT))+vy[0]*t[i+1]
    if ( y[i+1] < 0.0):
        break
data = {'t[s]': t,
        'Relative error in y': abs((y-yanalytic)/yanalytic),
        'vy[m/s]': vy,
        'x[m]': x,
        'vx[m/s]': vx
}
NewData = pd.DataFrame(data)
display(NewData)
# save to file
NewData.to_csv(outfile, index=False)
#then plot
fig, axs = plt.subplots(4, 1)
axs[0].plot(t, y)
axs[0].set_xlim(0, tfinal)
axs[0].set_ylabel('y')
axs[1].plot(t, vy)
axs[1].set_ylabel('vy[m/s]')
axs[1].set_xlabel('time[s]')
axs[2].plot(t, x)
axs[2].set_xlim(0, tfinal)
axs[2].set_ylabel('x')
axs[3].plot(t, vx)
axs[3].set_ylabel('vx[m/s]')
axs[3].set_xlabel('time[s]')
fig.tight_layout()
save_fig("EulerIntegration")
plt.show()

A more compact version of the code

# Exercise 6, hw3, smarter way with declaration of vx, vy, x and y
# Common imports
import numpy as np
import pandas as pd
from math import *
import matplotlib.pyplot as plt
import os

# Where to save the figures and data files
PROJECT_ROOT_DIR = "Results"
FIGURE_ID = "Results/FigureFiles"
DATA_ID = "DataFiles/"

if not os.path.exists(PROJECT_ROOT_DIR):
    os.mkdir(PROJECT_ROOT_DIR)

if not os.path.exists(FIGURE_ID):
    os.makedirs(FIGURE_ID)

if not os.path.exists(DATA_ID):
    os.makedirs(DATA_ID)

def image_path(fig_id):
    return os.path.join(FIGURE_ID, fig_id)

def data_path(dat_id):
    return os.path.join(DATA_ID, dat_id)

def save_fig(fig_id):
    plt.savefig(image_path(fig_id) + ".png", format='png')


from pylab import plt, mpl
plt.style.use('seaborn')
mpl.rcParams['font.family'] = 'serif'

g = 9.80655 #m/s^2 g to 6 leading digits after decimal point
D = 0.00245 #m/s
m = 0.2 # kg
# Define Gravitational force as a vector in x and y. It is a constant
G = -m*g*np.array([0.0,1])
DeltaT = 0.01
#set up arrays 
tfinal = 1.3
n = ceil(tfinal/DeltaT)
# set up arrays for t, a, v, and x
t = np.zeros(n)
v = np.zeros((n,2))
r = np.zeros((n,2))
# Initial conditions as compact 2-dimensional arrays
r0 = np.array([0.0,10.0])
v0 = np.array([10.0,0.0])
r[0] = r0
v[0] = v0
# Start integrating using Euler's method
for i in range(n-1):
    # Set up forces, air resistance FD, note now that we need the norm of the vector
    # Here you could have defined your own function for this
    vabs = sqrt(sum(v[i]*v[i]))
# Note: you need to think of the sign for the drag force 
    FD = -D*v[i]*vabs
    # Final net forces acting on falling object
    Fnet = FD+G
    # The accelration at a given time t_i
    a = Fnet/m
    # update velocity, time and position using Euler's method
    v[i+1] = v[i] + DeltaT*a
    r[i+1] = r[i] + DeltaT*v[i]
    t[i+1] = t[i] + DeltaT

fig, axs = plt.subplots(4, 1)
axs[0].plot(t, r[:,1])
axs[0].set_xlim(0, tfinal)
axs[0].set_ylabel('y')
axs[1].plot(t, v[:,1])
axs[1].set_ylabel('vy[m/s]')
axs[1].set_xlabel('time[s]')
axs[2].plot(t, r[:,0])
axs[2].set_xlim(0, tfinal)
axs[2].set_ylabel('x')
axs[3].plot(t, v[:,0])
axs[3].set_ylabel('vx[m/s]')
axs[3].set_xlabel('time[s]')

fig.tight_layout()
save_fig("EulerIntegration")
plt.show()
© 1999-2023, "Morten Hjorth-Jensen":"http://mhjgit.github.io/info/doc/web/". Released under CC Attribution-NonCommercial 4.0 license