public Substance(Pressure pressure, Entropy entropy)
        {
            Pressure = pressure;

            //Checking what region the Substanse belong to:

            //1. check if it is region 1
            try
            {
                Temperature = new Temperature(Region1BackwardEquation_Tps.CalculateTemperature(pressure.Value, entropy.Value));
                CalculateProperties(Temperature, Pressure);
            }
            catch (CantDetermineRegionException)
            { }

            if (SpecificEntropy!=null && Math.Round(SpecificEntropy.Value, 3) == Math.Round(entropy.Value, 3))
            {
                //it is region 1
                return;
            }

            //2. check if it is region 2

            if (pressure.Value <= 4)
            {
                Temperature = new Temperature(Region2aBackwardEquation_Tps.CalculateTemperature(pressure.Value, entropy.Value ));
                CalculateProperties(Temperature, Pressure);
                if (Math.Round(SpecificEntropy.Value, 3) == Math.Round(entropy.Value, 3))
                {
                    //it is region 2a
                    return;
                }
            }
            else if (entropy.Value>=5.85)
            {
                Temperature = new Temperature(Region2bBackwardEquation_Tps.CalculateTemperature(pressure.Value, entropy.Value));
                CalculateProperties(Temperature, Pressure);
                if (Math.Round(SpecificEntropy.Value, 3) == Math.Round(entropy.Value, 3))
                {
                    //it is region 2b
                    return;
                }
            }
            else
            {
                Temperature = new Temperature(Region2cBackwardEquation_Tps.CalculateTemperature(pressure.Value, entropy.Value));
                CalculateProperties(Temperature, Pressure);
                if (Math.Round(SpecificEntropy.Value, 3) == Math.Round(entropy.Value, 3))
                {
                    //it is region 2c
                    return;
                }
            }
        }
 private void Region5Calculations(Temperature temperature, Pressure pressure)
 {
     Temperature = temperature;
     Pressure = pressure;
     SpecificVolume = Region5.CalculateSpecificVolume(temperature.Value, pressure.Value);
     SpecificEnthalpy = new Enthalpy(Region5.CalculateSpecificEnthalpy(temperature.Value, pressure.Value));
     SpecificInternalEnergy = Region5.CalculateSpecificInternalEnergy(temperature.Value, pressure.Value);
     SpecificEntropy = new Entropy(Region5.CalculateSpecificEntropy(temperature.Value, pressure.Value));
     SpecificIsobaricHeatCapacity = Region5.SpecificIsobaricHeatCapacity(temperature.Value, pressure.Value);
     SpeedOfSound = Region5.SpeedOfSound(temperature.Value, pressure.Value);
     SpecificIsochoricHeatCapacity = Region5.SpecificIsochoricHeatCapacity(temperature.Value, pressure.Value);
 }