add the magnitude ratio and the phase angles data points on bode diagram

15 visualizaciones (últimos 30 días)
I plotted a bode diagram and wanted to add some magnitude ratio and phase angle to it , however it seems I can not get it right so please help with that .
w=[0.2 0.3 0.4 0.5 0.6 0.7 ];% frequency
mag=[61.1250012 55.9468284 53.92586737 52.3231432 51.3640345 50.0399108];% Magnitude Ratio
ph=[83.964 355.2663 156.7372 1166.141 1434.389 1432.116]; % phase angle (degree)
nz=0; np=1; %
zfr= mag.*exp(1j*ph);
data=frd(zfr,w);
Gc=tfest(data,np,nz);
Gc

Respuestas (1)

Star Strider
Star Strider el 26 de En. de 2023
I am not certain what you want for the result.
The fit is not the best, however the compare function will plot the data and the estimated transfer function together in one plot —
w=[0.2 0.3 0.4 0.5 0.6 0.7 ];% frequency
mag=[61.1250012 55.9468284 53.92586737 52.3231432 51.3640345 50.0399108];% Magnitude Ratio
ph=[83.964 355.2663 156.7372 1166.141 1434.389 1432.116]; % phase angle (degree)
nz=0; np=1; %
zfr= mag.*exp(1j*ph);
data=frd(zfr,w);
Gc=tfest(data,np,nz);
Gc
Gc = -6.131 ---------- s + 0.2454 Continuous-time identified transfer function. Parameterization: Number of poles: 1 Number of zeros: 0 Number of free coefficients: 2 Use "tfdata", "getpvec", "getcov" for parameters and their uncertainties. Status: Estimated using TFEST on frequency response data "data". Fit to estimation data: 1.695% FPE: 5525, MSE: 2762
figure
compare(data, Gc)
grid
.
  8 comentarios
Hassen Mohamed Yousif Abdelatif
Hassen Mohamed Yousif Abdelatif el 27 de En. de 2023
@Star Strider this one is so much better. However, I'm required to keep np=1 and nz=0 , so do not know how i will get higher accuracy .
Star Strider
Star Strider el 27 de En. de 2023
Thank you!
I did not realise that constraining the numbers of poles and zeros was a requirement. In that event, the only way to get more accuracy is to gather more data.
If that is also not an option, then this is the best you can do —
w=[0.2 0.3 0.4 0.5 0.6 0.7 ];% frequency
mag=[61.1250012 55.9468284 53.92586737 52.3231432 51.3640345 50.0399108];% Magnitude Ratio
ph=[83.964 355.2663 156.7372 1166.141 1434.389 1432.116]; % phase angle (degree)
nz=0; np=1; %
zfr= db2mag(mag).*exp(1j*deg2rad(ph));
data=frd(zfr,w);
Gc=tfest(data,np,nz);
Gc
Gc = -137.4 ----------- s - 0.05004 Continuous-time identified transfer function. Parameterization: Number of poles: 1 Number of zeros: 0 Number of free coefficients: 2 Use "tfdata", "getpvec", "getcov" for parameters and their uncertainties. Status: Estimated using TFEST on frequency response data "data". Fit to estimation data: 9.975% FPE: 4.719e+05, MSE: 2.359e+05
figure
compare(data, Gc)
grid
At the very least, now the ‘mag’ and ‘ph’ units are compatible with the frd requirements. That may be the best that can be done with these data.
.

Iniciar sesión para comentar.

Categorías

Más información sobre Get Started with Control System Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by