Finding Transfer Function from System of 3 Equations with 4 Unknowns

5 次查看(过去 30 天)
How would one find the transfer function T/X given the following equations?
syms X T E1 E2 s m k1 k2 k3 c1 I1 r1 r2
Eqn1 = m*s^2*X + k3*r2*E2 + X*k3 + k2*X + k2*r1*E1 + c1*s*X;
Eqn2 = I1*s^2*E1 - T - k1*r1*r2*E2 + k1*r1^2*E1 + k2*r1*X + k2*r1^2*E1;
Eqn3 = r2^2*k3*E2 + k3*r2*X + k1*r2^2*E2 - k1*r1*r2*E1;
(Does the * mean multiply or matrix multiply? I want to multiply these values.)
m, k1, k2, k3, c1, I1, r1, and r2 are all constants. The final answer should be: (some variables) / ()s^3+()s^2+ ...
All equations equal 0, I am just confused finding the end function. I can get to a certain point but then I get the error stating "Solutions are only valid under certain conditions. To include parameters and conditions in the solution, specify the 'ReturnConditions' value as 'true'."
Thank you for the help!

回答(1 个)

Umang Pandey
Umang Pandey 2024-11-7,4:48
编辑:Umang Pandey 2024-11-7,4:49
Hi August,
To find the transfer function ( T/X ) from the given system of equations, we need to express ( T ) in terms of ( X ) and eliminate the other variables ( E1 ) and ( E2 ). Here are the steps to achieve this using symbolic computation in MATLAB:
  1. Substitute and Rearrange Equations: Use the given equations to express ( E1 ) and ( E2 ) in terms of ( X ) and ( T ).
  2. Solve the System: Solve the system of equations to eliminate ( E1 ) and ( E2 ), leaving an expression for ( T ) in terms of ( X ).
  3. Derive the Transfer Function: Rearrange the expression to get the transfer function ( T/X ).
Here is the MATLAB code that performs these steps:
syms X T E1 E2 s m k1 k2 k3 c1 I1 r1 r2
% Define the equations
Eqn1 = m*s^2*X + k3*r2*E2 + X*k3 + k2*X + k2*r1*E1 + c1*s*X == 0;
Eqn2 = I1*s^2*E1 - T - k1*r1*r2*E2 + k1*r1^2*E1 + k2*r1*X + k2*r1^2*E1 == 0;
Eqn3 = r2^2*k3*E2 + k3*r2*X + k1*r2^2*E2 - k1*r1*r2*E1 == 0;
% Solve Eqn3 for E2
E2_sol = solve(Eqn3, E2);
% Substitute E2 in Eqn1 and Eqn2
Eqn1_sub = subs(Eqn1, E2, E2_sol);
Eqn2_sub = subs(Eqn2, E2, E2_sol);
% Solve Eqn2_sub for E1
E1_sol = solve(Eqn2_sub, E1);
% Substitute E1 in Eqn1_sub
Eqn1_final = subs(Eqn1_sub, E1, E1_sol);
% Solve for T in terms of X
T_sol = solve(Eqn1_final, T);
% Express T/X as a transfer function
TransferFunction = simplify(T_sol / X);
% Display the transfer function
disp('The transfer function T/X is:');
pretty(TransferFunction)
This code will symbolically solve the equations, substitute the solutions back, and express ( T ) in terms of ( X ). The result will be a rational function of ( s ), which is the desired transfer function ( T/X ). The "simplify" function is used to ensure the transfer function is in its simplest form. The "pretty" function is used to display the result in a readable format.
Please ensure that all the constants ( m, k1, k2, k3, c1, I1, r1, ) and ( r2 ) are assigned appropriate numerical values if you want to evaluate the transfer function numerically
Best,
Umang

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by