matlab optimal control plotting
Show older comments
hi, i did my code
just i need to ( Plot the time history of control gain for 30 sec) can any one help me ?
my code is :
tspan=[0,30];% time span
u=0.175; %maximum it can be 10 degree
%K is control gain
A=[-1.397,1,0,0;-5.47,-3.27,0,0;0,1,0,0;-400,0,400,0];
B=[-0.124;-13.2;0;0];
Q=[1,0,0,0
0,1,0,0
0,0,1,0
0,0,0,1];%Weighting are consider same on the states
R=2;% weighting on inputs
N=[1;1;1;1];
[K,S,e] = lqr(A,B,Q,R,N);
%K is the optimal gain
Answers (0)
Categories
Find more on Classical Control Design in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!