Correction for Simple Sytem Example and Note on Laplace Tranform / Deviation Variable ECHE 55 Fall 22 Conider a tank draining from an initial height of h o at time t =. With no flow into the tank (F in = ) and F out = αh(t) the ma balance can be written: A dh (t) = α h(t) Moving α h(t) to the left half ide and dividing by α give: A α dh (t) + h(t) = A i the tank area (contant) and α i the proportionality contant for flow out of the tank. Thee parameter can be replaced by = A/α to give the following differential equation: dy (t) + y(t) = () The initial tank height at time t = can be aumed to be y(t) t= = y o. Take the Laplace tranform of Equation : L{y(t)} i eay, L{y(t)} = y() o we have: { L dy } (t) + L {y(t)} = { L dy } (t) + y() = L { dy (t)} i a bit more complex. Firt, you can realize that i contant. Convince yourelf of thi! The L operator on a contant time a function i the ame a a contant time the Laplace of the function: L {c f(t)} = c e t f(t) = c So you can take the contant value outide the L operator: L { } dy (t) + y() = Now, you mut remember that L { df (t)} i jut f() f(t) t=. (y() y(t) t= ) + y() = And we have initial condition for the height of the tank, y(t) t= = y o e t f(t) = c L {f(t)}
(y() y o ) + y() = Solving for y(): y() y o + y() = L. Now rearrange a little bit y() + y() = y o ( + ) y() = y o y() = y o ( + ) y() = y o ( + ) / y() = y o ( + ) / y() = y o ( + ) Thi you realize i a contant y o time the term. To get y(t) you mut ue the invere Laplace tranform, + { } L {y()} = L y o ( + ) Again, y o i a contant and can be factored out { } L {y()} = y o L ( + ) And we know from lecture that L {e at } = +a, o in our cae, a =. y(t) = y o e ( )t Thi i the olution to the original differential equation! Now check your reult. At time t = your olution for y(t) i y o e ( ) = y o = y o. Thi matche the initial condition. The derivative of your reult can alo be found dy (t) = d { yo e ( )t} = y o ( ) e ( )t dy (t) = y o e ( )t Plug that back in the original differential EQ, along with your olution for y(t): dy (t) + y(t) = And we know we have the olution! ( y o ) e ( )t + y o e ( )t = 2
NOTES on firt order ytem modeling The firt order ytem model i: Taking the Laplace tranform: dy (t) + y(t) = u(t) y() + y(t) t= + y() = u() If we aume that y(t) t= = thi implifie the equation to We can then olve for y() y() + y() = u() ( + )y() = u() y() = ( + ) u() Here, i the proce model relating u() and y(). Thi i ometime called g() =. Given u(t) ( +) ( +) you can find u(), and given a model of your ytem you can find g(). Realizing that y() = g()u() you can then find y(t). From a proce reaction curve (the data for y(t) and u(t) given a tep in the input u(t)) you can find the PROCESS GAIN from the equation: = y fin y init u fin u init = y u The time contant i a bit trickier. Firt, let aume u(t) i a tep at time t = from a value of to a new value of A. The Laplace tranform of the tep function i: u() = A Now, we have enough information to get y() and y(t) y() = y() = ( + ) u() A ( + ) To olve thi eaily, we need the partial fraction expanion: y() = A ( + ) = Z ( + ) + Z 2 One way to get the partial fraction expanion i: firt multiply each term by the denominator of term and et that term to zero: A ( + ) ( + ) = ( + ) Z ( + ) + ( + ) Z 2 3
( + ) = Some term cancel, other don t: A ( + ) = ( + ) = A = / = Z + A / = Z + Z ( + ) + ( + ) = Z 2 Do thi for the econd term, Z 2 / ( + ) Cancel imilar term and evaluate at = A = Z A = Z ( + ) + Z 2 ( + ) A = Z ( + ) + Z 2 ( () + ) A = + Z 2 A = Z 2 The reult can be written: y() = A ( + ) = Z ( + ) + Z 2 Subtitute in Z and Z 2 Simplify term: y() = A ( + ) + A y() = A y() = A y() = A y() = A ( + ) + A / ( + ) / + A ( + ) + A ( + ) + A We can invert each term in thi expreion. L{e at } i, o +a L { (+ )} i jut e ( ) t. We know for the tep function from to at time the Laplace tranform i. The reulting olution y(t) i compoed of two different function, e ( ) t and a tep at time. y() = A ( + ) + A 4
} { L {y()} = L { A ( + ) + L A } Again, uing the argument about contant time a function, we can pull out the A term. { } { } L {y()} = A L ( + ) + A L y(t) = A e ( ) t + A y(t) = A( e ( ) t + ) y(t) = A( e ( ) t ) Laplace tranform aume everything i before time. Thi function y(t) only i defined for t. The two eparate function that comprie y(t) are hown in the following graph, e ( ) t and a unit tep at time zero: e (/)t, =.5 5 5.5 Unit tep at time 5 5 Graphing the actual ytem (the um of the two function):.5 u(t) = Unit tep at time 5 5.5 y(t), Firt order tep repone e (/)t, = Unit tep at time 5 5 5
NOTES on Deviation Variable Let examine a realitic Firt-Order ytem, the tank ytem. A dh (t) = F i(t) α h(t) Aume the flow manipulated and ha unit of m3. The height of the tank will be meaured, and the height of the tank i given in unit of m. The area of the tank i 2 m 2. For the outlet term to be conitent with the unit of other term ( m3 m2 m2 ), α mut have unit of. Aume α ha a value of.. The ma balance can be written a: (t) = F i(t). h(t) Now, aume that you normally operate thi tank at a flow rate of entering the tank of.5 m3. Thi mean we know the teady tate flow rate into the tank, F i =.5 m3. Thi alo mean we can figure out the teady tate height of the tank from the ma balance. At teady tate, dh(t) = (t) = F i(t). h(t) dh = F i. h =.5 m3. m2 h.5 m3 m2 =. h 5 m = h So now we know h, the teady tate height of the tank. Now to make our life eaier when taking Laplace tranform, we put everything in Deviation Variable. Thi mean we ubtract the teady tate from the normal function of time. The purpoe of thi i to make the function all tart at a value of. Currently, a tep repone for the tank ytem look like: 2.5 F i (t).5 F i (t) = Unit tep at time 2 3 4 5 6 7 5 h(t) h(t), Firt order tep repone 5 2 3 4 5 6 7 Uing the variable in deviation form, aume y(t) = h(t) h. Thi mean that if we tart at teady tate at time, y(t) will equal at the initial teady tate value, y(t) t= =. The other deviation variable can be written 6
u(t) = F i (t) F i. Thi mean the input u(t) equal at the initial tarting point, u(t) t= =. Alo, taking the derivative WRT time of y(t) = h(t) h yield But h doe not change with time. The dynamic ma balance i written a: The teady tate ma balance i written a: dy dh (t) = (t) dh (t) dy dh (t) = (t) dy dh (t) = (t) = F i(t). h(t) = F i h Subtracting the teady tate ma balance from the dynamic ma balance give: (t) = F i(t) F i. h(t) ( h ) (t) = (F i(t) F i ) (. h(t) h ) And replacing what we can with deviation variable: To put thi in the traditional dy 2 dy (t) = u(t). y(t) + y = u form, divide by.. 2 dy. (t) = u(t) y(t). 2 dy (t) + y(t) = u(t) So we know that = 2 and = for thi proce. Now, you can eaily take the Laplace tranform of thi dynamic model. { L 2 dy } (t) + L {y(t)} = L { u(t)} 2 L { } dy (t) + L {y(t)} = L {u(t)} 2 (y() y(t) t= ) + y() = u() Since we put everything in deviation variable, y(t) t= i now. 7
2 (y() ) + y() = u() Solving for y() : 2 y() + y() = u() 2 y() + y() = u() (2 + ) y() = u() y() = (2 + ) u() Again, you ee thi in the form. We want to get the expreion for y() a a function of, not a function + of and u(). We know the value for u(t). In the original variable, F i (t) changed from.5 to.5 at time t=. We do not know the Laplace tranform for a tep from.5 to.5 at time t =. In deviation variable, u(t) change from a value of to a value of at time t =. We know the Laplace tranform of a tep function from to at time t =. Thi value i u() = Uing our partial fraction expanion: y() = y() = (2 + ) 2 (2 + ) + y() = 2 /2 (2 + ) /2 + y() = ( + ) + 2 ( ) y() = ( + ) 2 y(t) = ( e ( 2 )t) Thi expreion for y(t) can be plotted. Note that y(t) and u(t) tart at zero..5 u(t).5.5 u(t) = Unit tep at time 2 3 4 5 6 7 y(t) 5 y(t), Firt order tep repone 2 3 4 5 6 7 8
What value doe the repone take when t =? In thi cae, = 2. y(t t=2 ) = ( e ( 2 )2) y(t t=2 ) = ( e ) y(t t=2 ) = (.3678) y(t t=2 ) = (.632) y( t=2 ) = 6.32 So at time t = the repone i 6.32, or 63% of the final value of. Thi can alo be imulated in Simulink: After running the imulation, the reult will be put in vector in the Matlab workpace. Thee vector are named (in thi example) t, y, u, h, and f. Note that the tep occur at time t =, o you hould tart the imulation at time t =. Alo note that the To Workpace block mut have the Save Format et to Array. The following plotting command will let you plot u(t) and y(t) on the ame figure: ubplot(2,,) plot(t,u) ylabel( u(t) ) legend( u(t) = Unit tep at time,4) ubplot(2,,2) plot(t,y) ylabel( y(t) ) legend( y(t), Firt-order tep repone,4) 9