You are on page 1of 33

Math Fundamentals

Ch 2-1 through Ch 2-5

Complex Variables Fourier Transforms Laplace Transforms Inverse Laplace Transforms Partial Fraction Expansion. Linear Time Invariant Differential Equations.

Ch 5-1, 5-2

State Space Analysis.

10/7/2013

MIE 312

M. Brown

1

Complex Variables

Im (s)

s = x + j y θ
s = x + j y
θ

For the spatial relationship,

s

Where

 x  jy  s e j  1 j 2 ,
x
jy
s e
j  1
j
2
,
 y  j  2 2  1  x  y  tan 
y
j
2
2
1
x
y
 tan
 
x
 
 
1
  
1
1,
j
3
 
j,

Re (s)

With complex conjugate

Complex variables follow algebraic rules such that if

s x jy x jy

s

1

1

1

and

s

2

s  s   x  x   j  y  y 
s
s
x
x
j
y
y
1
2
1
2
1
2
s s
x x
y y
j
x y
1
2
1
2
1
2
1
2
s s
s
e
j
s
e
j
1
2
s
s
e
1
2
1
2
1 2

y x

1

2

j (

1

2

)

10/7/2013

s x  jy  x  jy  x  jy   x 
s
x
jy
x
jy

x
jy
x
jy

x
jy
1
1
1
1
1
2
2
1
1
2
2
s
x
jy
x
jy

x
jy
x
2
y
2
2
2
2
2
2
2
2
2 2
s
s
e
j
1
s
1
1
1
e
j (
 
)
1
2
s
s
e
j
2
s
2
2
2
MIE 312
M. Brown

 x 2 s s 1 2 2 s 2
 x
2
s s
1
2
2
s
2

jy

2

2

Useful Exponential and Series Expansions

sin

1

2

j

e

j

e

j

,

sin

3

3!

5

7

5!

7!

Useful Exponential and Series Expansions sin   1 2 j  e j  

e

1

 



2

3

4

2!

3!

4!

Useful Exponential and Series Expansions sin   1 2 j  e j  

cos

1

2

e

j

e

j

,

cos

1

 

2

2!

4

6

4!

6!

Useful Exponential and Series Expansions sin   1 2 j  e j  

e

j

cos

j

sin

,

sin

1

2

j

e

j

e

j

e

j

cos

j

sin

,

cos

1

2

e

j

e

j

10/7/2013

cos

2

sin

2

1

MIE 312

M. Brown

3

Fourier Series and Transform

In the study of control systems, the principal goal is to design a system such that the response of the system meets the

functional specifications.

Therefore the designer must understand the methods in

describing a function in the time and frequency domains or

s-plane so that the behavior of the system can be analyzed.

10/7/2013

MIE 312

M. Brown

4

Fourier Series

A function in the time domain can be represented by a sum of exponential functions over the entire interval -∞<t<∞ such that the new function is periodic.

f ( t )

X e

n

jn t

 o
o

n 

10/7/2013

MIE 312 M. Brown 5
MIE 312
M. Brown
5

Fourier Series and Transform

Consider a time function x(t) described by a discrete set of exponential time

domain functions;

( )

x t

X e

n

jn t

o

n 

T

2

t

 

T

2

where

o

2

T

and

X

n

is

a

series of amplitudes.

For a periodic function existing within the time interval [-T/2, T/2], The

Fourier transform is given as

X

k

(

k

o

)

  • 1

T

T / 2

T / 2

( )

x t e

jk t

 o
o

dt

Where

X

k

represents the amplitude of the component of frequency

k

o

,

  k  

Which can be expanded for a non-periodic function with frequency domain

transform

F

(

)



( )

x t e

j t

dt

and inverse time domain

transform

x t

( )

1

2



F

(

)

e

j

t

d

10/7/2013

MIE 312

M. Brown

6

Fourier Transform

Fourier Transform 10/7/2013 f ( t )  F (  ) MIE 312 M. Brown

10/7/2013

f (t ) F ()

MIE 312

M. Brown

7

Laplace Transform

Since control systems do not operate in the minus infinity

time range, the single sided Fourier Transform with damping

