Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

PDCA

MATLAB FUNTIONS
Differential equation. Linear system constant
parameters

FERNANDO NAVARRO

Introduction
In this article we study a response of linear system when changing the coefficients. We
observe if coefficients change we obtain a new output response.
We studding output for impulse, step and ramp inputs.
The function to study is:
Y(k)=0.4y(k-1)+x(k-1)
initial coefficients are:
A=[1 -0.4] ; B=[0 1]

Development in Matlab
a = [1 -0.4]; // coefficients
b = [0 1]; // coefficients
X = [zeros(1,200) ones(1,800)]; // input Step
init = filtic(b,a,4); // function filtic
subplot(2,1,2); plot(1:1000,y,'bo'); // Output
subplot(2,1,1); plot(1:1000,X,'ro'); // Input
For change input we varying the variable X.
For change coefficients we varying the variable a or b.

Examples
STEP INPUT
B = [0 6]; A = [1 -0.4]

A=[1 -0.4]; B=[0 1]

0.5

0.5

200

400

600

800

1000

10

200

400

600

800

1000

200

400

600

800

1000

2
1.5

1
0.5

200

400

600

800

1000

We observer if coefficient B up, it obtain output with more gain.

A=[1 3]; B=[0 1]

A=[1 3]; B=[0 1]

0.5

0.5

2.9526

0
x 10

200

400

600

800

1000

307

2.9526

0
x 10

200

400

600

800

1000

200

400

600

800

1000

307

-2.9526

-2.9526

-8.8579

-8.8579

200

400

600

800

1000

We observer if varying coefficient A the response are unstable.

B=[0 -2 ]; A=[1 -0.4];


1

0.5

200

400

600

800

1000

200

400

600

800

1000

2
0
-2
-4

We Observer if coefficient A change signed the response is stable but inverter.

Ramp input
A=[1 -0.4]; B=[0 1]

A=[1 -0.4]; B=[0 3]

2000

2000

1500

1500

1000

1000

500

500

100

200

300

400

500

600

700

800

900

1000

100

200

300

400

500

600

700

800

900

1000

100

200

300

400

500

600

700

800

900

1000

10000

4000

8000

3000

6000

2000

4000

1000
0

2000
0

100

200

300

400

500

600

700

800

900

1000

If change the coefficient the result is the same a input step. We obtain more gain in output

A=[1 2]; B=[0 3]

B = [0 -1]; A = [1 -0.4];

2000

2000

1500

1500

1000

1000

500

500

100

200

300

400

500

600

700

800

900

1000

100

200

300

400

500

600

700

800

900

1000

100

200

300

400

500

600

700

800

900

1000

301

10

x 10

1000
0

-1000
-2000

-3000
-5

100

200

300

400

500

600

700

800

900

1000

-4000

In left, we observe if change the coefficient A obtain a unstable response. In right, we observe
if change signed of coefficient A the response is inverted but stable.

Conclusions
Matlab is a powerful tool.
If we change the coefficient A, we will obtain a unstable response.

You might also like