ASEN 3200 Orbital Mechanics and Attitude Dynamics Spring 2006 Laplace Transform Solution of Linear Differential Equations 1 General Form for Linear Time-Invariant Systems A single-input single-output (SISO) linear time-invariant (LTI) linear dynamical system can be represented in the time domain with an nth order ordinary differential equation (ODE) with constant coefficients (ai , bi ) : dn d n 1 y t a y t n 1 dt n dt n 1 a0 y t bm dm u t dt m b0u (t ) (1) Here, y (t ) is the output (dependent variable) and u (t ) is the input (independent variable). Solving this differential equation for y (t ) given a specific u (t ) is difficult, and this prevents a comprehensive understanding of system behavior for a variety of inputs. In addition, this difficulty complicates the design process, where system characteristics are specified or modified with feedback control to achieve desired system behavior. This difficulty has motivated a large amount of theoretical work in understanding these systems, and the development of a variety of analytical and numerical tools to aid in the design of feedback control systems. The resulting Theory of Linear Dynamical Systems (studied in more depth in ASEN 4114/5114 and ASEN 5014) is very powerful and enables the behavior of these systems to be understood and specified with surprising ease. In ASEN 3200 we will touch on some of the fundamental insights and tools of this theory. 2 Laplace Transforms Formal and complete derivations of the Laplace Transform and its properties are beyond the scope of these notes. There are many good references on the subject, a few of which are listed in the references. The objective of these notes is to provide enough background to use Laplace Transforms as a tool for solving second order linear ODE's and for the design and analysis of simple control laws. bg The Laplace Transform is an integral transformation that maps a function of time f t , into a function of a bg complex variable, F s . The single-sided Laplace Transform is defined as follows: L f t F s f t e st dt (2) 0 where s is a complex number defined by, s +j with the real part of and j s , designated by Re( s ) , and the imaginary part of s , designed by Im( s ) , bg 1. Note that and are real numbers. F s is a complex number for each s . bg bg The inverse Laplace Transform is another integral transform that maps F s back to f t . It is given by, f t L 1 Axelrad/Lawrence 2/5/2016 F s c j F s e st ds (3) c j 1 ASEN 3200 Orbital Mechanics and Attitude Dynamics Spring 2006 These transforms are rarely calculated directly. Instead, tables of transform pairs are used to quickly solve for solutions to (1) for given “standard” inputs. Often, lower case letters are used to represent time domain functions and the corresponding capital letters to represent their Laplace Transforms. It is also common to use the same letter for both the Laplace and time functions, using the argument s or t to designate which form of the function is being used. The main purpose of the Laplace Transform and its inverse is that they enable direct solution of ODE's using algebraic operations and function table lookup. In order to use it for this purpose we must understand two key properties. Linearity: The Laplace Transform is a linear transformation between functions in the t domain to functions in the s domain. That means that the Laplace Transform of the sum of two or more functions is the sum of their transforms, and the Laplace Transform of a function scaled by a constant is the constant times the Laplace Transform of the original function. L a1 f1 t a2 f 2 t a1F1 s a2 F2 s (4) Derivatives: The Laplace Transform of the time derivative of a function is s times the Laplace Transform of the function minus the initial value of the function. Higher order derivatives can be handled by iterating this rule. For example, the Laplace Transform of the second derivative is s2 times the Laplace Transform of the function minus s times the initial value of the function, minus the initial value of the time derivative of the function. df (t ) L sL f (t ) f t 0 sF s f t 0 dt 2 L d dtf 2(t ) s 2 L f (t ) sf t 0 f t 0 s 2 F s sf t 0 f t 0 (5) Use of these properties are illustrated in the following section, which applies the Laplace Transform to second order LTI ODEs. 2.1 Laplace Transform of Second Order ODE's Applying the derivative and linearity properties to the dynamical system represented by the ODE d2 d y t 2n y t n2 y t n2u t 2 dt dt (6) we find the Laplace Transform of this system to be d2 d L 2 y t 2n y t n2 y t L n2u t dt dt s 2Y ( s) sy (0) y (0) 2n Y ( s) y (0) n2 X s n2U ( s) (7) s 2 2n s n2 Y( s) n2U ( s) s 2n y (0) y (0) Axelrad/Lawrence 2/5/2016 2 ASEN 3200 Orbital Mechanics and Attitude Dynamics Spring 2006 which can be rearranged to solve for the (transform of the) output Y ( s ) due to the (transform of the) input U ( s ) , and the initial conditions as follows: Y ( s) n2 ( s 2n ) y(t 0) y(t 0) U (s) 2 2 s 2n s n s 2 2n s n2 (8) The first term in this expression for the response Y ( s ) is a product of U(s) and the transfer function from the input U(s) to the output Y(s), given by: n2 Y ( s) H ( s) U ( s) s 2 2n s n2 (9) The second term in (8) is due only to initial conditions (initial value and initial rate of change of y (t ) ). To solve for y (t ) , a particular u (t ) is selected, transformed to obtain U ( s ) , then Y ( s ) is found from (8) with specific initial conditions. Then Y ( s ) is inverse transformed, either from a table of transforms, or split up first using a partial fraction expansion of Y ( s ) into simple terms that can be inverse transformed by inspection. The partial fraction expansion also provides important insight into the type of solutions that can be obtained, which is very useful for design. Assuming that there are no repeated roots of the denominator of Y ( s ) , the partial fraction expansion has the form Y ( s) A1 A2 B B C1 C2 1 2 s p1 s p2 s q1 s q2 s p1 s p2 (10) pi are the roots of the denominator of the transfer function (called the poles of the system), and qi are the roots of the denominator of the Laplace expression for U ( s ) (called the poles of the input). where Together these poles produce the poles of the output. Note that the initial condition terms in (8) have partial fraction terms in the same form as for the transfer function (same poles pi ). Using the transform pair e t 1(t ) where 1(t ) is the unit step function (zero before solution 1 s (11) t 0 and 1 thereafter), we obtain the time domain y (t ) ( A1 C1 )e p1t ( A2 C2 )e p2t B1e q1t B2e q2t 1(t ) Observe that the shapes (or character) of the time response terms depend only on the poles (12) pi and qi . The amplitudes of the response terms depend on the amplitude of the input, as well as the size of the initial conditions. Importantly, the shape of the input carries through to the output via the input poles qi . This portion of the response is called the forced response. The portion of the response due to the system poles pi has a shape that is purely a function of the characteristics of the system (ODE) relating input to output. This part of the response is called the natural response. These system poles are discussed in more detail below. Axelrad/Lawrence 2/5/2016 3 ASEN 3200 Orbital Mechanics and Attitude Dynamics 2.2 Spring 2006 Roots of the Characteristic Equation The characteristic equation is obtained by setting the denominator polynomial of the transfer function to zero. The roots of the characteristic equation are therefore the poles of the system. (As an aside, the roots of the numerator polynomial of H ( s ) are called the zeros of the transfer function.) Knowing the poles of a transfer function tells us what the natural response looks like, and this is an important part of the overall response to initial conditions and inputs. Im(s) A second-order system (from an n=2 order ODE) has two poles, from the two roots of its second-order characteristic polynomial. The roots of polynomials with real coefficients may be real, imaginary or complex, but any complex roots must occur in complex-conjugate pairs. Pole locations in the complex “s-plane” are often indicated by an “x” as shown in Figure 1. x n For the general form of the 2nd order ODE, the poles are given by: s1 , s2 n n 1 2 where is called the “damping ratio”, and n d Re(s) (13) is called the “natural x frequency”. For 1 both poles are real and negative. From (12) we see that the corresponding response terms are decaying exponentials, with no oscillation. This is termed an overdamped system. Figure 1: Pole locations in the s-plane For 1 the roots are negative, real, and repeated. This is termed “critical damping” and again no oscillations occur. s1 , s2 n This is a special case (poles are not distinct) and the transform pair (11) does not provide the correct response. Instead, these two poles produce a response in the form te shape. n t , which has a non-exponential For 0 1 the roots are complex conjugates with negative real parts. In this case, the system is said to be “underdamped” and the system poles are given by p1 , p2 jd where the real part n and the imaginary part d n 1 2 (14) Since the poles are again distinct, (11) applies so that the time response corresponding to the two system poles is given by A1e( jd )t A2e( jd )t e t ( A1e jd t A2e jd t ) (15) Observe that the exponential “envelope” of this response is determined by the real part of the poles n . When this is negative, these response terms decay to zero. When is zero, the envelope is constant. When is positive, the response grows exponentially. The remaining complex exponentials in (15) are oscillation terms, as seen by applying the Euler formula Axelrad/Lawrence 2/5/2016 e jz cos( z ) j sin( z ) . This makes it 4 ASEN 3200 Orbital Mechanics and Attitude Dynamics clear that whenever there is an imaginary part an oscillation at the frequency d Spring 2006 d in a pole, the corresponding time response term contains [rad/sec]. A quantitative estimate of the decay rate of the envelope in (15) can be found by calculating the settling time ts where the envelope is a certain percentage of its initial value, e.g. 5%. Since the initial value of e t is 1, this requires that e ts 0.05 ts ln(0.05) 3 (16) Hence, settling time is a function of the real part of the system poles. In a system with many system poles, the composite settling time can be a complex function, but for design purposes it is usually specified that the settling time of (the envelopes of) each of the natural response terms satisfy a settling time requirement like (16). Performance objectives for a control system are often stated in terms of required settling time, which is a speed of response measure, and on oscillation frequency or damping ratio, which relates to the “overshoot” and “ringing” obtained tracking a reference or command pointing trajectory. The above relationships between pole locations and corresponding time response terms provide a theory that enables a control system to be designed “in the frequency domain” (i.e. by placing system poles in “good” locations). 3 Initial Conditions and Forced Responses In addition to the natural response of a system, we are also interested in understanding how it responds to input. For example, what is the motion of the spacecraft attitude in response to repeated gas jet firing or to slowly varying aerodynamic drag, or to sudden retargeting commands in a feedback control system? This constitutes the analysis of the forced response of a system. Of course the form of the forcing input can take a wide variety of forms. Fortunately, it can frequently be described by the sum of some rather simple components. The ones we will consider here are the impulse, step, and sinusoid. For now we will ignore other unbounded input such as a ramp input. It is interesting to note that any periodic input can always be described by the sum of a sinusoidal inputs (by Fourier analysis). Examples: Impulse An input that occurs over a very short period of time is described as an impulse with obvious analogy to linear and angular impulses that we have considered in ASEN2003. Gas jets used on spacecraft are often treated as impulses, due to their short on-time (tens of milliseconds) relative to the settling time of the spacecraft natural response. Step An input that begins at a specific time and then persists is described as a step input. Step type inputs can be created by sudden changes in pointing angle commands. Often, these are used to measure the behavior of a control system, since they enable both steady state tracking errors and transient natural responses to be measured. Sinusoid A harmonic forcing function is an input that varies sinusoidally at a fixed frequency. Many spacecraft have reaction wheels, momentum wheels, or control moment gyros which have spinning masses. Imbalance in these masses causes sinusoidal vibration forces which can disturb spacecraft line-of-sight stability, inducing jitter or smear in imaging instruments. This is also a common test signal, where a system is subjected to Axelrad/Lawrence 2/5/2016 5 ASEN 3200 Orbital Mechanics and Attitude Dynamics Spring 2006 sinusoidal forcing functions at various frequencies to measure its frequency response, and thereby provide more accurate models of its dynamics (particularly for identifying structural resonance modes). The Laplace Transforms of these and other input functions can be found on the class web site in the Handouts section. Each of these functions has specific poles, which describe the character (or shape) of the time function. This carries though to the system output, since the input poles qi appear also as poles of the output. Hence the output will contain terms that have the same character as the inputs. Exceptions to this only occur in the case of the impulse input (which has no poles), and when input and system poles coincide, which produces repeated roots and new types of functions on the output, not found in either the input or in the system natural modes (natural response). In this case, the functions can be found in Laplace Transform tables. Note overlapping input and system poles are rather difficult to obtain, since this requires precise matching between system and input. Hence the insight obtained from the above analysis of the distinct roots case is used extensively for system understanding and design efforts to achieve prescribed performance objectives. The following sections explore the outputs of the specific system (6) to various inputs. It is instructive to compare these responses to the shapes of the response predicted by the poles of the intput and the poles of the system. 4 Response of an Undamped 2nd Order System 0 , and system poles at s jd jn . All responses are valid for t 0 , and are zero for t 0 . This case has 4.1 Free Response - Initial condition only y (t ) y 0 cos nt 4.2 y 0 n sin nt (17) Unit Step Response (with zero initial conditions) With u(t) = 0 for t<0 and u(t)=1 for t>0. y(t ) 1 cos nt 4.3 With (18) Sinusoidal Input Response (with zero initial conditions) u t a cos t , n , y (t ) a cos t cos nt 1 2 (19) where n is the input-system frequency ratio Axelrad/Lawrence 2/5/2016 6 ASEN 3200 Orbital Mechanics and Attitude Dynamics Spring 2006 5 Response of an Underdamped 2nd Order System This case assumes that 1 1 . 5.1 Free Response - Initial condition y (t ) y 0 ent cos d t 1 2 sin d t y 0 d e nt sin d t (20) Notice that the decay envelope is determined by the real part of the roots (n) and the frequency of oscillation is determined by the imaginary part of the roots ( d). 5.2 Unit Step Response (with zero initial conditions) With u(t) = 0 for t<0 and u(t)=1 for t>0. y(t ) 1 ent cos d t 1 2 sin d t (21a) or y (t ) 1 e nt 1 2 sin d t (21b) where tan 5.3 With 1 2 Sinusoidal Input Response (with zero initial conditions) u t a cos t , y (t ) a cos t 1 2 2 2 2 2 2 1 cos d t 2 1 1 2 n t ae 2 1 2 2 2 where n is the input-system frequency ratio 1 sin d t (22) 2 and tan 1 2 1 Axelrad/Lawrence 2/5/2016 7 ASEN 3200 Orbital Mechanics and Attitude Dynamics Spring 2006 The so-called amplification factor is given by: AF 1 1 2 2 2 (23) 2 To find this peak amplification we take the derivative with respect to and set it to zero. This leads to two possibilities: For For 1 2 1 2 , the peak occurs at 0, and has a peak value of 1 , the peak occurs at 1 2 2 , and has a peak value For very small the peak value 1 2 1 2 1 2 (24) Figure 2 – Amplification factor as a function of Axelrad/Lawrence 2/5/2016 for various damping ratios . 8 ASEN 3200 Orbital Mechanics and Attitude Dynamics Spring 2006 6 Time domain performance measures Performance of a second order system is often specified in terms of the characteristics of the step response. Figure 3 illustrates the step response for the 2 nd order system (6) with damping ratio ranging from 0.2 to 1.2. The horizontal axis is a normalized time =nt so these graphs apply to all systems defined by the form given in Equation 6. The vertical axis is the output y (t ) . 6.1 Rise Time The rise time is generally defined as the time required for a unit step response to go from 0.1 to 0.9 or for a more generic step response to go from 10% to 90% of the input value. It can be easily seen on the step response graph. For the unit step it can be found analytically by setting y(tstart) = 0.1 in Equation 21b and solving for the first time at which this occurs; then setting x(tstop) = 0.9 and solving for the first time this occurs. The difference in the times is the rise time tr=tstop – tstart. An approximation for underdamped 2nd order responses with damping ratio, near 0.5 is: tr 1.8 (25) n A closely related time is the time required to go from 0 to the first crossing of 1 is given by: t zero _ to _1 Axelrad/Lawrence 2/5/2016 d 9 ASEN 3200 Orbital Mechanics and Attitude Dynamics 6.2 Spring 2006 Peak Time The peak time is the time required for a unit step response to reach is maximum value. To find it analytically set the time derivative of x(t) to zero and find the first time this occurs. Using Equation 18b, you find: t t d e np e np y (t ) 0 n sin d t p d cos d t p dt 1 2 1 2 n sin d t p d cos d t p tan d t p 1 2 d tan n so d t p 6.3 and tp d (26) Maximum Overshoot The maximum overshoot is how much above 1 the step response goes. To find it analytically compute x(tp)-1. Mp e n / d 1 2 Mp e 1 2 For small sin e n / d 1 2 sin (27) M p e Mp can also be represented as a percent overshoot. 6.4 Settling Time The settling time is the time required for the system to almost reach steady state. It is defined as the time required for the response to settle within some percent of its final value; which can be read off a plot of the response. Analytically it is approximated by the time at which the exponential decay envelope drops with some percent of its final value. So you set the envelope to 0.01, 0.02 or 0.05 and solve for the time. Axelrad/Lawrence 2/5/2016 10 ASEN 3200 Orbital Mechanics and Attitude Dynamics Spring 2006 for 1% e nts 0.01 ts for 2% e nts 0.02 ts for 5% e nts 0.05 ts 4.6 n 3.9 n (28) 3.0 n 7 References Blanchard, P., R. L. Devaney, and G.R. Hall, Differential Equations, Chapter 6, Brooks/Cole Publishing, 1997. DiStefano, Stubberud, Williams, Feedback and Control Systems, Shaum's Outline Series. Dorf, R.C., Modern Control Systems, Addison-Wesley, 1994. Franklin, G.F., Powell, J.D., and A. Emami-Naeini, Feedback Control of Dynamic Systems, Fourth Edition, Prentice Hall, 2002. Woods, R. L., and K.L. Lawrence, Modeling and Simulation of Dynamic Systems, Appendices E&F, Prentice Hall, 1997. Axelrad/Lawrence 2/5/2016 11