Undefined function 'dksyn' for input arguments of type 'ss'. Error in Report8 (line 41) [k, cl, bnd] = dksyn ( G, 1, 1)

3 次查看(过去 30 天)
R1=2;R2=1;L1=2;L2=1;
C1= ureal('C1',1,'percent',20)
Uncertain real parameter "C1" with nominal value 1 and variability [-20,20]%.
A=[-R1/L1 0 -1/L1 ; 0 -R2/L2 1/L2 ;1/C1 -1/C1 0]
Uncertain matrix with 3 rows and 3 columns. The uncertainty consists of the following blocks: C1: Uncertain real, nominal = 1, variability = [-20,20]%, 1 occurrences Type "A.NominalValue" to see the nominal value and "A.Uncertainty" to interact with the uncertain elements.
B=[1/L1;0;0]
B = 3×1
0.5000 0 0
C=[0 R2 0 ]
C = 1×3
0 1 0
D=[0]
D = 0
P=ss(A,B,C,D)
Uncertain continuous-time state-space model with 1 outputs, 1 inputs, 3 states. The model uncertainty consists of the following blocks: C1: Uncertain real, nominal = 1, variability = [-20,20]%, 1 occurrences Type "P.NominalValue" to see the nominal value and "P.Uncertainty" to interact with the uncertain elements.
s = tf('s');
Wt=(s)/((s)+2)
Wt = s ----- s + 2 Continuous-time transfer function.
w1 = logspace(-10,3,100)
w1 = 1×100
1.0e+03 * 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
P_g = ufrd(P,w1)
Uncertain continuous-time FRD model with 1 outputs, 1 inputs, 100 frequency points. C1: Uncertain real, nominal = 1, variability = [-20,20]%, 1 occurrences Type "P_g.NominalValue" to see the nominal value and "P_g.Uncertainty" to interact with the uncertain elements.
Dm_g = (P_g - P_g.nominal)/P_g.nominal;
%% Gain plot
MS=2 ; WS=0.38
WS = 0.3800
Ws=(((s)/MS)+WS)/(s+(WS*.007))
Ws = s + 0.76 ------------- 2 s + 0.00532 Continuous-time transfer function.
Weps = 5e-4;
figure(1);
w=logspace(-2,3,20);
bodemag(Ws,Wt,'--',w);grid on
legend('Ws','Wt');
figure(2);
w2=logspace(-10,3,100);
bodemag(Dm_g,'--',Wt,'r-',w2);grid on;
legend('\Deltam','Wt');
%% Building of generalized plant
Pn = P.nominal;
systemnames = 'Pn Ws Wt ';
inputvar = '[w1; w2; u]';
outputvar = '[Ws; Wt; Pn]';
input_to_Pn = '[w1 - u]';
input_to_Ws = '[w1 - u]';
input_to_Wt = '[ u ]';
G = sysic;
whos G
Name Size Bytes Class Attributes G 3x3 2190 ss
[k, cl, bnd] = dksyn ( G, 1, 1)
Incorrect number or types of inputs or outputs for function dksyn.
bnd

采纳的回答

Paul
Paul 2024-1-2
According to the doc page dksyn, the first input to the dksyn has to be a uss model, not an ss model. Mabye G should be built using P, not P.Nominal? That's just a guess.
Also, I don't know what release your're using, but, as of 2021b. sysic and dksyn are both not recommended.
R1=2;R2=1;L1=2;L2=1;
C1= ureal('C1',1,'percent',20);
A=[-R1/L1 0 -1/L1 ; 0 -R2/L2 1/L2 ;1/C1 -1/C1 0];
B=[1/L1;0;0];
C=[0 R2 0 ];
D=[0];
D = 0;
P=ss(A,B,C,D);
s = tf('s');
Wt=(s)/((s)+2);
w1 = logspace(-10,3,100);
P_g = ufrd(P,w1);
Dm_g = (P_g - P_g.nominal)/P_g.nominal;
%% Gain plot
MS=2 ; WS=0.38;
WS = 0.3800;
Ws=(((s)/MS)+WS)/(s+(WS*.007));
Weps = 5e-4;
figure(1);
w=logspace(-2,3,20);
bodemag(Ws,Wt,'--',w);grid on
legend('Ws','Wt');
figure(2);
w2=logspace(-10,3,100);
bodemag(Dm_g,'--',Wt,'r-',w2);grid on;
legend('\Deltam','Wt');
%% Building of generalized plant
Pn = P.nominal;
systemnames = 'Pn Ws Wt ';
inputvar = '[w1; w2; u]';
outputvar = '[Ws; Wt; Pn]';
input_to_Pn = '[w1 - u]';
input_to_Ws = '[w1 - u]';
input_to_Wt = '[ u ]';
G = sysic;
whos G P Pn
Name Size Bytes Class Attributes G 3x3 2190 ss P 1x1 1708 uss Pn 1x1 1450 ss

更多回答(1 个)

Sam Chak
Sam Chak 2024-1-3
I'm unfamiliar with the MU controller. Perhaps you are referring to the μ synthesis technique used to determine the parameters in tunable components, such as PID controllers, state-space models, or even static gains that minimize a parameter called μ (mu) to ensure robust stability.
The code below uses a basic PID controller to improve tracking but does not minimize the μ parameter. If you have designed a robust controller according to μ synthesis, you can later compare its robust performance with the PID controller.
%% Parameters
R1 = 2;
R2 = 1;
L1 = 2;
L2 = 1;
C1 = ureal('C1', 1, 'percent', 20); % uncertain parameter
%% Uncompensated system
A = [-R1/L1 0 -1/L1; 0 -R2/L2 1/L2; 1/C1 -1/C1 0];
B = [1/L1; 0; 0];
C = [0 R2 0];
D = 0*C*B;
sys = ss(A, B, C, D); % Plant that contains parametric uncertainty
step(sys), grid on
title('Step Response of Uncompensated Plant')
%% PID controller (preliminary design)
kp = 1;
ki = 1.5;
kd = 1;
Gc = pid(kp, ki, kd)
Gc = 1 Kp + Ki * --- + Kd * s s with Kp = 1, Ki = 1.5, Kd = 1 Continuous-time PID controller in parallel form.
%% Uncertain closed-loop system
figure
subplot(211)
uGcl = feedback(Gc*sys, 1);
step(uGcl, 20), grid on
title('Step Plot: Reference tracking')
subplot(212)
uGcd = feedback(sys, Gc);
step(uGcd, 20), grid on
title('Step Plot: Disturbance Rejection')
%% Evaluate robust performance
figure
S = feedback(1, Gc*sys); % closed-loop sensitivity function
bodemag(S, S.NominalValue), grid on
opts = robOptions('Sensitivity', 'On');
[perfmarg, wcu, info] = robgain(S, 1.5, opts)
perfmarg = struct with fields:
LowerBound: 1.8960 UpperBound: 1.8999 CriticalFrequency: 0.7618
wcu = struct with fields:
C1: 1.3800
info = struct with fields:
Model: 1 Frequency: 0.7618 Bounds: [1.8960 1.8999] WorstPerturbation: [1×1 struct] Sensitivity: [1×1 struct]
info.Sensitivity
ans = struct with fields:
C1: 100
Smax = usubs(S, wcu);
getPeakGain(Smax, 1e-6)
ans = 1.5001
step(S.NominalValue, Smax), grid on
legend('Nominal', 'Peak Gain = 1.5')

类别

Help CenterFile Exchange 中查找有关 Robust Control Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by