TomLXXVI / python-hvac

A multi-package for HVAC engineering written in Python.
MIT License
51 stars 15 forks source link

Change PumpCurve to use units with coefficients directly #4

Closed samskiter closed 1 year ago

samskiter commented 1 year ago

Addresses #2

Allows for better curve fitting by rescalling the input flow rates to the units specified. Also changes PumpCurve to store Pint Quantitys for the coefficients internally.

TomLXXVI commented 1 year ago

Thanks for pointing out to me the poor curve-fitting for small pumps when creating a PumpCurve object by curve-fitting. I have modified my code like you suggested, but I've left out the addition of the extra parameter analysis_flow_units in the signature of method curve_fitting. Now, the curve-fitting will be done with the magnitudes of the coordinates unchanged, i.e. they are left in the units they were passed to method curve_fitting. Internally the pump curve coefficients are no floats anymore that are converted to standard SI-units, but Quantity objects that can be converted to any other appropriate units.