Вы находитесь на странице: 1из 3

1.

Given

2. Solutions

2.1. Part (a)

() = () = (0) + (1) 1 + (2) 2 + (3) 3 + (4) 4 +


=0

According to the problem statement, (1) = 1 (0) = (2) = (3) = (4) = 0, thus

() = () = 0 + 1 + 0 + 0 + 0 +
=0

() = 1

Then solving the difference Eqn. (1) using the z-transformation,

2 () 2 (0) (1) 1.5[() (0)] + 0.56() = ()

, (0) = (1) = 0 , !

1 1 1
() = 2
= 2
=
1.5 + 0.56 ( 1.5 + 0.56) ( 0.8)( 0.7)
Applying partial fractions and solving for constants, A, B and C as follows:

1
() = = + +
( 0.8)( 0.7) ( 0.8) ( 0.7)

1 = ( 0.8)( 0.7) + ( 0.7) + ( 0.8)

1 = ( 2 1.5 + 0.56) + ( 2 0.7) + ( 2 0.8)

,
2, ++ = 0
1 , 1.5 + 0.7 + 0.8 = 0
0
, 0.56 = 1 = 1/0.56

,
0.7 1
= =
0.056 0.08
0.8 1
= =
0.056 0.07

1 1 1
0.56 0.08 0.07 1 1 1
() = + = 1 ( + )
0.8 0.7 0.56 0.08 0.8 0.07 0.7

0, =0
() = { 1 1 1
( 1) + (0.8)1 (0.7)1 , = 1, 2,
0.56 0.08 0.07

, (0) = (1) = 0 (0) = 1.


Then () becomes

0, = 0, 1
() = {
10((0.8)2 (0.7)2 ), = 2, 3

2
2.2. Part (b)

close all; clc


%Homework 1, Part b: Matlab code, by James Kabugo
%%Part a: Using the analytical solution.
k=[2:1:10];
xa=10*(0.8.^(k-2)-0.7.^(k-2));
disp(xa)
% xa(k) values obtained
% 0 1.0000 1.5000 1.6900 1.6950 1.5961 1.4450 1.2736 1.1012

% Part b: Solving the difference equation from


% the given initial conditions

xb(1)=0; xb(2)=0;
for k=3:1:11
if k==4, e=1;
else e=0;
end
xb(k)=1.5*xb(k-1)-0.56*xb(k-2)+e;
end
disp(xb)

% xb(k) values obtained


% 0 0 0 1.0000 1.5000 1.6900 1.6950 1.5961 1.4449 1.2736 1.1012

Remark: Both methods provide similar values of ().

Вам также может понравиться