is referred to as the Laplace Transform such that

( )

F s

0

st

f t e dt

( )

f t

( )

1

2 j

j

 

j

 

st

F s e ds

( )

where s = σ + jω

The Laplace Transform expresses a causal function f(t) as a continuous sum of exponentials of complex frequencies. Sufficient conditions for existence are the function f(t) must be piecewise continuous and of exponential order.

10/7/2013

10/7/2013

MIE 312

M. Brown

8

8

Existence of the Laplace Transformation

.

Given a time varying function f(t), 0 < t < ∞ a Laplace Transform exists such that

  

f t

F s

 

f t e

st

dt

0

With Inverse

1

F s

 

 

f t

1

2

j

j

j

F s e

 

st

dt

For the Laplace Transform to exist, the integral

0

f

 

t

e

st

dt

must be finite. The integral will be finite, provided that

f

 

t

e

t

dt  

, and real positive finite numbers M and α exist

0

so that

f

( )

t

Me

t

for all

t

0

, then f(t) is said to be an

exponential function and exists for all exists as well.

t 0

and the integral

10/7/2013

MIE 312

M. Brown

9

Fourier and Laplace Transform relationship

Complex Fourier Transform (Bilateral Laplace Transform) s = σ +jω . f(t) exists = in the
Complex Fourier Transform
(Bilateral Laplace Transform)
s = σ +jω . f(t) exists = in the interval
  t  
Ordinary Fourier Transform
Laplace Transform
s = jω .
f(t) exists in the
s = σ + jω . f(t) = exists as a
interval   = t  
casual function , t > 0

10/7/2013

MIE 312

M. Brown

10

Basic Rules of Transformations

Given that

 

f t

 

1

 

F s

Scaling

Time shifting:

f at

1

a
a

F

s

a

For

Frequency shifting:

 

f t e

at

Linearity property:

Time differentiation:

f

1

t

F

1

s

and

d

m

f

dt

m

s

m

F

s

f  t  t   F  s e   st t 0
f
t
t
F
s e
 st
t 0 > 0,
0
0
 F s  a
f
t
F
s
then
a f
t
a f
t
a F
s
 a F
2
2
1
1
2 2
1
1
2
2
m
1
s
f
m
2
m
1
0
s
f
0
f
0

s

Time integration:

t

0

f

 

t

dt

F s

f (0)

s

s

Frequency integration:

10/7/2013

 

f t

t

F sds

s

MIE 312

M. Brown

11

Examples

Determine the Laplace transform of the following command

signals:

Impulse function:

( t )

0

0

0

 

for t

t dt

( )

0

1

step function:

f ( t )

 

0,

1,

for t

0

for t

0

ramp function:

f ( t )

 

0,

for t

0

At for t

,

0

sinusoidal function:

f ( t )

 

A

0,

for t

0

sin ,

t

for t

0

10/7/2013

MIE 312

M. Brown

12

Development of Important Properties

Initial Value Theorem: As t → 0, the signal in the s- plane is related as s →∞ such that

lim

t 0

( )

f t

f

(0 )

lim

s 

(

sF s

)

Which states that it is always possible to determine the initial value of the time function from its Laplace transform.

Final Value Theorem: The final value of a signal as t → ∞ is related to the value of the Laplace transform of the function as s → 0, such

that

lim

t



( )

f t

lim

s

0

(

sF s

)

10/7/2013

MIE 312

M. Brown

13

Laplace transforms of common signals encountered in

control engineering

10/7/2013 MIE 312 M. Brown 14
10/7/2013
MIE 312
M. Brown
14

10/7/2013

MIE 312

M. Brown

15

Laplace Transform Examples

Determine the Laplace Transform for the following signals;

f ( t )

 e

0

 

t

3

e

2

t

t

0

t

0

f t

( )

at

e

cos

t

10/7/2013

MIE 312

M. Brown

16

Inverse Laplace transform by Partial

Fraction expansion

Given a rational function

(

F s

)

Y S

(

)

U S

(

)

b s

1

n

1

b s

2

n

2

b

n

s

n

a s

1

n

1

a s

2

n

2

a

n

By factoring the polynomials the function can be expressed as

