0% found this document useful (0 votes)
69 views4 pages

PEN Exogenous

This document contains MATLAB code defining matrices A, B, C, and G. It calculates Ac by subtracting B multiplied by G from A, and then calculates Bnum and G0 by multiplying various combinations of the inverse and transpose of Ac, B, C, and the vector E. The code is run twice with different values for G. It also contains a function definition for ipend that calculates the derivative of a 2D system based on x1, x2, and input u.

Uploaded by

hanytheking
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views4 pages

PEN Exogenous

This document contains MATLAB code defining matrices A, B, C, and G. It calculates Ac by subtracting B multiplied by G from A, and then calculates Bnum and G0 by multiplying various combinations of the inverse and transpose of Ac, B, C, and the vector E. The code is run twice with different values for G. It also contains a function definition for ipend that calculates the derivative of a 2D system based on x1, x2, and input u.

Uploaded by

hanytheking
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

PEN

Que 6
A=[0 1;12 -4];
B=[0;1];
C=[1 0];
G=[64 8];
Ac=A-B*G
Bnum=inv(C*inv(Ac)*B)*C*inv(Ac)
E=[0;6];
G0=Bnum*E
A=[0 1;12 -4];
B=[0;1];
C=[1 0];
G=[92 14];
Ac=A-B*G
Bnum=inv(C*inv(Ac)*B)*C*inv(Ac)
E=[0;6];
G0=Bnum*E

function dx = ipend(u,x)
%#codegen
dx1=x(2);
dx2=12*sin(x(1))-4*x(2)+u;
dx = [dx1;dx2];
A=[0 1;-12 -4];
B=[0;1];
C=[1 0];
G=[40 8];
Ac=A-B*G
Bnum=inv(C*inv(Ac)*B)*C*inv(Ac)
E=[0;6];
G0=Bnum*E
A=[0 1;-12 -4];
B=[0;1];
C=[1 0];
G=[68 14];
Ac=A-B*G
Bnum=inv(C*inv(Ac)*B)*C*inv(Ac)
E=[0;6];
G0=Bnum*E

You might also like