Obatin s domain and transfer function from the data

9 次查看(过去 30 天)
I have two set of graph data
Frequency / phase , angle data - Freq_phase_angle.txt
Frequency / real , imaginary data - Freq_complex.txt
Could any one please help with procedure to obatin S-domain/ Transfer function from data(.txt) using system idenrtification tool in MATLAB?
To obtain this circuit. using cauer/foster method

采纳的回答

Star Strider
Star Strider 2021-12-9
Start with the idfrd function and go from there. The documentation explains everything.
Actually though, to analyse the circuit using the Foster-Cauer approach, plot the imaginary part of the complex frequency vector and go from there —
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/828710/Freq_complex.txt', 'VariableNamingRule','preserve')
T1 = 5479×2 table
Freq. V(i_s) ______ _______________________________________________ 100 {'5.25923694595431e-001,6.34606935959376e+000'} 100.23 {'5.26471741717689e-001,6.36067773821260e+000'} 100.46 {'5.27022310375074e-001,6.37531964864880e+000'} 100.69 {'5.27575412141180e-001,6.38999516719951e+000'} 100.93 {'5.28131058638060e-001,6.40470437033997e+000'} 101.16 {'5.28689261538566e-001,6.41944733471207e+000'} 101.39 {'5.29250032542678e-001,6.43422413714084e+000'} 101.62 {'5.29813383450318e-001,6.44903485459486e+000'} 101.86 {'5.30379326076855e-001,6.46387956423504e+000'} 102.09 {'5.30947872306298e-001,6.47875834338622e+000'} 102.33 {'5.31519034080622e-001,6.49367126954284e+000'} 102.57 {'5.32092823401404e-001,6.50861842036846e+000'} 102.8 {'5.32669252306374e-001,6.52359987370368e+000'} 103.04 {'5.33248332892240e-001,6.53861570756800e+000'} 103.28 {'5.33830077315765e-001,6.55366600013723e+000'} 103.51 {'5.34414497792562e-001,6.56875082976168e+000'}
T1{:,2} = cellfun(@(x)sscanf(x, '%f, %f'), T1{:,2}, 'Unif',0);
RI = cell2mat(table2cell(T1(:,2)).').';
RI = complex(RI(:,1),RI(:,2));
T2 = [T1(:,1) table(RI)];
T2.Properties.VariableNames = {'Freq','V(i_s)'}
T2 = 5479×2 table
Freq V(i_s) ______ _______________ 100 0.52592+6.3461i 100.23 0.52647+6.3607i 100.46 0.52702+6.3753i 100.69 0.52758+6.39i 100.93 0.52813+6.4047i 101.16 0.52869+6.4194i 101.39 0.52925+6.4342i 101.62 0.52981+6.449i 101.86 0.53038+6.4639i 102.09 0.53095+6.4788i 102.33 0.53152+6.4937i 102.57 0.53209+6.5086i 102.8 0.53267+6.5236i 103.04 0.53325+6.5386i 103.28 0.53383+6.5537i 103.51 0.53441+6.5688i
figure
semilogx(T2{:,1}, imag(T2{:,2}))
grid
There is one obvious pole, however there may be two others with real values far from the imaginary axis. There is a zero at the origin, and likely one at infinity.
.
  2 个评论
Venkatkumar M
Venkatkumar M 2021-12-13
@Star Strider Could you please let me know how to use vetcors in system identification tool to find the poles and zeros?
Star Strider
Star Strider 2021-12-13
Using Cauer-Foster is not difficult, however I choose not to do it for you, since the assignment wants you to do it.
I will instead demonstrate how to identify it using the System Identification Toolbox —
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/828710/Freq_complex.txt', 'VariableNamingRule','preserve')
T1 = 5479×2 table
Freq. V(i_s) ______ _______________________________________________ 100 {'5.25923694595431e-001,6.34606935959376e+000'} 100.23 {'5.26471741717689e-001,6.36067773821260e+000'} 100.46 {'5.27022310375074e-001,6.37531964864880e+000'} 100.69 {'5.27575412141180e-001,6.38999516719951e+000'} 100.93 {'5.28131058638060e-001,6.40470437033997e+000'} 101.16 {'5.28689261538566e-001,6.41944733471207e+000'} 101.39 {'5.29250032542678e-001,6.43422413714084e+000'} 101.62 {'5.29813383450318e-001,6.44903485459486e+000'} 101.86 {'5.30379326076855e-001,6.46387956423504e+000'} 102.09 {'5.30947872306298e-001,6.47875834338622e+000'} 102.33 {'5.31519034080622e-001,6.49367126954284e+000'} 102.57 {'5.32092823401404e-001,6.50861842036846e+000'} 102.8 {'5.32669252306374e-001,6.52359987370368e+000'} 103.04 {'5.33248332892240e-001,6.53861570756800e+000'} 103.28 {'5.33830077315765e-001,6.55366600013723e+000'} 103.51 {'5.34414497792562e-001,6.56875082976168e+000'}
T1{:,2} = cellfun(@(x)sscanf(x, '%f, %f'), T1{:,2}, 'Unif',0);
RI = cell2mat(table2cell(T1(:,2)).').';
RI = complex(RI(:,1),RI(:,2));
T2 = [T1(:,1) table(RI)];
T2.Properties.VariableNames = {'Freq','V(i_s)'}
T2 = 5479×2 table
Freq V(i_s) ______ _______________ 100 0.52592+6.3461i 100.23 0.52647+6.3607i 100.46 0.52702+6.3753i 100.69 0.52758+6.39i 100.93 0.52813+6.4047i 101.16 0.52869+6.4194i 101.39 0.52925+6.4342i 101.62 0.52981+6.449i 101.86 0.53038+6.4639i 102.09 0.53095+6.4788i 102.33 0.53152+6.4937i 102.57 0.53209+6.5086i 102.8 0.53267+6.5236i 103.04 0.53325+6.5386i 103.28 0.53383+6.5537i 103.51 0.53441+6.5688i
figure
semilogx(T2{:,1}, imag(T2{:,2}))
grid
frd = idfrd(T2{:,2}, T2{:,1}, 1/(2*T2{end,1}))
frd = IDFRD model. Contains Frequency Response Data for 1 output(s) and 1 input(s). Response data is available at 5479 frequency points, ranging from 100 rad/s to 3e+07 rad/s. Sample time: 1.6667e-08 seconds Status: Created by direct construction or transformation. Not estimated.
sys_tf = tfest(frd, 4, 4) % Poles: 4, Zeros: 4
sys_tf = 24.81 s^4 + 5.406e08 s^3 + 6.957e13 s^2 + 5.884e17 s + 2.879e19 --------------------------------------------------------------- s^4 + 1.295e05 s^3 + 4.636e10 s^2 + 2.381e15 s + 1.011e19 Continuous-time identified transfer function. Parameterization: Number of poles: 4 Number of zeros: 4 Number of free coefficients: 9 Use "tfdata", "getpvec", "getcov" for parameters and their uncertainties. Status: Estimated using TFEST on frequency response data "frd". Fit to estimation data: 98.7% FPE: 459.9, MSE: 458.4
poles = pole(sys_tf)
poles =
1.0e+05 * -0.3661 + 2.0164i -0.3661 - 2.0164i -0.5160 + 0.0000i -0.0467 + 0.0000i
zeros = zero(sys_tf)
zeros = 4×1
1.0e+07 * -2.1663 -0.0120 -0.0009 -0.0000
figure
pzmap(sys_tf)
figure
pzmap(sys_tf)
axis([-100000 1000 -500 500]) % Detail Near Origin
sys_ss = ss(sys_tf)
sys_ss = A = x1 x2 x3 x4 x1 -1.295e+05 -1.769e+05 -6.929e+04 -1.796e+04 x2 2.621e+05 0 0 0 x3 0 1.311e+05 0 0 x4 0 0 1.638e+04 0 B = u1 x1 3.277e+04 x2 0 x3 0 x4 0 C = x1 x2 x3 x4 y1 1.64e+04 7965 470.1 -12.04 D = u1 y1 24.81 Continuous-time state-space model.
figure
compare(frd,sys_ss)
grid
There is a constant phase difference from the original spectrum of about 360° (by observation, not calculation), and the approsimation appears to be good. I cannot determine where the output is taken from that network (assuming it is a two-port), so I assume it is simply a one-port with 4 obvious poles and 4 obvious zeros. The Cauer-Foster synthesis requires the transfer function, and this identification provides it.
Since that is the point of the assignment, I leave that to you. It would be easier to do it symbolically using polynomial division, the other option being to use the deconv function to get a numeric polynomial continued-fraction decomposition of the transfer function.
.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Circuit Envelope Simulation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by