Search for question

Well now look at the impulse response of your second order system.

Replace the "heavisidelt" you have in your command for eqn3 with "dirac(t)" (no quotes). Recall that diracit) is how Matlab represents an impulse function. Then solve the ODE using

>>h-dsolve(eqn4.conds): % where eqn4 is your ODE with the impulse input

and display the result using

>>prettyth)

You'll see that the result has an exponential term and a sin term. If you graph h using the fplot command, you'll see that the response is oscillating as you'd expect due to the sin term.

For the first order ODE in an earlier question the response was of the form

Actually we have exactly the same form of response here-it's just harder to see. Say now that s is a complex number

s=a+jo

If we put this into e" we get

e²me(0+j) me²+ men eine

That is, two exponential terms multiplied together, one of which contains aj as an imaginary number. Remember that a complex exponential can be written as

=cost+jsin

This is what Matlab has done for us. You have one term of the form coming from the real part of s, and one term (the sinusoid) coming from the imaginary part of s. We refer to this as being a sinusoid inside an

exponentially decaying envelope.

You can ask Matlab to write the two exponential terms for us (rather than displaying it as an equation with a sinusoid) using

>>>hh-rewrite(h.'exp')

>>prettythh)

Although what Matlab displays isn't very easy to read.

Plot the impulse response of your system. By examining this, and the equation for the response given by Matlab, what is the oscillation frequency of the system? Enter your answer in rad/s. You do not

need to enter this unit.

QUESTION 12

Again using the plot of the impulse response of your system, and the equation for the response given by Matlab, what is the time constant of the system? A unit is not

required.

Take care to enter the time constant, not the value of s. Recall, this is coming from the exponential term containing only a real component.

QUESTION 13

As the final part of looking at solving ODEs in Matlab, for comparison now imagine you are solving the homogenous form of the equation by hand. That is, solving the ODE when the input

has been set to 0.

d²y (1)

di²

To do this you would substitute in a solution of the form y(t)=et giving

dy (1)

dt

+0.3-

+2y (1)=0

Fig: 1