Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

neutron_power<>

1.8
1.6
1.4

Neutron power

1.2
1
0.8
0.6
0.4
0.2
0

10
time

12

14

16

18

20

plant states
500

400

x1,x2,x3,x4,x5

300

200

100

-100

10
time

12

14

16

18

20

input of plant
0.2

plant & kalman input

-0.2

-0.4

-0.6

-0.8

-1

-1.2

10
time

12

14

16

18

20

noise
0.7

0.6

w(k)
v(k)

w(k) & v(k)

0.5

0.4

0.3

0.2

0.1

10
time

12

14

16

18

20

Matlab code
clear all
clc
format long
A=[-60.19 60.19 0.324 1.065 10000;.15 -.15 0 0 0;87.452 0 -.251 .1255
0;2.7855 0 .251 -4 0;0 0 0 0 0];
B=[0;0;0;0;.01450];
C=[1 0 0 0 0];
D=[0];
sys=ss(A,B,C,D);
pole(sys)
sysd = c2d(sys,.1)
pole(sysd)
zero(sysd)
a=[.01379 1.031 .00582 .01341 173.3;.002569 .9977 6.971e-5 .0001903
2.108;1.486 7.318 1.016 .1207 1224;.06093 .2702 .02191 .6745 45.17;0 0 0 0
1];
b=[.2051;.001316;.7651;.02708;.00145];
c=[1 0 0 0 0]
d=[0;0]
pole(sys);
O=[C;C*A;C*A*A;C*A*A*A;C*A*A*A*A];
rank(O);

r1=.1
r2=0.01
[kalmf,Kf,P] = kalman(sysd,r1,r2);
g=[1 0 0 0 0;0 1 0 0 0;0 0 1 0 0;0 0 0 1 0;0 0 0 0 1];
R=3000;
Q=[1 0 0 0 0;0 1 0 0 0;0 0 .01 0 0;0 0 0 .1 0;0 0 0 0
1];[M,P,Z,E]=dlqe(a,g,c,Q,R);
L=M

%LQR controller
N=0
[Kc S E]=dlqr(a,b,Q,R,N);
Kc
Kf

4.5

x 10

unit step response

3.5

%Neutron power

2.5

1.5

0.5

10

time sec

12

14

16

18

20

lqr with plant model


160

140

120

%Neutron power

100

80

60

40

20

-20

10

time sec

35336458

12

14

16

18

20

You might also like