matlab assignment
ENGR232 Week 4 Lab Winter 2015-16
Version C: Given the Spring-Mass-Damper System and its differential equation with forcing function f(t)
Create a published document with your name and section number. Address part in a separate cell.
a) Write the equations in state space (matrix form) 𝑥′(𝑡) = 𝐴𝑥(𝑡) + 𝐵𝑓(𝑡). Let x1 = y and x2 = y’. Do this symbolically. Hint: see Lecture 4.1 notes.
For following parts use the values
m b k f(t) y(0) y’(0) Simulation range
1 8 Changes in part e
300 As indicated By part
27 0 [0, 1.5]
b) Find the equilibrium point if The external force f(t) = 0 The external force fIt) = 50 The external force f(t) = -20
Explain how a constant external force f(t), can change the equilibrium point.
c) What are the roots of the auxiliary equation? Are they real or complex, discuss why.
d) Using ode45 simulate the system for the given initial conditions with f(t) = 0. Create component plots: y(t) vs. t, y’(t) vs. t and phase plots y’(t) v.s y(t). Use subplot to get all 3 plots
on the same graph – components on left 2 panes and phase on right 2 panes. Annotate your
axes properly. On the phase plot mark the initial conditions and equilibrium point with colored
circles and stars, define using legend.
e) It is desired that the system be modified so that the roots of the auxiliary equation are negative real and equal. Find the value of b that accomplishes this (do by hand with Matlab’s help).
What are the values of the roots? What is the value of b?
f) Redo part d using this new value of b. Hint: make a new function for this O.D.E. Discuss if the time to get and stay at the equilibrium point is faster or slower than part d.
𝒅𝟐𝒚
𝒅𝒕𝟐 + (
𝒃
𝒎 ) 𝐝𝐲
𝐝𝐭 + (
𝒌
𝒎 )𝐲 = 𝐟(𝐭)
= 𝟎
f(t)
Note: Submit a published pdf file of your script with convention lastname_initials_lab4.m The
published document must include all functions used. All figures must be annotated (labels, legends,
markers, title, etc. Answers to questions asked should be printed as an output.