Fitting Impedance data file to parallel RLC circuit model using fmincon

조회 수: 27 (최근 30일)
Hello
I am trying to fit an impedance data file from simuation to a parallel equivalent RLC circuit model. attached is files needed to run the fmincon optimaztion command.
Please any help will be appreciated.
  댓글 수: 5
Abdullah Qaroot
Abdullah Qaroot 2021년 12월 3일
The data are complete. you have the admittance data vs. frequency over the band from 5.6 GHz upto 6 GHz.
you can check the attached Y_adm.mat file. these are the measured/sim data. we don't have the measurments over a band statring from DC!!
again we are interested in finding the equivalent circuit model over the frequency band 5.6 GHz to 6 GHz.
Star Strider
Star Strider 2021년 12월 3일
The parameter estimation or optimisation will not work with incomplete data.
I will leave you to explore this at your leisure.
Good luck, and have fun!

댓글을 달려면 로그인하십시오.

채택된 답변

Mathieu NOE
Mathieu NOE 2021년 12월 3일
hello
my attempt below - with just fminsearch (as I don't have the Optimisation Toolbox)
I refined a bit the IC by manual serach , not even sure it was needed. ...
clear all
clc
load('Y_adm.mat')
figure(1)
freq = freq*1e9; % must be GHz
Zp = 1./Yp1(:); % measured
R0 = 100;
L0 = 35e-012;
C0 = 1/(L0*(2*pi*5.85e9)^2);
x = [R0 C0 L0]; %from ADS
Zth = 1./((1./x(1)) + (1i.*2.*pi.*freq.*x(2)) - (1i./(2.*pi.*freq.*x(3))));
semilogy(freq,abs(Zp),'b',freq,abs(Zth),'r')
grid on
% curve fit using fminsearch
x = freq;
y = abs(Zp);
f = @(a,b,c,x) abs(1./((1./a) + (1i.*2.*pi.*freq.*b) - (1i./(2.*pi.*freq.*c))));
obj_fun = @(params) norm(f(params(1), params(2), params(3),x)-y);
sol = fminsearch(obj_fun, [R0,C0,L0]);
a_sol = sol(1);
b_sol = sol(2);
c_sol = sol(3);
y_fit = f(a_sol, b_sol,c_sol, x);
Rsquared = my_Rsquared_coeff(y,y_fit); % correlation coefficient
figure(2)
plot(x, y_fit, '-',x,y, 'r .', 'MarkerSize', 20)
legend('fit','data');
title(['Gaussian Fit / R² = ' num2str(Rsquared) ], 'FontSize', 15)
ylabel('Z', 'FontSize', 14)
xlabel('freq (GHz)', 'FontSize', 14)
R = a_sol
C = b_sol
L = c_sol
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function Rsquared = my_Rsquared_coeff(data,data_fit)
% R2 correlation coefficient computation
% The total sum of squares
sum_of_squares = sum((data-mean(data)).^2);
% The sum of squares of residuals, also called the residual sum of squares:
sum_of_squares_of_residuals = sum((data-data_fit).^2);
% definition of the coefficient of correlation is
Rsquared = 1 - sum_of_squares_of_residuals/sum_of_squares;
end
  댓글 수: 8
Abdullah Qaroot
Abdullah Qaroot 2021년 12월 13일
Hi Mathiue
changing to the phses has an impact please check the attached code. the phase shift should be progressive in dx. in our example here since phi = 0 the phase shift in dy = 0.
Mathieu NOE
Mathieu NOE 2021년 12월 13일
hello again
ok, I can see the result
but I am a bit lost by the fact that you have some many degrees of freedom (AB_amplitudes, AB_phase, dx, dy,...) and your only target is to get a directivity plot centered at 30°
seems like an overdetermined system to me...

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by