<< Chapter < Page Chapter >> Page >

The equilibrium equation is

dv o ( t ) dt = 1 RC v o ( t ) + 1 RC v i ( t ) size 12{ { { ital "dv" rSub { size 8{o} } \( t \) } over { ital "dt"} } = - { {1} over { ital "RC"} } v rSub { size 8{o} } \( t \) + { {1} over { ital "RC"} } v rSub { size 8{i} } \( t \) } {}

To solve this equation numerically in a computer, the CT signals are discretized and the derivative is approximated.

2/ Forward Euler algorithm

a/ Discretization

Define

v i [ n ] = v i ( t ) t = nT = v i ( nT ) and v o [ n ] = v o ( t ) t = nT = v o ( nT ) size 12{v rSub { size 8{i} } \[ n \] =v rSub { size 8{i} } \( t \) \lline rSub { size 8{t= ital "nT"} } =v rSub { size 8{i} } \( ital "nT" \) matrix {{} # {} } ital "and" matrix {{} # {} } v rSub { size 8{o} } \[ n \]=v rSub { size 8{o} } \( t \) \lline rSub { size 8{t= ital "nT"} } =v rSub { size 8{o} } \( ital "nT" \) } {}

and approximate the derivative by the forward Euler algorithm

dv o ( t ) dt t = nT v o ( ( n + 1 ) T ) v o ( nT ) T size 12{ { { ital "dv" rSub { size 8{o} } \( t \) } over { ital "dt"} } \rline rSub { size 8{t= ital "nT"} } approx { {v rSub { size 8{o} } \( \( n+1 \) T \) - v rSub { size 8{o} } \( ital "nT" \) } over {T} } } {}

b/ Difference equation

Substituting the approximation for the derivative into the differential equation, we obtain

v o ( ( n + 1 ) T ) v o ( nT ) T = 1 RC v o ( nT ) + 1 RC v i ( nT ) size 12{ { {v rSub { size 8{o} } \( \( n+1 \) T \) - v rSub { size 8{o} } \( ital "nT" \) } over {T} } = - { {1} over { ital "RC"} } v rSub { size 8{o} } \( ital "nT" \) + { {1} over { ital "RC"} } v rSub { size 8{i} } \( ital "nT" \) } {}

This equation can be written as a difference equation

v o [ n + 1 ] = 1 T RC v o [ n ] + T RC v i [ n ] size 12{v rSub { size 8{o} } \[ n+1 \] = left [1 - { {T} over { ital "RC"} } right ]v rSub { size 8{o} } \[ n \] + { {T} over { ital "RC"} } v rSub { size 8{i} } \[ n \]} {}

This equation was solved iteratively for v i [ n ] = u [ n ] size 12{v rSub { size 8{i} } \[ n \] =u \[ n \]} {} and v o [ 0 ] = 0 size 12{v rSub { size 8{o} } \[ 0 \] =0} {} to yield the solution

v o [ n ] = ( 1 ( 1 α ) n ) u [ n ] size 12{v rSub { size 8{o} } \[ n \] = \( 1 - \( 1 - α \) rSup { size 8{n} } \) u \[ n \]} {}

where α = T/RC. We now solve this difference equation using the Z-transform method.

c/ System function

The Z-transform of the difference equation

v o [ n + 1 ] = ( 1 α ) v o [ n ] + αv i [ n ] size 12{v rSub { size 8{o} } \[ n+1 \] = \( 1 - α \) v rSub { size 8{o} } \[ n \]+αv rSub { size 8{i} } \[ n \] } {}

is

z V ~ o ( z ) = ( 1 α ) V ~ o ( z ) + α V ~ i ( z ) size 12{z {V} cSup { size 8{ "~" } } rSub { size 8{o} } \( z \) = \( 1 - α \) {V} cSup { size 8{ "~" } } rSub { size 8{o} } \( z \) +α {V} cSup { size 8{ "~" } } rSub { size 8{i} } \( z \) } {}

so that the system function is

H ~ ( z ) = V o ~ ( z ) V i ~ ( z ) = α z ( 1 α ) = αz 1 1 ( 1 α ) z 1 size 12{ {H} cSup { size 8{ "~" } } \( z \) = { { {V rSub { size 8{o} } } cSup { size 8{ "~" } } \( z \) } over { {V rSub { size 8{i} } } cSup { size 8{ "~" } } \( z \) } } = { {α} over {z - \( 1 - α \) } } = { {αz rSup { size 8{ - 1} } } over {1 - \( 1 - α \) z rSup { size 8{ - 1} } } } } {}

The region of convergence of H ~ ( z ) size 12{ {H} cSup { size 8{ "~" } } \( z \) } {} needs to be specified from the system description. Because we are simulating a CT system consisting of an RC circuit, we are dealing with a causal system, one that does not respond before it is stimulated. Then we know that the ROC is |z|>|1 − α|.

d/ Input and output Z-transforms

The input is v i [ n ] = u [ n ] size 12{v rSub { size 8{i} } \[ n \] =" u" \[ n \]} {} . Therefore,

V ~ i ( z ) = 1 1 z 1 for z > 1 size 12{ {V} cSup { size 8{ "~" } } rSub { size 8{i} } \( z \) = { {1} over {1 - z rSup { size 8{ - 1} } } } matrix { {} # {}} ital "for" matrix { {} # {}} \lline z \lline>1} {}

Therefore,

V ~ o ( z ) = 1 1 z 1 αz 1 1 ( 1 α ) z 1 for z > 1 z > 1 α size 12{ {V} cSup { size 8{ "~" } } rSub { size 8{o} } \( z \) = left [ { {1} over {1 - z rSup { size 8{ - 1} } } } right ] left [ { {αz rSup { size 8{ - 1} } } over {1 - \( 1 - α \) z rSup { size 8{ - 1} } } } right ]matrix { {} # {}} ital "for" matrix { {} # {}} \lline z \lline>1&\lline z \lline>\lline 1 - α \lline } {}

This is a proper rational function and we expand it in a partial fraction expansion as follows

V ~ o ( z ) = 1 1 z 1 1 1 ( 1 α ) z 1 for z > 1 z > 1 α size 12{ {V} cSup { size 8{ "~" } } rSub { size 8{o} } \( z \) = { {1} over {1 - z rSup { size 8{ - 1} } } } - { {1} over {1 - \( 1 - α \) z rSup { size 8{ - 1} } } } matrix { {} # {}} ital "for" matrix { {} # {}} \lline z \lline>1&\lline z \lline>\lline 1 - α \lline } {}

Because the ROC is outside a circle enclosing all the poles, the solution is

v o [ n ] = ( 1 ( 1 α ) n ) u [ n ] size 12{v rSub { size 8{o} } \[ n \] = \( 1 - \( 1 - α \) rSup { size 8{n} } \) u \[ n \]} {}

e/ Step response

CT and DT system step responses for α = T/RC, RC = 1,

v o ( t ) = ( 1 e t ) u ( t ) and v o [ n ] = ( 1 ( 1 α ) n ) u [ n ] size 12{v rSub { size 8{o} } \( t \) = \( 1 - e rSup { size 8{ - t} } \) u \( t \) matrix { {} # {}} ital "and" matrix { {} # {}} v rSub { size 8{o} } \[ n \] = \( 1 - \( 1 - α \) rSup { size 8{n} } \) u \[ n \]} {}

The DT solution is increasingly accurate as T is made smaller. Note that when

T>2, the DT solution diverges. Why?

f/ Natural frequencies of the CT and DT systems

The natural frequency of the CT system is s = −1/(RC) and the natural frequency of the DT system is z = 1− α = 1− T/(RC) .

g/ Relation of natural frequencies in s- and z-planes

The CT system has a natural frequency of s = −1/RC and the DT system for the forward Euler algorithm has the natural frequency z = 1− (T/RC) = 1+sT . Thus, the forward Euler algorithm maps the s-plane into the z-plane by the mapping z = 1+sT . The mapping is shown below.

s z 0 1 2 T 1 1 + jωT alignl { stack { size 12{s matrix {{} # {} } rightarrow matrix {{} # {} } z} {} #size 12{0 matrix { {} # {}} rightarrow matrix { {} # {}} 1} {} # size 12{ - { {2} over {T} } matrix {{} # {} } rightarrow matrix {{} # {} } - 1} {} #size 12{jω matrix { {} # {}} rightarrow matrix { {} # {}} 1+jωT} {} } } {}

The conclusion is that for s < 2 T size 12{"s "<{ { - 2} over {T} } } {} , z<−1 and the DT approximation to the CT system is unstable. Therefore, to extend the range of stability, decrease T.

3/ Backward Euler algorithm

The forward Euler algorithm is one of many possible approximations to the derivative. Another is called the backward Euler algorithm.

a/ Discretization

Define

v i [ n ] = v i ( t ) t = nT = v i ( nT ) and v o [ n ] = v o ( t ) t = nT = v o ( nT ) size 12{v rSub { size 8{i} } \[ n \] =v rSub { size 8{i} } \( t \) \lline rSub { size 8{t= ital "nT"} } =v rSub { size 8{i} } \( ital "nT" \) matrix {{} # {} } ital "and" matrix {{} # {} } v rSub { size 8{o} } \[ n \]=v rSub { size 8{o} } \( t \) \lline rSub { size 8{t= ital "nT"} } =v rSub { size 8{o} } \( ital "nT" \) } {}

and approximate the derivative by the backward Euler algorithm

dv o ( t ) dt t = nT v o ( nT ) v o ( ( n 1 ) T ) T size 12{ { { ital "dv" rSub { size 8{o} } \( t \) } over { ital "dt"} } \rline rSub { size 8{t= ital "nT"} } approx { {v rSub { size 8{o} } \( ital "nT" \) - v rSub { size 8{o} } \( \( n - 1 \) T \) } over {T} } } {}

b/ Difference equation and system function

Substituting the approximation for the derivative into the differential equation as before, we now obtain

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Signals and systems. OpenStax CNX. Jul 29, 2009 Download for free at http://cnx.org/content/col10803/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Signals and systems' conversation and receive update notifications?

Ask