//==================================================================
// Code generated automatically
// Description: Partition class body 
//==================================================================
#ifndef EP__EPsystem_default_CPP
#define EP__EPsystem_default_CPP

#include <EP.+e+psystem.default.h>

EP__EPsystem_default* EP__EPsystem_default::s_current= NULL;

extern "C" 
{
#if SIMULA_PLATFORM == 1
#if SIMULA_COMPILER == 1 /// COMPILER: MSVC
void SIMULA_FORTRAN_FCN1(READ_LABEL,read_label)(char* path, unsigned int _pathLength);
#elif SIMULA_COMPILER == 2 /// COMPILER: GCC-MINGW
void SIMULA_FORTRAN_FCN1(READ_LABEL,read_label)(char* path, unsigned int _pathLength);
#else
  #error Configuration SIMULA_COMPILER badly defined
#endif
#elif SIMULA_PLATFORM == 2 /// PLATFORM: LINUX
void SIMULA_FORTRAN_FCN1(READ_LABEL,read_label)(char* path, unsigned int _pathLength);
#else
  #error Configuration SIMULA_PLATFORM badly defined
#endif
}
void __WR__read_label(std::string path)
{     // Wrapper for the FORTRAN function
unsigned int _len1 = path.size();
char* _pstr1 = (char*)path.c_str();
#if SIMULA_PLATFORM == 1
#if SIMULA_COMPILER == 1 /// COMPILER: MSVC
SIMULA_FORTRAN_CALL1(READ_LABEL,read_label)(_pstr1, _len1 );
#elif SIMULA_COMPILER == 2 /// COMPILER: GCC-MINGW
SIMULA_FORTRAN_CALL1(READ_LABEL,read_label)(_pstr1, _len1 );
#else
  #error Configuration SIMULA_COMPILER badly defined
#endif
#elif SIMULA_PLATFORM == 2 /// PLATFORM: LINUX
SIMULA_FORTRAN_CALL1(READ_LABEL,read_label)(_pstr1, _len1 );
#else
  #error Configuration SIMULA_PLATFORM badly defined
#endif
}

extern "C" 
{
#if SIMULA_PLATFORM == 1
#if SIMULA_COMPILER == 1 /// COMPILER: MSVC
void SIMULA_FORTRAN_FCN1(READ_CEA,read_cea)(int *n , char* path, unsigned int _pathLength , double *MW , int *ier);
#elif SIMULA_COMPILER == 2 /// COMPILER: GCC-MINGW
void SIMULA_FORTRAN_FCN1(READ_CEA,read_cea)(int *n , char* path , double *MW , int *ier, unsigned int _pathLength);
#else
  #error Configuration SIMULA_COMPILER badly defined
#endif
#elif SIMULA_PLATFORM == 2 /// PLATFORM: LINUX
void SIMULA_FORTRAN_FCN1(READ_CEA,read_cea)(int *n , char* path , double *MW , int *ier, unsigned int _pathLength);
#else
  #error Configuration SIMULA_PLATFORM badly defined
#endif
}
void __WR__read_cea(int n , std::string path , double *MW , int *ier)
{     // Wrapper for the FORTRAN function
unsigned int _len1 = path.size();
char* _pstr1 = (char*)path.c_str();
#if SIMULA_PLATFORM == 1
#if SIMULA_COMPILER == 1 /// COMPILER: MSVC
SIMULA_FORTRAN_CALL1(READ_CEA,read_cea)(&n , _pstr1, _len1 , MW , ier );
#elif SIMULA_COMPILER == 2 /// COMPILER: GCC-MINGW
SIMULA_FORTRAN_CALL1(READ_CEA,read_cea)(&n , _pstr1 , MW , ier, _len1 );
#else
  #error Configuration SIMULA_COMPILER badly defined
#endif
#elif SIMULA_PLATFORM == 2 /// PLATFORM: LINUX
SIMULA_FORTRAN_CALL1(READ_CEA,read_cea)(&n , _pstr1 , MW , ier, _len1 );
#else
  #error Configuration SIMULA_PLATFORM badly defined
#endif
}

extern "C" void SIMULA_FORTRAN_FCN1(CP_CEA,cp_cea)(int *ind , double *Tk , double *cp , int *ier);
void __WR__cp_cea(int ind , double Tk , double *cp , int *ier)
{     // Wrapper for the FORTRAN function
SIMULA_FORTRAN_CALL1(CP_CEA,cp_cea)(&ind , &Tk , cp , ier );
}

extern "C" void SIMULA_FORTRAN_FCN1(H_CEA,h_cea)(int *ind , double *Tk , double *h , int *ier);
void __WR__h_cea(int ind , double Tk , double *h , int *ier)
{     // Wrapper for the FORTRAN function
SIMULA_FORTRAN_CALL1(H_CEA,h_cea)(&ind , &Tk , h , ier );
}

extern "C" void SIMULA_FORTRAN_FCN1(S_CEA,s_cea)(int *ind , double *Tk , double *s , int *ier);
void __WR__s_cea(int ind , double Tk , double *s , int *ier)
{     // Wrapper for the FORTRAN function
SIMULA_FORTRAN_CALL1(S_CEA,s_cea)(&ind , &Tk , s , ier );
}

extern "C" void SIMULA_FORTRAN_FCN1(TRANS_CEA,trans_cea)(int *n , int *ind , double *y , double *Tk , double *cond , double *visc , int *ier);
void __WR__trans_cea(int n , int *ind , double *y , double Tk , double *cond , double *visc , int *ier)
{     // Wrapper for the FORTRAN function
SIMULA_FORTRAN_CALL1(TRANS_CEA,trans_cea)(&n , ind , y , &Tk , cond , visc , ier );
}

extern "C" 
{
#if SIMULA_PLATFORM == 1
#if SIMULA_COMPILER == 1 /// COMPILER: MSVC
void SIMULA_FORTRAN_FCN1(TABLE_READ,table_read)(int *ig , char* path, unsigned int _pathLength , char* FluidKeys, unsigned int _FluidKeysLength , int *ind , int *ier);
#elif SIMULA_COMPILER == 2 /// COMPILER: GCC-MINGW
void SIMULA_FORTRAN_FCN1(TABLE_READ,table_read)(int *ig , char* path , char* FluidKeys , int *ind , int *ier, unsigned int _pathLength, unsigned int _FluidKeysLength);
#else
  #error Configuration SIMULA_COMPILER badly defined
#endif
#elif SIMULA_PLATFORM == 2 /// PLATFORM: LINUX
void SIMULA_FORTRAN_FCN1(TABLE_READ,table_read)(int *ig , char* path , char* FluidKeys , int *ind , int *ier, unsigned int _pathLength, unsigned int _FluidKeysLength);
#else
  #error Configuration SIMULA_PLATFORM badly defined
#endif
}
void __WR__table_read(int ig , std::string path , std::string FluidKeys , int ind , int *ier)
{     // Wrapper for the FORTRAN function
unsigned int _len1 = path.size();
char* _pstr1 = (char*)path.c_str();
unsigned int _len2 = FluidKeys.size();
char* _pstr2 = (char*)FluidKeys.c_str();
#if SIMULA_PLATFORM == 1
#if SIMULA_COMPILER == 1 /// COMPILER: MSVC
SIMULA_FORTRAN_CALL1(TABLE_READ,table_read)(&ig , _pstr1, _len1 , _pstr2, _len2 , &ind , ier );
#elif SIMULA_COMPILER == 2 /// COMPILER: GCC-MINGW
SIMULA_FORTRAN_CALL1(TABLE_READ,table_read)(&ig , _pstr1 , _pstr2 , &ind , ier, _len1, _len2 );
#else
  #error Configuration SIMULA_COMPILER badly defined
#endif
#elif SIMULA_PLATFORM == 2 /// PLATFORM: LINUX
SIMULA_FORTRAN_CALL1(TABLE_READ,table_read)(&ig , _pstr1 , _pstr2 , &ind , ier, _len1, _len2 );
#else
  #error Configuration SIMULA_PLATFORM badly defined
#endif
}

extern "C" void SIMULA_FORTRAN_FCN1(THERMO_PROP,thermo_prop)(int *ig , int *j1 , double *v1 , int *j2 , double *v2 , int *iwant , double *prop , double *x , int *ier , int *nor , int *jt , int *jp);
void __WR__thermo_prop(int ig , int j1 , double v1 , int j2 , double v2 , int iwant , double *prop , double *x , int *ier , int nor , int *jt , int *jp)
{     // Wrapper for the FORTRAN function
SIMULA_FORTRAN_CALL1(THERMO_PROP,thermo_prop)(&ig , &j1 , &v1 , &j2 , &v2 , &iwant , prop , x , ier , &nor , jt , jp );
}

extern "C" double SIMULA_FORTRAN_FCN1(PSAT_VS_T,psat_vs_t)(int *ig , double *t , int *n_or , int *iprp , int *ier);
double __WR__psat_vs_t(int ig , double t , int n_or , int *iprp , int *ier)
{     // Wrapper for the FORTRAN function
double  ___vret= SIMULA_FORTRAN_CALL1(PSAT_VS_T,psat_vs_t)(&ig , &t , &n_or , iprp , ier );
return ___vret;
}

extern "C" double SIMULA_FORTRAN_FCN1(TSAT_VS_P,tsat_vs_p)(int *ig , double *p , int *n_or , double *r_l , double *r_g , double *h_l , double *h_g , int *iprp , int *ier);
double __WR__tsat_vs_p(int ig , double p , int n_or , double *r_l , double *r_g , double *h_l , double *h_g , int *iprp , int *ier)
{     // Wrapper for the FORTRAN function
double  ___vret= SIMULA_FORTRAN_CALL1(TSAT_VS_P,tsat_vs_p)(&ig , &p , &n_or , r_l , r_g , h_l , h_g , iprp , ier );
return ___vret;
}

extern "C" void SIMULA_FORTRAN_FCN1(EQ_NL_SOLVER,eq_nl_solver)(int *ILAST , int *IOPT , int *N , double *X , double *FVEC , double *FJAC , double *tol , int *INFO , double *DUM , int *LDUM , int *IDUM , double *EPSFCN);
void __WR__eq_nl_solver(int *ILAST , int IOPT , int N , double *X , double *FVEC , double *FJAC , double tol , int *INFO , double *DUM , int LDUM , int *IDUM , double EPSFCN)
{     // Wrapper for the FORTRAN function
SIMULA_FORTRAN_CALL1(EQ_NL_SOLVER,eq_nl_solver)(ILAST , &IOPT , &N , X , FVEC , FJAC , &tol , INFO , DUM , &LDUM , IDUM , &EPSFCN );
}

extern "C" void SIMULA_FORTRAN_FCN1(CRIT_COND,crit_cond)(int *ig , double *prop , int *ier);
void __WR__crit_cond(int ig , double *prop , int *ier)
{     // Wrapper for the FORTRAN function
SIMULA_FORTRAN_CALL1(CRIT_COND,crit_cond)(&ig , prop , ier );
}

EP__EPsystem_default::EP__EPsystem_default(const char *mgr,const char *dirInstall,bool dmode):INTEG_simula(mgr,dirInstall,dmode)
{
m_infoLibraryName = "EP";
m_infoComponentName = "EPsystem";
m_infoPartitionName = "default";
m_infoModelName = "EP__EPsystem_default";
m_infoModelFileName = "EP.+e+psystem.default";
m_infoModelFileNameExtra = "+e+psystem.default";
m_perfFlag = false;
m_infoComponentDate = "17/01/2014 11:41:03.806000";
m_infoPartitionDate = "01/08/2014 09:59:15.843000";
m_programVersion= "EcosimPro V5.2.0";
m_libsVersion= "CONTROL V3.2 ELECTRICAL V3.1.1 EP V3.0 FLUID_FLOW_1D V3.0 FLUID_PROPERTIES V3.0 MATH V3.1.1 PORTS_LIB V1.1 ";

m_solveInternalBox= new int[3]; 
int nbx;
for (nbx=0; nbx < 3 ; nbx++)
	m_solveInternalBox[nbx]= 0;

m_boundaryBranch= new int[2];
int ib;
for (ib=0; ib < 2 ; ib++)
	m_boundaryBranch[ib]= 0;

m_branchZone= new int[27]; 
int nibr;
for (nibr=0; nibr < 27 ; nibr++)
	m_branchZone[nibr]= -1;

m_branchIf= new int[3]; 
int nif;
for (nif=0; nif < 3 ; nif++)
	m_branchIf[nif]= -1;

static const char * elmstr0[] = { "end_I", "end_PI", NULL } ;
static int elmind0[] = { 1, 2 } ;
static const char * elmstr1[] = { "Source_Constant", "Source_Sine", "Source_Pulse", "Source_Step", "Source_SawTooth", "Source_Square", "Source_Ramp", "Source_Table", NULL } ;
static int elmind1[] = { 1, 2, 3, 4, 5, 6, 7, 8 } ;
static const char * elmstr2[] = { "LinearInterpWithEvents", "LinearInterpWithoutEvents", "SplineInterp", "StepConnect", NULL } ;
static int elmind2[] = { 1, 2, 3, 4 } ;
static const char * elmstr3[] = { "Power_Off", "StandBy", "Configuration", "Remote", "Automatic", "Venting", NULL } ;
static int elmind3[] = { 1, 2, 3, 4, 5, 6 } ;
static const char * elmstr4[] = { "None", "TCStandBy", "TCConfiguration", "TCRemote", "TCAutomatic", "TCVenting", "TCrequestTm", "TCIdSet", "TCImagnet", "TCIheater", "TCIthermthrottle", "TCVaccel", "TCValvesOn", "TCValvesOff", "TCHeaterOn", "TCHeaterOff", 
		"TCMagnetOn", "TCMagnetOff", "TCLoopOn", "TCLoopOff", "TCIgnitorOn", NULL } ;
static int elmind4[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 
		17, 18, 19, 20, 21 } ;
static const char * elmstr5[] = { "TMthermistance", "TMId", "TMVd", "TMItt", "TMMode", NULL } ;
static int elmind5[] = { 1, 2, 3, 4, 5 } ;
static const char * elmstr6[] = { "Fail_PPU_power150pc", "Fail_PPU_PROM_checksum", "Fail_Anode_current_TM_not_available", "Fail_Max_Swirl_Torque", "Fail_Wrong_Swirl_Orientation", "Fail_XeLeakage_1", "Fail_XeLeakage_2", "NoFail", NULL } ;
static int elmind6[] = { 1, 2, 3, 4, 5, 6, 7, 8 } ;
static const char * elmstr7[] = { "UserDefined", "AlternateModel", "PPS1350", "T6", "EsaXX", NULL } ;
static int elmind7[] = { 1, 2, 3, 4, 5 } ;
static int elmind8[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 
		17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 
		33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 
		49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 
		65, 66, 67, 68 } ;
static const char * elmstr9[] = { "H2", "O2", "H2O", "H", "O", "OH", "H2SO4", "SO2", "SO", "N2", "NO", "CO", "CO2", "NH3", "NO2", "N2O", 
		"H2O2", "HO2", "HNO", "HNO2", "COOH", "HCO", "HCOOH", "Ar", "CH4", "C3H6", "C_gr", "MMH", "N2O4", "HCN", "C2H4", "C2H6", 
		"Jet_A", "HCHO", "O3", "Air", "He", "N", "Al2O", "N2H4", "C2H2", "C3H8", "C4H10", "UDMH", "CH3OH", "C2H5OH", "C4H10i", "NH4NO3_IV", 
		"NH4CLO4_I", "S2", "K", "KNO3_a", "KNO2", "K2SO4", "Al2O3", "Cl", "HCl", "AlCl", "AlOCl", "AlO", "S_a", "AlS", "H2S", "SH", 
		"Al2O2", "Al_cr", "AlOH", "AlO3H3", "NoCh", "HTPB", "IPDI", "RubUsr", NULL } ;
static int elmind9[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 
		17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 
		33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 
		49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 
		65, 66, 67, 68, 69, 70, 71, 72 } ;
static const char * elmstr10[] = { "PfGas_Air", "PfGas_N2", "PfGas_O2", "PfGas_CO2", "PfGas_CO", "PfGas_CH4", "PfGas_H2", "PfGas_He", "PfGas_Ar", "NoFluid", "PfGas_Usr1", "PfGas_Usr2", "PfGas_Usr3", "PfGas_Usr4", "PfGas_Usr5", "PfLiq_H2O", 
		"PfLiq_IPA", "PfLiq_MMH", "PfLiq_MON1", "PfLiq_MON3", "PfLiq_N2H4", "PfLiq_N2O4", "PfLiq_O2", "PfLiq_H2", "PfLiq_UDMh", "PfLiq_Oil", "PfLiq_Kerox", "PfLiq_Usr1", "PfLiq_Usr2", "PfLiq_Usr3", "PfLiq_Usr4", "PfLiq_Usr5", 
		"Real_N2", "Real_CO2", "Real_H2O", "Real_He", "Real_Xe", "Real_Ar", "Real_Air", "Real_O2", "Real_N2O", "Real_NTO", "Real_MON1", "Real_MON3", "Real_H2n", "Real_H2p", "Real_MMH", "Real_UDMH", 
		"Real_hydrazine", "Real_H2O2", "Real_CH4", "Real_C2H6", "Real_C3H8", "Real_C4H10", "Real_C4H10_i", "Real_C12H26", "Real_ethylene", "Real_propylene", "Real_methanol", "Real_ethanol", "Real_IPA", "Real_ammonia", "Real_acetone", "Real_benzene", 
		"Real_toluene", "Real_R12", "Real_R22", "Real_R134A", "Real_R141B", "Real_Usr1", "Real_Usr2", "Real_Usr3", "Real_Usr4", "Real_Usr5", "Comb_Gas", NULL } ;
static int elmind10[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 
		17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 
		33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 
		49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 
		65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75 } ;
static int elmind11[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 
		18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 
		34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 
		50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 
		66, 67, 68, 69, 70, 71, 72, 73, 74 } ;
static const char * elmstr12[] = { "fprop_pressure", "fprop_temperature", "fprop_density", "fprop_volume", "fprop_energy", "fprop_enthalpy", "fprop_entropy", "fprop_viscosity", "fprop_conductivity", "fprop_beta", "fprop_kappa", "fprop_vsound", "fprop_cp", "fprop_Rg", "fprop_gamma", "fprop_sigma", 
		"fprop_void_fr", "fprop_quality", "fprop_phi", NULL } ;
static int elmind12[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 
		17, 18, 19 } ;
static const char * elmstr13[] = { "INIT_PT", "INIT_PX", "INIT_TX", "INIT_RT", "INIT_RPT", NULL } ;
static int elmind13[] = { 1, 2, 3, 4, 5 } ;
static int elmind14[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } ;
static int elmind15[] = { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 
		32 } ;
static int elmind16[] = { 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 
		49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 
		65, 66, 67, 68, 69, 70, 71, 72, 73, 74 } ;
static int elmind17[] = { 69 } ;
n_typ=18;
static struct INTEG_simula::etype tmp_typ[] = { 
		{elmstr0,2,elmind0},
		{elmstr1,8,elmind1},
		{elmstr2,4,elmind2},
		{elmstr3,6,elmind3},
		{elmstr4,21,elmind4},
		{elmstr5,5,elmind5},
		{elmstr6,8,elmind6},
		{elmstr7,5,elmind7},
		{elmstr9,68,elmind8},
		{elmstr9,72,elmind9},
		{elmstr10,75,elmind10},
		{elmstr10,73,elmind11},
		{elmstr12,19,elmind12},
		{elmstr13,5,elmind13},
		{elmstr10,15,elmind14},
		{elmstr10,17,elmind15},
		{elmstr10,42,elmind16},
		{elmstr9,1,elmind17}
	} ;
typ= new struct INTEG_simula::etype[18];
etypecopy(18,typ,tmp_typ);
n_dyn=4;
dyn= new double[4] ;
static double tmp_dynInit[4]={ 0, 0, 0, 1 } ;
dynInit= new double[4];
dcopy(4,dynInit,tmp_dynInit);


n_der=3;
der= new double[4] ;
static double tmp_derInit[4]={ 0, 0, 0, 0 } ;
derInit= new double[4];
dcopy(4,derInit,tmp_derInit);


res= new double[4] ;
ldr= new double[4] ;
boxDyn= new double[4] ;
boxDer= new double[4] ;

static int tmp_frozenVars[3] = { 0,0,0 } ;
frozenVars= new int[3];
icopy(3,frozenVars,tmp_frozenVars);

n_unkR=359;
unkR= new double[359] ;
static double tmp_unkRInit[359]={ 0.9, 0.1, 0, 1000000, 0, 100000, 0, 0, 100000, 0, 0, 0, 0, 100000, 1, 0, 
		0, 0, 0, 0, 0, 0, 0, 100000, 0, 0, 5418, 15510, 14610, 0.5815, 0.9925, 0.89, 
		1.608e-006, 1.56e-006, 1.534e-006, 1, 0.89, 0.85, 0, 0, 0, 0, 0, 0, 100, 100000, 0, 0, 
		0, 0, 0, 0, 0, 0, 100000, 0, 0.5, 0.5, 0, 293.15, 0, 1e+040, 0.00014, 3e-005, 
		7e-005, 0, 0, 0, 50, 0, 0, 0, 0.5815, 0, 0.8468, 0, 1000000, 0, 0, 100000, 
		0, 0, 0, 100000, 1, 0, 0, 0, 0, 0, 0, 7.07108562377582e-005, 0, 0, 5418, 0, 
		1.5e-006, 1e-007, 0, -90, 0, 0.0174532925199433, 1, 0, 0, 0, 0, 90, 0, 0, 0, 0, 
		0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
		1, 1, 1, 1, 1, 1e-008, 0, 0.2, 0.25, 2, 0, 0.1, 250, 0, 0, 1e-005, 
		1e-005, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1000000, 0, 0, 0, 1000000, 0, 
		0, 0, 1000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0.001, 
		10, 0, 4, 0, 0, 10, 0, 0, 0.001, 10, 0, 0, 0, 0, 12, 1, 
		5, 1, 9, 0, 2, 0.1, 10, 0.1, 1, 0, 0, 0.1, -1, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 4, 0, 1, 0, 0, 0, 0.005, 1000000, 1000000, 
		1.66, 1000000, 0, 0, 0, 0, 20, 0, 15000, 0, 0, 0, 0, 0, 0, 5, 
		120, 0, 10000, -100, 0, 300, 280, 100, 28, 0, 0.05, 1e-005, 0, 0, 265000, 0, 
		10, 0, 0, 0.001, 10, 0, 0.001, 0, 0, 0, 100000, 293.15, 0, 0, 0, 0, 
		1, 0, 0, 0, 0, 0, 0, 0, 300, 0, 10, 0, 0, 0.001, 10, 50, 
		0, 2.4, 5e-006, 2.65, 0, 0.5, 200, 0, 10, 300, 0, 0, 2, 2, 0, 0, 
		1, 0, 10, 0, 0, 0.001, 10 } ;
unkRInit= new double[359];
dcopy(359,unkRInit,tmp_unkRInit);


n_cteR=142;
static double tmp_cteRInit[142]={ 2.18017270009963e-025, 9.80665, 3.14159265358979, 1.609e-019, 8314.4, 5988.678352, 135.6105561, 1715.19652, 0, 0, 0, 404.4474801, 167.7834309, 133.8695775, 174.5944783, 161.3201034, 
		188.1751346, 188.5599102, 1464.267553, 253.4307303, 198.2248723, 216.1170897, 0, 0, 0, 0, 0, 819.2743777, 84.88044799, 896.5306539, 475.3946204, 0, 
		549.3814808, 64.54069653, 1556.382819, 587.2984803, 619.9765484, 0, 817.1205792, 154.936687, 161.1857694, 214.012967, 0, 822.1301039, 666.153873, 482.9534158, 411.0633341, 409.0030308, 
		921.0664298, 590.2965962, 411.0633341, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0.012962735, 0.00100026, 0.001701597, 0, 0, 0, 0.001529886, 
		0.000889163, 0.000778067, 0.001381127, 0.000957279, 0.001413144, 0.000972122, 0.002190731, 0.000964022, 0.001004226, 0.000717921, 0, 0, 0, 0, 0, 0.002285308, 
		0.000800984, 0.002689641, 0.00195009, 0, 0.001590842, 0.000490639, 0.00328246, 0.002079522, 0.00217588, 0, 0.002142982, 0.001015004, 0.001255119, 0.005870489, 0, 0.001437762, 
		0.002004896, 0.002052078, 0.00200267, 0.001674883, 0.002051763, 0.00188576, 0.00200267, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3.14159265358979 } ;
cteR= tmp_cteRInit;

n_unkI=1119;
unkI= new int[1119] ;
static int tmp_unkIInit[1119]={ 37, 10, 0, 8, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 
		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
		1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 8, 1, 0, 
		1, 1, 1, 1, 0, 2, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 
		0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 } ;
unkIInit= new int[1119];
icopy(1119,unkIInit,tmp_unkIInit);


n_cteI=98;
static int tmp_cteIInit[98]={ 36, 10, 2, 13, 12, 25, 1, 37, 24, 0, 0, 0, 0, 0, 0, 3, 
		0, 28, 29, 29, 40, 29, 2, 1, 44, 0, 33, 0, 0, 0, 0, 0, 
		10, 13, 3, 37, 0, 24, 36, 2, 16, 29, 29, 29, 1, 1, 28, 44, 
		40, 17, 25, 32, 42, 43, 47, 33, 31, 26, 45, 46, 0, 0, 0, 0, 
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, 999, 1, 1, 1, 
		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
		1, 1 } ;
cteI= tmp_cteIInit;

n_unkS=144;
unkS= new std::string[144] ;
static std::string tmp_unkSInit[144]={ "H2", "O2", "H2O", "H", "O", "OH", "H2SO4", "SO2", "SO", "N2", "NO", "CO", "CO2", "NH3", "NO2", "N2O", 
		"H2O2", "HO2", "HNO", "HNO2", "COOH", "HCO", "HCOOH", "Ar", "CH4", "C3H6,propylene", "C(gr)", "MMH", "N2O4", "HCN", "C2H4", "C2H6", 
		"Jet-A(L)", "HCHO,formaldehy", "O3", "Air", "He  ", "N", "AL2O", "N2H4(L)", "C2H2,acetylene", "C3H8", "C4H10,n-butane", "UDMH", "CH3OH", "C2H5OH", "C4H10,isobutane", "NH4NO3(IV)", 
		"NH4CLO4(I)", "S2", "K", "KNO3(a)", "KNO2", "K2SO4", "AL2O3", "CL", "HCL", "ALCL", "ALOCL", "ALO", "S(a)", "ALS", "H2S", "SH", 
		"AL2O2", "AL(cr)", "ALOH", "AL(OH)3", "PfGasAir ", "PfGasN2  ", "PfGasO2 ", "PfGasCO2 ", "PfGasCO  ", "PfGasCH4 ", "PfGasH2 ", "PfGasHe ", "PfGasAr  ", " ", "PfGasUsr1", "PfGasUsr2", 
		"PfGasUsr3", "PfGasUsr4", "PfGasUsr5", "PfLiqH2O ", "PfLiqIPA ", "PfLiqMMH", "PfLiqMON1", "PfLiqMON3", "PfLiqN2H4", "PfLiqN2O4", "PfLiqO2 ", "PfLiqH2  ", "PfLiqUDMH", "PfLiqOil", "PfLiqKerox", "PfLiqUsr1", 
		"PfLiqUsr2", "PfLiqUsr3", "PfLiqUsr4", "PfLiqUsr5", "nitrogen", "co2    ", "water  ", "helium ", "xenon ", "argon   ", "AIR     ", "oxygen ", "n2o     ", "NTO    ", "MON1  ", "MON3    ", 
		"hydrogen", "parahyd ", "MMH     ", "UDMH   ", "hydrazine", "H2O2   ", "methane ", "ethane  ", "propane ", "butane  ", "isobutan", "dodecane", "ethylene", "propylen", "methanol", "ethanol ", 
		"IPA     ", "ammonia ", "acetone ", "benzene ", "toluene", "r12     ", "r22    ", "r134a  ", "r141b   ", "RealUsr1", "RealUsr2", "RealUsr3", "RealUsr4", "RealUsr5", "CombGas1", "" } ;
unkSInit= new std::string[144];
{for (int i=0; i < 144; i++)
	unkSInit[i]= tmp_unkSInit[i];}

n_cteS=8;
static std::string tmp_cteSInit[8]={ "@FLUID_PROPERTIES@/PROP_TABLES/", "-", "A", "Ohm", "S", "V", "rad", "s" } ;
cteS= &tmp_cteSInit[0];

n_unkT=6;
static double unkT0[4]={ 0,10,0,0 } ;
static double unkT1[4]={ 0,10,0,0 } ;
static double unkT2[4]={ 0,10,0,0 } ;
static double unkT3[4]={ 0,10,0,0 } ;
static double unkT4[123]={ 263,293,333,0,0.08,0.09,0.13,0.15,0.17,0.24,0.25,0.33,0.36,0.38,0.41,0.49,
		0.62,0.74,0.741,0.83,0.87,0.98,0.99,1,1.07,1.08,1.22,1.23,1.47,1.73,1.97,2.21,
		2.46,1.984,1.977,1.976,1.965,1.96,1.953,1.929,1.928,1.869,1.845,1.833,1.793,1.699,1.49,1.332,
		1.331,1.195,1.151,1.036,1.031,1.019,0.956,0.949,0.856,0.853,0.749,0.661,0.614,0.574,0.542,1.817,
		1.803,1.801,1.793,1.787,1.779,1.753,1.753,1.697,1.673,1.656,1.624,1.547,1.383,1.236,1.235,1.124,
		1.092,1.012,1.008,1,0.956,0.949,0.853,0.85,0.733,0.661,0.598,0.558,0.526,1.482,1.474,1.472,
		1.465,1.462,1.458,1.426,1.426,1.386,1.36,1.347,1.323,1.267,1.175,1.092,1.091,1.028,1,0.928,
		0.924,0.917,0.875,0.869,0.792,0.789,0.709,0.645,0.582,0.542,0.518 } ;
static double unkT5[4]={ 0,10,0,0 } ;
static  INTEG_table tmp_unkT[6]={
			INTEG_table( 2, unkT0+0, 0,NULL,0,NULL,unkT0+2),
			INTEG_table( 2, unkT1+0, 0,NULL,0,NULL,unkT1+2),
			INTEG_table( 2, unkT2+0, 0,NULL,0,NULL,unkT2+2),
			INTEG_table( 2, unkT3+0, 0,NULL,0,NULL,unkT3+2),
			INTEG_table( 3, unkT4+0, 30, unkT4+3, 0,NULL,unkT4+33),
			INTEG_table( 2, unkT5+0, 0,NULL,0,NULL,unkT5+2)
		} ;
unkT= new INTEG_table[6];
tablecopy(6,unkT,tmp_unkT);

n_cteT=0;

IMETHOD= DASSL;
n_nelg= 10;
n_neld= 5;
m_numBoxes= 2;
restartB = 0 ;
s_current= this;
}

  // init internal partition models if used
