Why does transforming transfer matrix into complex vector transfer function lead to NaN ?
Mostrar comentarios más antiguos
Hi,
I am currently trying to transform my transfer matrix into compex vector form. The following picture shows how it is theoretically done.

My
is Z_2 and has quite a high order. So when I try to use eq. (F2) to get
Matlab returns Z_2_cmplx = NaN. Here is my code:
%% Calculation of Transfer Function
% Parameters
Lf_1 = 5.6e-3;
Rf_1 = 0.1;
Cf_1 = 1.61e-05;
L_1 = 1.46e-3 ;
R_1 = 0.053;
wn = 2*pi*50;
Kpc_1 = 35.839999999999996;
Kic_1 = 8.789333333333335e+02;
Kpv_1 = 0.027560488364344;
Kiv_1 = 12.664025834171640;
F_i = 0.9;
% Calculating Transfer Functions
s = tf('s');
Z_PIi = (Kpc_1 + Kic_1 * 1/s) ;
Z_CDi = (-wn*Lf_1) * [0 -1;1 0];
Z_inner = (Z_PIi + (s*Lf_1 + Rf_1))*[1 0;0 1] + (wn*Lf_1)*[0 -1;1 0] + Z_CDi;
Z_inner_inv = inv(Z_inner);
G_I = Z_PIi / Z_inner;
Z_PIv = 1/(G_I * ((Kpv_1 + Kiv_1 * 1/s) * [1 0;0 1]));
Z_PIv_inv = inv(Z_PIv); %Removes extra s
Z_CDv = -1/((wn*Cf_1*[0 -1;1 0])*G_I);
Z_CDv_inv = inv(Z_CDv);
Z_parallel_inv = Z_PIv_inv + Z_CDv_inv + [s*Cf_1 -wn*Cf_1;wn*Cf_1 s*Cf_1] + Z_inner_inv; %equal to Zinner//Zpar mentioned in the notes
Z_parallel = 1/Z_parallel_inv;
Z_1 = Z_parallel/Z_PIv;
Z_ov = [R_1, -wn*Lv_1;
wn*Lv_1, R_1];
Z_Fi = -Z_parallel / inv(G_I)*F_i;
%% Transformation into complex vector form
Z_2 = Z_parallel + Z_Fi + (Z_ov * Z_1);
Z_2_cmplx = (Z_2(1,1)+Z_2(2,2))/2 + 1i * (Z_2(2,1)+Z_2(1,2))/2 % This yields NaN :/
Can anyone please help me with this? I am really out of ideas on how to solve this issue.
Thanks a lot!!!!
Merve
2 comentarios
Paul
el 27 de Oct. de 2021
Can't run the code because, variable Lv_1 is undefined.
Also, the expression for Z_2_cmplx doesn't follow the equation in the picture. It should be
Z_2_cmplx = (Z_2(1,1)+Z_2(2,2))/2 + 1i * (Z_2(2,1) - Z_2(1,2))/2
Because Z_2_cmplx is supposed to be G_dq_plus (I think).
Merve Can
el 27 de Oct. de 2021
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre MATLAB en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

