MARTHA: In previous videos
we applied the Laplace transform method
to solve the linear dynamic equations.
We also used the state space method
to rewrite a linear multidimensional dynamic system
into a single matrix equation.
Here we will look at the blending process
and we will combine Laplace transform and state space.
Let's start out and write out
the general form for a state space model, we have dx dt,
our time derivative terms that usually come from
cumulation terms in the balance equation,
that equals ax plus bu
and then we have our measurement equation,
y equals cx plus du
and that's just algebraic, not differential.
So these are linear equations
and we can take the Laplace transform to get
s, x of s minus x of zero,
that's the Laplace transform of the time derivative, dx dt.
That equals a, x of s plus b u of s,
where u are our process inputs,
either the manipulated variables
or the disturbance variables,
here w1 is a disturbance variable,
which means w2 is our manipulative variable.
Then we can also take
the Laplace transform of our measurement equation,
get y of s equals c x of s plus d u of s.
When we take the Laplace transform of a function of t,
we usually change the lowercase variable to uppercase
to denote that it's in the Laplace domain.
Now we will go ahead
and we will solve for first equation for x of s,
so x of s appears on both the left and right hand sides
so we will combine our terms that have x of s here
and put all of our other terms on the right hand side.
So this all works pretty much
the same as it does with scalar equations
when we have matrix equations but we do need to be careful
and remember that we're dealing with matrices
so we had to multiply our s by the identity matrix
so that it would have the right dimensions
to then have a subtractive on it.
Now we can go ahead and we can solve for x of s,
again we need to remember
that we're dealing with matrix equations
so we can't just divide by si minus a,
you need to take the matrix inverse.
And now we can look at our measurements, y of s,
and we can plug in x of s
and finally, we may wish to recombine some terms
so that we have single coefficient multiply, u of s.
The term that multiplies our input u
and describes its input on the measurement y
is sometimes called the process transfer function.
Now that we have the numerical values
for a, b, c, and d for the blending process,
we can go ahead and calculate the process transfer function
so if we look back at our y of s equation
up at the top of the screen
we have two terms, one for the initial condition,
in this example we will assume
that we start off with zero deviation
so we can focus on the second term
and if we wanna calculate g of s
the first thing we need to do is to calculate si minus a,
which is s, zero, zero,
and s plus four times 10 to the minus four.
Then we need to invert that
and in general that would not be so trivial
but because it's a diagonal matrix
here we can just take the inverse of the diagonal elements.
If it wasn't diagonal
then you could do something like Kramer's rule
to invert a two by two matrix.
Now let's go ahead and calculate our transfer function.
G of s, which is c times si minus a inverse, times b plus d,
we can go ahead and multiply the three matrices c,
si minus a inverse, times b and then we can add to it d
and when we do that we get a three by three matrix.
Now that we have the transfer function g,
we have a mathematical expression
for the relationship between our measurements and our inputs
so let's consider the step input
of 0.1 to w1 prime of t to our disturbance variable
that we have considered in previous videos
so we'll have w1 prime of s is 0.1, the height of the step,
over s since the Laplace transform
of step input is one over s.
So our input u if you recall was
w1 prime, w2 prime, and w prime.
So in the Laplace domain that is u of s is 0.1 over s,
our w1 term and then we have zero deviation
in our other two inputs in this example.
We can write y of s as the product of g and s and u and s
and get .1 over s, 10 to the minus four over s squared,
and 7.5 times 10 to the minus seven over s
times s plus four times 10 to the minus four
just by multiplying the matrix g of s
which is a three by three matrix
times the column vector u of s which has three rows.
Now that we've solved for y of s
we can take the inverse Laplace transform to solve for yt
so the inverse Laplace transform of that step is just .1,
the constant for t greater than zero
and the Laplace transform for the second term,
10 to the minus four times t,
that's the inverse Laplace transform of one over s squared
and finally we've got 7.5 times 10 to the minus seven
divided by four times 10 to the minus four
times one minus e to the t times four
times 10 to the minus four.
In an earlier video we wrote this as t over 2500
and viewed that as the time constant
so either one is equally applicable
but here we've gotten the solution
for all three of our measurements,
w1, the disturbance variable,
as well as the volume in the tank
and the mass fraction in the tank and deviation variables
and we've done that using a single matrix equation.