the product of the factors such as

(

F s

)

K

m

i

1

(

s

z

i

)

n

i

1

(

s

p

i

)

Where F(s) is the transfer function representing any physical

system . When

m n

z i is referred to as the zeros of the

, system and p i are the poles of the system. For the case that

the poles are either real or complex, but distinct, the transfer

function can be written in terms of partial fractions as

10/7/2013

( )

F s

C

1

C

2

C

3

s

p

1

s

p

2

s

p

3

C n s  p n
C
n
s
p
n

MIE 312

M. Brown

17

Inverse Laplace transform by Partial

Fraction expansion

The set of constants C i are determined by multiplying both sides of the above equation by the corresponding pole and solving for the constant. For example to determine C 1 the following method would be applied

s

p

1

(

F s

)

C

1

s

p

1

s

p

1

C

2

s

p

2

s

p

1

C

3

s

p

3

s

p

1

C

n

s

p

n

s

p 1
p
1

And evaluate the expression at s = p 1 with results

C 1
C
1

s

p

1

(

F s

) s

p

1

For the case of repeated roots consider the function with

three repeated roots, with partial fraction expansion given by

10/7/2013

(

F s

)

C

1

C

2

C

3

C

4

s

p

1

s

p

1

2

s

p

1

3

s

p

2

C n  s  p n
C
n
s
p
n

MIE 312

M. Brown

18

Inverse Laplace transform by Partial

Fraction expansion

Set s = p 1 , and

C 3 follows as

C 3
C
3

s

p 1
p
1

  • 3 F s

(

)

s

p

1

To determine the remaining constants related to the repeated root, differentiate equation with respect to the Laplace variable s.

In general

d

ds

  • C k

s

2

C

1

s

p

1

C

2

C

2

  • d  

ds

 3   d C  s  p    n 1 
3
d
C
s
p
n
1
ds
s
p
n
3
s
p
F s
(
)
1
s
p
1

0,

, k  1
,
k 
1

p

1

3

