Error: No. of variables exceed no. of equations (how to count variables)

조회 수: 4 (최근 30일)
Here is my code for a counterflow water/water heat exchanger based on LMTD method.
The error which I am receiving is that no. of variables are exceeding the no. of equations. But I can't think of any equation which I missed as it is a very simple model. Can someone take a look at it and suggest any equation which I have missed.
________________________________________________
component counterflow_HX
% Heat Exchanger
% Ideal Counter flow heat exchanger based on LMTD method
nodes
A1 = foundation.thermal_liquid.thermal_liquid; % A1:left
B1 = foundation.thermal_liquid.thermal_liquid; % B1:left
B2 = foundation.thermal_liquid.thermal_liquid; % B2:right
A2 = foundation.thermal_liquid.thermal_liquid; % A2:right
end
parameters
Cp = { 4.2, 'J/g/K'}; % Specific heat
UA = { 0.34, 'J/s/K'}; % Product of heat transfer coefficient & area
end
variables
M1 = { 0.09, 'kg/s' }; % hot side mass flow
M2 = { 0.275, 'kg/s' }; % cold side mass flow
Phi1 = { 0, 'J/s' }; % hot side duty
Phi2 = { 0, 'J/s' }; % cold side duty
end
branches
M1 : A1.mdot -> B1.mdot;
M2 : A2.mdot -> B2.mdot;
Phi1: A1.Phi -> B1.Phi;
Phi2: A2.Phi -> B2.Phi;
end
equations
let
p_A1 = A1.p;
T_A1 = A1.T;
p_A2 = A2.p;
T_A2 = A2.T;
p_B1 = B1.p;
T_B1 = B1.T;
p_B2 = B2.p;
T_B2 = B2.T;
LMTD = ((T_A1 - T_B2) - (T_A2 - T_B1))/ (log ((T_A1 - T_B2) / (T_A2 - T_B1)));
in
Phi1 == M1 * Cp * (T_A1 - T_B1)
Phi2 == M2 * Cp * (T_A2 - T_B2)
Phi1 == Phi2
p_A1 == p_B1
p_A2 == p_B2
Phi1 == UA * LMTD
end
end
end
---------------------------------------------------------------
  댓글 수: 3
Muhammad Zain Haider Ali
Muhammad Zain Haider Ali 2015년 8월 20일
Abhiram, This is the SIMSCAPE language, which used to model physical systems.
Andreas
Andreas 2015년 10월 15일
Could you share the working code?

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

채택된 답변

Drew Davis
Drew Davis 2015년 6월 22일
It appears you are missing equations for the "M1" and "M2" variables. See this example.

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by