Calculation of an Variable in Custom Simscape Component seems to be wrong

2 visualizaciones (últimos 30 días)
I'm testing a component of the Custom Simscape Library i currently develop.
There the following problem occurs: the value of the variable var_h_out does not match the value it should have when one take the values of T_e_out and T_e into account. However if I copy paste the corresponding equations and their parameters into a new component (see code below) and define T_e_out and T_e as inputs, var_h_out has the expected value. For T_e_out and T_e i used the values that the corresponding variables have in the original component. The value of var_h_s is correct in both cases.
Values:
T_e = 282.561 K
T_e_out = 282.582 K
var_h_s = 255.051 kJ/kg
right value of var_h_out = 404.118 kJ/kg
wrong value of var_h_out = 422 kJ/kg
What could be the reason for this error?
component Test
parameters
%saturated vapour specific enthalpy%%%%%%%%%%%%%%%%% h_s == bo * (b1 + b2*T_s - b3*T_s^2 - b4*T_s^3 + b0)
bo = {1, 'J/kg'};
b0 = {149048,'J/kg'};
b1 = {249455,'1'};
b2 = {606.163,'1/K'};
b3 = {1.05644,'1/K^2'};
b4 = {0.0182426,'1/K^3'};
%Superheated vapour specific enthalpy
%del_T == T - T_s%%%%%%%%%%%%%%%%%%%%%%%%%%% h_sh == h_s*(c1 + c2*del_T + c3*del_T^2 + c4*delt_T*T_s - c5*del_T^2 * T_s + c6*del_T*T_s^2 - c7*delT^2*T_s^2)
c1 = {1, '1'};
c2 = {0.00348186, '1/K'};
c3 = {1.6886e-06, '1/K^2'};
c4 = {9.2642e-6, '1/K^2'};
c5 = {7.698e-8, '1/K^3'};
c6 = {1.7070e-7, '1/K^3'};
c7 = {1.2130e-9, '1/K^4'};
parb0 = {149048, 'J/kg'};
par_Kelvin = {273.15, 'K'};
end
inputs
T_e = {0, 'K'};
T_e_out = {0, 'K'};
end
outputs
h_out = {0, 'kJ/kg'};
h_s = {0, 'kJ/kg'};
end
variables
var_h_out = {0, 'kJ/kg'};
var_h_s = {0, 'kJ/kg'};
var_T_e_out_K = {0, 'K'};
var_T_e_K = {0, 'K'};
end
equations
var_h_s == bo * (b1 + b2*(T_e - par_Kelvin) - b3*(T_e - par_Kelvin)^2 - b4*(T_e - par_Kelvin)^3);
var_T_e_out_K == T_e_out - par_Kelvin;
var_T_e_K == T_e - par_Kelvin;
var_h_out == var_h_s*(c1 + c2*(var_T_e_out_K - var_T_e_K) + c3*((var_T_e_out_K - var_T_e_K)^2) + c4*(var_T_e_out_K - var_T_e_K)*var_T_e_K - c5*((var_T_e_out_K - var_T_e_K)^2) * var_T_e_K + c6*(var_T_e_out_K - var_T_e_K)*(var_T_e_K^2) - c7*((var_T_e_out_K - var_T_e_K)^2)*var_T_e_K^2) + parb0;
h_out == var_h_out;
h_s == var_h_s;
end
end

Respuestas (1)

Juan Sagarduy
Juan Sagarduy el 26 de Oct. de 2020
Hello Moritz
It looks like Simscape might initialize the variables Te and Te_out with a given value that then leads a different enthalpy as the differential algebraic equation system is solved in your model.
By defining Te and Te out as inputs, you decouple them from the state space problem as you actually prescribe them into your block. With a technical support request to MathWorks, this could be solved I believe.
Regards / Juan

Categorías

Más información sobre Simscape 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