errors with musyn -- Plant must have at least <> inputs and <> outputs

9 views (last 30 days)
Jonathan Salfity
Jonathan Salfity on 28 Nov 2021
Commented: Paul on 30 Nov 2021
4 states, 1 input, 4 outputs.
Attempting to find a robust controller using musyn, but coming across this error message
```
Error using uss/musyn (line 74)
P must have at least 2 inputs and 5 outputs.
```
Code below:
% PLANT MODEL
g = ureal('g', 9.8, 'percentage', 80);
mcart = ureal('mcart', 1.0, 'percentage', 80);
mpole = ureal('mpole', 0.1, 'percentage', 80);
l = ureal('l', 2*0.5, 'percentage', 80);
M = mcart + mpole;
a = g /(l*(4.0/3 - mpole/(mpole+mcart)));
A = [0 1 0 0; 0 0 a 0; 0 0 0 1; 0 0 a 0];
b = -1/(l*(4.0/3 - mpole/(mpole+mcart)));
B = [0;1/mcart; 0; b];
C = [1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 1];
D = [0; 0; 0; 0];
% MAKE SS
P = ss(A, B, C, D);
P.StateName = {'cart pos (m)';'car vel (m/s)';...
'pole angle (\theta)';'pole angular vel (\theta/s)'};
P.InputName = {'force'};
P.OutputName = {'x'; 'xdot'; 'theta'; 'thetadot'};
% ROBUST ANALYSIS
nY = 4;
nU = 1;
[Krob, ~, gamma_inf] = musyn(P, nY, nU)

Answers (1)

Paul
Paul on 29 Nov 2021
The plant model has 4 outputs and 1 input. If you look at
doc musyn
you'll see that the second (nY) and third inputs (nU) are the number of measurements (y) from and control inputs (u) to the plant. But the plant has additional inputs (w) and outputs (z) that define the the closed loop transfer function for optimization. So the plant has to have at least 2 inputs and 5 outputs altogether, which is what the error message is saying.
Having said all that, are you sure musyn is the correct function to use? I'm asking because
a) the comment says "Robust Analysis" and musyn is used for robust design, and
b) the outputs from the call to musyn don't seem to match any of the signatures on doc page.
  4 Comments
Paul
Paul on 30 Nov 2021
I don't think you can get a state feedback solution, but it's been a long time since I did any mu synthesis stuff and so could very well be wrong.

Sign in to comment.

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!