Today on Simulink for ChemE's we'll go over using Simulink to model dynamic responses
for second-order systems. Most chemical processes, like tanks, reactors, and heat exchangers
can be modeled as first-order transfer functions, however if two first-order processes are placed
in series, they create a second-order process, which can behave very differently from the
two first-order processes on their own. All second-order transfer functions can be expressed
in the general form, K over tau squared s squared plus two zeta tau s plus one. K is
the gain, or the change in output variable divided by the change in input variable, tau
is the time constant, and zeta is what's called the damping coefficient. The value of this
damping coefficient zeta dictates what sort of response the process will have to a step
input, whether it will be underdamped, overdamped, or runaway. So our question today is how do
the second-order transfer functions, shown here on the screen, respond to a step change
of one, and what is a different possible transfer function that would trigger an unstable response
from this same step change? So this question is a lot like the one in our first screencast,
and if things ever feel like they are going too quickly you can go watch that one, it
deals with first-order transfer functions and just an overview of how Simulink works.
We have to see how the step change affects three different transfer function blocks,
and Simulink is great because it will let us plot our results. So we can go into the
library and put the three transfer functions on the screen, and we also need our sink and
our source. So our sink, where the sink is going, be our scope so we can plot it, and
our source of all the signals will be the step input, and in order to take these signals
and mix them together again, so they can be plotted, we have to go into signal routing
and get a mux, and then we'll connect all of them with the arrows. We'll go from the
mux to the scope, we go from the step to all three transfer functions, and we need to plot
our input and our output functions simultaneously, so we have three outputs and one input, so we
should have four ports on our mux block, four places to collect the signals. Spread those
out a bit. One goes here. Alright now let's fill in the transfer functions. So the first
one is one over s squared plus four s plus one, so it has to be in the denominator one
space four space one. Middle one should be s squared plus two s plus one, so that's going
to be one space two space one. Bottom one here should be one over s squared plus point
five s plus one. So before we run the simulation, what sort of response should we expect from
each transfer function? So all these transfer functions have a gain of one in the numerator.
Tau, the time constant, is equal to one for all three of these transfer functions, because
the tau squared coefficient on all the s squared terms is one, and since the three functions
have equal gains and equal time constants, all the differences we'll see in their behavior
will come from their damping coefficients. The middle coefficient right here is equal
to two times tau times zeta. For the top block, if two times tau times zeta equals four, zeta
must equal two. This means that the top transfer function is overdamped, it will not oscillate.
For the middle block, if two times tau times zeta equals two, zeta equals one. The middle
transfer function therefore is critically damped. It won't oscillate either, but compared
to the overdamped function it will respond more quickly to the step change. The bottom
block by the same method has a damping coefficient of point two five. The damping coefficient
is between zero and one, the system will be underdamped. The response will look different from the
other two, it will be stable but oscillatory. Let's save our model right here, we can save it
as second order, yeah. Set our simulation time to thirty minutes, press run, show our
results. Alright, so we can see our input step change. All of our systems eventually
reach the new steady state value of one, but in different ways. The overdamped function
adjusts more slowly than the critically damped function in magenta. The underdamped function
in cyan is oscillatory, but it still converges. So what about the second part of our question,
what is a transfer function that would trigger an unstable response? Well an unstable response
is caused by a damping coefficient between negative one and zero. The damping coefficient
on this bottom block is point two five, so if we change the sign in the middle term from
positive to negative, damping coefficient will now be negative point two five, and it
should cause an unstable response. So we'll save our model, run it again, and then double
click on the scope. Wow, that is an unstable response. If you auto scale it and you can
see the whole thing, you can see that it starts out oscillating at a reasonable level, but
then as more time passes the oscillations keep growing more and more. Well there you
go, I hope you enjoyed learning about how second-order processes can be modeled in Simulink.
If you want to learn more about using Simulink to solve process control problems, you can
subscribe to the Lafayette CHBE YouTube channel.