Commit c199e80e authored by Kristian Soltesz's avatar Kristian Soltesz
Browse files

code clean

parent a4181b19
......@@ -61,6 +61,8 @@ K_p = @(p)[F(p)*C_pC(p);C(p)*F_pF(p)]; % dK/dp
% Frequency responses
Pw = fr(P); % Frequency response
K_pw = @(p)fr(K_p(p));
% Optimization
cfg = optimset('algorithm','active-set','GradConstr','on','GradObj',...
......@@ -102,10 +104,9 @@ K = minreal(K(p));
cEq = [];
% Gradients
K_pw = fr(K_p(p));
Sm_p = -mdot(Sm,real(mdot(Sw.*Pw,K_pw)));
Tm_p = mdot(Tm,real(mdot(Sw.^2.*Pw./Tw,K_pw)));
Qm_p = mdot(Sm./Km,real(mdot(conj(Kw).*Sw,K_pw)));
Sm_p = -mdot(Sm,real(mdot(Sw.*Pw,K_pw(p))));
Tm_p = mdot(Tm,real(mdot(Sw.^2.*Pw./Tw,K_pw(p))));
Qm_p = mdot(Sm./Km,real(mdot(conj(Kw).*Sw,K_pw(p))));
c_p = [Sm_p;Tm_p;Qm_p].';
cEq_p = [];
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment