Homework for Garcia Ch. 2, pendulum
Modify the MATLAB program pendul.m such that it includes the option to use the Leap-Frog method. Compare the results for the different methods for a simulation of 300 steps with a time step size of 0.1 sec.
Modify pendul.m so that the angular velocity is updated at each step when using the Verlet method. Display your results for θ vs. t, ω vs. t, and ω vs. θ as subplots similar to the format shown below.
Comment: The figure was produced running 1000 time steps with the Verlet method, for θ0 = 160° and with a time step size of τ = 0.1 sec.
Modify pendul.m to include a velocity-dependent damping term, such that the equation of motion for the pendulum is described by:
where γ is the damping constant. Also, modify the program to terminate the simulation after the mechanical energy (i.e. potential + kinetic energy) is less than five percent of the original mechanical energy. Run the program with Verlet method for the following conditions:
- θ(0) = 175°
- ω(0) = 5 rad/s
- τ = 0.02 s (time step size)
- γ = 0.1 (damping coefficient)
Display plots of θ vs. t, ω vs. t, and ω(t) vs. θ(t) as in Problem 2.