(

F s

Then

  • 1    

    • d i

ds

  • i

p

1

k

(

F s

)

s

p

1

,

  • i

i !

10/7/2013

MIE 312

M. Brown

19

Examples

F ( s )

 

s 3

 
 

s

2

3 s 2

 
   

s 3

F ( s )

 
 

(

s

1)(

s

2)

2

F ( s )

1

2

 

(

s s s

1)

 

10/7/2013

MIE 312

M. Brown

20

Transfer function of spring-damper-mass

system

Given the differential equation for a typical spring (spring constant k) damper (damping constant c) system with mass m; from Newton’s law, the

equation can be written as

my cyky ut

Where u(t) is a forcing function on the system. The Laplace Transform for

the system equation (Output/Input) is written as:

 

Y s

 

U s

1

ms

  • 2

cs

k

In general, define the natural frequency as damping ratio

c

  • 2 m

n

n

k m
k
m

and

10/7/2013

10/7/2013

Y

s

U

s

1

ms

2

cs

k

1

2

n

k s

2

  • 2 

n

s

2

n

MIE 312

M. Brown

21

21

Displacement

Matlab Example

H ( s )

( )

Y s

( )

U s

2 10

s

2

s s

2

10

For a unit step function input num=[2 10]; den=[1 2 10];

sys=tf(num,den)

t=0:0.01:8;

step(sys,t);

%U(s)=1/s

title('Response');

xlabel('time');ylabel('Displacement');

Response

1.5

1

0.5

0

Displacement Matlab Example H ( s )  ( ) Y s ( ) U s

0

1

2

3

4

5

6

7

8

time (sec)

10/7/2013

MIE 312

M. Brown

22

Solution of an Ordinary Differential

Equation

2

3

1

3

y y 2y 0, y(0) 1 and y (0) 0 y(t ) 3y(t ) 2y(t ) 2u(t ) u(t ),

Solution of an Ordinary Differential Equation • • 2 3 1 3 y (0)  1

With unit impulse input

( )

t

1

 

0

t 0

t 0

Solution of an Ordinary Differential Equation • • 2 3 1 3 y (0)  1
Solution of an Ordinary Differential Equation • • 2 3 1 3 y (0)  1

( )

e

2

t

y t

t

e

y(0) y ,

0

y(0)  y , and u(0)  u 0 0  y t ( ) 
y(0)  y ,
and
u(0)  u
0
0
y t
( )
 
e
t
3
e
 2
t

10/7/2013

y  5 y  6 y  3 e  2 t  e 3
y
5
y
6
y
3
e
2
t
e
3
t
,
y (0)  0 and y (0)  0.
2
t
3
t
y t
(
)
c e
c e
3
te
1
2
MIE 312
M. Brown

2

t

1

30

e

3

t

23

State Space Representation Example

For the ODE

yyy  2  3  0
yyy
 2
 3
 0

Define the state variables

In state variable form:

x  y 1 x  y 2 x  y 2 x x 3 x
x
y
1
x
y
2
x
y
2
x
x
3 x
0
1
x
x
x
0
1
 
x
1
2
1
1

x
 
3
x
2
x
x
3
2
x
 
2
1
2
2
2

Given the matrix form as

A is the state matrix .

 

x

=

Ax +B

 

u

B is the input matrix .

   

y Cx +D

=

u

C is the output matrix .

 

u is the

input vector .

y is the output vector. D is the transmission matrix

10/7/2013

 

MIE 312

M. Brown

24

Block Diagram of State Space Model

x

=

Ax +B

 

u

y Cx +D

=

u

u(t)

D xt( ) xt( ) + B  dt ∑ C ∑ + + A
D
xt( )
xt( )
+
B
dt
C
+
+
A

y(t)

10/7/2013

MIE 312

M. Brown

25

State Space Representation Example

yyy  2  3  0
yyy
 2
 3
 0

With state variables:

x  y 1 x  y 2 x  y 2
x
y
1
x
y
2
x
y
2

The state formulation becomes

x

=

Ax +B

 

u

y Cx +D

=

u

10/7/2013

 x   x   x   0 1   x 
x
x
x
0
1
 
x
1
1
1
1
x
x
 
x
x
x
3
2
x
 
2
2
2
2
x
1
y  1
0
x
2

,

MIE 312

M. Brown

26

Displacement

MatLab Representation

Applying initial conditions such that x(0) = 0.1m,

A= [0

1;-3

-2];C = [1 0];

x0 = [0.1 ; 0];

sys = ss(A,[],C,[]);

initial(sys,x0);

response to initial displacement x(0)=0.1

0.1

0.08

0.06

0.04

0.02

0

-0.02

Displacement MatLab Representation • Applying initial conditions such that x(0) = 0.1m, A= [0 1;-3 -2];C
Displacement MatLab Representation • Applying initial conditions such that x(0) = 0.1m, A= [0 1;-3 -2];C
Displacement MatLab Representation • Applying initial conditions such that x(0) = 0.1m, A= [0 1;-3 -2];C
Displacement MatLab Representation • Applying initial conditions such that x(0) = 0.1m, A= [0 1;-3 -2];C
Displacement MatLab Representation • Applying initial conditions such that x(0) = 0.1m, A= [0 1;-3 -2];C
Displacement MatLab Representation • Applying initial conditions such that x(0) = 0.1m, A= [0 1;-3 -2];C
Displacement MatLab Representation • Applying initial conditions such that x(0) = 0.1m, A= [0 1;-3 -2];C
   
Displacement MatLab Representation • Applying initial conditions such that x(0) = 0.1m, A= [0 1;-3 -2];C
 

0

1

2

3

4

5

6

time (sec)

title('response to initial displacement x(0)=0.1');

ylabel('Displacement');

xlabel('time');

10/7/2013

MIE 312

M. Brown

27

Amplitude

System Velocity

x  y 1 x 1 is the displacement x  y 2 x 2 is
x
y
1
x 1 is the displacement
x
y
2
x 2 is the velocity
x
y
2

The output vectors become

Matlab code

y

1

x =
x
=

Ax +B u

y Cx +D

=

u

0

x

 

1

x

2

,

v

0

1

x

1

x

2

A= [0

1;-3

-2];Cy = [1 0]; Cv=[0 1]; %Displacement

x0 = [0.1 ; 0]

sysd = ss(A,[],Cy,[]);

sysv= ss(A[],Cv,[]);

initial(sysd,sysv,x0);

%Cy represents Displacement

%Cv represents Velocity

title('response to initial displacement x(0)=0.1');

ylabel('Amplitude')

xlabel('time')

response to initial displacement x(0)=0.1

0.1

0.08

0.06

0.04

0.02

0

-0.02

-0.04

-0.06

-0.08

-0.1

Velocity Displacement
Velocity Displacement
Velocity Displacement
Velocity Displacement
Velocity Displacement
Velocity
Velocity
Displacement
Displacement
Velocity Displacement

0

1

2

3

4

5

6

time (sec)

10/7/2013

MIE 312

M. Brown

28

Amplitude

System Response with forcing function

For the following system equation

A= [0 1;-3 -2]; B=[0;10]; D=[0;0]

C= [1 0;0 1]

%[Displacement; Velocity]

sys = ss(A,B,C,D);

t=0:0.01:5;

U = sin(5*t);

[Y,T,X] = lsim(sys,U,t); x1=[1 0 ]*X'; %Displacement x2=[ 0 1 ]*X'; %Velocity

plot(t,x1,t,x2)

Amplitude System Response with forcing function • For the following system equation A= [0 1;-3 -2];

y 2y 3y 10sin5t

3

2

1

0

-1

-2

-3

Response to Forcing Function 10sin(5t)

Velocity
Velocity

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

5

 

time

title('Response to Forcing Function 10sin(5t)'); ylabel('Amplitude');xlabel('time')

10/7/2013

MIE 312

M. Brown

29

DC motor Transfer Function

DC motor – Transfer Function Torque Equation: T  K t i  e  K

Torque Equation:

T

 

K

t

i

 

e

K

e

 
 



J

b

Ki

 

L

  • di K

Ri

V

System Equations:

Transfer Function:

dt

s

Js

b

(

s

)

I(

K

s

)

Ls

R

I(

s

)

V

(

s

)

Ks

(

s

)

W

(

s

)

(

V s

)

K

Js

b



Ls

R

K

2

5/12/2012

10/7/2013

MIE 312

M. Brown

30

30

  • DC Motor State Space Formulation



J

b

Ki

L

  • di Ri

dt

V

K

DC Motor State Space Formulation  J   b    Ki L di
  
  

b

  K i

J

J

di

dt

K

 

L

DC Motor State Space Formulation  J   b    Ki L di

R

  • 1 V

L

L

5/12/2012

10/7/2013

x   1 x   2 x   2 x  i 3
x
1
x
2
x
2
x
i
3
di
x
3
dt

K

J

x

3

R

L

x

3

DC Motor State Space Formulation  J   b    Ki L di

1

L

V

DC Motor State Space Formulation  J   b    Ki L di

x Ax Bu

y Cx + Du

MIE 312

M. Brown

31

31

2 DOF State Space

2 DOF State Space x  y x  y 1 1 3 2 x 
x  y x  y 1 1 3 2 x  y x  y
x
y
x
y
1
1
3
2
x
y
x
y
2
1
4
2
x
y
x
y
2
1
4
2

10/7/2013

MIE 312

M. Brown

32

Runge-Kutta numerical soln

An alternate method to the Controls Tool Box is the Runge-Kutta Algorithm ODE45 in Matlab follows. ODE45 is designed to solve first order ordinary differential equations. Open an M-file and save as any name you want. In

this case the file is named mike.m

function dx = mike(t,x)

dx = zeros(2,1); dx(1) = x(2) ;

% designates a column vector

dx(2) = -3*x(1) - 2*x(2) ;

In the Matlab command window or generate an m-file, enter the following

x0 = [0.1 ; 0];

%initial displacement in radians

[T,X] = ode45(@mike,[0 6],x0);

% @mike is the call to the M-file and [0 6]

% is the time span. plot(T,X(:,1)); title('response to initial displacement x(0)= 0.1') ylabel('Displacement'); xlabel('time')

End of lecture

10/7/2013

MIE 312

M. Brown

33