unit35.mws

ORDINARY DIFFERENTIAL EQUATIONS POWERTOOL

Unit 35 -- Application: Transfer Functions and Frequency Response Curves

Prof. Douglas B. Meade

Industrial Mathematics Institute

Department of Mathematics

University of South Carolina

Columbia, SC 29208

URL: http://www.math.sc.edu/~meade/

E-mail: meade@math.sc.edu

Copyright © 2001 by Douglas B. Meade

All rights reserved

-------------------------------------------------------------------

>

Outline of Unit 35

>

Initialization

> restart;

> with( DEtools ):

> with( plots ):

> with( linalg ):

> with( inttrans ):

Warning, the name changecoords has been redefined

Warning, the name adjoint has been redefined

Warning, the protected names norm and trace have been redefined and unprotected

Warning, the name hilbert has been redefined

> alias( X(t)=laplace(x(t),t,s) ):

>

35.A Transfer Functions

35.A-1 Definition 1

The transfer function for a linear ODE is the Laplace transform of the fundamental solution to the ODE. While this definition applies to an ODE any order, only second-order linear ODEs will be discussed here. In particular, consider

> ode1 := m*diff( x(t), t$2 ) + b*diff( x(t), t ) + k*x(t) = g(t);

ode1 := m*diff(x(t),`$`(t,2))+b*diff(x(t),t)+k*x(t)...

>

The fundamental solution can be obtained as the solution for the IVP with g(t) = delta(t) and homogeneous initial conditions.

> ic1 := x(0)=0, D(x)(0)=0;

ic1 := x(0) = 0, D(x)(0) = 0

>

35.A-2 Computation of Transfer Functions

The definition suggests finding the transfer function from the fundamental solution of the ODE :

> q1 := dsolve( { eval(ode1,g(t)=Dirac(t)), ic1 }, x(t), method=laplace );

