Reference no: EM13559
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.
![2244_Schematic diagram of the model.png](https://www.expertsmind.com/CMSImages/2244_Schematic%20diagram%20of%20the%20model.png)
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
![1460_Schematic diagram of the model4.png](https://www.expertsmind.com/CMSImages/1460_Schematic%20diagram%20of%20the%20model4.png)
The equation of motion of the system can be written as:
![2095_Schematic diagram of the model1.png](https://www.expertsmind.com/CMSImages/2095_Schematic%20diagram%20of%20the%20model1.png)
with initial conditions ![1395_Schematic diagram of the model2.png](https://www.expertsmind.com/CMSImages/1395_Schematic%20diagram%20of%20the%20model2.png)
Part -2
1. By defining new variables rewrite the equations of motion in the form ![1357_Schematic diagram of the model3.png](https://www.expertsmind.com/CMSImages/1357_Schematic%20diagram%20of%20the%20model3.png)
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.