Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
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 comentarios
Muhammad Zain Haider Ali
Muhammad Zain Haider Ali el 20 de Ag. de 2015
Abhiram, This is the SIMSCAPE language, which used to model physical systems.
Andreas
Andreas el 15 de Oct. de 2015
Could you share the working code?

Iniciar sesión para comentar.

Respuesta aceptada

Drew Davis
Drew Davis el 22 de Jun. de 2015
It appears you are missing equations for the "M1" and "M2" variables. See this example.

Más respuestas (0)

Categorías

Más información sobre Elements en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by