Matlab Transfer function multiple single s terms

조회 수: 3 (최근 30일)
Aaron Frost
Aaron Frost 2023년 2월 20일
댓글: Paul 2023년 2월 22일
How can modify this script in order to get the transfer function shown in the picutre. Thanks.
C1 = 0.000000000150;
C2 = 0.000000000470;
R1 = 10000;
R2 = 180000;
R3 = 2700;
R4 = 56000;
A = 1/(C1*R2);
B = 1/(C2*R2);
C = (1/(C1*R1))*(1-G);
D = 1/(C1*C2*R1*R2);
G = (R3+R4)/R3;
%{
Numerator = {[G 0 0] };
Denominator = {[1 0] [A] [B] [C] [0 D]};
T = tf(Numerator, Denominator)
%}
T = tf([G 0 0], {[1] [A] [B] [C] [0 D]})

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 2월 20일
Here it is:
C1 = 0.000000000150;
C2 = 0.000000000470;
R1 = 10000;
R2 = 180000;
R3 = 2700;
R4 = 56000;
G = (R3+R4)/R3;
A = 1/(C1*R2);
B = 1/(C2*R2);
C = (1/(C1*R1))*(1-G);
D = 1/(C1*C2*R1*R2);
%{
Numerator = {[G 0 0] };
Denominator = {[1 0] [A] [B] [C] [0 D]};
T = tf(Numerator, Denominator)
%}
T = tf([G 0 0], [1 (A+B+C) -D])
T = 21.74 s^2 -------------------------- s^2 - 1.378e07 s - 7.88e09 Continuous-time transfer function.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2023년 2월 20일
syms G C_1 R_2 C_2 R_1 s R_3 R_4
G = (R_3 + R_4)/R_3
G = 
vratio = G*s^2/ ( s^2 + s * (1/(C_1*R_2) + 1/(C_2*R_2) + 1/(C_1*R_1)*(1-G)) + 1/(C_1*C_2*R_1*R_2) )
vratio = 
vex = expand(vratio);
[N, D] = numden(vex)
N = 
D = 
Nc = collect(N, s);
Dc = collect(D, s);
vpretty = Nc/Dc
vpretty = 
NCs = coeffs(Nc, s, 'all')
NCs = 
DCs = coeffs(Dc, s, 'all')
DCs = 
C1 = 0.000000000150;
C2 = 0.000000000470;
R1 = 10000;
R2 = 180000;
R3 = 2700;
R4 = 56000;
NC = double(subs(NCs, [C_1, C_2, R_1, R_2, R_3, R_4], [C1, C2, R1, R2, R3, R4]));
DC = double(subs(DCs, [C_1, C_2, R_1, R_2, R_3, R_4], [C1, C2, R1, R2, R3, R4]));
leading = DC(1);
NC = NC ./ leading;
DC = DC ./ leading;
sys = tf(NC, DC)
sys = 21.74 s^2 -------------------------- s^2 - 1.378e07 s + 7.88e09 Continuous-time transfer function.
  댓글 수: 2
Walter Roberson
Walter Roberson 2023년 2월 21일
Note that the reason to solve symbolically is to construct a general form that multiple sets of resister and capacitor values could be substituted into. After calculating NCs and DCs you could use matlabFunction() to create functions that would accept numeric inputs and calculate the coefficients.
Paul
Paul 2023년 2월 22일
But the CST can handle this directly without too much complication, even if the desire is to have a general expression
s = tf('s');
G = @(R_3,R_4) ((R_3 + R_4)/R_3);
vratio = @(C_1,C_2,R_1,R_2,R_3,R_4) G(R_3,R_4)*s^2/ ( s^2 + s * (1/(C_1*R_2) + 1/(C_2*R_2) + 1/(C_1*R_1)*(1-G(R_3,R_4))) + 1/(C_1*C_2*R_1*R_2) );
C1 = 0.000000000150;
C2 = 0.000000000470;
R1 = 10000;
R2 = 180000;
R3 = 2700;
R4 = 56000;
vratio(C1,C2,R1,R2,R3,R4)
ans = 21.74 s^2 -------------------------- s^2 - 1.378e07 s + 7.88e09 Continuous-time transfer function.
Unrelated comment, but I have my suspicions about the expression for vratio in the question. I thought that circuits composed of just (positive) resistors and (positive) capacitors can't be unstable, whereas vratio clearly is.

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

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by