Is there a way to determine an equivalent circuit for Nyquist diagrams (I have the data set) using Matlab (or Simulink)?
이전 댓글 표시
I am working on gathering some Nyquist diagrams experimentally and facing some difficulties on simulating equivalent circuits for my data. What I have done so far is simply trying to come up with an idea of an equivalent circuit and seen if it fits the case. Well this is obscure and it is not always representative of what has been going on. So is it possible to use Matlab to construct/simulate equivalent circuits from experimental data?
채택된 답변
추가 답변 (3개)
Hi @Arthur FdA
I'm unfamiliar with your circuit system. However, if you have the data in the form of frequency-response, then you can apply the frd() and nyquistplot() commands
data = [
0.0010 1.562e+01-1.9904i
0.0018 1.560e+01-2.0947i
0.0034 1.513e+01-3.3670i
0.0062 1.373e+01-5.4306i
0.0113 1.047e+01-7.5227i
0.0207 5.829e+00-7.6529i
0.0379 2.340e+00-5.6271i
0.0695 7.765e-01-3.4188i
0.1274 2.394e-01-1.9295i
0.2336 7.216e-02-1.0648i
0.4281 2.157e-02-0.5834i
0.7848 6.433e-03-0.3188i
1.4384 1.916e-03-0.1740i
2.6367 5.705e-04-0.0950i
4.8329 1.698e-04-0.0518i
8.8587 5.055e-05-0.0283i
16.2378 1.505e-05-0.0154i
29.7635 4.478e-06-0.0084i
54.5559 1.333e-06-0.0046i
100.0000 3.967e-07-0.0025i
];
freq = data(:,1);
resp = data(:,2);
sys = frd(resp, freq);
figure
np = nyquistplot(sys); grid on
figure
bd = bodeplot(sys); grid on, grid minor
William Rose
2024년 10월 4일
1 개 추천
Yes you can. The experimental data needed for Nyquist and Bode plots is the same: a set of magnitudes and phases, or (equivalently) real and imaginary parts, at a set of frequencies, f. The Bode plot shows the frequencies on the plot. The frequencies are not explicit on the Nyquist plot, but I assume you have the frequencies in your experimental data.
You make a guess, based on experience and the appearance of th Bode plot or Nyquist plot, of the circuit type (high pass, low pass, etc) and number of components. Then you compute the expected theoretical frequency response
, which will be a complex function involving the values of R. C, L, etc. in your circuit. Then you compare it to the measured frequency response,
, which is also complex, and which you have measured in your experiment at a set of frequencies. Then you adjust the values of R, C, L, etc., in order to minimize the error between
and
. The error is the sum of the squared distances in the complex plane between
and
at the measured frequencies. You can use Matlab's fmincon() to find the values of the unknown parameters (R, L, C,...) that minimize the error.
If the system is a filter, where the input and output have the same units (typically volts), then you have no informatopn about the overal circuit impedance because you don;t know what current is flowing. Then there may be many equivalent solutions that give the same frequency response. If this is true, then there is no unique solution forr the component values. So you fix one of the component values (for example, you specify that you want impedance Z=100 Ω at DC, which fixes one of the R values in the circuit). Then you solve for the other unknown parameters.
If your best-fit model response does not look like the experimental data, then try a different theoretical circuit.
댓글 수: 1
Here is an example of what I meant in my answer above.
Files simulatedFilterResponse{0,1,2}.txt contains Nyquist plot data from three simulated experiments. Each file has 3 columns: frequency (rad/s), real part of Gmeas, imaginary part of Gmeas, where Gmeas is the measured frequency response. The measurement noise has relative amplitude 0, 1, 2 on files 0, 1, 2 respectively.
The main script, fitFreqResponse.m, minimizes the error between a model and the data, by adjusting the values of R, L, and C for a second order filter circuit. After finding the best-fit values, the script displays the best-fit values, and plots the measured and best-fit transfer functions. The script calls external function sumsqerr(p,w,Gmeas), where p=[R;L;C] are the adjustable parameters, w is the vector of frequencies, and Gmeas is the experimental data: a complex vector of measured frequency responses. Function sumsqerr() calculates the model transfer function and the sum squared error betwen the model and the measured data.
If your experimental data does not look like a second order lowpass filter, then adjust the line Gmodel=..., in function file sumsqerr1.m. Also change the line Gfit=... in the main script, so that Gfit and Gmodel match. (Gfit is used to plot the best-fit transfer function after the best fit circuit component values have been found.)
The simulated Nyquist plot data is from the circuit below, with R=100 Ω, L=0.1125 H, C=22.51
.

When I estimate R, L, C from the noise-free Nyquist plot data (simulatedFilterResponse0.txt), I get exactly correct estimates for R, L, C. When I edit the main script so that it reads a file of noisy Nyquist plot data (simulatedFilterResponse1.txt), the estimated R, L, C values are not quite the same. See below.
fitFreqResponse
Arthur
2024년 10월 7일
0 개 추천
댓글 수: 2
Star Strider
2024년 10월 7일
It would be helpful to have your actual data. The best option is time-domain data, however if all you have is frequency-domain data, that could also work.
With time-domain data we can simulate time-domain and frequency-domain results, however with only frequency-domain data, we can only simulate frequency-domain results.
Arthur
2024년 10월 8일
카테고리
도움말 센터 및 File Exchange에서 Simscape Electrical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!