void EP__EPsystem_default::initInternalModels()
{
}

double EP__EPsystem_default::Ae6a23018e8eb6ae5d737c9d181606d74(double T,int chem,int ical)
{
	double y = 0.0;
	int n = 0;
	int ind = 0;
	int ier = 0;
	int l = 0;
	int _vi1;
	int _vi2;

	ier = 0 ;
	if( unkS[143] == "" ) {
	unkS[143] = expandFilePath(cteS[0]) ;
	_vi1 = 1 ;
	while ( _vi1 <= setofSize(&typ[8]) ) {
	_vi2 = setofElem(&typ[8], _vi1) ;
	__WR__read_label(unkS[0+(_vi1-1)]) ;
	_vi1 += 1 ;
	}
	__WR__read_cea(68, unkS[143], &unkR[113], &ier) ;
	}
	ind = setofPos(&typ[8], chem) ;
	if( ical == 1 ) {
	__WR__cp_cea(ind, T, &y, &ier) ;
		}
	else if( ical == 2) {
	__WR__h_cea(ind, T, &y, &ier) ;

		}
	else if( ical == 3) {
	__WR__s_cea(ind, T, &y, &ier) ;

	}
	else {
	if(!(0))
	issueError(215,99,13,98,"FluidProps_Chem_Therm.el",50,".","ASSERT failed: %s","Calculation index in function PGasEnergy not valid");

	}
	if( ier != 0 ) {
	if(!(0))
	issueError(215,99,13,98,"FluidProps_Chem_Therm.el",55,".","ASSERT failed: %s","Problems reading CEA coefficients");

	}
	return y ;
}