q1 := x(t) = 2*exp(-1/2*b*t/m)*sin(1/2*sqrt((4*k*m-...

> q2 := laplace( rhs(q1), t, s );

q2 := 1/(m*((s+1/2*b/m)^2+1/4*(4*k*m-b^2)/(m^2)))

> H1 := 1/expand(simplify(1/q2));

H1 := 1/(s^2*m+s*b+k)

>

However, it is generally more efficient to simply take the Laplace transform of the IVP and solve for the Laplace transform of the fundamental solution. That is,

> H2 := solve( eval( laplace( eval(ode1,g(t)=Dirac(t)), t, s ), {ic1} ), X(t) );

H2 := 1/(s^2*m+s*b+k)

>

These results are obviously equivalent.

>

35.A-3 Definition 2

Note that since L(delta(t)) = exp(-0*s) = 1, an equilvalent definition of the transfer function is the ratio of the Laplace transform of the solution (with homogeneous initial conditions) and the Laplace transform of the forcing function. That is, H(s) = L(x(t))/L(g(t)) = X(s)/G(s) .

>

35.B Frequency Response Curves

35.B-1 Introduction to Bode Plots

The frequency response curves, or Bode plots, are plots of the magnitude and argument (in degrees) of the transfer function evaluated at s = i*omega ( i = sqrt(-1) ) as functions of the frequency omega . That is, if the transfer function is H, then M(omega) = abs(H(i*omega)) and N(omega) = arg(H(i*omega)) . The functions M and N correspond to the amplitude and phase shift, respectively, of the steady-state solution to the linear ODE with sinusoidal forcing function, g(t) = sin(omega*t) , i.e., x(t) = M(omega)*sin(omega*t+N(omega)) .

For example, when

> H := unapply( H1, s );

H := proc (s) options operator, arrow; 1/(s^2*m+s*b...

>

the amplitude and argument (in degrees) of the steady-state solution with frequency omega are

> M := unapply( evalc( abs( H(I*omega) ) ), (m,b,k) );

M := proc (m, b, k) options operator, arrow; 1/(sqr...

> N := unapply( evalc( argument( H(I*omega) ) ) * 180/Pi, (m,b,k) );

N := proc (m, b, k) options operator, arrow; 180*ar...

>

The quantity 20*log[10](M(omega)) is the gain, in decibels (dB). Bode plots typically display the gain (in decibels) and phase angle (in degrees) versus the angular frequency on a logarithmic scale for omega .

>

35.B-2 Example 1

For example, when m = 1 , b = 1/4 , and k = 1 ,

> semilogplot( 20*log[10](M(1,1/4,2)), omega=0.1..10,

> axes=framed, labels=[omega,"gain (dB)"],

> labeldirections=[HORIZONTAL,VERTICAL] );

[Maple Plot]

>

> semilogplot( N(1,1/4,2), omega=0.1..10, axes=framed,

> labels=[omega,"phase shift (degrees)"],

> labeldirections=[HORIZONTAL,VERTICAL] );

[Maple Plot]

>

35.B-3 Example 2

One important use of the Bode plot for the magnitude is to determine the resonant frequency. The resonant frequency for a system occurs when the magnitude of the steady-state response is maximized.

> dM := diff( M(m,b,k), omega );

dM := -1/2*(4*omega^3*m^2-4*omega*m*k+2*omega*b^2)/...

> q3 := solve( dM=0, omega );

q3 := 0, 1/2*sqrt(4*k*m-2*b^2)/m, -1/2*sqrt(4*k*m-2...

> res_freq := omega = op(select( w->evalb(eval(w,{m=1.,b=0,k=1.})>0), [q3] ));

res_freq := omega = 1/2*sqrt(4*k*m-2*b^2)/m

>

Note that for the undamped system, the resonant frequency is found to be

> simplify( eval( res_freq, b=0 ) );

omega = sqrt(k*m)/m

>

as expected.

>

35.B-4 Example 3

Another use of Bode plots is to investigate the behavior of a system as one of the parameters changes. To illustrate, the gain and phase angle are investigated as the mass and spring constant are held fixed and the damping coefficient decreases to zero.

Consider the damped spring-mass system with m = 1, k = 4, and damping coefficients selected from

> damp_vals := [2^(-i) $ i=-3..8, 0];

damp_vals := [8, 4, 2, 1, 1/2, 1/4, 1/8, 1/16, 1/32...

>

Also, chose an interval of positive frequencies to use as the domain for the Bode plots.

> freq_range := 0.1..10;

freq_range := .1 .. 10

>

The animated Bode plots of the magnitude for each damping coeffcient is

> display( [seq( semilogplot( 20*log[10](M(1,b,4)), omega=freq_range,

> axes=framed, labels=[omega,"gain (dB)"],

> labeldirections=[HORIZONTAL,VERTICAL] ),

> b=damp_vals )], insequence=true );

[Maple Plot]

>

Note that there is no (interior) maximum amplitude in the first two frames of this animation ( b = 8 and b = 4). This is consistent with the fact that a damped spring-mass system has a resonant frequency only when b^2 < 4*m*k .

The animated Bode plots for the phase angle for each damping coefficient is

> display( [seq( semilogplot( N(1,b,4), omega=freq_range,

> axes=framed, labels=[omega,"phase shift (degrees)"],

> labeldirections=[HORIZONTAL,VERTICAL] ),

> b=damp_vals )], insequence=true );

[Maple Plot]

>

Note the jump in the phase shift when b = 0 . The argument jumps to 180 degrees instead of -180 degrees because Maple's arctangent function returns values in ( -Pi , Pi ].

And, now, the two Bode plots with all 13 frames superimposed on the same set of axes.

> semilogplot( [seq( 20*log[10](M(1,b,4)), b=damp_vals )],

> omega=freq_range, axes=framed,

> labels=[omega,"gain (dB)"],

> labeldirections=[HORIZONTAL,VERTICAL] );

[Maple Plot]

>

> semilogplot( [seq( N(1,b,4), b=damp_vals )],

> omega=freq_range, axes=framed,

> labels=[omega,"phase shift (degrees)"],

> labeldirections=[HORIZONTAL,VERTICAL] );

[Maple Plot]

>

>

[Back to ODE Powertool Table of Contents]

>