Part-1:
Suppose that a simple pendulum is attached to our spring-damper-mass system. A simple schematic of the model is given in Figure 1.
The mass can move horizontally while the pendulum oscillates about a vertical axis attached to this mass.
The problem parameters in their appropriate units are given in Table1.
Table1. Problem Parameters
The equation of motion of the system can be written as:
with initial conditions
Part -2
1. By defining new variables rewrite the equations of motion in the form
2. Solve for the dynamics of the resulting system for 20 seconds of real time using midpoint method. Select your step size so that the local error is less than 10-4.
3. Plot x vs. t, θ vs. t and θ vs. x on three separate figures.
4. Repeat steps 2 and 3 for θ(0) = 90o and θ(0) =179o while keeping the other initial conditions fixed.
Part-3
1. Develop a Matlab function named RK4.m which implements the classical 4-stage Runge-Kutta method (RK-4) for solution of IVPs.
2. Repeat steps 2 and 3 of Lab assignment by using the RK-4 method as the solution technique. Compare the step sizes used and the CPU times spent by the Mid-point and RK-4 methods.