How to create a LPV model from a given vector of operating points?
I have a 2 parameter LPV system that I wish to design a PID for it later and I also have the operating points so I don’t need to use the linearize function, as most examples do. I don’t understand well how the lpvss function works, how can I input my operating points vectors to it? How do I use it to create a system for each point?
Worst case scenario I think I can do it manually for each system, but it would be very nice if I can do it in a more efficient and compact way.
% Parameters
X_u = 0;
m = 5037.7;
V_ops = [20 22 24 26 28 30]* 1.852/3.6;
X_uu_ops = [33.5345 27.7066 23.6158 20.9720 19.3457 18.2671];
% Equilibrium points
operatingPoints = [V_ops; X_uu_ops];
x0 = operatingPoints(1,1);
X_uu = operatingPoints(2,1)
u0 = X_u*x0 + X_uu*x0^2 % Propeller thrust in N
% Linearize system around x0
A = -(X_u/m + 2*X_uu/m*x0)
B = 1/m;
C = 1;
D = 0;
% System order
n = size(A,1);
sys_ol = ss(A,B,C,D);
lpvsys = lpvss([‘v’ ‘X_uu’],@PlantLPV)
function [A,B,C,D,E,dx0,x0,u0,y0,Delays] = PlantLPV(~,v,X_uu)
X_u = 0;
m = 5037;
A = -(X_u/m + 2*X_uu/m*v);
B = 1/m;
C = 1;
D = 0;
E = [];
u0 = X_u*v + X_uu*v^2;
dx0 = [];
x0 = v;
y0 = v;
Delays = [];
endI have a 2 parameter LPV system that I wish to design a PID for it later and I also have the operating points so I don’t need to use the linearize function, as most examples do. I don’t understand well how the lpvss function works, how can I input my operating points vectors to it? How do I use it to create a system for each point?
Worst case scenario I think I can do it manually for each system, but it would be very nice if I can do it in a more efficient and compact way.
% Parameters
X_u = 0;
m = 5037.7;
V_ops = [20 22 24 26 28 30]* 1.852/3.6;
X_uu_ops = [33.5345 27.7066 23.6158 20.9720 19.3457 18.2671];
% Equilibrium points
operatingPoints = [V_ops; X_uu_ops];
x0 = operatingPoints(1,1);
X_uu = operatingPoints(2,1)
u0 = X_u*x0 + X_uu*x0^2 % Propeller thrust in N
% Linearize system around x0
A = -(X_u/m + 2*X_uu/m*x0)
B = 1/m;
C = 1;
D = 0;
% System order
n = size(A,1);
sys_ol = ss(A,B,C,D);
lpvsys = lpvss([‘v’ ‘X_uu’],@PlantLPV)
function [A,B,C,D,E,dx0,x0,u0,y0,Delays] = PlantLPV(~,v,X_uu)
X_u = 0;
m = 5037;
A = -(X_u/m + 2*X_uu/m*v);
B = 1/m;
C = 1;
D = 0;
E = [];
u0 = X_u*v + X_uu*v^2;
dx0 = [];
x0 = v;
y0 = v;
Delays = [];
end I have a 2 parameter LPV system that I wish to design a PID for it later and I also have the operating points so I don’t need to use the linearize function, as most examples do. I don’t understand well how the lpvss function works, how can I input my operating points vectors to it? How do I use it to create a system for each point?
Worst case scenario I think I can do it manually for each system, but it would be very nice if I can do it in a more efficient and compact way.
% Parameters
X_u = 0;
m = 5037.7;
V_ops = [20 22 24 26 28 30]* 1.852/3.6;
X_uu_ops = [33.5345 27.7066 23.6158 20.9720 19.3457 18.2671];
% Equilibrium points
operatingPoints = [V_ops; X_uu_ops];
x0 = operatingPoints(1,1);
X_uu = operatingPoints(2,1)
u0 = X_u*x0 + X_uu*x0^2 % Propeller thrust in N
% Linearize system around x0
A = -(X_u/m + 2*X_uu/m*x0)
B = 1/m;
C = 1;
D = 0;
% System order
n = size(A,1);
sys_ol = ss(A,B,C,D);
lpvsys = lpvss([‘v’ ‘X_uu’],@PlantLPV)
function [A,B,C,D,E,dx0,x0,u0,y0,Delays] = PlantLPV(~,v,X_uu)
X_u = 0;
m = 5037;
A = -(X_u/m + 2*X_uu/m*v);
B = 1/m;
C = 1;
D = 0;
E = [];
u0 = X_u*v + X_uu*v^2;
dx0 = [];
x0 = v;
y0 = v;
Delays = [];
end lpvss, gain scheduling MATLAB Answers — New Questions