creating a transfer function from a determinant
5 次查看(过去 30 天)
显示 更早的评论
Hey Guys,
So I'm trying to create a transfer function in matlab using the determinants and state space equations via linear algebra. The thing is I can manually pull the coefficients out of the results and plug them into the tf command, but I have to fiddle with the input numbers to get the desired result, so I'd rather not have to manually plug that in every time. Any suggestions?
syms s
m = 5;
k = 10;
b = 50;
m_c = 0.1*m;
k_c = k;
b_c = b;
R_wc = 10;
T_c = 10;
H = (b_c*R_wc)/(b_c*R_wc+T_c^2);
V_1 = det([-(H*T_c^2-b)/R_wc -k -H*T_c^2/(m_c*R_wc) -H*k_c*T_c^2/(b_c*R_wc); ...
1 s 0 0; ...
-H*T_c^2/R_wc 0 s-H*T_c^2/(m_c*R_wc) -H*k_c*T_c^2/(b_c*R_wc); ...
-H*T_c^2/(b_c*R_wc) 0 -H*T_c^2/(m_c*b_c*R_wc) s-(k_c*H*T_c^2-H*R_wc)/(b_c^2*R_wc)]);
V_2 = det([H*T_c/R_wc -k -H*T_c^2/(m_c*R_wc) -H*k_c*T_c^2/(b_c*R_wc); ...
0 s 0 0; ...
H*T_c/R_wc 0 s-H*T_c^2/(m_c*R_wc) -H*k_c*T_c^2/(b_c*R_wc); ...
H*T_c/(b_c*R_wc) 0 -H*T_c^2/(m_c*b_c*R_wc) s-(k_c*H*T_c^2-H*R_wc)/(b_c^2*R_wc)]);
den = det([s-(H*T_c^2-b*R_wc)/(m*R_wc) -k -H*T_c^2/(m_c*R_wc) -H*k_c*T_c^2/(b_c*R_wc); ...
1/m s 0 0; ...
-H*T_c^2/(m*R_wc) 0 s-H*T_c^2/(m_c*R_wc) -H*k_c*T_c^2/(b_c*R_wc); ...
-H*T_c^2/(m*b_c*R_wc) 0 -H*T_c^2/(m_c*b_c*R_wc) s-(k_c*H*T_c^2-H*R_wc)/(b_c^2*R_wc)]);
G_vel = vpa(V_1/den,10)
G_vel_tf = tf([4.257211935 242.9349118 271.8731897 0.07907120546],[-1.0 19.8925608 269.8083056 54.43899276 0.01581424109]);
0 个评论
采纳的回答
David Wilson
2019-12-2
How about:
[num,den] = numden(G_vel)
G_vel_tf = tf(sym2poly(num), sym2poly(den))
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Financial Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!