Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
(EOD).Mechatronics.pdf
Скачиваний:
81
Добавлен:
23.08.2013
Размер:
5.07 Mб
Скачать

page 38

5. DISCRETE SYSTEMS

When dealing with computers we will sample data values from the real world. These sampled values can then be used to estimate how a system will behave.

The term ‘discrete’ refers to the use of single sampled values, instead of a continuous functions. You will see that the difference is between weighted sums and integrals.

5.1 DISCRETE SYSTEM MODELLING WITH EQUATIONS

• We can write a differential equation, and then manipulate it to put in terms of time steps of length ‘T’

sampled

values

T - Sample Period

• In review consider how we can approximate derivatives using two/three points on a line.

page 39

y( t)

 

 

yi + 1

 

 

yi

 

 

yi – 1

 

 

ti – 1

T

T

 

ti

ti + 1

 

 

ti

y

( t ) ≈

 

 

yi + yi – 1

( t

 

t

 

 

) =

T

( y

 

 

+ y

 

 

)

 

 

 

 

 

 

 

 

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

 

2

 

 

i

 

 

--

i

i – 1

 

 

 

 

 

 

ti – 1

i

 

 

 

 

 

 

 

 

 

 

 

 

i – 1

 

 

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

d

 

 

 

yi yi – 1

=

 

 

yi + 1

yi

 

=

1

 

( y

 

y

 

) =

1

( y

 

y )

 

----y( t ) ≈

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

 

t

 

 

 

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

 

 

 

 

t

 

 

--

i

 

--

i + 1

 

dt

i

 

t

i

i – 1

 

 

 

t

i + 1

 

 

 

T

 

 

 

 

i – 1

 

T

 

i

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

i

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

( y

 

 

y )

 

1

( y

 

y

 

)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

d

2

 

 

 

--

 

 

 

T--

 

 

 

 

 

yi + 1 + yi – 1 – 2yi

 

( t )

 

T

 

i + 1

i

 

 

 

 

 

 

i

 

 

i – 1

=

 

 

----

y

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

 

 

 

 

 

 

 

T

 

 

 

 

 

 

 

 

 

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

 

 

 

 

 

2

 

 

 

 

dt

 

i

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

T

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

• Consider the example,

If we read the flow rate of oil in a pipeline once every hour for three hours. The readings in order are 1003, 1007, 1010. What is the integral and first and second derivatives for the values?

page 40

5.1.1 Getting a Discrete Equation

• First, consider the example of a simple differential equation,

d

y( t) = Kx( t)

 

d

----

say

dt

----A = V

 

 

 

dt

 

 

 

 

We can solve the differential equation at time T, assuming that the slope is constant and known,

y( T) = T

 

Kx( t) dt = 0

Kx( t) dt + T Kx( t) dt = y0 + T Kx( t) dt

 

–∞

–∞

0

0

 

Now we can assume that the velocity ‘x(t)’ is constant,

 

 

 

 

 

 

 

 

y( T) = y

 

+ K( x ) T

 

 

for this particular differential

y = x0t

0

 

 

equation we can assume

 

0

 

 

 

 

 

 

 

 

 

 

 

The equation above is developed for a time T after zero. We can manipulate it so that it will be valid for any point in time,

ASIDE: The approximations above can y( T) = y0 + K( x0) T be shown using a slope approxi-

mated with two points on a curve.

yn = yn – 1 + K( xn – 1) T

yn yn – 1 = K( xn – 1) T

• We can continue the example and use this equation to simulate the system. Here the ‘x’ values are given, and the first ‘y’ value is assumed to be 0. Assume T=0.5 and K=0.2.

page 41

i

xi

yi

0.2(xi)0.5

 

 

 

 

0

0

0

0

1

0

0

0

2

1

0.1

0.1

3

1

0.2

0.1

4

1

0.3

0.1

5

1

0.4

0.1

6

1

0.5

0.1

7

1

0.6

0.1

8

0

0.7

0

9

0

0.7

0

10

0

0.7

0

11

0

0.7

0

12

0

0.7

0

13

0

0.7

0

.....

.....

.....

.....

 

 

 

 

• Find the discrete equation for the differential equation below. Then find values over time.

d

1

----v =

----F

dt

M

• We can expand this model by also including a ‘disturbance’. This can be used to model random

Соседние файлы в предмете Электротехника