BuildingSystems
BuildingSystems copied to clipboard
clean up SmoothFunctions
We should check the subpackge BS/Utilities/SmoothFunctions. https://github.com/UdK-VPT/BuildingSystems/tree/master/BuildingSystems/Utilities/SmoothFunctions
All functions that are usefull should get a documentation, a corresponding block and a runnable example with reference results. Then they can be added to Annex60/Utilities/Math: https://github.com/iea-annex60/modelica-annex60/tree/master/Annex60/Utilities/Math
All other functions should be deleted or replaced with their MSL or Annex60 equivalent.
Statistics for concerend functions:
-
softcut
: 16 function calls in 11 filesBuildings\Airvolumes\AirvolumeCompressible0D
Buildings\Constructions\Windows\RadiationTransmission
Climate\SolarRadiationTransformers\SolarRadiationTransformerGeneral
Climate\SolarRadiationTransformers\SolarRadiationTransformerIsotropicSky
Technologies\Chillers\CompressionChiller
Technologies\ElectricalStorages\BatterySimple.mo
Technologies\Photovoltaics\BaseClasses\ElectricalModels\ElectricalModelOneDiode
Technologies\Photovoltaics\BaseClasses\ElectricalModels\ElectricalModelOneDiodeMPP
Technologies\SolarThermal\ThermalCollector
Utilities\MoistAirFunctions\T_sat
Utilities\NcDataReader2\NcDataReader
-
softcut_lower
: 6 function calls in 5 filesBuildings\Constructions\Windows\RadiationTransmission
Technologies\Chillers\CompressionChiller
Technologies\Photovoltaics\BaseClasses\ElectricalModels\ElectricalModelOneDiode
Technologies\Photovoltaics\BaseClasses\ElectricalModels\ElectricalModelOneDiodeMPP
Technologies\SolarThermal\ThermalCollector
-
softswitch
: 12 function calls in 4 filesBuildings\Data\AirpathCharacteristics\AirpathCharacteristicWindow
HAM\ConvectiveHeatTransfer\Gaps\alphaGap
HAM\ConvectiveHeatTransfer\Surfaces\alphaPlateFree
Utilities\MoistAirFunctions\enthalpy
-
softcut_upper
: 4 function calls in 3 filesClimate\SolarRadiationTransformers\SolarRadiationTransformerIsotropicSky
Technologies\Chillers\CompressionChiller
Technologies\ElectricalStorages\BatterySimple
-
safetanh
: 2 function calls in 2 filesUtilities\SmoothFunctions\softswitch
Utilities\SmoothFunctions\softfabs
-
softfabs
: 2 function calls in 2 filesBuildings\Airpathes\AirpathPrescribedPressure
Buildings\BaseClasses\AirpathGeneral
-
savepow
: 2 function calls in 2 files:Buildings\Airpathes\AirpathPrescribedPressure
Buildings\BaseClasses\AirpathGeneral
-
softpow
: 12 function calls in 1 fileHAM\ConvectiveHeatTransfer\Surfaces\alphaPlateFree
No function calls within the entire library
-
powerLinearized
-
safereciprocal
Note, that safetanh
is not used correctly, as it is not called with absolute path.
Actually I realized that these statistics are only lower boundaries, as several functions use relative paths.
I especially checked for powerLinearized
and safereciprocal
and it seems, that these really are not used within the library.
@jraedler : Do you still have the old documentation about the SmootFunctions (old SMILE context) and can you send it to @thorade
https://www.j-raedler.de/2010/10/smooth-transition-between-functions-with-tanh/
Here is my opinion on each function (alphabetically):
-
powerLinearized
is not used, not documented, and it does not have a test, so I think we should just remove it -
safepow
should be deleted, just use normal power, and where that fails, explicitly use sign(x) -
safereciprocal
is not used and does not have a test, so I think we should remove it -
safetanh
can be replaced by normal tanh -
softcut_lower
andsoftcut_upper
do the same as IBPSA softMin and softMax. We should do testing which one is better (faster, more stable, higher continuity) and then use that function everywhere, and remove the other one. -
softcut
usessoftcut_upper
orsoftcut_lower
. After fixing the above point, we should possibly rename it, then add a block and example, and move it to IBPSA. -
softabs
: not sure yet -
softpow
: not sure yet -
softswitch
: not sure yet