void EP__EPsystem_default::Aa84ee00c3c95ab829a927c7afa14e13d(struct INTEG_simula::etype* mix,double x[],double T,double * MW,double * Cp)
{
	double x_sum = 0.0;
	double x_i = 0.0;
	int _vi3;
	int _vi4;

	*MW = 0 ;
	*Cp = 0 ;
	x_sum = 0 ;
	_vi3 = 1 ;
	while ( _vi3 <= setofSize(mix) ) {
	_vi4 = setofElem(mix, _vi3) ;
	x_i = unkI[14+(setofPos(&typ[8], _vi4)-1)] * x[_vi3-1] ;
	x_sum = x_sum + x_i ;
	*Cp = *Cp + _div( x_i , unkR[113+(setofPos(&typ[8], _vi4)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi4)]") * Ae6a23018e8eb6ae5d737c9d181606d74(T, _vi4, 1) ;
	*MW = *MW + _div( x_i , unkR[113+(setofPos(&typ[8], _vi4)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi4)]") ;
	_vi3 += 1 ;
	}
	*MW = _div( x_sum , *MW,"MW") ;
	*Cp = _div( 1000. * *Cp , x_sum,"x_sum") ;
}


double EP__EPsystem_default::A51661d9e86455ea0316f81625e9fce54(struct INTEG_simula::etype* mix,double x[],double T)
{
	double H = 0.0;
	int _vi5;
	int _vi6;

	H = 0 ;
	_vi5 = 1 ;
	while ( _vi5 <= setofSize(mix) ) {
	_vi6 = setofElem(mix, _vi5) ;
	if( x[_vi5-1] > unkR[181] ) {
	H = H + _div( x[_vi5-1] , unkR[113+(setofPos(&typ[8], _vi6)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi6)]") * Ae6a23018e8eb6ae5d737c9d181606d74(T, _vi6, 2) ;
	}
	_vi5 += 1 ;
	}
	H = 1000. * H ;
	return H ;
}


void EP__EPsystem_default::Aeaec98570be1efc7fbb75cbb6e715cd6(struct INTEG_simula::etype* mix,double x_eq[],double T,double * eta_mix,double * lambda_mix)
{
	int ier = 0;
	int nchem = 0;
	int n = 0;
	double *y;
	int *po;
	double MW = 0.0;
	int _vi10;
	int _vi11;
	int _vi12;
	int _vi7;
	int _vi8;
	int _vi9;

	y = ALLOC__MEM__INIT(double ,setofSize(mix),0.0) ;
	po = ALLOC__MEM__INIT(int ,setofSize(mix),0) ;
	if( unkS[143] == "" ) {
	unkS[143] = expandFilePath(cteS[0]) ;
	_vi7 = 1 ;
	while ( _vi7 <= setofSize(&typ[8]) ) {
	_vi8 = setofElem(&typ[8], _vi7) ;
	__WR__read_label(unkS[0+(_vi7-1)]) ;
	_vi7 += 1 ;
	}
	__WR__read_cea(68, unkS[143], &unkR[113], &ier) ;
	}
	MW = 0 ;
	_vi9 = 1 ;
	while ( _vi9 <= setofSize(mix) ) {
	_vi10 = setofElem(mix, _vi9) ;
	if( x_eq[_vi9-1] > unkR[181] ) {
	MW = MW + _div( x_eq[_vi9-1] , unkR[113+(setofPos(&typ[8], _vi10)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi10)]") ;
	}
	_vi9 += 1 ;
	}
	MW = _div( 1. , MW,"MW") ;
	nchem = 0 ;
	_vi11 = 1 ;
	while ( _vi11 <= setofSize(mix) ) {
	_vi12 = setofElem(mix, _vi11) ;
	if( x_eq[_vi11-1] > 1e-006 ) {
	nchem = nchem + 1 ;
	y[nchem-1] = _div( x_eq[_vi11-1] , unkR[113+(setofPos(&typ[8], _vi12)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi12)]") * MW ;
	po[nchem-1] = setofPos(&typ[8], _vi12) ;
	}
	_vi11 += 1 ;
	}
	__WR__trans_cea(nchem, po, y, T, &*lambda_mix, &*eta_mix, &ier) ;
	goto __end ;

__end :
	delete[] po;
	delete[] y;
}


void EP__EPsystem_default::A26bc87d0ba8929c7bde3518fa7dbf74f(int fluid,double P_o,double T_o,double * rho,double * u,double * c,double * qu,double * alpha,double * rho_f,double * rho_g,double * h_f,double * h_g,double * visc,double * cond,int * jx,int * jy,int * ier)
{
	int ig = 0;
	double prop[60];
	{int __i=0; for(; __i <60; __i++) prop[__i] = 0.0; }
;
	int _vi13;
	int _vi14;

	if( unkS[143] == "" ) {
	unkS[143] = expandFilePath(cteS[0]) ;
	_vi13 = 1 ;
	while ( _vi13 <= setofSize(&typ[8]) ) {
	_vi14 = setofElem(&typ[8], _vi13) ;
	__WR__read_label(unkS[0+(_vi13-1)]) ;
	_vi13 += 1 ;
	}
	__WR__read_cea(68, unkS[143], &unkR[113], &*ier) ;
	}
	ig = setofPos(&typ[10], fluid) ;
	if( unkI[82+(ig-1)] == 0 ) {
	sprintf(s_tmpBuffer,"\n   ******    Reading properties file %s.dat     ******\n",unkS[68+(fluid-1)].c_str());
	WRITE( std::string(s_tmpBuffer) );
	__WR__table_read(ig, unkS[143], unkS[68+(fluid-1)], cteI[0+(fluid-1)], &*ier) ;
	unkI[1081] = unkI[1081] + 1 ;
	unkI[82+(ig-1)] = unkI[1081] ;
	}
	if( *ier >= 100 ) {
	sprintf(s_tmpBuffer,"\n   ******    Properties file %s.dat not found or bad format    ******\n",unkS[68+(fluid-1)].c_str());
	WRITE( std::string(s_tmpBuffer) );
	if(!(0))
	issueError(215,99,13,98,"FluidProps_init.el",202,".","ASSERT failed: %s","   Execution stoped  ");

	}
	__WR__thermo_prop(ig, 1, P_o, 2, T_o, 111, prop, &*qu, &*ier, cteI[75], &*jx, &*jy) ;
	*visc = prop[19 + 20*0] ;
	*cond = prop[18 + 20*0] ;
	*rho = prop[2 + 20*0] ;
	*u = prop[6 + 20*0] ;
	*c = prop[16 + 20*0] ;
	*h_f = prop[4 + 20*1] ;
	*h_g = prop[4 + 20*2] ;
	*rho_g = prop[2 + 20*2] ;
	*rho_f = prop[2 + 20*1] ;
	if( T_o < prop[1 + 20*1] ) {
	*alpha = 0 ;
	}
	else {
	*alpha = 1 ;
	}
}


void EP__EPsystem_default::A2261e77cb6ba4a6fc25cd22b6256bfba(int fluid,double rho_o,double T_o,double * P,double * u,double * c,double * qu,double * alpha,double * rho_f,double * rho_g,double * h_f,double * h_g,double * visc,double * cond,int * jx,int * jy,int * ier)
{
	int ig = 0;
	double prop[60];
	{int __i=0; for(; __i <60; __i++) prop[__i] = 0.0; }
;
	int _vi15;
	int _vi16;

	if(!(setofPos(&typ[15], fluid) == 0))
	issueError(215,99,13,98,"FluidProps_init.el",256,".","ASSERT failed: %s","Not allowed initialisation in density with a PerfectLiq");

	if( unkS[143] == "" ) {
	unkS[143] = expandFilePath(cteS[0]) ;
	_vi15 = 1 ;
	while ( _vi15 <= setofSize(&typ[8]) ) {
	_vi16 = setofElem(&typ[8], _vi15) ;
	__WR__read_label(unkS[0+(_vi15-1)]) ;
	_vi15 += 1 ;
	}
	__WR__read_cea(68, unkS[143], &unkR[113], &*ier) ;
	}
	ig = setofPos(&typ[10], fluid) ;
	if( unkI[82+(ig-1)] == 0 ) {
	sprintf(s_tmpBuffer,"\n   ******    Reading properties file %s.dat     ******\n",unkS[68+(fluid-1)].c_str());
	WRITE( std::string(s_tmpBuffer) );
	__WR__table_read(ig, unkS[143], unkS[68+(fluid-1)], cteI[0+(fluid-1)], &*ier) ;
	unkI[1081] = unkI[1081] + 1 ;
	unkI[82+(ig-1)] = unkI[1081] ;
	}
	if( *ier >= 100 ) {
	sprintf(s_tmpBuffer,"\n   ******    Properties file %s.dat not found or bad format    ******\n",unkS[68+(fluid-1)].c_str());
	WRITE( std::string(s_tmpBuffer) );
	if(!(0))
	issueError(215,99,13,98,"FluidProps_init.el",276,".","ASSERT failed: %s","   Execution stoped  ");

	}
	__WR__thermo_prop(ig, 3, rho_o, 2, T_o, 111, prop, &*qu, &*ier, cteI[75], &*jx, &*jy) ;
	*visc = prop[19 + 20*0] ;
	*cond = prop[18 + 20*0] ;
	*P = prop[0 + 20*0] ;
	*u = prop[6 + 20*0] ;
	*c = prop[16 + 20*0] ;
	*h_f = prop[4 + 20*1] ;
	*h_g = prop[4 + 20*2] ;
	*rho_g = prop[2 + 20*2] ;
	*rho_f = prop[2 + 20*1] ;
	if( *rho_f > 0 && *rho_g > 0 ) {
	*alpha = _div( _div( *qu , *rho_g,"rho_g") , (_div( *qu , *rho_g,"rho_g") + _div( (1. - *qu) , *rho_f,"rho_f")),"qu / rho_g + (1. - qu) / rho_f") ;
	}
	else {
	*alpha = 1 ;
	}
}


double EP__EPsystem_default::A0fd502d022009a0b903514fff0d4ec7c(int fluid,double T,int * jy,int * ier)
{
	int ig = 0;
	double p_sat = 0.0;
	int _vi17;
	int _vi18;

	*ier = 0 ;
	if( unkS[143] == "" ) {
	unkS[143] = expandFilePath(cteS[0]) ;
	_vi17 = 1 ;
	while ( _vi17 <= setofSize(&typ[8]) ) {
	_vi18 = setofElem(&typ[8], _vi17) ;
	__WR__read_label(unkS[0+(_vi17-1)]) ;
	_vi17 += 1 ;
	}
	__WR__read_cea(68, unkS[143], &unkR[113], &*ier) ;
	}
	ig = setofPos(&typ[10], fluid) ;
	if( unkI[82+(ig-1)] == 0 ) {
	sprintf(s_tmpBuffer,"\n   ******    Reading properties file %s.dat     ******\n",unkS[68+(fluid-1)].c_str());
	WRITE( std::string(s_tmpBuffer) );
	__WR__table_read(ig, unkS[143], unkS[68+(fluid-1)], cteI[0+(fluid-1)], &*ier) ;
	unkI[1081] = unkI[1081] + 1 ;
	unkI[82+(ig-1)] = unkI[1081] ;
	}
	if( *ier >= 100 ) {
	sprintf(s_tmpBuffer,"\n   ******    Properties file %s.dat not found or bad format    ******\n",unkS[68+(fluid-1)].c_str());
	WRITE( std::string(s_tmpBuffer) );
	if(!(0))
	issueError(215,99,13,98,"FluidProps_PureFluid.el",141,".","ASSERT failed: %s","   Execution stoped  ");

	}
	p_sat = __WR__psat_vs_t(ig, T, cteI[75], &*jy, &*ier) ;
	return p_sat ;
}


double EP__EPsystem_default::A5d5009412690d2490d4b49130c141ac2(int fluid,double T,double qu,int fprop,int * ier)
{
	int ig = 0;
	int jx = 0;
	int jy = 0;
	double h = 0.0;
	double h_f = 0.0;
	double h_g = 0.0;
	double p_sat = 0.0;
	double rho = 0.0;
	double rho_f = 0.0;
	double rho_g = 0.0;
	double T_sat = 0.0;
	double u = 0.0;
	double v = 0.0;
	double vprop = 0.0;
	double xr = 0.0;
	double prop[60];
	{int __i=0; for(; __i <60; __i++) prop[__i] = 0.0; }
;
	int _vi19;
	int _vi20;

	*ier = 0 ;
	if( unkS[143] == "" ) {
	unkS[143] = expandFilePath(cteS[0]) ;
	_vi19 = 1 ;
	while ( _vi19 <= setofSize(&typ[8]) ) {
	_vi20 = setofElem(&typ[8], _vi19) ;
	__WR__read_label(unkS[0+(_vi19-1)]) ;
	_vi19 += 1 ;
	}
	__WR__read_cea(68, unkS[143], &unkR[113], &*ier) ;
	}
	ig = setofPos(&typ[10], fluid) ;
	if( unkI[82+(ig-1)] == 0 ) {
	sprintf(s_tmpBuffer,"\n   ******    Reading properties file %s.dat     ******\n",unkS[68+(fluid-1)].c_str());
	WRITE( std::string(s_tmpBuffer) );
	__WR__table_read(ig, unkS[143], unkS[68+(fluid-1)], cteI[0+(fluid-1)], &*ier) ;
	unkI[1081] = unkI[1081] + 1 ;
	unkI[82+(ig-1)] = unkI[1081] ;
	}
	if( *ier >= 100 ) {
	sprintf(s_tmpBuffer,"\n   ******    Properties file %s.dat not found or bad format    ******\n",unkS[68+(fluid-1)].c_str());
	WRITE( std::string(s_tmpBuffer) );
	if(!(0))
	issueError(215,99,13,98,"FluidProps_PureFluid.el",1231,".","ASSERT failed: %s","   Execution stoped  ");

	}
	p_sat = __WR__psat_vs_t(ig, T, cteI[75], &jy, &*ier) ;
	T_sat = __WR__tsat_vs_p(ig, p_sat, cteI[75], &rho_f, &rho_g, &h_f, &h_g, &jy, &*ier) ;
	if( fprop == 18 ) {
	vprop = qu ;
		}
	else if( fprop == 1) {
	vprop = p_sat ;

		}
	else if( fprop == 2) {
	vprop = T ;

		}
	else if( fprop == 3) {
	rho = _div( 1. , (_div( 1. , rho_f,"rho_f") + qu * (_div( 1. , rho_g,"rho_g") - _div( 1. , rho_f,"rho_f"))),"1. / rho_f + qu * (1. / rho_g - 1. / rho_f)") ;
	vprop = rho ;

		}
	else if( fprop == 4) {
	v = _div( 1. , rho_f,"rho_f") + qu * (_div( 1. , rho_g,"rho_g") - _div( 1. , rho_f,"rho_f")) ;
	vprop = v ;

		}
	else if( fprop == 5) {
	v = _div( 1. , rho_f,"rho_f") + qu * (_div( 1. , rho_g,"rho_g") - _div( 1. , rho_f,"rho_f")) ;
	h = h_f + qu * (h_g - h_f) ;
	u = h - p_sat * v ;
	vprop = u ;

		}
	else if( fprop == 6) {
	h = h_f + qu * (h_g - h_f) ;
	vprop = h ;

		}
	else if( fprop == 7) {
	h = h_f + 0.5 * (h_g - h_f) ;
	__WR__thermo_prop(ig, 1, p_sat, 5, h, 1, prop, &xr, &*ier, cteI[75], &jx, &jy) ;
	vprop = (1. - qu) * prop[5 + 20*1] + qu * prop[5 + 20*2] ;

		}
	else if( fprop == 13) {
	h = h_f + 0.5 * (h_g - h_f) ;
	__WR__thermo_prop(ig, 1, p_sat, 5, h, 10, prop, &xr, &*ier, cteI[75], &jx, &jy) ;
	vprop = (1. - qu) * prop[10 + 20*1] + qu * prop[10 + 20*2] ;

		}
	else if( fprop == 10) {
	h = h_f + 0.5 * (h_g - h_f) ;
	__WR__thermo_prop(ig, 1, p_sat, 5, h, 10, prop, &xr, &*ier, cteI[75], &jx, &jy) ;
	vprop = (1. - qu) * prop[13 + 20*1] + qu * prop[13 + 20*2] ;

		}
	else if( fprop == 11) {
	h = h_f + 0.5 * (h_g - h_f) ;
	__WR__thermo_prop(ig, 1, p_sat, 5, h, 10, prop, &xr, &*ier, cteI[75], &jx, &jy) ;
	vprop = (1. - qu) * prop[15 + 20*1] + qu * prop[15 + 20*2] ;

		}
	else if( fprop == 12) {
	h = h_f + qu * (h_g - h_f) ;
	__WR__thermo_prop(ig, 1, p_sat, 5, h, 11, prop, &xr, &*ier, cteI[75], &jx, &jy) ;
	vprop = prop[16 + 20*0] ;

		}
	else if( fprop == 17) {
	vprop = _div( _div( qu , rho_g,"rho_g") , (_div( qu , rho_g,"rho_g") + _div( (1. - qu) , rho_f,"rho_f")),"qu / rho_g + (1. - qu) / rho_f") ;

		}
	else if( fprop == 8) {
	h = h_f + 0.5 * (h_g - h_f) ;
	__WR__thermo_prop(ig, 1, p_sat, 5, h, 100, prop, &xr, &*ier, cteI[75], &jx, &jy) ;
	vprop = (1. - qu) * prop[19 + 20*1] + qu * prop[19 + 20*2] ;

		}
	else if( fprop == 9) {
	h = h_f + 0.5 * (h_g - h_f) ;
	__WR__thermo_prop(ig, 1, p_sat, 5, h, 100, prop, &xr, &*ier, cteI[75], &jx, &jy) ;
	vprop = (1. - qu) * prop[18 + 20*1] + qu * prop[18 + 20*2] ;

		}
	else if( fprop == 16) {
	h = h_f + 0.5 * (h_g - h_f) ;
	__WR__thermo_prop(ig, 1, p_sat, 5, h, 100, prop, &xr, &*ier, cteI[75], &jx, &jy) ;
	vprop = prop[17 + 20*1] ;

	}
	else {
	if(!(0))
	issueError(215,99,13,98,"FluidProps_PureFluid.el",1292,".","ASSERT failed: %s","Property not supported by FL_prop_vs_Tx");

	*ier = 1 ;
	vprop = 0 ;
	}
	return vprop ;
}


double EP__EPsystem_default::Af3d7010422c363d543790d0660e62bf3(struct INTEG_simula::etype* mix,double x[])
{
	double MW = 0.0;
	double x_sum = 0.0;
	double x_i = 0.0;
	int _vi21;
	int _vi22;

	MW = 0 ;
	x_sum = 0 ;
	_vi21 = 1 ;
	while ( _vi21 <= setofSize(mix) ) {
	_vi22 = setofElem(mix, _vi21) ;
	if( x[_vi21-1] > unkR[181] ) {
	x_i = unkI[14+(setofPos(&typ[8], _vi22)-1)] * x[_vi21-1] ;
	x_sum = x_sum + x_i ;
	MW = MW + _div( x_i , unkR[113+(setofPos(&typ[8], _vi22)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi22)]") ;
	}
	_vi21 += 1 ;
	}
	MW = _div( x_sum , MW,"MW") ;
	return MW ;
}


double EP__EPsystem_default::Af01de3fc59c6a12d6fef25ebc12a0021(int chem,double T)
{
	double cp = 0.0;

	cp = Ae6a23018e8eb6ae5d737c9d181606d74(T, chem, 1) ;
	cp = _div( cp , unkR[113+(setofPos(&typ[8], chem)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, chem)]") * 1000. ;
	return cp ;
}


double EP__EPsystem_default::A14acc79e26ff610ce943fded558b863a(int chem,double T)
{
	double h = 0.0;

	h = Ae6a23018e8eb6ae5d737c9d181606d74(T, chem, 2) ;
	h = _div( h , unkR[113+(setofPos(&typ[8], chem)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, chem)]") * 1000. ;
	return h ;
}


double EP__EPsystem_default::A7946d3620809facf5a526de1a3b5dc2c(int chem,double T)
{
	double phi = 0.0;

	phi = Ae6a23018e8eb6ae5d737c9d181606d74(T, chem, 3) ;
	phi = _div( phi , unkR[113+(setofPos(&typ[8], chem)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, chem)]") * 1000. ;
	return phi ;
}


double EP__EPsystem_default::Ad5577fc29943618f69ad5c843eba833c(double x,double y)
{

	if( x > y ) {
	return x ;
	}
	return y ;
}


double EP__EPsystem_default::A900ac6b073dbbc9395688aa56d394f3d(struct INTEG_simula::etype* mix,double x[],double T,double v,int fluid_prop)
{
	double val = 0.0;
	double MW_mix = 0.0;
	double *y;
	double cp = 0.0;
	double cp_p = 0.0;
	double cv_p = 0.0;
	double R = 0.0;
	double beta = 0.0;
	double rho_p = 0.0;
	double kapparho = 0.0;
	double P = 0.0;
	int _vi23;
	int _vi24;
	int _vi25;
	int _vi26;
	int _vi27;
	int _vi28;
	int _vi29;
	int _vi30;
	int _vi31;
	int _vi32;
	int _vi33;
	int _vi34;
	double __retVal ;

	y = ALLOC__MEM__INIT(double ,setofSize(mix),0.0) ;
	MW_mix = 0 ;
	_vi23 = 1 ;
	while ( _vi23 <= setofSize(mix) ) {
	_vi24 = setofElem(mix, _vi23) ;
	if( x[_vi23-1] > unkR[181] ) {
	MW_mix = MW_mix + _div( unkI[14+(setofPos(&typ[8], _vi24)-1)] * x[_vi23-1] , unkR[113+(setofPos(&typ[8], _vi24)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi24)]") ;
	}
	_vi23 += 1 ;
	}
	MW_mix = _div( 1. , MW_mix,"MW_mix") ;
	if( fluid_prop == 13 ) {
	cp = 0 ;
	_vi25 = 1 ;
	while ( _vi25 <= setofSize(mix) ) {
	_vi26 = setofElem(mix, _vi25) ;
	if( x[_vi25-1] > unkR[181] ) {
	R = _div( 8314.4 , unkR[113+(setofPos(&typ[8], _vi26)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi26)]") ;
	rho_p = _div( x[_vi25-1] , v,"v") ;
	beta = _div( R , (_div( R * T , (1. - cteR[73+(setofPos(&typ[8], _vi26)-1)] * rho_p),"1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi26)] * rho_p") - 2. * cteR[5+(setofPos(&typ[8], _vi26)-1)] * rho_p * (1. - cteR[73+(setofPos(&typ[8], _vi26)-1)] * rho_p)),"R * T / (1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi26)] * rho_p) - 2. * FLUID_PROPERTIES.a_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi26)] * rho_p * (1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi26)] * rho_p)") ;
	kapparho = _div( -(_pow( (1. - cteR[73+(setofPos(&typ[8], _vi26)-1)] * rho_p) , 2.,"1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi26)] * rho_p ** 2." )) , (2. * cteR[5+(setofPos(&typ[8], _vi26)-1)] * rho_p * _pow( (1. - cteR[73+(setofPos(&typ[8], _vi26)-1)] * rho_p) , 2.,"1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi26)] * rho_p ** 2." ) - R * T),"2. * FLUID_PROPERTIES.a_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi26)] * rho_p * (1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi26)] * rho_p) ** 2. - R * T") ;
	cv_p = Af01de3fc59c6a12d6fef25ebc12a0021(_vi26, T) - _div( R * (1. + cteR[73+(setofPos(&typ[8], _vi26)-1)] * rho_p) , (1. - cteR[73+(setofPos(&typ[8], _vi26)-1)] * rho_p),"1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi26)] * rho_p") ;
	cp_p = _div( _pow( beta , 2.,"beta ** 2." ) * T , kapparho,"kapparho") + cv_p ;
	cp = cp + x[_vi25-1] * cp_p ;
	}
	_vi25 += 1 ;
	}
	val = cp ;
		}
	else if( fluid_prop == 6) {
	val = 0 ;
	_vi27 = 1 ;
	while ( _vi27 <= setofSize(mix) ) {
	_vi28 = setofElem(mix, _vi27) ;
	if( x[_vi27-1] > unkR[181] ) {
	val = val + x[_vi27-1] * (A14acc79e26ff610ce943fded558b863a(_vi28, T) + _div( 2. * cteR[5+(setofPos(&typ[8], _vi28)-1)] * x[_vi27-1] , v,"v") - _div( _div( 8314.4 , unkR[113+(setofPos(&typ[8], _vi28)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi28)]") * T * cteR[73+(setofPos(&typ[8], _vi28)-1)] * x[_vi27-1] , (v - cteR[73+(setofPos(&typ[8], _vi28)-1)] * x[_vi27-1]),"v - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi28)] * x[_vi27]")) ;
	}
	_vi27 += 1 ;
	}

		}
	else if( fluid_prop == 5) {
	val = 0 ;
	_vi29 = 1 ;
	while ( _vi29 <= setofSize(mix) ) {
	_vi30 = setofElem(mix, _vi29) ;
	if( x[_vi29-1] > unkR[181] ) {
	val = val + x[_vi29-1] * (A14acc79e26ff610ce943fded558b863a(_vi30, T) + _div( 3. * cteR[5+(setofPos(&typ[8], _vi30)-1)] * x[_vi29-1] , v,"v") - _div( _div( 8314.4 , unkR[113+(setofPos(&typ[8], _vi30)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi30)]") * T * (v + cteR[73+(setofPos(&typ[8], _vi30)-1)] * x[_vi29-1]) , (v - cteR[73+(setofPos(&typ[8], _vi30)-1)] * x[_vi29-1]),"v - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi30)] * x[_vi29]")) ;
	}
	_vi29 += 1 ;
	}

		}
	else if( fluid_prop == 19) {
	val = 0 ;
	_vi31 = 1 ;
	while ( _vi31 <= setofSize(mix) ) {
	_vi32 = setofElem(mix, _vi31) ;
	if( x[_vi31-1] > unkR[181] ) {
	y[_vi31-1] = _div( x[_vi31-1] , unkR[113+(setofPos(&typ[8], _vi32)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi32)]") * MW_mix ;
	val = val + x[_vi31-1] * A7946d3620809facf5a526de1a3b5dc2c(_vi32, T) - _div( 8314.4 , MW_mix,"MW_mix") * y[_vi31-1] * _log(Ad5577fc29943618f69ad5c843eba833c(1e-009, y[_vi31-1]),"MATH.max(1e-009, y[_vi31])") - _div( x[_vi31-1] * 8314.4 , unkR[113+(setofPos(&typ[8], _vi32)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi32)]") * _log(1. - _div( _div( cteR[5+(setofPos(&typ[8], _vi32)-1)] * x[_vi31-1] * (v - cteR[73+(setofPos(&typ[8], _vi32)-1)] * x[_vi31-1]) , _pow( v , 2.,"v ** 2." ),"v ** 2.") , (_div( 8314.4 , unkR[113+(setofPos(&typ[8], _vi32)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi32)]") * T),"8314.4 / FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi32)] * T"),"1. - FLUID_PROPERTIES.a_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi32)] * x[_vi31] * (v - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi32)] * x[_vi31]) / v ** 2. / (8314.4 / FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi32)] * T)") ;
	}
	_vi31 += 1 ;
	}

		}
	else if( fluid_prop == 7) {
	P = 0 ;
	val = 0 ;
	_vi33 = 1 ;
	while ( _vi33 <= setofSize(mix) ) {
	_vi34 = setofElem(mix, _vi33) ;
	if( x[_vi33-1] > unkR[181] ) {
	y[_vi33-1] = _div( x[_vi33-1] , unkR[113+(setofPos(&typ[8], _vi34)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi34)]") * MW_mix ;
	rho_p = _div( x[_vi33-1] , v,"v") ;
	P = P + rho_p * (_div( _div( 8314.4 , unkR[113+(setofPos(&typ[8], _vi34)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi34)]") * T , (1. - cteR[73+(setofPos(&typ[8], _vi34)-1)] * rho_p),"1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi34)] * rho_p") - cteR[5+(setofPos(&typ[8], _vi34)-1)] * rho_p) ;
	val = val + x[_vi33-1] * A7946d3620809facf5a526de1a3b5dc2c(_vi34, T) - _div( 8314.4 , MW_mix,"MW_mix") * y[_vi33-1] * _log(Ad5577fc29943618f69ad5c843eba833c(1e-009, y[_vi33-1]),"MATH.max(1e-009, y[_vi33])") - _div( x[_vi33-1] * 8314.4 , unkR[113+(setofPos(&typ[8], _vi34)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi34)]") * _log(1. - _div( _div( cteR[5+(setofPos(&typ[8], _vi34)-1)] * x[_vi33-1] * (v - cteR[73+(setofPos(&typ[8], _vi34)-1)] * x[_vi33-1]) , _pow( v , 2.,"v ** 2." ),"v ** 2.") , (_div( 8314.4 , unkR[113+(setofPos(&typ[8], _vi34)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi34)]") * T),"8314.4 / FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi34)] * T"),"1. - FLUID_PROPERTIES.a_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi34)] * x[_vi33] * (v - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi34)] * x[_vi33]) / v ** 2. / (8314.4 / FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi34)] * T)") ;
	}
	_vi33 += 1 ;
	}
	val = val - _div( 8314.4 , MW_mix,"MW_mix") * _log(P/100000.,"P / 100000.") ;

	}
	else {
	sprintf(s_tmpBuffer,"\n Propiedad: %s",gvalEnumByType(&typ[12], fluid_prop).c_str());
	WRITE( std::string(s_tmpBuffer) );
	if(!(0))
	issueError(215,99,13,98,"FluidProps_Chem_VDW.el",871,".","ASSERT failed: %s","Property non supported by VDWMix_Energy_vs_Tv");

	}
	{ __retVal = val ; goto __end ; }

__end :
	delete[] y;
	return __retVal ;
}


double EP__EPsystem_default::A7625727b45f33d86ffab92283f722b41(struct INTEG_simula::etype* mix,double x[])
{
	double a_T = 0.0;
	int _vi35;
	int _vi36;
	double _vr1;

	_vr1 = 0 ;
	_vi35 = 1 ;
	while ( _vi35 <= setofSize(mix) ) {
	_vi36 = setofElem(mix, _vi35) ;
	_vr1 += x[_vi35-1] * _sqrt(cteR[5+(setofPos(&typ[8], _vi36)-1)],"FLUID_PROPERTIES.a_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi36)]") ;
	_vi35 += 1 ;
	}
	a_T = _pow( _vr1 , 2.,"_vr1 ** 2." ) ;
	return a_T ;
}


double EP__EPsystem_default::A1b182e61facaf86869b3d0cbc0077d78(struct INTEG_simula::etype* mix,double x[])
{
	double b_T = 0.0;
	int _vi37;
	int _vi38;
	double _vr2;

	_vr2 = 0 ;
	_vi37 = 1 ;
	while ( _vi37 <= setofSize(mix) ) {
	_vi38 = setofElem(mix, _vi37) ;
	_vr2 += x[_vi37-1] * cteR[73+(setofPos(&typ[8], _vi38)-1)] ;
	_vi37 += 1 ;
	}
	b_T = _vr2 ;
	return b_T ;
}


double EP__EPsystem_default::A717555152a128e4c2db369d8b3dc1beb(struct INTEG_simula::etype* mix,double x[],double rho,double T,int fprop,int * ier)
{
	double R = 0.0;
	double MW_mix = 0.0;
	double P = 0.0;
	double *rho_p;
	double v = 0.0;
	double a = 0.0;
	double b = 0.0;
	double cv = 0.0;
	double cv_p = 0.0;
	double cp = 0.0;
	double cp_p = 0.0;
	double beta = 0.0;
	double kappa = 0.0;
	double kapparho = 0.0;
	double prop = 0.0;
	double visc = 0.0;
	double cond = 0.0;
	int _vi39;
	int _vi40;
	int _vi41;
	int _vi42;
	int _vi43;
	int _vi44;
	int _vi45;
	int _vi46;
	int _vi47;
	int _vi48;
	double __retVal ;

	rho_p = ALLOC__MEM__INIT(double ,setofSize(mix),0.0) ;
	*ier = 0 ;
	MW_mix = 0 ;
	_vi39 = 1 ;
	while ( _vi39 <= setofSize(mix) ) {
	_vi40 = setofElem(mix, _vi39) ;
	if( x[_vi39-1] > unkR[181] ) {
	MW_mix = MW_mix + _div( unkI[14+(setofPos(&typ[8], _vi40)-1)] * x[_vi39-1] , unkR[113+(setofPos(&typ[8], _vi40)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi40)]") ;
	}
	_vi39 += 1 ;
	}
	MW_mix = _div( 1. , MW_mix,"MW_mix") ;
	P = 0 ;
	_vi41 = 1 ;
	while ( _vi41 <= setofSize(mix) ) {
	_vi42 = setofElem(mix, _vi41) ;
	if( x[_vi41-1] > unkR[181] ) {
	rho_p[_vi41-1] = x[_vi41-1] * rho ;
	P = P + rho_p[_vi41-1] * (_div( _div( 8314.4 , unkR[113+(setofPos(&typ[8], _vi42)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi42)]") * T , (1. - cteR[73+(setofPos(&typ[8], _vi42)-1)] * rho_p[_vi41-1]),"1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi42)] * rho_p[_vi41]") - cteR[5+(setofPos(&typ[8], _vi42)-1)] * rho_p[_vi41-1]) ;
	}
	_vi41 += 1 ;
	}
	v = _div( 1. , rho,"rho") ;
	if( fprop == 1 ) {
	prop = P ;
		}
	else if( fprop == 2) {
	prop = T ;

		}
	else if( fprop == 3) {
	prop = rho ;

		}
	else if( fprop == 4) {
	prop = v ;

		}
	else if( fprop == 5) {
	prop = A900ac6b073dbbc9395688aa56d394f3d(mix, x, T, v, 5) ;

		}
	else if( fprop == 6) {
	prop = A900ac6b073dbbc9395688aa56d394f3d(mix, x, T, v, 6) ;

		}
	else if( fprop == 7) {
	prop = A900ac6b073dbbc9395688aa56d394f3d(mix, x, T, v, 19) - _div( 8314.4 , MW_mix,"MW_mix") * _log(P/100000.,"P / 100000.") ;

		}
	else if( fprop == 13) {
	cp = 0 ;
	_vi43 = 1 ;
	while ( _vi43 <= setofSize(mix) ) {
	_vi44 = setofElem(mix, _vi43) ;
	if( x[_vi43-1] > unkR[181] ) {
	R = _div( 8314.4 , unkR[113+(setofPos(&typ[8], _vi44)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi44)]") ;
	kapparho = _div( -(_pow( (1. - cteR[73+(setofPos(&typ[8], _vi44)-1)] * rho_p[_vi43-1]) , 2.,"1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi44)] * rho_p[_vi43] ** 2." )) , (2. * cteR[5+(setofPos(&typ[8], _vi44)-1)] * rho_p[_vi43-1] * _pow( (1. - cteR[73+(setofPos(&typ[8], _vi44)-1)] * rho_p[_vi43-1]) , 2.,"1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi44)] * rho_p[_vi43] ** 2." ) - R * T),"2. * FLUID_PROPERTIES.a_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi44)] * rho_p[_vi43] * (1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi44)] * rho_p[_vi43]) ** 2. - R * T") ;
	beta = _div( R , (_div( R * T , (1. - cteR[73+(setofPos(&typ[8], _vi44)-1)] * rho_p[_vi43-1]),"1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi44)] * rho_p[_vi43]") - 2. * cteR[5+(setofPos(&typ[8], _vi44)-1)] * rho_p[_vi43-1] * (1. - cteR[73+(setofPos(&typ[8], _vi44)-1)] * rho_p[_vi43-1])),"R * T / (1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi44)] * rho_p[_vi43]) - 2. * FLUID_PROPERTIES.a_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi44)] * rho_p[_vi43] * (1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi44)] * rho_p[_vi43])") ;
	cv_p = Af01de3fc59c6a12d6fef25ebc12a0021(_vi44, T) - _div( R * (1. + cteR[73+(setofPos(&typ[8], _vi44)-1)] * rho_p[_vi43-1]) , (1. - cteR[73+(setofPos(&typ[8], _vi44)-1)] * rho_p[_vi43-1]),"1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi44)] * rho_p[_vi43]") ;
	cp_p = _div( _pow( beta , 2.,"beta ** 2." ) * T , kapparho,"kapparho") + cv_p ;
	cp = cp + x[_vi43-1] * cp_p ;
	}
	_vi43 += 1 ;
	}
	prop = cp ;

		}
	else if( fprop == 15) {
	cv = 0 ;
	cp = 0 ;
	_vi45 = 1 ;
	while ( _vi45 <= setofSize(mix) ) {
	_vi46 = setofElem(mix, _vi45) ;
	if( x[_vi45-1] > unkR[181] ) {
	R = _div( 8314.4 , unkR[113+(setofPos(&typ[8], _vi46)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi46)]") ;
	kapparho = _div( -(_pow( (1. - cteR[73+(setofPos(&typ[8], _vi46)-1)] * rho_p[_vi45-1]) , 2.,"1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi46)] * rho_p[_vi45] ** 2." )) , (2. * cteR[5+(setofPos(&typ[8], _vi46)-1)] * rho_p[_vi45-1] * _pow( (1. - cteR[73+(setofPos(&typ[8], _vi46)-1)] * rho_p[_vi45-1]) , 2.,"1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi46)] * rho_p[_vi45] ** 2." ) - R * T),"2. * FLUID_PROPERTIES.a_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi46)] * rho_p[_vi45] * (1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi46)] * rho_p[_vi45]) ** 2. - R * T") ;
	beta = _div( R , (_div( R * T , (1. - cteR[73+(setofPos(&typ[8], _vi46)-1)] * rho_p[_vi45-1]),"1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi46)] * rho_p[_vi45]") - 2. * cteR[5+(setofPos(&typ[8], _vi46)-1)] * rho_p[_vi45-1] * (1. - cteR[73+(setofPos(&typ[8], _vi46)-1)] * rho_p[_vi45-1])),"R * T / (1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi46)] * rho_p[_vi45]) - 2. * FLUID_PROPERTIES.a_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi46)] * rho_p[_vi45] * (1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi46)] * rho_p[_vi45])") ;
	cv_p = Af01de3fc59c6a12d6fef25ebc12a0021(_vi46, T) - _div( R * (1. + cteR[73+(setofPos(&typ[8], _vi46)-1)] * rho_p[_vi45-1]) , (1. - cteR[73+(setofPos(&typ[8], _vi46)-1)] * rho_p[_vi45-1]),"1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi46)] * rho_p[_vi45]") ;
	cp_p = _div( _pow( beta , 2.,"beta ** 2." ) * T , kapparho,"kapparho") + cv_p ;
	cv = cv + x[_vi45-1] * cv_p ;
	cp = cp + x[_vi45-1] * cp_p ;
	}
	_vi45 += 1 ;
	}
	prop = _div( cp , cv,"cv") ;

		}
	else if( fprop == 12) {
	cv = 0 ;
	cp = 0 ;
	_vi47 = 1 ;
	while ( _vi47 <= setofSize(mix) ) {
	_vi48 = setofElem(mix, _vi47) ;
	if( x[_vi47-1] > unkR[181] ) {
	R = _div( 8314.4 , unkR[113+(setofPos(&typ[8], _vi48)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi48)]") ;
	kapparho = _div( -(_pow( (1. - cteR[73+(setofPos(&typ[8], _vi48)-1)] * rho_p[_vi47-1]) , 2.,"1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi48)] * rho_p[_vi47] ** 2." )) , (2. * cteR[5+(setofPos(&typ[8], _vi48)-1)] * rho_p[_vi47-1] * _pow( (1. - cteR[73+(setofPos(&typ[8], _vi48)-1)] * rho_p[_vi47-1]) , 2.,"1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi48)] * rho_p[_vi47] ** 2." ) - R * T),"2. * FLUID_PROPERTIES.a_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi48)] * rho_p[_vi47] * (1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi48)] * rho_p[_vi47]) ** 2. - R * T") ;
	beta = _div( R , (_div( R * T , (1. - cteR[73+(setofPos(&typ[8], _vi48)-1)] * rho_p[_vi47-1]),"1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi48)] * rho_p[_vi47]") - 2. * cteR[5+(setofPos(&typ[8], _vi48)-1)] * rho_p[_vi47-1] * (1. - cteR[73+(setofPos(&typ[8], _vi48)-1)] * rho_p[_vi47-1])),"R * T / (1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi48)] * rho_p[_vi47]) - 2. * FLUID_PROPERTIES.a_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi48)] * rho_p[_vi47] * (1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi48)] * rho_p[_vi47])") ;
	cv_p = Af01de3fc59c6a12d6fef25ebc12a0021(_vi48, T) - _div( R * (1. + cteR[73+(setofPos(&typ[8], _vi48)-1)] * rho_p[_vi47-1]) , (1. - cteR[73+(setofPos(&typ[8], _vi48)-1)] * rho_p[_vi47-1]),"1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi48)] * rho_p[_vi47]") ;
	cp_p = _div( _pow( beta , 2.,"beta ** 2." ) * T , kapparho,"kapparho") + cv_p ;
	cv = cv + x[_vi47-1] * cv_p ;
	cp = cp + x[_vi47-1] * cp_p ;
	}
	_vi47 += 1 ;
	}
	a = A7625727b45f33d86ffab92283f722b41(mix, x) ;
	b = A1b182e61facaf86869b3d0cbc0077d78(mix, x) ;
	kapparho = _div( -(_pow( (1. - b * rho) , 2.,"1. - b * rho ** 2." )) , (2. * a * rho * _pow( (1. - b * rho) , 2.,"1. - b * rho ** 2." ) - _div( 8314.4 , MW_mix,"MW_mix") * T),"2. * a * rho * (1. - b * rho) ** 2. - 8314.4 / MW_mix * T") ;
	prop = _sqrt(_div( _div( cp , cv,"cv") , kapparho,"kapparho"),"cp / cv / kapparho") ;

		}
	else if( fprop == 17) {
	prop = 1 ;

		}
	else if( fprop == 8) {
	Aeaec98570be1efc7fbb75cbb6e715cd6(mix, x, T, &prop, &cond) ;

		}
	else if( fprop == 9) {
	Aeaec98570be1efc7fbb75cbb6e715cd6(mix, x, T, &visc, &prop) ;

	}
	else {
	if(!(0))
	issueError(215,99,13,98,"FluidProps_Chem_VDW.el",1049,".","ASSERT failed: %s","Property non supported by VDWMix_prop_vs_rhoT");

	prop = 0 ;
	*ier = 1 ;
	}
	{ __retVal = prop ; goto __end ; }

__end :
	delete[] rho_p;
	return __retVal ;
}


double EP__EPsystem_default::A6669030322409227cc20314f5739b5c2(struct INTEG_simula::etype* mix,double x[],double P,double T,int fprop,double * rho,int * ier)
{
	int n = 1;
	int ldum = 27;
	double x_unk[1];
	{int __i=0; for(; __i <1; __i++) x_unk[__i] = 0.0; }
;
	double fvec[1];
	{int __i=0; for(; __i <1; __i++) fvec[__i] = 0.0; }
;
	double dum[27];
	{int __i=0; for(; __i <27; __i++) dum[__i] = 0.0; }
;
	double fjac[1];
	{int __i=0; for(; __i <1; __i++) fjac[__i] = 0.0; }
;
	double tol = 0.0;
	int idum[20];
	{int __i=0; for(; __i <20; __i++) idum[__i] = 0; }
;
	int k = 0;
	int info = 0;
	int ilast = 0;
	int iopt = 0;
	double rho_p = 0.0;
	double Pt = 0.0;
	int _vi49;
	int _vi50;

	tol = 1e-012 ;
	k = 0 ;
	iopt = 2 ;
	ilast = -1 ;
	x_unk[0] = *rho ;
	while ( ilast != 0 ) {
	k = k + 1 ;
	__WR__eq_nl_solver(&ilast, iopt, n, x_unk, fvec, fjac, tol, &info, dum, ldum, idum, 1e-012) ;
	*rho = x_unk[0] ;
	Pt = 0 ;
	_vi49 = 1 ;
	while ( _vi49 <= setofSize(mix) ) {
	_vi50 = setofElem(mix, _vi49) ;
	if( x[_vi49-1] > unkR[181] ) {
	rho_p = *rho * x[_vi49-1] ;
	Pt = Pt + rho_p * (_div( _div( 8314.4 , unkR[113+(setofPos(&typ[8], _vi50)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi50)]") * T , (1. - cteR[73+(setofPos(&typ[8], _vi50)-1)] * rho_p),"1. - FLUID_PROPERTIES.b_VDW[setofPos(FLUID_PROPERTIES.Chemicals, _vi50)] * rho_p") - cteR[5+(setofPos(&typ[8], _vi50)-1)] * rho_p) ;
	}
	_vi49 += 1 ;
	}
	fvec[0] = Pt - P ;
	}
	if( info == 0 ) {
	sprintf(s_tmpBuffer,"\nVDWMix_prop_vs_pT: Improper input parameters (wrong initialization)\n");
	WRITE( std::string(s_tmpBuffer) );
		}
	else if( abs(fvec[0]) > 0.1) {
	sprintf(s_tmpBuffer,"\nVDWMix_prop_vs_pT: Number of calls to FCN has been exceeded. T=%g rho=%g err=%g \n",T,*rho,fvec[0]);
	WRITE( std::string(s_tmpBuffer) );

		}
	else if( info == 4) {
	sprintf(s_tmpBuffer,"\nVDWMix_prop_vs_pT is not making good progress\n");
	WRITE( std::string(s_tmpBuffer) );

	}
	return A717555152a128e4c2db369d8b3dc1beb(mix, x, *rho, T, fprop, &*ier) ;
}


double EP__EPsystem_default::Affa307f0da73ee12e8c657f49cd5c2b5(struct INTEG_simula::etype* mix,double x[],double T)
{
	double MW = 0.0;
	double U = 0.0;
	int _vi51;
	int _vi52;

	MW = 0 ;
	U = 0 ;
	_vi51 = 1 ;
	while ( _vi51 <= setofSize(mix) ) {
	_vi52 = setofElem(mix, _vi51) ;
	if( x[_vi51-1] > unkR[181] ) {
	U = U + _div( x[_vi51-1] , unkR[113+(setofPos(&typ[8], _vi52)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi52)]") * Ae6a23018e8eb6ae5d737c9d181606d74(T, _vi52, 2) ;
	MW = MW + _div( x[_vi51-1] , unkR[113+(setofPos(&typ[8], _vi52)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi52)]") ;
	}
	_vi51 += 1 ;
	}
	MW = _div( 1. , MW,"MW") ;
	U = 1000. * U - _div( T * 8314.4 , MW,"MW") ;
	return U ;
}


double EP__EPsystem_default::Aa5cb7549104896f696616fb0442b4848(struct INTEG_simula::etype* mix,double x[],double T,double P)
{
	double MW = 0.0;
	double S = 0.0;
	double Sc = 0.0;
	double x_sum = 0.0;
	int _vi53;
	int _vi54;

	MW = Af3d7010422c363d543790d0660e62bf3(mix, x) ;
	S = 0 ;
	Sc = 0 ;
	x_sum = 0 ;
	_vi53 = 1 ;
	while ( _vi53 <= setofSize(mix) ) {
	_vi54 = setofElem(mix, _vi53) ;
	if( x[_vi53-1] > unkR[181] ) {
	x_sum = x_sum + unkI[14+(setofPos(&typ[8], _vi54)-1)] * x[_vi53-1] ;
	S = S + _div( x[_vi53-1] , unkR[113+(setofPos(&typ[8], _vi54)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi54)]") * Ae6a23018e8eb6ae5d737c9d181606d74(T, _vi54, 3) ;
	Sc = Sc + _div( unkI[14+(setofPos(&typ[8], _vi54)-1)] * x[_vi53-1] , unkR[113+(setofPos(&typ[8], _vi54)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi54)]") * 8.3144 * _log(_div( x[_vi53-1] , unkR[113+(setofPos(&typ[8], _vi54)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi54)]") * MW,"x[_vi53] / FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi54)] * MW") ;
	}
	_vi53 += 1 ;
	}
	S = 1000. * (S - _div( Sc , x_sum,"x_sum") - _div( 8.3144 , MW,"MW") * _log(Ad5577fc29943618f69ad5c843eba833c(1e-020, P)/100000.,"MATH.max(1e-020, P) / 100000.")) ;
	return S ;
}


double EP__EPsystem_default::A564e20074c3f8ffd31cb21d91144caee(struct INTEG_simula::etype* mix,double x[],double T)
{
	double MW = 0.0;
	double Cp = 0.0;
	double Rg = 0.0;

	Aa84ee00c3c95ab829a927c7afa14e13d(mix, x, T, &MW, &Cp) ;
	return _div( Cp , (Cp - _div( 8314.4 , MW,"MW")),"Cp - 8314.4 / MW") ;
}


double EP__EPsystem_default::Ae8a0ac1b3e6c9d0daf2c1477821fa807(struct INTEG_simula::etype* mix,double x[],double T)
{
	double Cp = 0.0;
	int _vi55;
	int _vi56;

	Cp = 0 ;
	_vi55 = 1 ;
	while ( _vi55 <= setofSize(mix) ) {
	_vi56 = setofElem(mix, _vi55) ;
	if( x[_vi55-1] > unkR[181] ) {
	Cp = Cp + _div( x[_vi55-1] , unkR[113+(setofPos(&typ[8], _vi56)-1)],"FLUID_PROPERTIES.MW_ch[setofPos(FLUID_PROPERTIES.Chemicals, _vi56)]") * Ae6a23018e8eb6ae5d737c9d181606d74(T, _vi56, 1) ;
	}
	_vi55 += 1 ;
	}
	Cp = 1000. * Cp ;
	return Cp ;
}


double EP__EPsystem_default::A199d18e0806ac2c34de831af64e94147(struct INTEG_simula::etype* mix,double x[],double P,double T,int fprop,int * ier)
{
	double rho = 0.0;
	double Mw = 0.0;
	double cv = 0.0;
	double cp = 0.0;
	double prop = 0.0;
	double visc = 0.0;
	double cond = 0.0;
	double Rg = 0.0;
	int n = 1;
	int ldum = 27;
	double xx[1];
	{int __i=0; for(; __i <1; __i++) xx[__i] = 0.0; }
;
	double fvec[1];
	{int __i=0; for(; __i <1; __i++) fvec[__i] = 0.0; }
;
	double dum[27];
	{int __i=0; for(; __i <27; __i++) dum[__i] = 0.0; }
;
	double fjac[1];
	{int __i=0; for(; __i <1; __i++) fjac[__i] = 0.0; }
;
	double tol = 0.0;
	int idum[20];
	{int __i=0; for(; __i <20; __i++) idum[__i] = 0; }
;
	int k = 0;
	int info = 0;
	int ilast = 0;
	int iopt = 0;

	*ier = 0 ;
	Mw = Af3d7010422c363d543790d0660e62bf3(mix, x) ;
	Rg = _div( 8314.4 , Mw,"Mw") ;
	rho = _div( _div( P , T,"T") , Rg,"Rg") ;
	if( fprop == 1 ) {
	prop = P ;
		}
	else if( fprop == 2) {
	prop = T ;

		}
	else if( fprop == 3) {
	prop = rho ;

		}
	else if( fprop == 4) {
	prop = _div( 1. , rho,"rho") ;

		}
	else if( fprop == 5) {
	prop = Affa307f0da73ee12e8c657f49cd5c2b5(mix, x, T) ;

		}
	else if( fprop == 6) {
	prop = A51661d9e86455ea0316f81625e9fce54(mix, x, T) ;

		}
	else if( fprop == 7) {
	prop = Aa5cb7549104896f696616fb0442b4848(mix, x, T, P) ;

		}
	else if( fprop == 15) {
	prop = A564e20074c3f8ffd31cb21d91144caee(mix, x, T) ;

		}
	else if( fprop == 13) {
	prop = Ae8a0ac1b3e6c9d0daf2c1477821fa807(mix, x, T) ;

		}
	else if( fprop == 12) {
	cp = Ae8a0ac1b3e6c9d0daf2c1477821fa807(mix, x, T) ;
	cv = cp - Rg ;
	prop = _sqrt(_div( cp , cv,"cv") * Rg * T,"cp / cv * Rg * T") ;

		}
	else if( fprop == 17) {
	prop = 1 ;

		}
	else if( fprop == 8) {
	Aeaec98570be1efc7fbb75cbb6e715cd6(mix, x, T, &prop, &cond) ;

		}
	else if( fprop == 9) {
	Aeaec98570be1efc7fbb75cbb6e715cd6(mix, x, T, &visc, &prop) ;

	}
	else {
	sprintf(s_tmpBuffer,"\n Propiedad: %s",gvalEnumByType(&typ[12], fprop).c_str());
	WRITE( std::string(s_tmpBuffer) );
	if(!(0))
	issueError(215,99,13,98,"FluidProps_Chem_Therm.el",702,".","ASSERT failed: %s","Property non supported by PfGasMix_prop_vs_rhoT");

	prop = 0 ;
	*ier = 1 ;
	}
	return prop ;
}


double EP__EPsystem_default::Ad9d4db5bf62c7ee749b3d001cbe1f379(struct INTEG_simula::etype* mix,double x[],int fluid,double P,double T,int fprop,int * ier)
{
	int ig = 0;
	int j1 = 1;
	int j2 = 2;
	int iwant = 1;
	int jx = 0;
	int jy = 0;
	double u = 0.0;
	double vprop = 0.0;
	double qu = 0.0;
	double prop[60];
	{int __i=0; for(; __i <60; __i++) prop[__i] = 0.0; }
;
	double rho = 0.0;
	int _vi57;
	int _vi58;

	*ier = 0 ;
	if( fluid == 10 ) {
	return 0 ;
	}
	if( cteI[0+(fluid-1)] < 0 ) {
	if( unkR[182] > 0.5 ) {
	rho = _div( P , T,"T")/8314.4 * Af3d7010422c363d543790d0660e62bf3(mix, x) ;
	vprop = A6669030322409227cc20314f5739b5c2(mix, x, P, T, fprop, &rho, &*ier) ;
	}
	else {
	vprop = A199d18e0806ac2c34de831af64e94147(mix, x, P, T, fprop, &*ier) ;
	}
	return vprop ;
	}
	if( unkS[143] == "" ) {
	unkS[143] = expandFilePath(cteS[0]) ;
	_vi57 = 1 ;
	while ( _vi57 <= setofSize(&typ[8]) ) {
	_vi58 = setofElem(&typ[8], _vi57) ;
	__WR__read_label(unkS[0+(_vi57-1)]) ;
	_vi57 += 1 ;
	}
	__WR__read_cea(68, unkS[143], &unkR[113], &*ier) ;
	}
	ig = setofPos(&typ[10], fluid) ;
	if( unkI[82+(ig-1)] == 0 ) {
	sprintf(s_tmpBuffer,"\n   ******    Reading properties file %s.dat     ******\n",unkS[68+(fluid-1)].c_str());
	WRITE( std::string(s_tmpBuffer) );
	__WR__table_read(ig, unkS[143], unkS[68+(fluid-1)], cteI[0+(fluid-1)], &*ier) ;
	unkI[1081] = unkI[1081] + 1 ;
	unkI[82+(ig-1)] = unkI[1081] ;
	}
	if( *ier >= 100 ) {
	sprintf(s_tmpBuffer,"\n   ******    Properties file %s.dat not found or bad format    ******\n",unkS[68+(fluid-1)].c_str());
	WRITE( std::string(s_tmpBuffer) );
	if(!(0))
	issueError(215,99,13,98,"FluidProps_PureFluid.el",304,".","ASSERT failed: %s","   Execution stoped  ");

	}
	if( fprop == 8 || fprop == 9 || fprop == 16 ) {
	iwant = 100 ;
	}
	else {
	iwant = 11 ;
	}
	__WR__thermo_prop(ig, j1, P, j2, T, iwant, prop, &qu, &*ier, cteI[75], &jx, &jy) ;
	if( fprop == 18 ) {
	vprop = qu ;
		}
	else if( fprop == 1) {
	vprop = prop[0 + 20*0] ;

		}
	else if( fprop == 2) {
	vprop = prop[1 + 20*0] ;

		}
	else if( fprop == 3) {
	vprop = prop[2 + 20*0] ;

		}
	else if( fprop == 4) {
	vprop = _div( 1. , prop[2 + 20*0],"prop[1,03]") ;

		}
	else if( fprop == 5) {
	vprop = prop[6 + 20*0] ;

		}
	else if( fprop == 6) {
	vprop = prop[4 + 20*0] ;

		}
	else if( fprop == 7) {
	vprop = prop[5 + 20*0] ;

		}
	else if( fprop == 14) {
	vprop = prop[10 + 20*0] - prop[11 + 20*0] ;

		}
	else if( fprop == 13) {
	if( qu < 1e-010 || qu > 0.9999999999 ) {
	vprop = prop[10 + 20*0] ;
	}
	else {
	vprop = (1. - qu) * prop[10 + 20*1] + qu * prop[10 + 20*2] ;
	}

		}
	else if( fprop == 10) {
	if( qu < 1e-010 || qu > 0.9999999999 ) {
	vprop = prop[13 + 20*0] ;
	}
	else {
	vprop = (1. - qu) * prop[13 + 20*1] + qu * prop[13 + 20*2] ;
	}

		}
	else if( fprop == 11) {
	if( qu < 1e-010 || qu > 0.9999999999 ) {
	vprop = prop[15 + 20*0] ;
	}
	else {
	vprop = (1. - qu) * prop[15 + 20*1] + qu * prop[15 + 20*2] ;
	}

		}
	else if( fprop == 12) {
	vprop = prop[16 + 20*0] ;

		}
	else if( fprop == 15) {
	if( qu < 1e-010 || qu > 0.9999999999 ) {
	vprop = prop[12 + 20*0] ;
	}
	else {
	vprop = (1. - qu) * prop[12 + 20*1] + qu * prop[12 + 20*2] ;
	}

		}
	else if( fprop == 17) {
	if( qu < 1e-010 ) {
	vprop = 0 ;
		}
	else if( qu > 0.9999999999) {
	vprop = 1 ;

	}
	else {
	vprop = _div( _div( qu , prop[2 + 20*2],"prop[3,03]") , (_div( qu , prop[2 + 20*2],"prop[3,03]") + _div( (1. - qu) , prop[2 + 20*1],"prop[2,03]")),"qu / prop[3,03] + (1. - qu) / prop[2,03]") ;
	}

		}
	else if( fprop == 8) {
	vprop = prop[19 + 20*0] ;

		}
	else if( fprop == 9) {
	vprop = prop[18 + 20*0] ;

		}
	else if( fprop == 16) {
	vprop = prop[17 + 20*1] ;

	}
	else {
	if(!(0))
	issueError(215,99,13,98,"FluidProps_PureFluid.el",374,".","ASSERT failed: %s","Property not supported by FL_prop_vs_pT");

	*ier = 1 ;
	return 0 ;
	}
	return vprop ;
}


void EP__EPsystem_default::Ac801e03fee227f3b95c9edc11faa6ea4(int fluid,double T,double qu,double * P,double * rho,double * u,double * c,double * alpha,double * rho_f,double * rho_g,double * h_f,double * h_g,double * visc,double * cond,int * jx,int * jy,int * ier)
{
	int ig = 0;
	double prop[60];
	{int __i=0; for(; __i <60; __i++) prop[__i] = 0.0; }
;
	double h = 0.0;
	double xr = 0.0;
	double Tsat = 0.0;
	int _vi59;
	int _vi60;

	if(!(setofPos(&typ[16], fluid) != 0))
	issueError(215,99,13,98,"FluidProps_init.el",45,".","ASSERT failed: %s","FL_init_vs_Tx: initialisation in quality not allowed with perfect liquids or gases");

	if( unkS[143] == "" ) {
	unkS[143] = expandFilePath(cteS[0]) ;
	_vi59 = 1 ;
	while ( _vi59 <= setofSize(&typ[8]) ) {
	_vi60 = setofElem(&typ[8], _vi59) ;
	__WR__read_label(unkS[0+(_vi59-1)]) ;
	_vi59 += 1 ;
	}
	__WR__read_cea(68, unkS[143], &unkR[113], &*ier) ;
	}
	ig = setofPos(&typ[10], fluid) ;
	if( unkI[82+(ig-1)] == 0 ) {
	sprintf(s_tmpBuffer,"\n   ******    Reading properties file %s.dat     ******\n",unkS[68+(fluid-1)].c_str());
	WRITE( std::string(s_tmpBuffer) );
	__WR__table_read(ig, unkS[143], unkS[68+(fluid-1)], cteI[0+(fluid-1)], &*ier) ;
	unkI[1081] = unkI[1081] + 1 ;
	unkI[82+(ig-1)] = unkI[1081] ;
	}
	if( *ier >= 100 ) {
	sprintf(s_tmpBuffer,"\n   ******    Properties file %s.dat not found or bad format    ******\n",unkS[68+(fluid-1)].c_str());
	WRITE( std::string(s_tmpBuffer) );
	if(!(0))
	issueError(215,99,13,98,"FluidProps_init.el",66,".","ASSERT failed: %s","   Execution stoped  ");

	}
	*P = __WR__psat_vs_t(ig, T, cteI[75], &*jy, &*ier) ;
	Tsat = __WR__tsat_vs_p(ig, *P, cteI[75], &*rho_f, &*rho_g, &*h_f, &*h_g, &*jy, &*ier) ;
	h = *h_f + qu * (*h_g - *h_f) ;
	__WR__thermo_prop(ig, 1, *P, 5, h, 111, prop, &xr, &*ier, cteI[75], &*jx, &*jy) ;
	*c = prop[16 + 20*0] ;
	*visc = qu * prop[19 + 20*2] + (1. - qu) * prop[19 + 20*1] ;
	*cond = qu * prop[18 + 20*2] + (1. - qu) * prop[18 + 20*1] ;
	*rho = _div( 1. , (_div( 1. , *rho_f,"rho_f") + qu * (_div( 1. , *rho_g,"rho_g") - _div( 1. , *rho_f,"rho_f"))),"1. / rho_f + qu * (1. / rho_g - 1. / rho_f)") ;
	*u = h - _div( *P , *rho,"rho") ;
	*alpha = _div( _div( qu , *rho_g,"rho_g") , (_div( qu , *rho_g,"rho_g") + _div( (1. - qu) , *rho_f,"rho_f")),"qu / rho_g + (1. - qu) / rho_f") ;
}


void EP__EPsystem_default::Abd0cf2de98e1e1f8a80bdef1119cb7fa(int fluid,double P,double qu,double * T,double * rho,double * u,double * c,double * alpha,double * rho_f,double * rho_g,double * h_f,double * h_g,double * visc,double * cond,int * jx,int * jy,int * ier)
{
	int ig = 0;
	double prop[60];
	{int __i=0; for(; __i <60; __i++) prop[__i] = 0.0; }
;
	double h = 0.0;
	double xr = 0.0;
	int _vi61;
	int _vi62;

	if(!(setofPos(&typ[16], fluid) != 0))
	issueError(215,99,13,98,"FluidProps_init.el",116,".","ASSERT failed: %s","FL_init_vs_Px: initialisation in quality not allowed with perfect liquids or gases");

	if( unkS[143] == "" ) {
	unkS[143] = expandFilePath(cteS[0]) ;
	_vi61 = 1 ;
	while ( _vi61 <= setofSize(&typ[8]) ) {
	_vi62 = setofElem(&typ[8], _vi61) ;
	__WR__read_label(unkS[0+(_vi61-1)]) ;
	_vi61 += 1 ;
	}
	__WR__read_cea(68, unkS[143], &unkR[113], &*ier) ;
	}
	ig = setofPos(&typ[10], fluid) ;
	if( unkI[82+(ig-1)] == 0 ) {
	sprintf(s_tmpBuffer,"\n   ******    Reading properties file %s.dat     ******\n",unkS[68+(fluid-1)].c_str());
	WRITE( std::string(s_tmpBuffer) );
	__WR__table_read(ig, unkS[143], unkS[68+(fluid-1)], cteI[0+(fluid-1)], &*ier) ;
	unkI[1081] = unkI[1081] + 1 ;
	unkI[82+(ig-1)] = unkI[1081] ;
	}
	if( *ier >= 100 ) {
	sprintf(s_tmpBuffer,"\n   ******    Properties file %s.dat not found or bad format    ******\n",unkS[68+(fluid-1)].c_str());
	WRITE( std::string(s_tmpBuffer) );
	if(!(0))
	issueError(215,99,13,98,"FluidProps_init.el",136,".","ASSERT failed: %s","   Execution stoped  ");

	}
	*T = __WR__tsat_vs_p(ig, P, cteI[75], &*rho_f, &*rho_g, &*h_f, &*h_g, &*jy, &*ier) ;
	h = *h_f + qu * (*h_g - *h_f) ;
	__WR__thermo_prop(ig, 1, P, 5, h, 111, prop, &xr, &*ier, cteI[75], &*jx, &*jy) ;
	*c = prop[16 + 20*0] ;
	*visc = qu * prop[19 + 20*2] + (1. - qu) * prop[19 + 20*1] ;
	*cond = qu * prop[18 + 20*2] + (1. - qu) * prop[18 + 20*1] ;
	*rho = _div( 1. , (_div( 1. , *rho_f,"rho_f") + qu * (_div( 1. , *rho_g,"rho_g") - _div( 1. , *rho_f,"rho_f"))),"1. / rho_f + qu * (1. / rho_g - 1. / rho_f)") ;
	*u = h - _div( P , *rho,"rho") ;
	*alpha = _div( _div( qu , *rho_g,"rho_g") , (_div( qu , *rho_g,"rho_g") + _div( (1. - qu) , *rho_f,"rho_f")),"qu / rho_g + (1. - qu) / rho_f") ;
}


double EP__EPsystem_default::A6e1f457b2f00c9d7486b29da455bd931(int fluid,double rho,double T,int fprop,int * ier)
{
	int ig = 0;
	int j1 = 3;
	int j2 = 2;
	int iwant = 1;
	int jx = 0;
	int jy = 0;
	double vprop = 0.0;
	double qu = 0.0;
	double prop[60];
	{int __i=0; for(; __i <60; __i++) prop[__i] = 0.0; }
;
	int _vi63;
	int _vi64;

	*ier = 0 ;
	if( unkS[143] == "" ) {
	unkS[143] = expandFilePath(cteS[0]) ;
	_vi63 = 1 ;
	while ( _vi63 <= setofSize(&typ[8]) ) {
	_vi64 = setofElem(&typ[8], _vi63) ;
	__WR__read_label(unkS[0+(_vi63-1)]) ;
	_vi63 += 1 ;
	}
	__WR__read_cea(68, unkS[143], &unkR[113], &*ier) ;
	}
	ig = setofPos(&typ[10], fluid) ;
	if( unkI[82+(ig-1)] == 0 ) {
	sprintf(s_tmpBuffer,"\n   ******    Reading properties file %s.dat     ******\n",unkS[68+(fluid-1)].c_str());
	WRITE( std::string(s_tmpBuffer) );
	__WR__table_read(ig, unkS[143], unkS[68+(fluid-1)], cteI[0+(fluid-1)], &*ier) ;
	unkI[1081] = unkI[1081] + 1 ;
	unkI[82+(ig-1)] = unkI[1081] ;
	}
	if( *ier >= 100 ) {
	sprintf(s_tmpBuffer,"\n   ******    Properties file %s.dat not found or bad format    ******\n",unkS[68+(fluid-1)].c_str());
	WRITE( std::string(s_tmpBuffer) );
	if(!(0))
	issueError(215,99,13,98,"FluidProps_PureFluid.el",974,".","ASSERT failed: %s","   Execution stoped  ");

	}
	if( fprop == 8 || fprop == 9 || fprop == 16 ) {
	iwant = 100 ;
	}
	else {
	iwant = 11 ;
	}
	__WR__thermo_prop(ig, j1, rho, j2, T, iwant, prop, &qu, &*ier, cteI[75], &jx, &jy) ;
	if( fprop == 18 ) {
	vprop = qu ;
		}
	else if( fprop == 1) {
	vprop = prop[0 + 20*0] ;

		}
	else if( fprop == 2) {
	vprop = prop[1 + 20*0] ;

		}
	else if( fprop == 3) {
	vprop = prop[2 + 20*0] ;

		}
	else if( fprop == 4) {
	vprop = _div( 1. , prop[2 + 20*0],"prop[1,03]") ;

		}
	else if( fprop == 5) {
	vprop = prop[6 + 20*0] ;

		}
	else if( fprop == 6) {
	vprop = prop[4 + 20*0] ;

		}
	else if( fprop == 7) {
	vprop = prop[5 + 20*0] ;

		}
	else if( fprop == 13) {
	if( qu < 1e-010 || qu > 0.9999999999 ) {
	vprop = prop[10 + 20*0] ;
	}
	else {
	vprop = (1. - qu) * prop[10 + 20*1] + qu * prop[10 + 20*2] ;
	}

		}
	else if( fprop == 10) {
	if( qu < 1e-010 || qu > 0.9999999999 ) {
	vprop = prop[13 + 20*0] ;
	}
	else {
	vprop = (1. - qu) * prop[13 + 20*1] + qu * prop[13 + 20*2] ;
	}

		}
	else if( fprop == 11) {
	if( qu < 1e-010 || qu > 0.9999999999 ) {
	vprop = prop[15 + 20*0] ;
	}
	else {
	vprop = (1. - qu) * prop[15 + 20*1] + qu * prop[15 + 20*2] ;
	}

		}
	else if( fprop == 12) {
	vprop = prop[16 + 20*0] ;

		}
	else if( fprop == 15) {
	if( qu < 1e-010 || qu > 0.9999999999 ) {
	vprop = prop[12 + 20*0] ;
	}
	else {
	vprop = (1. - qu) * prop[12 + 20*1] + qu * prop[12 + 20*2] ;
	}

		}
	else if( fprop == 17) {
	if( qu < 1e-010 ) {
	vprop = 0 ;
		}
	else if( qu > 0.9999999999) {
	vprop = 1 ;

	}
	else {
	vprop = _div( _div( qu , prop[2 + 20*2],"prop[3,03]") , (_div( qu , prop[2 + 20*2],"prop[3,03]") + _div( (1. - qu) , prop[2 + 20*1],"prop[2,03]")),"qu / prop[3,03] + (1. - qu) / prop[2,03]") ;
	}

		}
	else if( fprop == 8) {
	if( qu < 1e-010 || qu > 0.9999999999 ) {
	vprop = prop[19 + 20*0] ;
	}
	else {
	vprop = (1. - qu) * prop[19 + 20*1] + qu * prop[19 + 20*2] ;
	}

		}
	else if( fprop == 9) {
	if( qu < 1e-010 || qu > 0.9999999999 ) {
	vprop = prop[18 + 20*0] ;
	}
	else {
	vprop = (1. - qu) * prop[18 + 20*1] + qu * prop[18 + 20*2] ;
	}

		}
	else if( fprop == 16) {
	vprop = prop[17 + 20*1] ;

	}
	else {
	if(!(0))
	issueError(215,99,13,98,"FluidProps_PureFluid.el",1050,".","ASSERT failed: %s","Property not supported by FL_prop_vs_rhoT");

	*ier = 1 ;
	return 0 ;
	}
	return vprop ;
}


void EP__EPsystem_default::Ae8dcac04355b7929caae5c4efed3ad7b(struct INTEG_simula::etype* mix,double xp[],int fluid,int fluid_nc,int init_flag,double x_nco,double P_o,double T_o,double x_o,double rho_o,double * P,double * P_nc,double * x_nc,double * u,double * T,double * rho,double * c,double * qu,double * alpha,double * visc,double * cond,int * jx,int * jy,int * ier)
{
	int n = 2;
	int ldum = 35;
	double x[2];
	{int __i=0; for(; __i <2; __i++) x[__i] = 0.0; }
;
	double fvec[2];
	{int __i=0; for(; __i <2; __i++) fvec[__i] = 0.0; }
;
	double dum[35];
	{int __i=0; for(; __i <35; __i++) dum[__i] = 0.0; }
;
	double fjac[4];
	{int __i=0; for(; __i <4; __i++) fjac[__i] = 0.0; }
;
	double tol = 0.0;
	int idum[20];
	{int __i=0; for(; __i <20; __i++) idum[__i] = 0; }
;
	int k = 0;
	int info = 0;
	int ilast = 0;
	int iopt = 0;
	double P_v = 0.0;
	double rho_f = 0.0;
	double rho_v = 0.0;
	double rho_c = 0.0;
	double rho_nc = 0.0;
	double hf = 0.0;
	double hg = 0.0;
	double rho_vo = 0.0;
	double P_vo = 0.0;
	double c_nc = 0.0;
	double cg = 0.0;
	double cf = 0.0;
	double rhog = 0.0;
	double visc_nc = 0.0;
	double cond_nc = 0.0;
	double visc_g = 0.0;
	double cond_g = 0.0;
	double visc_f = 0.0;
	double cond_f = 0.0;
	double Rg = 0.0;
	double Cp = 0.0;

	info = 1 ;
	*ier = 0 ;
	if(!(fluid != 10))
	issueError(215,99,13,98,"FluidProps_init.el",352,".","ASSERT failed: %s","Init_Vol: Working fluid not defined");

	if( cteI[0+(fluid-1)] < 0 ) {
	if( init_flag != 1 ) {
	if(!(0))
	issueError(214,8,13,98,"FluidProps_init.el",357,".","ASSERT failed: %s","In case of mixture of chemicals, only INIT_PT option is possible");

	*ier = 999 ;
	return  ;
	}
	*P = P_o ;
	*T = T_o ;
	Aa84ee00c3c95ab829a927c7afa14e13d(mix, xp, T_o, &Rg, &Cp) ;
	Rg = _div( 8314.4 , Rg,"Rg") ;
	*rho = _div( _div( P_o , Rg,"Rg") , T_o,"T_o") ;
	*u = A51661d9e86455ea0316f81625e9fce54(mix, xp, T_o) - _div( P_o , *rho,"rho") ;
	*P_nc = *P ;
	*x_nc = 1 ;
	*alpha = 1 ;
	*qu = 1. ;
	*c = _sqrt(_div( Cp , (Cp - Rg),"Cp - Rg") * Rg * *T,"Cp / (Cp - Rg) * Rg * T") ;
	Aeaec98570be1efc7fbb75cbb6e715cd6(mix, xp, *T, &*visc, &*cond) ;
	return  ;
	}
	if( init_flag != 5 && x_nco > 0.999999999999 && fluid_nc != 10 ) {
	*x_nc = 1 ;
	if( init_flag == 1 ) {
	A26bc87d0ba8929c7bde3518fa7dbf74f(fluid_nc, P_o, T_o, &*rho, &*u, &*c, &*qu, &*alpha, &rho_f, &rho_v, &hf, &hg, &*visc, &*cond, &*jx, &*jy, &*ier) ;
	*P = P_o ;
	*T = T_o ;
		}
	else if( init_flag == 4) {
	A2261e77cb6ba4a6fc25cd22b6256bfba(fluid_nc, rho_o, T_o, &*P, &*u, &*c, &*qu, &*alpha, &rho_f, &rho_v, &hf, &hg, &*visc, &*cond, &*jx, &*jy, &*ier) ;
	*rho = rho_o ;
	*T = T_o ;

	}
	else {
	if(!(0))
	issueError(214,8,13,98,"FluidProps_init.el",391,".","ASSERT failed: %s","Init_Vol: initialisation option not allowed with perfect gases");

	*ier = 999 ;
	}
	return  ;
	}
	if( init_flag == 5 && fluid_nc != 10 ) {
	rho_c = rho_o ;
	*P = P_o ;
	*T = T_o ;
	P_v = A0fd502d022009a0b903514fff0d4ec7c(fluid, *T, &*jy, &*ier) ;
	if( *P <= P_v ) {
	sprintf(s_tmpBuffer,"\n Init_Vol: Impossible liquid state at given P/T: P=%g T=%g ==> Pvap=%g",*P,*T,P_v);
	WRITE( std::string(s_tmpBuffer) );
	if(!(0))
	issueError(214,8,13,98,"FluidProps_init.el",405,".","ASSERT failed: %s","Init_Vol: Wrong RPT init conditions: Pvap(T_imposed) > P_imposed");

	*ier = 999 ;
	return  ;
	}
	if( P_v <= 0 ) {
	rho_v = 0 ;
	}
	else {
	rho_v = A5d5009412690d2490d4b49130c141ac2(fluid, *T, 1., 3, &*ier) ;
	}
	rho_f = Ad9d4db5bf62c7ee749b3d001cbe1f379(mix, xp, fluid, *P, *T, 3, &*ier) ;
	*alpha = _div( (rho_f - rho_c) , (rho_f - rho_v),"rho_f - rho_v") ;
	*P_nc = *P - P_v ;
	rho_nc = Ad9d4db5bf62c7ee749b3d001cbe1f379(mix, xp, fluid_nc, *P_nc, *T, 3, &*ier) ;
	*x_nc = _div( rho_nc * *alpha , (rho_nc * *alpha + rho_c),"rho_nc * alpha + rho_c") ;
		}
	else if( fluid_nc == 10 || x_nco < 1e-012) {
	if( init_flag == 5 ) {
	if(!(0))
	issueError(214,8,13,98,"FluidProps_init.el",425,".","ASSERT failed: %s","Init_Vol: Initialisation in RPT is not possible without a non-condensable fluid.");

	*ier = 999 ;
	return  ;
	}
	if( init_flag == 3 ) {
	Ac801e03fee227f3b95c9edc11faa6ea4(fluid, T_o, x_o, &*P, &*rho, &*u, &*c, &*alpha, &rho_f, &rho_v, &hf, &hg, &*visc, &*cond, &*jx, &*jy, &*ier) ;
	*qu = x_o ;
	*T = T_o ;
		}
	else if( init_flag == 2) {
	Abd0cf2de98e1e1f8a80bdef1119cb7fa(fluid, P_o, x_o, &*T, &*rho, &*u, &*c, &*alpha, &rho_f, &rho_v, &hf, &hg, &*visc, &*cond, &*jx, &*jy, &*ier) ;
	*qu = x_o ;
	*P = P_o ;

		}
	else if( init_flag == 1) {
	A26bc87d0ba8929c7bde3518fa7dbf74f(fluid, P_o, T_o, &*rho, &*u, &*c, &*qu, &*alpha, &rho_f, &rho_v, &hf, &hg, &*visc, &*cond, &*jx, &*jy, &*ier) ;
	*P = P_o ;
	*T = T_o ;

		}
	else if( init_flag == 4) {
	A2261e77cb6ba4a6fc25cd22b6256bfba(fluid, rho_o, T_o, &*P, &*u, &*c, &*qu, &*alpha, &rho_f, &rho_v, &hf, &hg, &*visc, &*cond, &*jx, &*jy, &*ier) ;
	*rho = rho_o ;
	*T = T_o ;

	}
	*ier = 0 ;
	*x_nc = 0 ;
	return  ;

		}
	else if( init_flag == 2 || init_flag == 3) {
	if(!(0))
	issueError(214,8,13,98,"FluidProps_init.el",453,".","ASSERT failed: %s","Init_Vol: initialisation in non-condensable fraction and quality is not allowed. Use RPT variables");

	*ier = 999 ;
	return  ;

		}
	else if( init_flag == 4) {
	*x_nc = x_nco ;
	rho_c = rho_o ;
	*T = T_o ;
	k = 0 ;
	iopt = 2 ;
	ilast = -1 ;
	tol = 0 ;
	x[0] = *alpha ;
	P_v = A0fd502d022009a0b903514fff0d4ec7c(fluid, *T, &*jy, &*ier) ;
	if( setofPos(&typ[15], fluid) != 0 ) {
	rho_v = 0 ;
	}
	else {
	rho_v = A5d5009412690d2490d4b49130c141ac2(fluid, *T, 1., 3, &*ier) ;
	}
	while ( ilast != 0 ) {
	k = k + 1 ;
	__WR__eq_nl_solver(&ilast, iopt, 1, x, fvec, fjac, tol, &info, dum, ldum, idum, 0) ;
	*alpha = x[0] ;
	rho_nc = _div( _div( rho_c * *x_nc , Ad5577fc29943618f69ad5c843eba833c(1e-020, *alpha),"MATH.max(1e-020, alpha)") , (1. - *x_nc),"1. - x_nc") ;
	*P_nc = A6e1f457b2f00c9d7486b29da455bd931(fluid_nc, rho_nc, *T, 1, &*ier) ;
	if(!(*ier < 100))
	issueError(215,99,13,98,"FluidProps_init.el",482,".","ASSERT failed: %s","Init_Vol: Problems reading non-condensable properties file");

	if( *alpha > 1 ) {
	P_v = A6e1f457b2f00c9d7486b29da455bd931(fluid, rho_c, *T, 1, &*ier) ;
	rho_v = rho_c ;
	}
	*P = *P_nc + P_v ;
	rho_f = Ad9d4db5bf62c7ee749b3d001cbe1f379(mix, xp, fluid, *P, *T, 3, &*ier) ;
	fvec[0] = rho_c - *alpha * rho_v - rho_f * (1. - *alpha) ;
	}

	}
	else {
	*x_nc = x_nco ;
	*alpha = 1 ;
	*T = T_o ;
	*P = P_o ;
	k = 0 ;
	iopt = 2 ;
	ilast = -1 ;
	tol = 0 ;
	x[0] = *rho * (1. - *x_nc) ;
	P_vo = A0fd502d022009a0b903514fff0d4ec7c(fluid, *T, &*jy, &*ier) ;
	if( P_vo >= 1e+020 ) {
	rho_vo = 1e+020 ;
		}
	else if( P_vo <= 0) {
	rho_vo = 0 ;

	}
	else {
	rho_vo = A5d5009412690d2490d4b49130c141ac2(fluid, *T, 1., 3, &*ier) ;
	}
	rho_f = Ad9d4db5bf62c7ee749b3d001cbe1f379(mix, xp, fluid, *P, *T, 3, &*ier) ;
	while ( ilast != 0 ) {
	k = k + 1 ;
	__WR__eq_nl_solver(&ilast, iopt, 1, x, fvec, fjac, tol, &info, dum, ldum, idum, 0) ;
	rho_c = x[0] ;
	if( rho_c > rho_vo ) {
	P_v = P_vo ;
	rho_v = rho_vo ;
	*alpha = _div( (rho_f - rho_c) , (rho_f - rho_v),"rho_f - rho_v") ;
	}
	else {
	P_v = A6e1f457b2f00c9d7486b29da455bd931(fluid, rho_c, *T, 1, &*ier) ;
	rho_v = rho_c ;
	*alpha = 1 ;
	}
	rho_nc = _div( _div( rho_c * *x_nc , Ad5577fc29943618f69ad5c843eba833c(1e-020, *alpha),"MATH.max(1e-020, alpha)") , (1. - *x_nc),"1. - x_nc") ;
	*P_nc = A6e1f457b2f00c9d7486b29da455bd931(fluid_nc, rho_nc, *T, 1, &*ier) ;
	if(!(*ier < 100))
	issueError(215,99,13,98,"FluidProps_init.el",536,".","ASSERT failed: %s","Init_Vol: problems reading non-condensable properties file");

	fvec[0] = *P - *P_nc - P_v ;
	}
	}
	*qu = _div( rho_v * *alpha , (rho_f - (rho_f - rho_v) * *alpha),"rho_f - (rho_f - rho_v) * alpha") ;
	*u = *qu * A6e1f457b2f00c9d7486b29da455bd931(fluid, rho_v, *T, 5, &*ier) + (1. - *qu) * A6e1f457b2f00c9d7486b29da455bd931(fluid, rho_f, *T, 5, &*ier) ;
	*u = *x_nc * A6e1f457b2f00c9d7486b29da455bd931(fluid_nc, rho_nc, *T, 5, &*ier) + (1. - *x_nc) * *u ;
	*rho = rho_c + rho_nc * *alpha ;
	cg = A6e1f457b2f00c9d7486b29da455bd931(fluid, rho_v, *T, 12, &*ier) ;
	cond_g = A6e1f457b2f00c9d7486b29da455bd931(fluid, rho_v, *T, 9, &*ier) ;
	visc_g = A6e1f457b2f00c9d7486b29da455bd931(fluid, rho_v, *T, 8, &*ier) ;
	cf = A6e1f457b2f00c9d7486b29da455bd931(fluid, rho_f, *T, 12, &*ier) ;
	cond_f = A6e1f457b2f00c9d7486b29da455bd931(fluid, rho_f, *T, 9, &*ier) ;
	visc_f = A6e1f457b2f00c9d7486b29da455bd931(fluid, rho_f, *T, 8, &*ier) ;
	c_nc = A6e1f457b2f00c9d7486b29da455bd931(fluid_nc, rho_nc, *T, 12, &*ier) ;
	cond_nc = A6e1f457b2f00c9d7486b29da455bd931(fluid_nc, rho_nc, *T, 9, &*ier) ;
	visc_nc = A6e1f457b2f00c9d7486b29da455bd931(fluid_nc, rho_nc, *T, 8, &*ier) ;
	rhog = rho_nc + rho_v ;
	*qu = _div( rhog * *alpha , (rho_f - (rho_f - rhog) * *alpha),"rho_f - (rho_f - rhog) * alpha") ;
	cg = Ad5577fc29943618f69ad5c843eba833c(0.01, ssqrt(_div( rhog , (_div( rho_v , _pow( cg , 2.,"cg ** 2." ),"cg ** 2.") + _div( rho_nc , _pow( c_nc , 2.,"c_nc ** 2." ),"c_nc ** 2.")),"rho_v / cg ** 2. + rho_nc / c_nc ** 2."))) ;
	visc_g = _div( (rho_v * visc_g + rho_nc * visc_nc) , rhog,"rhog") ;
	cond_g = _div( (rho_v * cond_g + rho_nc * cond_nc) , rhog,"rhog") ;
	*c = Ad5577fc29943618f69ad5c843eba833c(0.01, _div( 1. , ssqrt(*rho * (_div( _div( *alpha , rhog,"rhog") , _pow( cg , 2.,"cg ** 2." ),"cg ** 2.") + _div( _div( (1. - *alpha) , rho_f,"rho_f") , _pow( cf , 2.,"cf ** 2." ),"cf ** 2."))),"ssqrt(rho * (alpha / rhog / cg ** 2. + (1. - alpha) / rho_f / cf ** 2.))")) ;
	*visc = *qu * visc_g + (1. - *qu) * visc_f ;
	*cond = *qu * cond_g + (1. - *qu) * cond_f ;
	if( info == 2 || info == 4 ) {
	*ier = 20 ;
	}
	return  ;
}


double EP__EPsystem_default::Adfa33bda75208049874ee3ad97974713(int fluid,int fprop,int * ier)
{
	int ig = 0;
	double vprop = 0.0;
	double prop_crit[20];
	{int __i=0; for(; __i <20; __i++) prop_crit[__i] = 0.0; }
;
	int _vi65;
	int _vi66;

	*ier = 0 ;
	if( unkS[143] == "" ) {
	unkS[143] = expandFilePath(cteS[0]) ;
	_vi65 = 1 ;
	while ( _vi65 <= setofSize(&typ[8]) ) {
	_vi66 = setofElem(&typ[8], _vi65) ;
	__WR__read_label(unkS[0+(_vi65-1)]) ;
	_vi65 += 1 ;
	}
	__WR__read_cea(68, unkS[143], &unkR[113], &*ier) ;
	}
	ig = setofPos(&typ[10], fluid) ;
	if( unkI[82+(ig-1)] == 0 ) {
	__WR__table_read(ig, unkS[143], unkS[68+(fluid-1)], cteI[0+(fluid-1)], &*ier) ;
	unkI[1081] = unkI[1081] + 1 ;
	unkI[82+(ig-1)] = unkI[1081] ;
	}
	__WR__crit_cond(ig, prop_crit, &*ier) ;
	if( fprop == 1 ) {
	vprop = prop_crit[0] ;
		}
	else if( fprop == 2) {
	vprop = prop_crit[1] ;

		}
	else if( fprop == 3) {
	vprop = prop_crit[2] ;

	}
	else {
	if(!(0))
	issueError(215,99,13,98,"FluidProps_PureFluid.el",60,".","ASSERT failed: %s","Property not supported by FL_CritProp");

	}
	return vprop ;
}


double EP__EPsystem_default::A22c1adc231b377ecd584fbb6cfaefff6(double x,double y)
{

	if( x < y ) {
	return x ;
	}
	return y ;
}


double EP__EPsystem_default::Aed64542d622c36acbe0681ac43b0f786(int fluid,double P,double rho,double T,double P_nc,double v,double vsound,int * ier)
{
	double Ff = 0.0;
	double Gcrit_gas = 0.0;
	double Gcrit_sc = 0.0;
	double k = 0.0;
	double M = 0.0;
	double Pcrit = 0.0;
	double Psat = 0.0;
	double rho_gas = 0.0;
	double v_gas = 0.0;
	double v_sc = 0.0;
	double Gcrit = 0.0;
	double Gcrit_nc = 0.0;
	int jy = 0;

	Pcrit = Adfa33bda75208049874ee3ad97974713(fluid, 1, &*ier) ;
	if( Pcrit > 0 ) {
	Psat = A0fd502d022009a0b903514fff0d4ec7c(fluid, T, &jy, &*ier) ;
	Ff = 0.96 - 0.28 * _pow( Ad5577fc29943618f69ad5c843eba833c(0, A22c1adc231b377ecd584fbb6cfaefff6(1, _div( Psat , Pcrit,"Pcrit"))) , 0.5,"MATH.max(0, MATH.min(1, Psat / Pcrit)) ** 0.5" ) ;
	Gcrit_sc = _sqrt(Ad5577fc29943618f69ad5c843eba833c(0, 2. * rho * (A22c1adc231b377ecd584fbb6cfaefff6(P, Pcrit) - Ff * Ad5577fc29943618f69ad5c843eba833c(P_nc, Psat))),"MATH.max(0, 2. * rho * (MATH.min(P, Pcrit) - Ff * MATH.max(P_nc, Psat)))") ;
	}
	else {
	Gcrit_sc = 0 ;
	}
	M = A22c1adc231b377ecd584fbb6cfaefff6(abs(_div( v , Ad5577fc29943618f69ad5c843eba833c(0.01, vsound),"MATH.max(0.01, vsound)")), 1) ;
	k = Ad5577fc29943618f69ad5c843eba833c(1.0001, _div( _pow( vsound , 2.,"vsound ** 2." ) , Ad5577fc29943618f69ad5c843eba833c(0.001, _div( P , rho,"rho")),"MATH.max(0.001, P / rho)")) ;
	rho_gas = rho * _pow( (_div( (2. + (k - 1.) * _pow( M , 2.,"M ** 2." )) , (k + 1.),"k + 1.")) , (_div( 1. , (k - 1.),"k - 1.")),"(2. + (k - 1.) * M ** 2.) / (k + 1.) ** 1. / (k - 1.)" ) ;
	v_gas = vsound * _pow( (_div( (2. + (k - 1.) * _pow( M , 2.,"M ** 2." )) , (k + 1.),"k + 1.")) , 0.5,"(2. + (k - 1.) * M ** 2.) / (k + 1.) ** 0.5" ) ;
	Gcrit_gas = rho_gas * v_gas ;
	Gcrit = _pow( (_pow( Gcrit_gas , 8.,"Gcrit_gas ** 8." ) + _pow( Gcrit_sc , 8.,"Gcrit_sc ** 8." )) , 0.125,"Gcrit_gas ** 8. + Gcrit_sc ** 8. ** 0.125" ) ;
	return Gcrit ;
}


double EP__EPsystem_default::A3f3d662a9e7edeee86fcf73966fa969c(double flow,double upstream_prop,double downstream_prop)
{
	double c = 0.0;
	double prop = 0.0;
	double tol = 1e-010;

	c = _div( flow , (abs(flow) + 1e-010),"abs(flow) + 1e-010") ;
	prop = 0.5 * ((1. + c) * upstream_prop + (1. - c) * downstream_prop) ;
	return prop ;
}


int EP__EPsystem_default::A70cc6b29de1c2b1f2003db9666acb8b9(int FailureName)
{
	int _vi69;
	int _vi70;

	_vi69 = 1 ;
	while ( _vi69 <= setofSize(&typ[6]) ) {
	_vi70 = setofElem(&typ[6], _vi69) ;
	if( FailureName == unkI[3] ) {
	return 1 ;
	}
	_vi69 += 1 ;
	}
	return 0 ;
}


int EP__EPsystem_default::A513ad26e1f4f8bd583076b41541d6b46(int Mode)
{
	int iCode = 0;
	int _vi71;
	int _vi72;

	_vi71 = 1 ;
	while ( _vi71 <= setofSize(&typ[3]) ) {
	_vi72 = setofElem(&typ[3], _vi71) ;
	iCode = iCode + 1 ;
	if( Mode == _vi72 ) {
	return iCode ;
	}
	_vi71 += 1 ;
	}
	return -1 ;
}



void EP__EPsystem_default::copyBack( double dyn[], double ldr[] )
{
	dyn[1] = unkR[259] ;
	dyn[2] = unkR[262] ;
}



void EP__EPsystem_default::initBlocks( double dyn[], double ldr[], double *_time )
{
	s_current= this;
	unkI[1115] = 1 ;
	unkI[2] = 0 ;
	unkR[350] = Ad9d4db5bf62c7ee749b3d001cbe1f379(&typ[17], &unkR[351], unkI[0], 0, 298.15, 6, &unkI[1116]) ;
	unkR[48] = 0 ;
	unkI[1109] = 1 ;
	while ( unkI[1109] <= setofSize(&typ[17]) ) {
	unkI[1110] = setofElem(&typ[17], unkI[1109]) ;
	unkR[326+(setofPos(&typ[17], unkI[1110])-1)] = 0 ;
	unkI[1109] += 1 ;
	}
	if( cteI[0+(unkI[0]-1)] < 0 ) {
	unkR[326+(setofPos(&typ[17], setofElem(&typ[8], cteI[0+(unkI[1]-1)]))-1)] = 1 ;
	}
	dyn[0] = 0 ;
	unkR[277] = _div( unkR[293] , (unkR[240] - unkR[242]),"PPU.ImaxOp - PPU.Ishort") ;
	if( unkI[1099] == 4 || unkI[1099] == 5 ) {
	unkR[277] = -100000000 ;
	}
	unkR[281] = 0 ;
	unkR[42] = unkR[42] ;
	unkR[227] = unkR[226] ;
	unkR[51] = unkR[51] ;
	unkR[276] = unkR[276] ;
	unkR[211] = unkR[211] ;
	unkR[46] = unkR[46] ;
	unkR[47] = unkR[47] ;
	unkR[52] = unkR[52] ;
	unkI[1111] = 1 ;
	while ( unkI[1111] <= setofSize(&typ[17]) ) {
	unkI[1112] = setofElem(&typ[17], unkI[1111]) ;
	unkR[111+(setofPos(&typ[17], unkI[1112])-1)] = 0 ;
	unkI[1111] += 1 ;
	}
	if( cteI[0+(unkI[0]-1)] < 0 ) {
	unkR[111+(setofPos(&typ[17], setofElem(&typ[8], cteI[0+(unkI[1]-1)]))-1)] = 1 ;
	}
	unkI[9] = 0 ;
	unkR[93] = unkR[94] ;
	unkR[71] = unkR[72] ;
	unkR[95] = unkR[96] ;
	unkR[73] = unkR[74] ;
	unkI[1113] = 1 ;
	while ( unkI[1113] <= setofSize(&typ[7]) ) {
	unkI[1114] = setofElem(&typ[7], unkI[1113]) ;
	if( unkI[1114] != 1 ) {
	if( unkI[1114] != 2 ) {
	unkI[9] = unkI[9] + 1 ;
	if( unkI[1114] == unkI[8] ) {
	unkR[93] = unkR[26+(unkI[9]-1)+3*0] ;
	unkR[71] = unkR[26+(unkI[9]-1)+3*1] ;
	unkR[95] = unkR[26+(unkI[9]-1)+3*2] ;
	unkR[73] = unkR[26+(unkI[9]-1)+3*3] ;
	}
	}
	}
	unkI[1113] += 1 ;
	}
	copyBack( dyn, ldr ) ;
}

void EP__EPsystem_default::fbox2(double *_time,double dyn[],double ldr[],double res[])
{
 if(m_branchZone[23]==0)
	unkR[38] = unkR[92] * _pow( unkR[55] , 2.,"EPthr.Power ** 2." ) + unkR[91] * unkR[55] + unkR[90] ;
else  if(m_branchZone[23]==1)
	unkR[38] = _div( unkR[71] * unkR[55] , (0.5 * _pow( (9.80665 * dyn[3]) , 2.,"9.80665 * EPthr.Isp ** 2." ) + _pow( unkR[93] , 2.,"EPthr.goIspLoss ** 2." )),"0.5 * (9.80665 * EPthr.Isp) ** 2. + EPthr.goIspLoss ** 2.") * 9.80665 * dyn[3] ;
else  if(m_branchZone[23]==2)
	unkR[38] = _div( unkR[71] * unkR[55] , (0.5 * _pow( (9.80665 * dyn[3]) , 2.,"9.80665 * EPthr.Isp ** 2." ) + _pow( unkR[93] , 2.,"EPthr.goIspLoss ** 2." )),"0.5 * (9.80665 * EPthr.Isp) ** 2. + EPthr.goIspLoss ** 2.") * unkR[93] ;
else unkR[38] = 0 ;
 if(m_branchZone[24]==0)
	res[3] = evalNormResidueInternal(3,dyn[3],_div( unkR[38] , (9.80665 * dyn[0]),"9.80665 * EPthr.m"));
else res[3] = evalNormResidueInternal(3,dyn[3],0);
}

void EP__EPsystem_default::fcn2(int *n, double x[], double residues[], int *iflag)
{
	EP__EPsystem_default& m= *EP__EPsystem_default::s_current;
	m.printDbgInfoForModel(2,true);
	dcopy(*n,&m.boxDyn[3],x);
	m.fbox2(&m.TIME, m.boxDyn, m.boxDer, m.res);
	dcopy(*n,residues,&m.res[3]);
	m.printDbgInfoForModel(2,false);
}

void EP__EPsystem_default::fhyb2(double dyn[], double ldr[], double tol, int n, int itmax)
{
	bool isOk= false;
	bool adiv= abortDiv;
	abortDiv= false;
	int box(2);
	int info= 0;
	double residues[1];
	s_current= this;
	dcopy(4, boxDyn, dyn) ;
	dcopy(3, boxDer, ldr) ;
	isOk= solveSteady(EP__EPsystem_default::fcn2, n, &dyn[3], residues, &info, box);
	if ( !isOk )
		endReportNoConvergence(info, 200, 2);
	abortDiv= adiv;
}


void EP__EPsystem_default::fres( double *_time, double dyn[], double der[], double res[] )
{
m_residuesEvals++;
s_current= this;
dcopy(3,ldr,der) ;
evalBoundsExp(*_time);
printDbgInfoForModel(-1,true);
unkR[259] = dyn[1] ;
unkR[262] = dyn[2] ;
 if(m_branchZone[25]==0)
	unkR[42] = _div( dyn[0] , unkR[95],"EPthr.kI") ;
else unkR[42] = 0 ;
 if(m_branchZone[13]==0)
	unkR[51] = unkR[293] ;
else  if(m_branchZone[13]==1)
	unkR[51] = unkR[293] + unkR[277] * (unkR[42] - unkR[240]) ;
else unkR[51] = 0 ;
unkR[55] = _div( unkR[42] * unkR[51] , unkR[73],"EPthr.eta_e") ;
 if(m_branchZone[16]==0)
	unkR[46] = unkR[238] ;
else unkR[46] = 0 ;
 if(m_branchZone[17]==0)
	unkR[47] = unkR[239] ;
else unkR[47] = 0 ;
unkR[49] = unkR[55] + unkR[56] * _pow( unkR[46] , 2.,"EPthr.PPUFU.Iheater ** 2." ) + unkR[57] * _pow( unkR[47] , 2.,"EPthr.PPUFU.Imagnet ** 2." ) ;
unkR[186] = unkR[49] + unkR[187] * _pow( (unkR[42] + unkR[47] + unkR[46]) , 2.,"FU.THR.Idischarge + FU.THR.Imagnet + FU.THR.Iheater ** 2." ) ;
 if(m_branchZone[0]==0)
	unkR[48] = unkR[184] * unkR[42] ;
else  if(m_branchZone[0]==1)
	unkR[48] = unkR[183] * unkR[42] ;
else unkR[48] = 0 ;
 if(m_branchZone[3]==0)
	unkR[322] = unkR[353] ;
else  if(m_branchZone[3]==1)
	unkR[322] = unkR[352] + unkR[353] ;
else  if(m_branchZone[3]==2)
	unkR[322] = unkR[352] * sin(_div( 6.28318530717959 , unkR[354],"qual.Period") * ((*_time) - unkR[356]) + unkR[355]) + unkR[353] ;
else  if(m_branchZone[3]==3)
	unkR[322] = pulse((*_time) - unkR[356], unkR[354], unkR[357], 17) + unkR[353] ;
else  if(m_branchZone[3]==4)
	unkR[322] = unkR[352] * step((*_time), unkR[356], 18) + unkR[353] ;
else  if(m_branchZone[3]==5)
	unkR[322] = _div( unkR[352] * ramp((*_time) - unkR[356], unkR[354], 19) , unkR[354],"qual.Period") + unkR[353] ;
else  if(m_branchZone[3]==6)
	unkR[322] = unkR[352] * square((*_time) - unkR[356], unkR[354], 20) + unkR[353] ;
else  if(m_branchZone[3]==7)
	unkR[322] = _div( unkR[352] , unkR[358],"qual.rampDuration") * ((*_time) - unkR[356]) * (1. - step((*_time), unkR[356] + unkR[358], 21)) + unkR[352] * step((*_time), unkR[356] + unkR[358], 22) + unkR[353] ;
else  if(m_branchZone[3]==8)
	unkR[322] = unkR[352] * timeTableInterp((*_time) - unkR[356], &unkT[5], 23) + unkR[353] ;
else  if(m_branchZone[3]==9)
	unkR[322] = unkR[352] * linearInterp1D(&unkT[5], (*_time) - unkR[356]) + unkR[353] ;
else  if(m_branchZone[3]==10)
	unkR[322] = unkR[352] * splineInterp1D(&unkT[5], (*_time) - unkR[356]) + unkR[353] ;
else  if(m_branchZone[3]==11)
	unkR[322] = unkR[352] * timeTableStep((*_time) - unkR[356], &unkT[5], 24) + unkR[353] ;
else unkR[322] = 0 ;
 if(m_branchZone[1]==0)
	unkR[309] = unkR[303] ;
else  if(m_branchZone[1]==1)
	unkR[309] = unkR[302] + unkR[303] ;
else  if(m_branchZone[1]==2)
	unkR[309] = unkR[302] * sin(_div( 6.28318530717959 , unkR[304],"Pxenon.Period") * ((*_time) - unkR[306]) + unkR[305]) + unkR[303] ;
else  if(m_branchZone[1]==3)
	unkR[309] = pulse((*_time) - unkR[306], unkR[304], unkR[307], 1) + unkR[303] ;
else  if(m_branchZone[1]==4)
	unkR[309] = unkR[302] * step((*_time), unkR[306], 2) + unkR[303] ;
else  if(m_branchZone[1]==5)
	unkR[309] = _div( unkR[302] * ramp((*_time) - unkR[306], unkR[304], 3) , unkR[304],"Pxenon.Period") + unkR[303] ;
else  if(m_branchZone[1]==6)
	unkR[309] = unkR[302] * square((*_time) - unkR[306], unkR[304], 4) + unkR[303] ;
else  if(m_branchZone[1]==7)
	unkR[309] = _div( unkR[302] , unkR[308],"Pxenon.rampDuration") * ((*_time) - unkR[306]) * (1. - step((*_time), unkR[306] + unkR[308], 5)) + unkR[302] * step((*_time), unkR[306] + unkR[308], 6) + unkR[303] ;
else  if(m_branchZone[1]==8)
	unkR[309] = unkR[302] * timeTableInterp((*_time) - unkR[306], &unkT[2], 7) + unkR[303] ;
else  if(m_branchZone[1]==9)
	unkR[309] = unkR[302] * linearInterp1D(&unkT[2], (*_time) - unkR[306]) + unkR[303] ;
else  if(m_branchZone[1]==10)
	unkR[309] = unkR[302] * splineInterp1D(&unkT[2], (*_time) - unkR[306]) + unkR[303] ;
else  if(m_branchZone[1]==11)
	unkR[309] = unkR[302] * timeTableStep((*_time) - unkR[306], &unkT[2], 8) + unkR[303] ;
else unkR[309] = 0 ;
unkR[314] = unkR[309] ;
 if(m_branchZone[2]==0)
	unkR[321] = unkR[329] ;
else  if(m_branchZone[2]==1)
	unkR[321] = unkR[328] + unkR[329] ;
else  if(m_branchZone[2]==2)
	unkR[321] = unkR[328] * sin(_div( 6.28318530717959 , unkR[330],"Txenon.Period") * ((*_time) - unkR[332]) + unkR[331]) + unkR[329] ;
else  if(m_branchZone[2]==3)
	unkR[321] = pulse((*_time) - unkR[332], unkR[330], unkR[333], 9) + unkR[329] ;
else  if(m_branchZone[2]==4)
	unkR[321] = unkR[328] * step((*_time), unkR[332], 10) + unkR[329] ;
else  if(m_branchZone[2]==5)
	unkR[321] = _div( unkR[328] * ramp((*_time) - unkR[332], unkR[330], 11) , unkR[330],"Txenon.Period") + unkR[329] ;
else  if(m_branchZone[2]==6)
	unkR[321] = unkR[328] * square((*_time) - unkR[332], unkR[330], 12) + unkR[329] ;
else  if(m_branchZone[2]==7)
	unkR[321] = _div( unkR[328] , unkR[334],"Txenon.rampDuration") * ((*_time) - unkR[332]) * (1. - step((*_time), unkR[332] + unkR[334], 13)) + unkR[328] * step((*_time), unkR[332] + unkR[334], 14) + unkR[329] ;
else  if(m_branchZone[2]==8)
	unkR[321] = unkR[328] * timeTableInterp((*_time) - unkR[332], &unkT[3], 15) + unkR[329] ;
else  if(m_branchZone[2]==9)
	unkR[321] = unkR[328] * linearInterp1D(&unkT[3], (*_time) - unkR[332]) + unkR[329] ;
else  if(m_branchZone[2]==10)
	unkR[321] = unkR[328] * splineInterp1D(&unkT[3], (*_time) - unkR[332]) + unkR[329] ;
else  if(m_branchZone[2]==11)
	unkR[321] = unkR[328] * timeTableStep((*_time) - unkR[332], &unkT[3], 16) + unkR[329] ;
else unkR[321] = 0 ;
unkR[315] = unkR[321] ;
unkR[327] = 0 ;
unkR[320] = 0 ;
Ae8dcac04355b7929caae5c4efed3ad7b(&typ[17], &unkR[326], unkI[0], unkI[1], 1, unkR[322], unkR[314], unkR[315], unkR[327], unkR[320], &unkR[5], &unkR[313], &unkR[19], &unkR[323], &unkR[7], &unkR[14], &unkR[324], &unkR[325], &unkR[316], &unkR[16], &unkR[317], &unkI[1104], &unkI[1105], &unkI[1102]);
unkR[15] = 0 ;
unkR[8] = unkR[323] + _div( unkR[5] , unkR[14],"Tank.rho") + _pow( unkR[15] , 2.,"Tank.vel ** 2." )/2. ;
unkR[3] = Aed64542d622c36acbe0681ac43b0f786(unkI[0], unkR[5], unkR[14], unkR[7], unkR[313], unkR[15], unkR[324], &unkI[1103]) ;
unkR[2] = 1e+020 ;
unkR[4] = 0 ;
if( cteI[0+(unkI[0]-1)] >= 0 ) 
{
reportIfChangesBranch(*_time,0, m_branchIf[0],0,"FLUID_PROPERTIES.ChemCode[Tank.f.fluid] >= 0");
unkR[319] = 0 ;
}
else 
{
reportIfChangesBranch(*_time,0, m_branchIf[0],1,"ELSE");
unkR[319] = unkR[326] ;
}
unkR[25] = unkR[319] ;
if( cteI[0+(unkI[0]-1)] >= 0 ) 
{
reportIfChangesBranch(*_time,2, m_branchIf[2],0,"FLUID_PROPERTIES.ChemCode[EPthr.f.fluid] >= 0");
unkR[87] = 0 ;
}
else 
{
reportIfChangesBranch(*_time,2, m_branchIf[2],1,"ELSE");
unkR[87] = unkR[111] ;
}
if( cteI[0+(unkI[0]-1)] >= 0 ) 
{
reportIfChangesBranch(*_time,1, m_branchIf[1],0,"FLUID_PROPERTIES.ChemCode[XFC.f1.fluid] >= 0");
unkR[81] = 0 ;
}
else 
{
reportIfChangesBranch(*_time,1, m_branchIf[1],1,"ELSE");
unkR[81] = dyn[0] * A3f3d662a9e7edeee86fcf73966fa969c(dyn[0], unkR[25], unkR[87]) ;
}
unkR[318] = -unkR[81] ;
unkR[190] = 0 ;
unkR[311] = unkR[335] + unkR[190] ;
{
double coef[5][5], indep[5];
int n= 5,nrhs= 1 ,ipiv[5],info;
coef[0][0]= (m_branchZone[4] == 0)? 0 : 0;
coef[1][0]= (m_branchZone[4] == 0)? 0 : 0;
coef[2][0]= (m_branchZone[4] == 0)? -1 : -unkR[192];
coef[3][0]= (m_branchZone[4] == 0)? 1 : 1;
coef[4][0]= (m_branchZone[4] == 0)? 0 : 0;
coef[0][1]= (m_branchZone[5] == 0)? 0 : 0;
coef[1][1]= (m_branchZone[5] == 0)? 1 : 1;
coef[2][1]= (m_branchZone[5] == 0)? -unkR[191] : -1;
coef[3][1]= (m_branchZone[5] == 0)? 0 : 0;
coef[4][1]= (m_branchZone[5] == 0)? 0 : 0;
coef[0][2]= -1;
coef[1][2]= unkR[272];
coef[2][2]= 0;
coef[3][2]= 0;
coef[4][2]= 0;
coef[0][3]= 1;
coef[1][3]= 0;
coef[2][3]= 0;
coef[3][3]= 1;
coef[4][3]= 1;
coef[0][4]= 0;
coef[1][4]= unkR[310];
coef[2][4]= 0;
coef[3][4]= 0;
coef[4][4]= -1;
indep[0]= (m_branchZone[4] == 0)? 0 : 0;
indep[1]= (m_branchZone[5] == 0)? 0 : 0;
indep[2]= 0;
indep[3]= unkR[311];
indep[4]= 0;

wDGESV(&n,&nrhs,(double*)coef,&n,ipiv,indep,&n,&info);
checkErrorInDgesv(info,1);

unkR[193] = indep[0];
unkR[194] = indep[1];
unkR[196] = indep[2];
unkR[197] = indep[3];
unkR[312] = indep[4];
}
unkR[195] = unkR[311] - unkR[312] ;
unkR[9] = -dyn[0] ;
unkR[54] = 1e-009 ;
unkR[59] = 300. ;
unkR[112] = 0 ;
unkR[102] = 0 ;
Ae8dcac04355b7929caae5c4efed3ad7b(&typ[17], &unkR[111], unkI[0], unkI[1], 1, 0., unkR[54], unkR[59], unkR[112], unkR[102], &unkR[45], &unkR[53], &unkR[88], &unkR[108], &unkR[58], &unkR[84], &unkR[109], &unkR[110], &unkR[69], &unkR[86], &unkR[70], &unkI[12], &unkI[13], &unkI[10]);
unkR[85] = 0 ;
unkR[79] = unkR[108] + _div( unkR[45] , unkR[84],"EPthr.rho") + _pow( unkR[85] , 2.,"EPthr.vel ** 2." )/2. ;
unkR[83] = dyn[0] * A3f3d662a9e7edeee86fcf73966fa969c(dyn[0], unkR[8], unkR[79]) ;
unkR[13] = -unkR[83] ;
unkR[78] = _div( dyn[0] , A3f3d662a9e7edeee86fcf73966fa969c(dyn[0], unkR[14], unkR[84]),"MATH.donor_cell(XFC.m, XFC.f1.rho, XFC.f2.rho)") ;
unkR[6] = -unkR[78] ;
unkR[80] = dyn[0] * A3f3d662a9e7edeee86fcf73966fa969c(dyn[0], unkR[19], unkR[88]) ;
unkR[82] = dyn[0] * A3f3d662a9e7edeee86fcf73966fa969c(dyn[0], unkR[20], unkR[89]) ;
unkR[10] = -unkR[80] ;
unkR[12] = -unkR[82] ;
unkR[24] = -unkR[81] ;
unkR[75] = 1e+020 ;
unkR[336] = A22c1adc231b377ecd584fbb6cfaefff6(unkR[2], unkR[75]) ;
 if(m_branchZone[22]==0)
	unkR[23] = unkR[5] * unkR[0] ;
else  if(m_branchZone[22]==1)
	unkR[23] = unkR[5] * unkR[1] ;
else unkR[23] = unkR[5] ;
unkR[340] = unkR[23]/100000. ;
 if(m_branchZone[8]==0)
	unkR[225] = unkR[219] ;
else  if(m_branchZone[8]==1)
	unkR[225] = unkR[42] + unkR[219] ;
else  if(m_branchZone[8]==2)
	unkR[225] = unkR[42] * sin(_div( 6.28318530717959 , unkR[220],"PPU.IdMeasured.Period") * ((*_time) - unkR[222]) + unkR[221]) + unkR[219] ;
else  if(m_branchZone[8]==3)
	unkR[225] = pulse((*_time) - unkR[222], unkR[220], unkR[223], 25) + unkR[219] ;
else  if(m_branchZone[8]==4)
	unkR[225] = unkR[42] * step((*_time), unkR[222], 26) + unkR[219] ;
else  if(m_branchZone[8]==5)
	unkR[225] = _div( unkR[42] * ramp((*_time) - unkR[222], unkR[220], 27) , unkR[220],"PPU.IdMeasured.Period") + unkR[219] ;
else  if(m_branchZone[8]==6)
	unkR[225] = unkR[42] * square((*_time) - unkR[222], unkR[220], 28) + unkR[219] ;
else  if(m_branchZone[8]==7)
	unkR[225] = _div( unkR[42] , unkR[224],"PPU.IdMeasured.rampDuration") * ((*_time) - unkR[222]) * (1. - step((*_time), unkR[222] + unkR[224], 29)) + unkR[42] * step((*_time), unkR[222] + unkR[224], 30) + unkR[219] ;
else  if(m_branchZone[8]==8)
	unkR[225] = unkR[42] * timeTableInterp((*_time) - unkR[222], &unkT[0], 31) + unkR[219] ;
else  if(m_branchZone[8]==9)
	unkR[225] = unkR[42] * linearInterp1D(&unkT[0], (*_time) - unkR[222]) + unkR[219] ;
else  if(m_branchZone[8]==10)
	unkR[225] = unkR[42] * splineInterp1D(&unkT[0], (*_time) - unkR[222]) + unkR[219] ;
else  if(m_branchZone[8]==11)
	unkR[225] = unkR[42] * timeTableStep((*_time) - unkR[222], &unkT[0], 32) + unkR[219] ;
else unkR[225] = 0 ;
unkR[261] = unkR[225] ;
unkR[227] = unkR[226] ;
 if(m_branchZone[9]==0)
	unkR[234] = unkR[228] ;
else  if(m_branchZone[9]==1)
	unkR[234] = unkR[227] + unkR[228] ;
else  if(m_branchZone[9]==2)
	unkR[234] = unkR[227] * sin(_div( 6.28318530717959 , unkR[229],"PPU.Id_Set.Period") * ((*_time) - unkR[231]) + unkR[230]) + unkR[228] ;
else  if(m_branchZone[9]==3)
	unkR[234] = pulse((*_time) - unkR[231], unkR[229], unkR[232], 33) + unkR[228] ;
else  if(m_branchZone[9]==4)
	unkR[234] = unkR[227] * step((*_time), unkR[231], 34) + unkR[228] ;
else  if(m_branchZone[9]==5)
	unkR[234] = _div( unkR[227] * ramp((*_time) - unkR[231], unkR[229], 35) , unkR[229],"PPU.Id_Set.Period") + unkR[228] ;
else  if(m_branchZone[9]==6)
	unkR[234] = unkR[227] * square((*_time) - unkR[231], unkR[229], 36) + unkR[228] ;
else  if(m_branchZone[9]==7)
	unkR[234] = _div( unkR[227] , unkR[233],"PPU.Id_Set.rampDuration") * ((*_time) - unkR[231]) * (1. - step((*_time), unkR[231] + unkR[233], 37)) + unkR[227] * step((*_time), unkR[231] + unkR[233], 38) + unkR[228] ;
else  if(m_branchZone[9]==8)
	unkR[234] = unkR[227] * timeTableInterp((*_time) - unkR[231], &unkT[1], 39) + unkR[228] ;
else  if(m_branchZone[9]==9)
	unkR[234] = unkR[227] * linearInterp1D(&unkT[1], (*_time) - unkR[231]) + unkR[228] ;
else  if(m_branchZone[9]==10)
	unkR[234] = unkR[227] * splineInterp1D(&unkT[1], (*_time) - unkR[231]) + unkR[228] ;
else  if(m_branchZone[9]==11)
	unkR[234] = unkR[227] * timeTableStep((*_time) - unkR[231], &unkT[1], 40) + unkR[228] ;
else unkR[234] = 0 ;
unkR[249] = unkR[234] - unkR[261] ;
unkR[253] = unkR[261] + unkR[249] ;
ldr[2] = _div( (unkR[261] - unkR[262]) , (unkR[247] * unkR[245]),"PPU.ItthPID.alpha[1] * PPU.ItthPID.Td[1]") ;
unkR[258] = unkR[252] * (unkR[248] * unkR[253] - unkR[261] - unkR[245] * ldr[2]) + unkR[259] ;
 if(m_branchZone[10]==0)
	unkR[255] = unkR[256] ;
else  if(m_branchZone[10]==1)
	unkR[255] = unkR[257] ;
else unkR[255] = unkR[258] ;
unkR[254] = unkR[255] ;
unkR[266] = unkR[265] * unkR[254] ;
 if(m_branchZone[18]==0)
	unkR[243] = unkR[244] ;
else unkR[243] = 0 ;
 if(m_branchZone[19]==0)
	unkR[211] = unkR[266] ;
else unkR[211] = unkR[243] ;
unkR[347] = linearInterp2D(&unkT[4], unkR[345], _div( unkR[211] , unkR[337],"XFC.NominalItt")) ;
 if(m_branchZone[6]==0)
	unkR[343] = 1. ;
else unkR[343] = 0 ;
 if(m_branchZone[7]==0)
	unkR[346] = _pow( (_div( unkR[340] , unkR[339],"XFC.NominalPXe_bar")) , unkR[348],"XFC.PXe / XFC.NominalPXe_bar ** XFC.n" ) * unkR[347] * unkR[338] ;
else unkR[346] = _pow( (_div( unkR[340] , unkR[339],"XFC.NominalPXe_bar")) , unkR[348],"XFC.PXe / XFC.NominalPXe_bar ** XFC.n" ) * unkR[338] * unkR[343] ;
ldr[0] = _div( (unkR[346] - dyn[0]) , unkR[349],"XFC.tau_tt") ;
 if(m_branchZone[15]==0)
	unkR[276] = unkR[296] ;
else unkR[276] = 0 ;
unkR[297] = unkR[341] * _pow( unkR[211] , 2.,"XFC.Itt ** 2." ) + _div( _pow( unkR[276] , 2.,"XFC.xfc.Vvalves ** 2." ) , unkR[342],"XFC.Rvalves") ;
 if(m_branchZone[12]==0)
	unkR[260] = unkR[256] ;
else  if(m_branchZone[12]==1)
	unkR[260] = unkR[257] ;
else unkR[260] = unkR[259] ;
 if(m_branchZone[11]==0)
	unkR[250] = unkR[260] - unkR[259] ;
else unkR[250] = unkR[255] - unkR[258] ;
ldr[1] = _div( unkR[252] , unkR[246],"PPU.ItthPID.Ti[1]") * unkR[249] + _div( unkR[250] , (unkR[251] * unkR[246]),"PPU.ItthPID.gamma[1] * PPU.ItthPID.Ti[1]") ;
unkR[199] = 0 ;
unkR[213] = -unkR[211] ;
unkR[214] = _div( unkR[213] , unkR[210],"PPU.Ct.G") ;
unkR[212] = -unkR[214] ;
unkR[215] = 0 ;
unkR[204] = -unkR[46] ;
unkR[205] = _div( unkR[204] , unkR[202],"PPU.Ch.G") ;
unkR[203] = -unkR[205] ;
unkR[208] = -unkR[47] ;
unkR[209] = _div( unkR[208] , unkR[206],"PPU.Cm.G") ;
unkR[207] = -unkR[209] ;
unkR[198] = _div( unkR[51] , unkR[270],"PPU.Ra.R") ;
unkR[200] = -unkR[198] ;
unkR[275] = _div( unkR[276] , unkR[273],"PPU.Rv.R") ;
unkR[274] = -unkR[275] ;
 if(m_branchZone[14]==0)
	unkR[52] = unkR[294] ;
else unkR[52] = 0 ;
unkR[235] = _div( unkR[52] , unkR[271],"PPU.Rik.R") ;
unkR[236] = -unkR[235] ;
unkR[216] = 0 ;
unkR[282] = unkR[280] ;
unkR[283] = unkR[42] ;
unkR[284] = unkR[51] ;
unkR[285] = -unkR[213] ;
unkR[286] = A513ad26e1f4f8bd583076b41541d6b46(unkI[1095]) ;
unkR[268] = unkR[186] + unkR[297] ;
 if(m_branchZone[20]==0)
	unkR[301] = (1. - (unkR[298] + unkR[299] * unkR[268] + unkR[300] * _pow( unkR[268] , 2.,"PPU.PowerOutPPU ** 2." )))/1.5 ;
else unkR[301] = 1. - (unkR[298] + unkR[299] * unkR[268] + unkR[300] * _pow( unkR[268] , 2.,"PPU.PowerOutPPU ** 2." )) ;
 if(m_branchZone[21]==0)
	unkR[267] = _div( (unkR[268] + unkR[278]) , unkR[301],"PPU.etaPowerPPU") ;
else unkR[267] = _div( unkR[268] , unkR[301],"PPU.etaPowerPPU") ;
unkR[218] = _div( unkR[267] , unkR[193],"PPU.e_p.v") ;
unkR[17] = unkR[25] ;
unkR[11] = -unkR[81] ;
unkR[76] = Aed64542d622c36acbe0681ac43b0f786(unkI[0], unkR[45], unkR[84], unkR[58], unkR[53], unkR[85], unkR[109], &unkI[11]) ;
unkR[77] = 0 ;
unkR[43] = (*_time) ;

if( restartB || m_solveInternalBox[2] ) 
    fhyb2(dyn,ldr,TOLERANCE,1,50);
else fbox2(_time,dyn,ldr,res) ;

 if(m_branchZone[26]==0)
	unkR[60] = 0 ;
else  if(m_branchZone[26]==1)
	unkR[60] = unkR[62] ;
else  if(m_branchZone[26]==2)
	unkR[60] = -unkR[62] ;
else unkR[60] = 0 ;
unkR[103] = unkR[100] * sin(unkR[106] * unkR[101]) * cos(unkR[98] * unkR[101]) ;
unkR[104] = unkR[100] * sin(unkR[106] * unkR[101]) * sin(unkR[98] * unkR[101]) ;
unkR[105] = unkR[100] * cos(unkR[106] * unkR[101]) ;
unkR[39] = unkR[38] * sin(unkR[107] * unkR[101]) * cos(unkR[99] * unkR[101]) ;
unkR[40] = unkR[38] * sin(unkR[107] * unkR[101]) * sin(unkR[99] * unkR[101]) ;
unkR[41] = unkR[38] * cos(unkR[107] * unkR[101]) ;
unkR[65] = unkR[104] * unkR[41] - unkR[105] * unkR[40] + unkR[60] * sin(unkR[107] * unkR[101]) * cos(unkR[99] * unkR[101]) ;
unkR[66] = unkR[105] * unkR[39] - unkR[103] * unkR[41] + unkR[60] * sin(unkR[107] * unkR[101]) * sin(unkR[99] * unkR[101]) ;
unkR[67] = unkR[103] * unkR[40] - unkR[104] * unkR[39] + unkR[60] * cos(unkR[107] * unkR[101]) ;
unkR[189] = -unkR[194] ;
res[0]= evalNormResidueInternal(0,der[0],ldr[0]);
res[1]= evalNormResidueInternal(1,der[1],ldr[1]);
res[2]= evalNormResidueInternal(2,der[2],ldr[2]);

if( restartB )
     dcopy(3,der,ldr);
memcpy(this->res,res,4*sizeof(double));
printDbgInfoForModel(-1,false);
}

void EP__EPsystem_default::checkAsserts(double *_time)
{
if ( warnProgramme() == false)
	return;
if(!(unkI[2] > 0))
	issueError(215,99,13,98,"CompVolTMD.el",71,"Tank.","ASSERT failed: %s","Vol_TMD: working fluid not defined");
if(!(cteI[0+(unkI[0]-1)] >= 0 || cteI[0+(unkI[1]-1)] > 0))
	issueError(215,99,13,98,"CompVolTMD.el",72,"Tank.","ASSERT failed: %s","Vol_TMD: A non condensable fluid compatible with Chemicals must be defined in case of combusted gases");
if(!(unkI[1102] != 20))
	issueError(214,8,13,98,"CompVolTMD.el",74,"Tank.","ASSERT failed: %s","Vol_TMD: lack of convergence in H.E. Model");
if(!(unkI[2] > 0))
	issueError(215,99,13,98,"CompJunction.el",221,"XFC.","ASSERT failed: %s","AbstractJunction: working fluid not defined in the model");
if(!(cteI[0+(unkI[0]-1)] >= 0 || 0))
	issueError(215,99,13,98,"CompJunction.el",223,"XFC.","ASSERT failed: %s","Junction: burnerGasesOption must be Chemicals in case of combusted gases");
if(!(cteI[0+(unkI[0]-1)] < 0 || 1))
	issueError(215,99,13,98,"CompJunction.el",225,"XFC.","ASSERT failed: %s","Junction: burnerGasesOption must be noBurnGases in case of no combusted gases");
if(!(unkR[256] > unkR[257]))
	issueError(215,99,13,98,"CTRL_CompControllers.el",177,"PPU.ItthPID.","ASSERT failed: %s","Wrong limits for the controller");
if(!(unkI[2] > 0))
	issueError(215,99,13,98,"CompVolTMD.el",71,"EPthr.","ASSERT failed: %s","Vol_TMD: working fluid not defined");
if(!(cteI[0+(unkI[0]-1)] >= 0 || cteI[0+(unkI[1]-1)] > 0))
	issueError(215,99,13,98,"CompVolTMD.el",72,"EPthr.","ASSERT failed: %s","Vol_TMD: A non condensable fluid compatible with Chemicals must be defined in case of combusted gases");
if(!(unkI[10] != 20))
	issueError(214,8,13,98,"CompVolTMD.el",74,"EPthr.","ASSERT failed: %s","Vol_TMD: lack of convergence in H.E. Model");
}

void EP__EPsystem_default::constraints( double *_time, double ev[],double dyn[],double ldr[]) 
{
    ev[0]= unkI[1115] - 1;
    ev[1]= unkI[1082] - 1;
    ev[2]= unkI[1082] - 1;
    ev[3]= unkI[1085] - 8;
    ev[4]= unkI[1086] - 1;
    ev[5]= unkR[193] - 45;
    ev[6]= unkR[193] - 45;
    ev[7]= unkI[1097];
    ev[8]= unkI[1087] - 1;
    ev[9]= unkI[1095] - 1;
    ev[10]= unkI[1096] - 1;
    ev[11]= unkI[1095] - 2;
    ev[12]= unkI[1098] - 1;
    ev[13]= unkI[1095] - 2;
    ev[14]= unkI[1098] - 3;
    ev[15]= unkI[1095] - 2;
    ev[16]= unkI[1098] - 4;
    ev[17]= unkI[1095] - 2;
    ev[18]= unkI[1098] - 5;
    ev[19]= unkI[1095] - 2;
    ev[20]= unkI[1098] - 6;
    ev[21]= unkI[1096] - 1;
    ev[22]= unkI[1098] - 2;
    ev[23]= unkI[1095] - 3;
    ev[24]= unkI[1098] - 1;
    ev[25]= unkI[1095] - 6;
    ev[26]= unkI[1095] - 4;
    ev[27]= unkI[1098] - 13;
    ev[28]= unkI[1095] - 4;
    ev[29]= unkI[1098] - 14;
    ev[30]= unkI[1095] - 4;
    ev[31]= unkI[1098] - 15;
    ev[32]= unkI[1095] - 4;
    ev[33]= unkI[1098] - 16;
    ev[34]= unkI[1095] - 4;
    ev[35]= unkI[1098] - 17;
    ev[36]= unkI[1095] - 4;
    ev[37]= unkI[1098] - 18;
    ev[38]= unkI[1095] - 4;
    ev[39]= unkI[1098] - 19;
    ev[40]= unkI[1095] - 4;
    ev[41]= unkI[1098] - 20;
    ev[42]= unkI[1095] - 4;
    ev[43]= unkI[1098] - 21;
    ev[44]= unkI[1096] - 1;
    ev[45]= unkI[1098] - 8;
    ev[46]= unkI[1096] - 1;
    ev[47]= unkI[1098] - 9;
    ev[48]= unkI[1096] - 1;
    ev[49]= unkI[1098] - 10;
    ev[50]= unkI[1096] - 1;
    ev[51]= unkI[1098] - 11;
    ev[52]= unkI[1096] - 1;
    ev[53]= unkI[1098] - 12;
    ev[54]= unkI[1098] - 1;
    ev[55]= unkI[1087] - 1;
    ev[56]= unkI[1096] - 1;
    ev[57]= unkI[1095] - 5;
    ev[58]= unkI[1092] - 1;
    ev[59]= unkI[1095] - 5;
    ev[60]= unkR[42] - unkR[241];
    ev[61]= unkR[46] - 10;
    ev[62]= unkR[46] - 10;
    ev[63]= unkR[43] - unkR[61] - unkR[44];
    ev[64]= unkR[52] - 30;
    ev[65]= unkI[4] - 1;
    ev[66]= unkI[4] - 1;
    ev[67]= dyn[0] - unkR[97];
    ev[68]= unkI[6] - unkI[7];
    ev[69]= unkR[51] - unkR[68];
    ev[70]= dyn[0] - unkR[97];
    ev[71]= unkR[51] - unkR[188];
    ev[72]= unkR[42] - unkR[185];
    ev[73]= unkR[42] - unkR[185];
    ev[74]= (*_time) - unkR[306];
    ev[75]= unkI[1100] - 1;
    ev[76]= unkI[1100] - 2;
    ev[77]= unkI[1100] - 3;
    ev[78]= unkI[1100] - 4;
    ev[79]= unkI[1100] - 5;
    ev[80]= unkI[1100] - 6;
    ev[81]= unkI[1100] - 7;
    ev[82]= unkI[1100] - 8;
    ev[83]= unkI[1101] - 1;
    ev[84]= unkI[1100] - 8;
    ev[85]= unkI[1101] - 2;
    ev[86]= unkI[1100] - 8;
    ev[87]= unkI[1101] - 3;
    ev[88]= unkI[1100] - 8;
    ev[89]= unkI[1101] - 4;
    ev[90]= (*_time) - unkR[332];
    ev[91]= unkI[1106] - 1;
    ev[92]= unkI[1106] - 2;
    ev[93]= unkI[1106] - 3;
    ev[94]= unkI[1106] - 4;
    ev[95]= unkI[1106] - 5;
    ev[96]= unkI[1106] - 6;
    ev[97]= unkI[1106] - 7;
    ev[98]= unkI[1106] - 8;
    ev[99]= unkI[1107] - 1;
    ev[100]= unkI[1106] - 8;
    ev[101]= unkI[1107] - 2;
    ev[102]= unkI[1106] - 8;
    ev[103]= unkI[1107] - 3;
    ev[104]= unkI[1106] - 8;
    ev[105]= unkI[1107] - 4;
    ev[106]= (*_time) - unkR[356];
    ev[107]= unkI[1117] - 1;
    ev[108]= unkI[1117] - 2;
    ev[109]= unkI[1117] - 3;
    ev[110]= unkI[1117] - 4;
    ev[111]= unkI[1117] - 5;
    ev[112]= unkI[1117] - 6;
    ev[113]= unkI[1117] - 7;
    ev[114]= unkI[1117] - 8;
    ev[115]= unkI[1118] - 1;
    ev[116]= unkI[1117] - 8;
    ev[117]= unkI[1118] - 2;
    ev[118]= unkI[1117] - 8;
    ev[119]= unkI[1118] - 3;
    ev[120]= unkI[1117] - 8;
    ev[121]= unkI[1118] - 4;
    ev[122]= unkI[1084] - 1;
    ev[123]= unkI[1084] - 1;
    ev[124]= unkR[276] - unkR[344];
    ev[125]= unkR[343] - 1;
    ev[126]= (*_time) - unkR[222];
    ev[127]= unkI[1088] - 1;
    ev[128]= unkI[1088] - 2;
    ev[129]= unkI[1088] - 3;
    ev[130]= unkI[1088] - 4;
    ev[131]= unkI[1088] - 5;
    ev[132]= unkI[1088] - 6;
    ev[133]= unkI[1088] - 7;
    ev[134]= unkI[1088] - 8;
    ev[135]= unkI[1089] - 1;
    ev[136]= unkI[1088] - 8;
    ev[137]= unkI[1089] - 2;
    ev[138]= unkI[1088] - 8;
    ev[139]= unkI[1089] - 3;
    ev[140]= unkI[1088] - 8;
    ev[141]= unkI[1089] - 4;
    ev[142]= (*_time) - unkR[231];
    ev[143]= unkI[1090] - 1;
    ev[144]= unkI[1090] - 2;
    ev[145]= unkI[1090] - 3;
    ev[146]= unkI[1090] - 4;
    ev[147]= unkI[1090] - 5;
    ev[148]= unkI[1090] - 6;
    ev[149]= unkI[1090] - 7;
    ev[150]= unkI[1090] - 8;
    ev[151]= unkI[1091] - 1;
    ev[152]= unkI[1090] - 8;
    ev[153]= unkI[1091] - 2;
    ev[154]= unkI[1090] - 8;
    ev[155]= unkI[1091] - 3;
    ev[156]= unkI[1090] - 8;
    ev[157]= unkI[1091] - 4;
    ev[158]= unkR[258] - unkR[256];
    ev[159]= unkR[258] - unkR[257];
    ev[160]= unkI[1093] - 1;
    ev[161]= unkR[259] - unkR[256];
    ev[162]= unkR[259] - unkR[257];
    ev[163]= unkR[201] - 1;
    ev[164]= unkR[42] - unkR[240];
    ev[165]= unkR[201] - 1;
    ev[166]= unkR[42] - unkR[240];
    ev[167]= unkR[42] - (unkR[240] + _div( unkR[293] , abs(unkR[277]),"abs(PPU.SlopeAfterKnee)"));
    ev[168]= unkR[237] - 1;
    ev[169]= unkR[292] - 1;
    ev[170]= unkR[217] - 1;
    ev[171]= unkR[264] - 1;
    ev[172]= unkR[289] - 1;
    ev[173]= unkI[1094] - 1;
    ev[174]= A70cc6b29de1c2b1f2003db9666acb8b9(1) - 1;
    ev[175]= unkI[1095] - 2;
    ev[176]= unkI[1095] - 3;
    ev[177]= unkI[1095] - 4;
    ev[178]= A70cc6b29de1c2b1f2003db9666acb8b9(6) - 1;
    ev[179]= A70cc6b29de1c2b1f2003db9666acb8b9(7) - 1;
    ev[180]= unkI[5] - 1;
    ev[181]= unkI[8] - 2;
    ev[182]= unkI[5] - 1;
    ev[183]= 9.80665 * dyn[3] - unkR[93];
    ev[184]= unkI[5] - 1;
    ev[185]= unkI[5] - 1;
    ev[186]= unkI[5] - 1;
    ev[187]= unkI[5] - 1;
    ev[188]= A70cc6b29de1c2b1f2003db9666acb8b9(4) - 1;
    ev[189]= A70cc6b29de1c2b1f2003db9666acb8b9(5) - 1;
}

void EP__EPsystem_default::evalWhen(double *_time, bool w[],bool cont[] )
{
     w[0] = cont[0] ;     w[1] = cont[1] ;     w[2] = ! cont[2] ;     w[3] = cont[3] ;     w[4] = ! cont[4] ;     w[5] = cont[5] ;     w[6] = cont[6] ;     w[7] = cont[7]  && cont[8] ;     w[8] = cont[9]  && cont[10] ;     w[9] = cont[11]  && cont[12] ;     w[10] = cont[13]  && cont[14] ;     w[11] = cont[15]  && cont[16] ;     w[12] = cont[17]  && cont[18] ;     w[13] = cont[19]  && cont[20] ;     w[14] = cont[21]  && cont[22] ;     w[15] = cont[23]  && cont[24] ;     w[16] = cont[25] ;     w[17] = cont[26]  && cont[27] ;     w[18] = cont[28]  && cont[29] ;     w[19] = cont[30]  && cont[31] ;     w[20] = cont[32]  && cont[33] ;     w[21] = cont[34]  && cont[35] ;     w[22] = cont[36]  && cont[37] ;     w[23] = cont[38]  && cont[39] ;     w[24] = cont[40]  && cont[41] ;     w[25] = cont[42]  && cont[43] ;     w[26] = cont[44]  && cont[45] ;     w[27] = cont[46]  && cont[47] ;     w[28] = cont[48]  && cont[49] ;     w[29] = cont[50]  && cont[51] ;     w[30] = cont[52]  && cont[53] ;     w[31] = cont[54] ;     w[32] = ! cont[55] ;     w[33] = ! cont[56] ;     w[34] = cont[57] ;     w[35] = cont[58] ;     w[36] = cont[59]  && cont[60] ;     w[37] = cont[61] ;     w[38] = cont[62] ;     w[39] = cont[63] ;     w[40] = cont[64]  && cont[65] ;     w[41] = cont[66]  && cont[67]  && cont[68] ;     w[42] = cont[69]  || cont[70] ;}

void EP__EPsystem_default::executeWhen(double *_time,  int index )
{
  if ( index == 0 )
  {
	unkI[2] = unkI[2] + 1 ;
	if(!(unkI[2] == 1))
	issueError(215,99,13,98,"CompWorkingFluid.el",46,"gas.","ASSERT failed: %s","WorkingFluid: working fluid defined more than once");

	unkI[1115] = 0 ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 1 )
  {
	unkI[1084] = 0 ;
	unkI[1083] = 1 ;
	return;
  }

  if ( index == 2 )
  {
	unkI[1083] = 0 ;
	unkI[1084] = 1 ;
	return;
  }

  if ( index == 3 )
  {
	unkI[1086] = 1 ;
	unkI[3] = unkI[1085] ;
	unkI[1085] = 8 ;
	return;
  }

  if ( index == 4 )
  {
	unkI[3] = 8 ;
	return;
  }

  if ( index == 5 )
  {
	unkI[1087] = 1 ;
	return;
  }

  if ( index == 6 )
  {
	unkI[1087] = 0 ;
	return;
  }

  if ( index == 7 )
  {
	if( unkI[1097] == 1 ) {
	if( A70cc6b29de1c2b1f2003db9666acb8b9(2) ) {
	unkI[1096] = 0 ;
	}
	else {
	addTimedAssignI(&unkI[1096], 1, (*_time)+1 ) ;
	}
		}
	else if( unkI[1097] == 2) {
	addTimedAssignI(&unkI[1096], 0, (*_time)+1 ) ;

	}
	addTimedAssignI(&unkI[1097], 0, (*_time)+1 ) ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 8 )
  {
	addTimedAssignI(&unkI[1095], 2, (*_time)+0.1 ) ;
	return;
  }

  if ( index == 9 )
  {
	if( unkI[1098] == 2 || unkI[1098] == 13 || unkI[1098] == 14 || unkI[1098] == 15 || unkI[1098] == 16 || unkI[1098] == 17 || unkI[1098] == 18 || unkI[1098] == 19 || unkI[1098] == 20 || unkI[1098] == 21 ) {
	unkR[279] = 1 ;
	}
	else {
	unkR[279] = 0 ;
	}
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 10 )
  {
	addTimedAssignI(&unkI[1095], 3, (*_time)+0.1 ) ;
	unkI[1098] = 1 ;
	return;
  }

  if ( index == 11 )
  {
	addTimedAssignI(&unkI[1095], 4, (*_time)+0.1 ) ;
	unkI[1098] = 1 ;
	return;
  }

  if ( index == 12 )
  {
	addTimedAssignI(&unkI[1095], 5, (*_time)+0.1 ) ;
	unkI[1098] = 1 ;
	return;
  }

  if ( index == 13 )
  {
	addTimedAssignI(&unkI[1095], 6, (*_time)+0.1 ) ;
	unkI[1098] = 1 ;
	return;
  }

  if ( index == 14 )
  {
	unkI[1095] = 2 ;
	unkI[1098] = 1 ;
	return;
  }

  if ( index == 15 )
  {
	if( unkI[1098] == 13 ) {
	unkR[292] = 1 ;
		}
	else if( unkI[1098] == 14) {
	unkR[292] = 0 ;

	}
	unkI[1098] = 1 ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 16 )
  {
	unkR[292] = 1 ;
	addTimedAssignR(&unkR[292], 0, (*_time)+getAfterExpr(unkR[290],"PPU.Tventing") ) ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 17 )
  {
	unkR[292] = 1 ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 18 )
  {
	unkR[292] = 0 ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 19 )
  {
	unkR[217] = 1 ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 20 )
  {
	unkR[217] = 0 ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 21 )
  {
	unkR[264] = 1 ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 22 )
  {
	unkR[264] = 0 ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 23 )
  {
	unkI[1094] = 1 ;
	return;
  }

  if ( index == 24 )
  {
	unkI[1094] = 0 ;
	return;
  }

  if ( index == 25 )
  {
	unkI[1092] = 1 ;
	return;
  }

  if ( index == 26 )
  {
	unkR[226] = unkR[281] ;
	unkI[1098] = 1 ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 27 )
  {
	unkR[239] = unkR[281] ;
	unkI[1098] = 1 ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 28 )
  {
	unkR[238] = unkR[281] ;
	unkI[1098] = 1 ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 29 )
  {
	unkR[244] = unkR[281] ;
	unkI[1098] = 1 ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 30 )
  {
	unkR[291] = unkR[281] ;
	unkI[1098] = 1 ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 31 )
  {
	unkR[281] = -1 ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 32 )
  {
	unkI[1096] = 0 ;
	return;
  }

  if ( index == 33 )
  {
	unkI[1095] = 1 ;
	unkR[201] = 0 ;
	unkR[217] = 0 ;
	unkR[264] = 0 ;
	unkR[289] = 0 ;
	unkR[292] = 0 ;
	unkR[279] = 0 ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 34 )
  {
	unkR[201] = 1 ;
	unkR[217] = 1 ;
	unkR[289] = 1 ;
	addTimedAssignR(&unkR[292], 1, (*_time)+getAfterExpr(unkR[288],"PPU.Theating") ) ;
	addTimedAssignI(&unkI[1092], 1, (*_time)+getAfterExpr(unkR[288] + unkR[287],"PPU.Theating + PPU.Tflow") ) ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 35 )
  {
	unkR[217] = 0 ;
	unkR[237] = 1 ;
	addTimedAssignR(&unkR[237], 0, (*_time)+getAfterExpr(unkR[269],"PPU.PulseWidth") ) ;
	addTimedAssignI(&unkI[1092], 0, (*_time)+getAfterExpr(unkR[269],"PPU.PulseWidth") ) ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 36 )
  {
	unkI[1094] = 1 ;
	unkR[264] = 1 ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 37 )
  {
	unkR[61] = unkR[43] ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 38 )
  {
	unkR[61] = 1e+040 ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 39 )
  {
	unkI[4] = 1 ;
	return;
  }

  if ( index == 40 )
  {
	unkI[6] = unkI[6] + 1 ;
	m_needSatisfyResidues = true;
	return;
  }

  if ( index == 41 )
  {
	unkI[5] = 1 ;
	return;
  }

  if ( index == 42 )
  {
	unkI[4] = 0 ;
	unkI[5] = 0 ;
	unkI[6] = 0 ;
	m_needSatisfyResidues = true;
	return;
  }

}

void EP__EPsystem_default::evalZones( double *_time,  int branchZone[],bool cont[] )
{
     branchZone[0] = (cont[71]  && cont[72] ) ? 0 : (cont[73] ) ? 1 : 2;
     branchZone[1] = (cont[74] ) ? 0 : (cont[75] ) ? 1 : (cont[76] ) ? 2 : (cont[77] ) ? 3 : (cont[78] ) ? 4 : (cont[79] ) ? 5 : (cont[80] ) ? 6 : (cont[81] ) ? 7 : (cont[82]  && cont[83] ) ? 8 : (cont[84]  && cont[85] ) ? 9 : (cont[86]  && cont[87] ) ? 10 : (cont[88]  && cont[89] ) ? 11 : 12;
     branchZone[2] = (cont[90] ) ? 0 : (cont[91] ) ? 1 : (cont[92] ) ? 2 : (cont[93] ) ? 3 : (cont[94] ) ? 4 : (cont[95] ) ? 5 : (cont[96] ) ? 6 : (cont[97] ) ? 7 : (cont[98]  && cont[99] ) ? 8 : (cont[100]  && cont[101] ) ? 9 : (cont[102]  && cont[103] ) ? 10 : (cont[104]  && cont[105] ) ? 11 : 12;
     branchZone[3] = (cont[106] ) ? 0 : (cont[107] ) ? 1 : (cont[108] ) ? 2 : (cont[109] ) ? 3 : (cont[110] ) ? 4 : (cont[111] ) ? 5 : (cont[112] ) ? 6 : (cont[113] ) ? 7 : (cont[114]  && cont[115] ) ? 8 : (cont[116]  && cont[117] ) ? 9 : (cont[118]  && cont[119] ) ? 10 : (cont[120]  && cont[121] ) ? 11 : 12;
     branchZone[4] = (cont[122] ) ? 0 : 1;
     branchZone[5] = (cont[123] ) ? 0 : 1;
     branchZone[6] = (cont[124] ) ? 0 : 1;
     branchZone[7] = (cont[125] ) ? 0 : 1;
     branchZone[8] = (cont[126] ) ? 0 : (cont[127] ) ? 1 : (cont[128] ) ? 2 : (cont[129] ) ? 3 : (cont[130] ) ? 4 : (cont[131] ) ? 5 : (cont[132] ) ? 6 : (cont[133] ) ? 7 : (cont[134]  && cont[135] ) ? 8 : (cont[136]  && cont[137] ) ? 9 : (cont[138]  && cont[139] ) ? 10 : (cont[140]  && cont[141] ) ? 11 : 12;
     branchZone[9] = (cont[142] ) ? 0 : (cont[143] ) ? 1 : (cont[144] ) ? 2 : (cont[145] ) ? 3 : (cont[146] ) ? 4 : (cont[147] ) ? 5 : (cont[148] ) ? 6 : (cont[149] ) ? 7 : (cont[150]  && cont[151] ) ? 8 : (cont[152]  && cont[153] ) ? 9 : (cont[154]  && cont[155] ) ? 10 : (cont[156]  && cont[157] ) ? 11 : 12;
     branchZone[10] = (cont[158] ) ? 0 : (cont[159] ) ? 1 : 2;
     branchZone[11] = (cont[160] ) ? 0 : 1;
     branchZone[12] = (cont[161] ) ? 0 : (cont[162] ) ? 1 : 2;
     branchZone[13] = (cont[163]  && cont[164] ) ? 0 : (cont[165]  && cont[166]  && cont[167] ) ? 1 : 2;
     branchZone[14] = (cont[168] ) ? 0 : 1;
     branchZone[15] = (cont[169] ) ? 0 : 1;
     branchZone[16] = (cont[170] ) ? 0 : 1;
     branchZone[17] = (cont[171] ) ? 0 : 1;
     branchZone[18] = (cont[172] ) ? 0 : 1;
     branchZone[19] = (cont[173] ) ? 0 : 1;
     branchZone[20] = (cont[174] ) ? 0 : 1;
     branchZone[21] = (cont[175]  || cont[176]  || cont[177] ) ? 0 : 1;
     branchZone[22] = (cont[178] ) ? 0 : (cont[179] ) ? 1 : 2;
     branchZone[23] = (cont[180]  && cont[181] ) ? 0 : (cont[182]  && cont[183] ) ? 1 : (cont[184] ) ? 2 : 3;
     branchZone[24] = (cont[185] ) ? 0 : 1;
     branchZone[25] = (cont[186] ) ? 0 : 1;
     branchZone[26] = (! cont[187] ) ? 0 : (cont[188] ) ? 1 : (cont[189] ) ? 2 : 3;
}

INTEG_simula::t_initEvent* EP__EPsystem_default::initEvents(int& nEvents,int& nWhen,int& nZones,         
	int& nConstraints, const char**& whenTxt,const char**& zoneTxt,int *&zoneTxtIndex)
{
	nEvents= 190 ;
	nConstraints= 542;
	nWhen= 43;
	nZones= 27;
	static const char* whenTxtTable[43]= { "",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		"",
		""};
	whenTxt= whenTxtTable;

	static const char* zoneTxtTable[] = { "FU.THR.Vdischarge < FU.VoltageTransition AND FU.THR.Idischarge > FU.CurrentTransition","FU.THR.Idischarge > FU.CurrentTransition","OTHERS",
	"TIME < Pxenon.Tstart","Pxenon.source == Source_Constant","Pxenon.source == Source_Sine","Pxenon.source == Source_Pulse","Pxenon.source == Source_Step","Pxenon.source == Source_SawTooth","Pxenon.source == Source_Square","Pxenon.source == Source_Ramp","Pxenon.source == Source_Table AND Pxenon.tabmethod == LinearInterpWithEvents","Pxenon.source == Source_Table AND Pxenon.tabmethod == LinearInterpWithoutEvents","Pxenon.source == Source_Table AND Pxenon.tabmethod == SplineInterp","Pxenon.source == Source_Table AND Pxenon.tabmethod == StepConnect","OTHERS",
	"TIME < Txenon.Tstart","Txenon.source == Source_Constant","Txenon.source == Source_Sine","Txenon.source == Source_Pulse","Txenon.source == Source_Step","Txenon.source == Source_SawTooth","Txenon.source == Source_Square","Txenon.source == Source_Ramp","Txenon.source == Source_Table AND Txenon.tabmethod == LinearInterpWithEvents","Txenon.source == Source_Table AND Txenon.tabmethod == LinearInterpWithoutEvents","Txenon.source == Source_Table AND Txenon.tabmethod == SplineInterp","Txenon.source == Source_Table AND Txenon.tabmethod == StepConnect","OTHERS",
	"TIME < qual.Tstart","qual.source == Source_Constant","qual.source == Source_Sine","qual.source == Source_Pulse","qual.source == Source_Step","qual.source == Source_SawTooth","qual.source == Source_Square","qual.source == Source_Ramp","qual.source == Source_Table AND qual.tabmethod == LinearInterpWithEvents","qual.source == Source_Table AND qual.tabmethod == LinearInterpWithoutEvents","qual.source == Source_Table AND qual.tabmethod == SplineInterp","qual.source == Source_Table AND qual.tabmethod == StepConnect","OTHERS",
	"HPSSPC.open","OTHERS",
	"HPSSPC.open","OTHERS",
	"XFC.xfc.Vvalves >= XFC.Vvalves_drop_out","OTHERS",
	"XFC.ValvesPosition == 1","OTHERS",
	"TIME < PPU.IdMeasured.Tstart","PPU.IdMeasured.source == Source_Constant","PPU.IdMeasured.source == Source_Sine","PPU.IdMeasured.source == Source_Pulse","PPU.IdMeasured.source == Source_Step","PPU.IdMeasured.source == Source_SawTooth","PPU.IdMeasured.source == Source_Square","PPU.IdMeasured.source == Source_Ramp","PPU.IdMeasured.source == Source_Table AND PPU.IdMeasured.tabmethod == LinearInterpWithEvents","PPU.IdMeasured.source == Source_Table AND PPU.IdMeasured.tabmethod == LinearInterpWithoutEvents","PPU.IdMeasured.source == Source_Table AND PPU.IdMeasured.tabmethod == SplineInterp","PPU.IdMeasured.source == Source_Table AND PPU.IdMeasured.tabmethod == StepConnect","OTHERS",
	"TIME < PPU.Id_Set.Tstart","PPU.Id_Set.source == Source_Constant","PPU.Id_Set.source == Source_Sine","PPU.Id_Set.source == Source_Pulse","PPU.Id_Set.source == Source_Step","PPU.Id_Set.source == Source_SawTooth","PPU.Id_Set.source == Source_Square","PPU.Id_Set.source == Source_Ramp","PPU.Id_Set.source == Source_Table AND PPU.Id_Set.tabmethod == LinearInterpWithEvents","PPU.Id_Set.source == Source_Table AND PPU.Id_Set.tabmethod == LinearInterpWithoutEvents","PPU.Id_Set.source == Source_Table AND PPU.Id_Set.tabmethod == SplineInterp","PPU.Id_Set.source == Source_Table AND PPU.Id_Set.tabmethod == StepConnect","OTHERS",
	"PPU.ItthPID.v[1] > PPU.VectorIttmax[1]","PPU.ItthPID.v[1] < PPU.ItthPID.u_min[1]","OTHERS",
	"PPU.ItthPID.end_pos == end_I","OTHERS",
	"PPU.ItthPID.vi[1] > PPU.VectorIttmax[1]","PPU.ItthPID.vi[1] < PPU.ItthPID.u_min[1]","OTHERS",
	"PPU.AnodeSupply == 1 AND PPU.Id <= PPU.ImaxOp","PPU.AnodeSupply == 1 AND PPU.Id > PPU.ImaxOp AND PPU.Id < (PPU.ImaxOp + PPU.VdSet / abs(PPU.SlopeAfterKnee))","OTHERS",
	"PPU.IgnitorSupply == 1","OTHERS",
	"PPU.ValveSupply == 1","OTHERS",
	"PPU.HeaterSupply == 1","OTHERS",
	"PPU.MagnetSupply == 1","OTHERS",
	"PPU.ThermothrottleSupply == 1","OTHERS",
	"PPU.LoopON","OTHERS",
	"EP.event_RAMS(Fail_PPU_power150pc)","OTHERS",
	"PPU.Mode == StandBy OR PPU.Mode == Configuration OR PPU.Mode == Remote","OTHERS",
	"EP.event_RAMS(Fail_XeLeakage_1)","EP.event_RAMS(Fail_XeLeakage_2)","OTHERS",
	"EPthr.AlreadyIgnited AND EPthr.ThrType == AlternateModel","EPthr.AlreadyIgnited AND (9.80665 * EPthr.Isp) >= EPthr.goIspLoss","EPthr.AlreadyIgnited","OTHERS",
	"EPthr.AlreadyIgnited","OTHERS",
	"EPthr.AlreadyIgnited","OTHERS",
	"NOT EPthr.AlreadyIgnited","EP.event_RAMS(Fail_Max_Swirl_Torque)","EP.event_RAMS(Fail_Wrong_Swirl_Orientation)","OTHERS"};
	static int zoneTxtIndexTable[] = { 0,3,16,29,42,44,46,48,50,63,76,79,81,84,
87,89,91,93,95,97,99,101,103,106,110,112,114 };
	zoneTxt= zoneTxtTable;
	zoneTxtIndex= zoneTxtIndexTable;

	static t_initEvent evs[190]= { { WHEN,EQ_OP,0,0,"gas.Init_Flag"},{ WHEN,EQ_OP,0,1,"HPSSPC.b_fire.signal[1]"},{ WHEN,EQ_OP,0,2,"HPSSPC.b_fire.signal[1]"},{ WHEN,NOT_EQ_OP,0,3,"InjectFailure.rams.event != NoFail"},{ WHEN,EQ_OP,0,4,"InjectFailure.rams.set"},{ WHEN,GT_OP,0,5,"HPSSPC.e_n.v > 45"}
,{ WHEN,LT_EQ_OP,0,6,"HPSSPC.e_n.v <= 45"},{ WHEN,NOT_EQ_OP,0,7,"PPU.TcTm.DTC != 0"},{ WHEN,EQ_OP,0,7,"PPU.BusPowerON"},{ WHEN,EQ_OP,0,8,"PPU.Mode == Power_Off"},{ WHEN,EQ_OP,0,8,"PPU.PPU_ON"}
,{ WHEN,EQ_OP,0,9,"PPU.Mode == StandBy"},{ WHEN,NOT_EQ_OP,0,9,"PPU.TcTm.TC != None"},{ WHEN,EQ_OP,0,10,"PPU.Mode == StandBy"},{ WHEN,EQ_OP,0,10,"PPU.TcTm.TC == TCConfiguration"},{ WHEN,EQ_OP,0,11,"PPU.Mode == StandBy"}
,{ WHEN,EQ_OP,0,11,"PPU.TcTm.TC == TCRemote"},{ WHEN,EQ_OP,0,12,"PPU.Mode == StandBy"},{ WHEN,EQ_OP,0,12,"PPU.TcTm.TC == TCAutomatic"},{ WHEN,EQ_OP,0,13,"PPU.Mode == StandBy"},{ WHEN,EQ_OP,0,13,"PPU.TcTm.TC == TCVenting"}
,{ WHEN,EQ_OP,0,14,"PPU.PPU_ON"},{ WHEN,EQ_OP,0,14,"PPU.TcTm.TC == TCStandBy"},{ WHEN,EQ_OP,0,15,"PPU.Mode == Configuration"},{ WHEN,NOT_EQ_OP,0,15,"PPU.TcTm.TC != None"},{ WHEN,EQ_OP,0,16,"PPU.Mode == Venting"}
,{ WHEN,EQ_OP,0,17,"PPU.Mode == Remote"},{ WHEN,EQ_OP,0,17,"PPU.TcTm.TC == TCValvesOn"},{ WHEN,EQ_OP,0,18,"PPU.Mode == Remote"},{ WHEN,EQ_OP,0,18,"PPU.TcTm.TC == TCValvesOff"},{ WHEN,EQ_OP,0,19,"PPU.Mode == Remote"}
,{ WHEN,EQ_OP,0,19,"PPU.TcTm.TC == TCHeaterOn"},{ WHEN,EQ_OP,0,20,"PPU.Mode == Remote"},{ WHEN,EQ_OP,0,20,"PPU.TcTm.TC == TCHeaterOff"},{ WHEN,EQ_OP,0,21,"PPU.Mode == Remote"},{ WHEN,EQ_OP,0,21,"PPU.TcTm.TC == TCMagnetOn"}
,{ WHEN,EQ_OP,0,22,"PPU.Mode == Remote"},{ WHEN,EQ_OP,0,22,"PPU.TcTm.TC == TCMagnetOff"},{ WHEN,EQ_OP,0,23,"PPU.Mode == Remote"},{ WHEN,EQ_OP,0,23,"PPU.TcTm.TC == TCLoopOn"},{ WHEN,EQ_OP,0,24,"PPU.Mode == Remote"}
,{ WHEN,EQ_OP,0,24,"PPU.TcTm.TC == TCLoopOff"},{ WHEN,EQ_OP,0,25,"PPU.Mode == Remote"},{ WHEN,EQ_OP,0,25,"PPU.TcTm.TC == TCIgnitorOn"},{ WHEN,EQ_OP,0,26,"PPU.PPU_ON"},{ WHEN,EQ_OP,0,26,"PPU.TcTm.TC == TCIdSet"}
,{ WHEN,EQ_OP,0,27,"PPU.PPU_ON"},{ WHEN,EQ_OP,0,27,"PPU.TcTm.TC == TCImagnet"},{ WHEN,EQ_OP,0,28,"PPU.PPU_ON"},{ WHEN,EQ_OP,0,28,"PPU.TcTm.TC == TCIheater"},{ WHEN,EQ_OP,0,29,"PPU.PPU_ON"}
,{ WHEN,EQ_OP,0,29,"PPU.TcTm.TC == TCIthermthrottle"},{ WHEN,EQ_OP,0,30,"PPU.PPU_ON"},{ WHEN,EQ_OP,0,30,"PPU.TcTm.TC == TCVaccel"},{ WHEN,EQ_OP,0,31,"PPU.TcTm.TC == None"},{ WHEN,EQ_OP,0,32,"PPU.BusPowerON"}
,{ WHEN,EQ_OP,0,33,"PPU.PPU_ON"},{ WHEN,EQ_OP,0,34,"PPU.Mode == Automatic"},{ WHEN,EQ_OP,0,35,"PPU.IgnitionPulse"},{ WHEN,EQ_OP,0,36,"PPU.Mode == Automatic"},{ WHEN,GT_OP,0,36,"PPU.IdMeasured.Amp > PPU.IminOp"}
,{ WHEN,GT_OP,0,37,"PPU.Heater.I > 10"},{ WHEN,LT_OP,0,38,"PPU.Heater.I < 10"},{ WHEN,GT_OP,0,39,"(EPthr.LocalTime - EPthr.Th_start) > EPthr.NeededHeatingTime"},{ WHEN,GT_OP,0,40,"PPU.IgnitorKeeper.V > 30"},{ WHEN,EQ_OP,0,40,"EPthr.AlreadyHeated ==  TRUE "}
,{ WHEN,EQ_OP,0,41,"EPthr.AlreadyHeated"},{ WHEN,GT_OP,0,41,"XFC.m > EPthr.m_min"},{ WHEN,GT_EQ_OP,0,41,"EPthr.IgnitionPulseCount >= EPthr.NeededIgnitionPulses"},{ WHEN,LT_EQ_OP,0,42,"PPU.Anode.V <= EPthr.VminOp"},{ WHEN,LT_EQ_OP,0,42,"XFC.m <= EPthr.m_min"}
,{ ZONE,LT_OP,0,0,"PPU.Anode.V < FU.VoltageTransition"},{ ZONE,GT_OP,0,0,"PPU.IdMeasured.Amp > FU.CurrentTransition"},{ ZONE,GT_OP,0,0,"PPU.IdMeasured.Amp > FU.CurrentTransition"},{ ZONE,LT_OP,0,0,"TIME < Pxenon.Tstart"},{ ZONE,EQ_OP,0,0,"Pxenon.source == Source_Constant"}
,{ ZONE,EQ_OP,0,0,"Pxenon.source == Source_Sine"},{ ZONE,EQ_OP,0,0,"Pxenon.source == Source_Pulse"},{ ZONE,EQ_OP,0,0,"Pxenon.source == Source_Step"},{ ZONE,EQ_OP,0,0,"Pxenon.source == Source_SawTooth"},{ ZONE,EQ_OP,0,0,"Pxenon.source == Source_Square"}
,{ ZONE,EQ_OP,0,0,"Pxenon.source == Source_Ramp"},{ ZONE,EQ_OP,0,0,"Pxenon.source == Source_Table"},{ ZONE,EQ_OP,0,0,"Pxenon.tabmethod == LinearInterpWithEvents"},{ ZONE,EQ_OP,0,0,"Pxenon.source == Source_Table"},{ ZONE,EQ_OP,0,0,"Pxenon.tabmethod == LinearInterpWithoutEvents"}
,{ ZONE,EQ_OP,0,0,"Pxenon.source == Source_Table"},{ ZONE,EQ_OP,0,0,"Pxenon.tabmethod == SplineInterp"},{ ZONE,EQ_OP,0,0,"Pxenon.source == Source_Table"},{ ZONE,EQ_OP,0,0,"Pxenon.tabmethod == StepConnect"},{ ZONE,LT_OP,0,0,"TIME < Txenon.Tstart"}
,{ ZONE,EQ_OP,0,0,"Txenon.source == Source_Constant"},{ ZONE,EQ_OP,0,0,"Txenon.source == Source_Sine"},{ ZONE,EQ_OP,0,0,"Txenon.source == Source_Pulse"},{ ZONE,EQ_OP,0,0,"Txenon.source == Source_Step"},{ ZONE,EQ_OP,0,0,"Txenon.source == Source_SawTooth"}
,{ ZONE,EQ_OP,0,0,"Txenon.source == Source_Square"},{ ZONE,EQ_OP,0,0,"Txenon.source == Source_Ramp"},{ ZONE,EQ_OP,0,0,"Txenon.source == Source_Table"},{ ZONE,EQ_OP,0,0,"Txenon.tabmethod == LinearInterpWithEvents"},{ ZONE,EQ_OP,0,0,"Txenon.source == Source_Table"}
,{ ZONE,EQ_OP,0,0,"Txenon.tabmethod == LinearInterpWithoutEvents"},{ ZONE,EQ_OP,0,0,"Txenon.source == Source_Table"},{ ZONE,EQ_OP,0,0,"Txenon.tabmethod == SplineInterp"},{ ZONE,EQ_OP,0,0,"Txenon.source == Source_Table"},{ ZONE,EQ_OP,0,0,"Txenon.tabmethod == StepConnect"}
,{ ZONE,LT_OP,0,0,"TIME < qual.Tstart"},{ ZONE,EQ_OP,0,0,"qual.source == Source_Constant"},{ ZONE,EQ_OP,0,0,"qual.source == Source_Sine"},{ ZONE,EQ_OP,0,0,"qual.source == Source_Pulse"},{ ZONE,EQ_OP,0,0,"qual.source == Source_Step"}
,{ ZONE,EQ_OP,0,0,"qual.source == Source_SawTooth"},{ ZONE,EQ_OP,0,0,"qual.source == Source_Square"},{ ZONE,EQ_OP,0,0,"qual.source == Source_Ramp"},{ ZONE,EQ_OP,0,0,"qual.source == Source_Table"},{ ZONE,EQ_OP,0,0,"qual.tabmethod == LinearInterpWithEvents"}
,{ ZONE,EQ_OP,0,0,"qual.source == Source_Table"},{ ZONE,EQ_OP,0,0,"qual.tabmethod == LinearInterpWithoutEvents"},{ ZONE,EQ_OP,0,0,"qual.source == Source_Table"},{ ZONE,EQ_OP,0,0,"qual.tabmethod == SplineInterp"},{ ZONE,EQ_OP,0,0,"qual.source == Source_Table"}
,{ ZONE,EQ_OP,0,0,"qual.tabmethod == StepConnect"},{ ZONE,EQ_OP,0,0,"HPSSPC.open"},{ ZONE,EQ_OP,0,0,"HPSSPC.open"},{ ZONE,GT_EQ_OP,0,0,"PPU.Valves.V >= XFC.Vvalves_drop_out"},{ ZONE,EQ_OP,0,0,"XFC.ValvesPosition == 1"}
,{ ZONE,LT_OP,0,0,"TIME < PPU.IdMeasured.Tstart"},{ ZONE,EQ_OP,0,0,"PPU.IdMeasured.source == Source_Constant"},{ ZONE,EQ_OP,0,0,"PPU.IdMeasured.source == Source_Sine"},{ ZONE,EQ_OP,0,0,"PPU.IdMeasured.source == Source_Pulse"},{ ZONE,EQ_OP,0,0,"PPU.IdMeasured.source == Source_Step"}
,{ ZONE,EQ_OP,0,0,"PPU.IdMeasured.source == Source_SawTooth"},{ ZONE,EQ_OP,0,0,"PPU.IdMeasured.source == Source_Square"},{ ZONE,EQ_OP,0,0,"PPU.IdMeasured.source == Source_Ramp"},{ ZONE,EQ_OP,0,0,"PPU.IdMeasured.source == Source_Table"},{ ZONE,EQ_OP,0,0,"PPU.IdMeasured.tabmethod == LinearInterpWithEvents"}
,{ ZONE,EQ_OP,0,0,"PPU.IdMeasured.source == Source_Table"},{ ZONE,EQ_OP,0,0,"PPU.IdMeasured.tabmethod == LinearInterpWithoutEvents"},{ ZONE,EQ_OP,0,0,"PPU.IdMeasured.source == Source_Table"},{ ZONE,EQ_OP,0,0,"PPU.IdMeasured.tabmethod == SplineInterp"},{ ZONE,EQ_OP,0,0,"PPU.IdMeasured.source == Source_Table"}
,{ ZONE,EQ_OP,0,0,"PPU.IdMeasured.tabmethod == StepConnect"},{ ZONE,LT_OP,0,0,"TIME < PPU.Id_Set.Tstart"},{ ZONE,EQ_OP,0,0,"PPU.Id_Set.source == Source_Constant"},{ ZONE,EQ_OP,0,0,"PPU.Id_Set.source == Source_Sine"},{ ZONE,EQ_OP,0,0,"PPU.Id_Set.source == Source_Pulse"}
,{ ZONE,EQ_OP,0,0,"PPU.Id_Set.source == Source_Step"},{ ZONE,EQ_OP,0,0,"PPU.Id_Set.source == Source_SawTooth"},{ ZONE,EQ_OP,0,0,"PPU.Id_Set.source == Source_Square"},{ ZONE,EQ_OP,0,0,"PPU.Id_Set.source == Source_Ramp"},{ ZONE,EQ_OP,0,0,"PPU.Id_Set.source == Source_Table"}
,{ ZONE,EQ_OP,0,0,"PPU.Id_Set.tabmethod == LinearInterpWithEvents"},{ ZONE,EQ_OP,0,0,"PPU.Id_Set.source == Source_Table"},{ ZONE,EQ_OP,0,0,"PPU.Id_Set.tabmethod == LinearInterpWithoutEvents"},{ ZONE,EQ_OP,0,0,"PPU.Id_Set.source == Source_Table"},{ ZONE,EQ_OP,0,0,"PPU.Id_Set.tabmethod == SplineInterp"}
,{ ZONE,EQ_OP,0,0,"PPU.Id_Set.source == Source_Table"},{ ZONE,EQ_OP,0,0,"PPU.Id_Set.tabmethod == StepConnect"},{ ZONE,GT_OP,0,0,"PPU.ItthPID.v[1] > PPU.VectorIttmax[1]"},{ ZONE,LT_OP,0,0,"PPU.ItthPID.v[1] < PPU.ItthPID.u_min[1]"},{ ZONE,EQ_OP,0,0,"PPU.ItthPID.end_pos == end_I"}
,{ ZONE,GT_OP,0,0,"PPU.ItthPID.vi[1] > PPU.VectorIttmax[1]"},{ ZONE,LT_OP,0,0,"PPU.ItthPID.vi[1] < PPU.ItthPID.u_min[1]"},{ ZONE,EQ_OP,0,0,"PPU.AnodeSupply == 1"},{ ZONE,LT_EQ_OP,0,0,"PPU.IdMeasured.Amp <= PPU.ImaxOp"},{ ZONE,EQ_OP,0,0,"PPU.AnodeSupply == 1"}
,{ ZONE,GT_OP,0,0,"PPU.IdMeasured.Amp > PPU.ImaxOp"},{ ZONE,LT_OP,0,0,"PPU.IdMeasured.Amp < (PPU.ImaxOp + PPU.VdSet / abs(PPU.SlopeAfterKnee))"},{ ZONE,EQ_OP,0,0,"PPU.IgnitorSupply == 1"},{ ZONE,EQ_OP,0,0,"PPU.ValveSupply == 1"},{ ZONE,EQ_OP,0,0,"PPU.HeaterSupply == 1"}
,{ ZONE,EQ_OP,0,0,"PPU.MagnetSupply == 1"},{ ZONE,EQ_OP,0,0,"PPU.ThermothrottleSupply == 1"},{ ZONE,EQ_OP,0,0,"PPU.LoopON"},{ ZONE,EQ_OP,0,0,"EP.event_RAMS(Fail_PPU_power150pc)"},{ ZONE,EQ_OP,0,0,"PPU.Mode == StandBy"}
,{ ZONE,EQ_OP,0,0,"PPU.Mode == Configuration"},{ ZONE,EQ_OP,0,0,"PPU.Mode == Remote"},{ ZONE,EQ_OP,0,0,"EP.event_RAMS(Fail_XeLeakage_1)"},{ ZONE,EQ_OP,0,0,"EP.event_RAMS(Fail_XeLeakage_2)"},{ ZONE,EQ_OP,0,0,"EPthr.AlreadyIgnited"}
,{ ZONE,EQ_OP,0,0,"EPthr.ThrType == AlternateModel"},{ ZONE,EQ_OP,0,0,"EPthr.AlreadyIgnited"},{ ZONE,GT_EQ_OP,0,0,"(9.80665 * EPthr.Isp) >= EPthr.goIspLoss"},{ ZONE,EQ_OP,0,0,"EPthr.AlreadyIgnited"},{ ZONE,EQ_OP,0,0,"EPthr.AlreadyIgnited"}
,{ ZONE,EQ_OP,0,0,"EPthr.AlreadyIgnited"},{ ZONE,EQ_OP,0,0,"EPthr.AlreadyIgnited"},{ ZONE,EQ_OP,0,0,"EP.event_RAMS(Fail_Max_Swirl_Torque)"},{ ZONE,EQ_OP,0,0,"EP.event_RAMS(Fail_Wrong_Swirl_Orientation)"}};
	return evs;
};

void EP__EPsystem_default::initDelays()
{
}

void EP__EPsystem_default::extractSymbols()
{
}

SIMULA_EXPORT_C INTEG_simula* create_EP__EPsystem_default(const char *name=NULL,const char *dirInstall=NULL)
{
	return new EP__EPsystem_default(name,dirInstall);
}
SIMULA_EXPORT_C void delete_EP__EPsystem_default(INTEG_simula *obj,const char *name=NULL)
{
	if ( obj )
		{obj->deleteManager(name);
		delete obj;}
}

#ifndef SIMULA_NOT_USE_METAINFO
SIMULA_EXPORT_C void getInformationPartition(char *libraryName, char *componentName, char *partitionName, char *symbolTableFilename, bool& isDebug)
{
	sprintf(libraryName,"%s","EP");
	sprintf(componentName,"%s","EPsystem");
	sprintf(partitionName,"%s","default");
	sprintf(symbolTableFilename,"%s","EP.+e+psystem.default");
	isDebug= false;
	return;
}
#endif //SIMULA_NOT_USE_METAINFO

#endif 

