Finding Transfer Function from System of 3 Equations with 4 Unknowns

6 次查看(过去 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 个)

Avni Agrawal
Avni Agrawal 2025-4-1
编辑:Avni Agrawal 2025-4-2
Hi August,
To determine the transfer function ( \frac{T}{X} ) from the given system of equations, we need to express ( T ) in terms of ( X ) while eliminating the other variables, ( E1 ) and ( E2 ). Below are the steps to accomplish this using symbolic computation in MATLAB:
  1. Substitute and Rearrange Equations: Begin by using the provided 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), resulting in an expression for ( T ) solely in terms of ( X ).
  3. Derive the Transfer Function: Rearrange the resulting expression to obtain the transfer function ( \frac{T}{X} ).
Below is the MATLAB code that executes 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 symbolically solves the equations, substitutes the solutions back, and expresses ( T ) in terms of ( X ). The result is a rational function of ( s ), representing the desired transfer function ( \frac{T}{X} ). The simplify function is used to ensure the transfer function is in its simplest form, and the pretty function displays it in a readable format.
To evaluate the transfer function numerically, please assign appropriate numerical values to all constants: ( m, k_1, k_2, k_3, c_1, I_1, r_1) and ( r_2 ).
I hope this helps!

类别

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