Solution of algebraic equation that a variable occures both in numerator and denomirator with respect to an other variable

1 回表示 (過去 30 日間)
Hi eneryone , i have a fraction equation that a variable occures both in numerator and denominator ,the equation is
The variables A, n0 ,a1,a2,G,cp,Ta and Tin are supposed to be defined ,the problem is to find a value for m dot value such as lead the Tout variable in a desired value for any combination of other values,my problem is that m dot value affected by both Tout and Tin value when all the other values are fixed,how i can solve this problem and take a solution that for any value in variables A, n0 ,a1,a2,G,cp,Ta and Tin i will take a mdot value for my desired Tout value?
And how i can reverse the problem in order to find the Tout value for any m dot insert?
Thanks.
  1 件のコメント
Torsten
Torsten 2025 年 1 月 29 日
Multiply by cp*(Tout-Tin) and you will see that you have a quadratic equation in Tout if you want to prescribe mdot. The other direction is trivial because your relation is already solved for mdot (given a value for Tout).

サインインしてコメントする。

回答 (2 件)

sai charan sampara
sai charan sampara 2025 年 3 月 11 日
編集済み: sai charan sampara 2025 年 3 月 11 日
Hi,
The following code might help you:
%random values for defined variables
A=1;
n0=1;
a1=1;
a2=1;
G=1;
cp=1;
Ta=300;
Tin=350;
syms Tout mdot;
eq=(A*n0-a1*(((Tin+Tout)/2)-Ta)-(a2*G*G*((((Tin+Tout)/2)-Ta)/G)^2)-mdot*(cp*(Tout-Tin)))
eq = 
% for a given mdot find the value of Tout
eq1=subs(eq,mdot,1)%equation for Tout
eq1 = 
vpa(solve(eq1,Tout))%required Tout value
ans = 
% for a given Tout find the value of mdot
eq2=subs(eq,Tout,2)% equation for mdot
eq2 = 
vpa(solve(eq2,mdot))%required mdot value
ans = 
43.824712643678160919540229885057

Sam Chak
Sam Chak 2025 年 3 月 11 日
I would like to show graphically that the nonlinear equation is not strictly a quadratic equation. I also demonstrated two methods. The first method, using solve(), is exactly the same as the demonstration provided by @sai charan sampara. The second method involves finding the inverse function, as you originally inquired.
syms m T_o
%% parameters
A = 1;
n0 = 1;
a1 = 1;
a2 = 1;
G = 1;
cp = 1;
Ta = 300;
Tin = 350;
sympref('AbbreviateOutput', false);
%% the equation
eq = m == (A*n0 - a1*((Tin + T_o)/2 - Ta) - a2*G^2*(((Tin + T_o)/2 - Ta)/G)^2)/(cp*(T_o - Tin))
eq = 
%% use fplot to plot the equation over the interval [-5, 505]
fplot(rhs(eq), [-5, 505])
xlabel({'$T_{out}$'}, 'interpreter', 'latex')
ylabel({'$\dot{m}$'}, 'interpreter', 'latex')
title('Plot of the equation');
grid on;
%% find the inverse function
m_expr = solve(eq, m);
inverse_func = finverse(m_expr, T_o);
inverse_func = subs(inverse_func, T_o, m);
disp(inverse_func);
%% Method 1: Solve the nonlinear equation
m_value = 1;
Tout_value1 = solve(subs(eq, m, m_value), T_o);
disp(['When mdot = 1, Tout = ', char(vpa(Tout_value1))]);
When mdot = 1, Tout = [226.67759856709842472362822377051; 267.32240143290157527637177622949]
%% Method 2: Substitute mdot value into the inverse function
Tout_value2 = subs(inverse_func, m, m_value);
disp(['When mdot = 1, Tout = ', char(vpa(Tout_value2))]);
When mdot = 1, Tout = 267.32240143290157527637177622949

カテゴリ

Help Center および File ExchangeEmbedded Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by