Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Homework 5

Total points: 100

Exercise 1 (10 pt), SHO and Conservation of Energy

Consider the standard harmonic oscillator with a mass mm attached to a horizontal spring with spring constant kk. It is constrained to move in the xx direction only and there is no friction present. With the equilibrium position as x=0x=0, then the potential energy is U(x)=12kx2U(x)=\frac{1}{2}kx^2.

We give the oscillator a little kick at t=0t=0 and let it go. It reaches a maximum distance of AA from the equilibrium position.

Exercise 2 (10pt), Kid’s toy and stable equilibrium

A toy is made from a cylinder mounted on a hemisphere as shown in the figure below. The hemisphere has a radius of RR and the center of mass of the whole toy is hh above the ground.

toy

Exercise 3 (15pt), “Generic” 1D motion

We will eventually learn how to solve for equations of motion for generalized coordinates. That work requires us to think about the forces and constraints on a system. Here we will consider a particle moving along a curved path to begin to think about how to describe the motion of a particle in a more general way.

curved-path

A bead follows the curved path above, you can imagine it is a wire or a track, and the bead is constrained to move along the path. The bead’s position is described by its distance along the path, ss as measured from the origin OO. The s^\hat{s} direction is always along the path - that is, it’s always tangent to the wire.

There is a force due to the wire (Fw\mathbf{F}_w) that ensures the bead stays on the path. It is not in the direction of the path (unlike friction); it is perpendicular to the wire. Assume all other forces are conservative (i.e., can be derived from a generic potential −∇U-\nabla U).

This 1D concept extends to multiple dimensions and can help us understand the Lagrangian method of solving for the equations of motion.

Exercise 4 (15pt), Another 1-D conservative system; baby bifurcations

The apparatus below is a massless wheel of radius RR that is mounted to a frictionless axle. A small, dense piece of clay with mass MM is glued to edge of the wheel as shown. Another mass mm hangs from a massless string that is wrapped around the wheel. We can assume the string is inextensible and does not slip, and the system is in a uniform gravitational field.

apparatus

We can show that this complicated system is still one-dimensional (at least in space) and then we can see the effects of parameters like m/Mm/M.

The value of m/Mm/M is a dimensionless quantity that characterizes the system. In a dynamical system, we think of it as a parameter that can change the qualitative behavior of the system. Such parameters can lead us to bifurcations, phase transitions, and other interesting (often non-equilibrium) phenomena.

Exercise 5 (20 pt), Phase Diagrams

One of the most useful tools we can learn from classical mechanics is the phase diagram. For us, it is the plot of the position and velocity of a particle in a 1D system, but the concept can be extended to higher dimensions and to other systems. The phase diagram can tell us about the stability of fixed points, the period of oscillations, and the qualitative behavior of the system.

In this exercise, we will consider a particle in a potential U(x)U(x) and we will plot the phase diagrams using both quiver and streamplot in matplotlib. The purpose of this exercise is to learn how to plot phase diagrams and to interpret the results.

We start with a little code for plotting the phase diagram of the simple harmonic oscillator. The code is written in a way that you can easily modify it to plot the phase diagram of other systems. The key point is to make sure that the quiver or streamplot function is called with the correct arguments.

<Figure size 800x1000 with 2 Axes>

We have discussed the physical pendulum in class where the potential energy is given by:

U(θ)=mgl(1−cos⁡θ)U(\theta)=mgl(1-\cos\theta)

Now we have a code that we can use to plot the phase diagram of any 1D system. We will use it to explore the damped harmonic oscillator and the damped physical pendulum. Here we write the equations of motion as the system is still 1-D, but the forces are not derived from a potential.

The damped harmonic oscillator has the equation of motion:

x¨=−kmx−bmx˙\ddot{x}=-\frac{k}{m}x-\frac{b}{m}\dot{x}

The damped physical pendulum has the equation of motion:

θ¨=−glsin⁡θ−bmlθ˙\ddot{\theta}=-\frac{g}{l}\sin\theta-\frac{b}{ml}\dot{\theta}

Exercise 6 (30pt), Numerical integration techniques and oscillations

We’ve discussed the Euler method and made use of it in the prior homeworks. However, the Euler method is not the most accurate method for solving ODEs. It has a real issue with energy conservation, which is a problem for conservative systems. Here we will explore the Euler-Cromer method and the Runge-Kutta methods for the simple harmonic oscillator. You will then apply these same methods to the various oscillators in Exercise 5.

Below we have written a code to solve the ODE:

x¨=−ω2x\ddot{x}=-\omega^2 x

where the initial position is 1 and the initial velocity is 0. The time step is set by the number of integration steps, NN. We wrote a function called euler that will then solve the ODE using the Euler method. There’s a second function called euler_cromer that uses the Euler-Cromer method.

We now call the euler and euler_cromer functions and plot the position and velocity as a function of time. We do this by storing the position and velocity as pandas dataframes. This kind of data structure is useful for storing time series data and is easy to plot. It’s a good idea to get in the habit of working with data structures like this.

In the resulting plots you can see how the Euler-Cromer method is more accurate than the Euler method. The Euler method has a systematic error that causes the amplitude of the oscillation to grow. The Euler-Cromer method does not have this problem.

Loading...
<Figure size 800x600 with 1 Axes>