Matlab
HW 2 due in 1 wk
ENGR 100 – Applying an Engr SW Tool Homework #2: Solving Dynamic Systems using MATLAB
Due Date: 9/13/19 at 11:00 am uploaded on iLearn
Problem #1: Derive the equation of motion and compute the response 𝜃𝜃(𝑡𝑡) of for the following system using MATLAB.
where 𝜃𝜃 is the angle of the cable with respect to the vertical axis, mass m = 25 grams, and length l = 7 cm. The initial conditions are set at 𝜃𝜃(0) = 110° and �̇�𝜃(0) = 0 𝑑𝑑𝑑𝑑𝑑𝑑/𝑠𝑠
a) Draw Free Body Diagram (FBD)
b) Apply law of physics, ∑𝐹𝐹 = 𝑚𝑚𝑚𝑚
c) Reduce your equation from a second order system to two first order system by
assigning 𝜃𝜃 = a(1) and �̇�𝜃 = a(2).
d) Open MATLAB and utilize ‘ode45’ solver to setup your system of equations to
determine the response of 𝜃𝜃(𝑡𝑡).
e) Plot results of both 𝜃𝜃(𝑡𝑡) and �̇�𝜃(𝑡𝑡) over a time duration of 8 seconds.
f) Reduce the mass of the ball to m = 10 grams. Replot 𝜃𝜃(𝑡𝑡) and �̇�𝜃(𝑡𝑡) and what
observation differences do you encounter compared to part e) results? Explain what
HW 2 due in 1 wk
you think is happening in terms of law of motion when changing the mass amount?
Problem #2: Derive the equation of motion for a motor circuit and compute the current 𝑖𝑖(𝑡𝑡) response for the following system using MATLAB.
where the voltage source is V = 20*sin(1.5* 𝑡𝑡) Volts, resistance is R = 0.102 Ω, and inductance L = 16 * 10^3 Henry. Set all initial conditions to zero.
a) Draw Free Body Diagram (FBD)
b) Apply Kirchhoff’s Voltage law.
c) Setup first order system by assigning 𝑖𝑖 = b(1).
d) Open MATLAB and utilize ‘ode45’ solver to setup your system of equations to
determine the response of 𝑖𝑖(𝑡𝑡).
e) Plot results of both 𝑖𝑖(𝑡𝑡) over a time duration of 5 seconds.
f) Change the voltage amplitude from 20 to 9 Volts and increase resistance to a value of R
= 0.5 Ω. Replot 𝑖𝑖(𝑡𝑡) and what observation differences do you encounter compared to
part e) results? Explain what you think is happening in terms of the overall circuit with
the changes?
HW 2 due in 1 wk
Problem #3: Compute the response 𝜃𝜃(𝑡𝑡) from the following non-linear equation of motions using MATLAB.
Eqn 1
where 𝜃𝜃 is the angle of the cable with respect to the vertical axis, mass m = 25 grams, viscous damping 𝐶𝐶𝑎𝑎 = 120, and length l = 7 cm. The initial conditions are set at 𝜃𝜃(0) = 110° and �̇�𝜃(0) = 0 𝑑𝑑𝑑𝑑𝑑𝑑/𝑠𝑠. Note: use MATLAB function ‘sign’ for sgn(�̇�𝜃).
a) Reduce your equation from a second order system to two first order system by
assigning 𝜃𝜃 = c(1) and �̇�𝜃 = c(2).
b) Open MATLAB and utilize ‘ode45’ solver to setup your system of equations to
determine the response of 𝜃𝜃(𝑡𝑡).
c) Plot results of both 𝜃𝜃(𝑡𝑡) and �̇�𝜃(𝑡𝑡) over a time duration of 8 seconds.
d) Repeat parts a) through c) for the following linearized equations.
Eqn 2
Plot Eqn 1 and Eqn 2 results against each other on the same plots for both 𝜃𝜃(𝑡𝑡) and
�̇�𝜃(𝑡𝑡). Note, use the ‘hold on’ function in MATLAB. Explain why there is a difference.
TURN-IN:
1. Save and upload One PDF File that includes the following: a. Answer all questions and show MATLAB plot results that each include title, x/y
labels, and legend of all problems. b. Appendix will include scanned hand calculations and your MATLAB code of all
problems. Clearly comment your entire code where it is relevant using the ‘%.’