You are on page 1of 4

# 3RA PRACTICA CALIFICADA: SISTEMAS NO LINEALES

## DENMARK ABANTO PEZO 1

3RA PRACTICA CALIFICADA: SISTEMAS NO LINEALES

% Linealizacion en matlab
clear all; close all; clc
%% Variables simbolicas
syms h1 h2 h q1 k u v Ar As g Q H H1 H2;

## DENMARK ABANTO PEZO 2

3RA PRACTICA CALIFICADA: SISTEMAS NO LINEALES

H1=1/Ar*(Q-k*(sqrt(h1-h2)));
H2=1/Ar*(k*(sqrt(h1-h2)-sqrt(h2)));

H=[H1 H2];
h=[h1 h2]; u=[Q]; % w=u, h=v

## %% Calculo de Jacobianos de manera simbolica

As=subs(jacobian(H,h))
Bs=subs(jacobian(H,u))
% B=vpa(subs(Bs,1),4)
%% Dando valores a parmetros del sistema linealizado
A=vpa(subs(As,[k Ar h1 h2],[4.4272 10 0.4077 0.2039]),4)
B=subs(Bs,1)
C=[1 1]
D=0
% Matrices obtenidas
A=[-0.4903 0.4903; 0.4903 -0.9806];
B=[1 0]';
C=[1 0];
D=0;
[num,den]=ss2tf(A,B,C,D);
G=tf(num,den)
step(G)

EJECUTANDO EL PROGRAMA

As =

## [ k/(2*Ar*(h1 - h2)^(1/2)), -(k*(1/(2*h2^(1/2)) + 1/(2*(h1 - h2)^(1/2))))/Ar]

Bs =

1/Ar

A=

[ -0.4903, 0.4903]

[ 0.4903, -0.9806]

B=

## DENMARK ABANTO PEZO 3

3RA PRACTICA CALIFICADA: SISTEMAS NO LINEALES

C=

1 1

D=

Transfer function:

s + 0.9806

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

## s^2 + 1.471 s + 0.2404

Step Response
4.5

3.5

2.5
Amplitude

1.5

0.5

0
0 5 10 15 20 25 30 35 40
Time (sec)