CenterForTheBuiltEnvironment / pythermalcomfort

Package to calculate several thermal comfort indices (e.g. PMV, PPD, SET, adaptive) and convert physical variables.
https://pythermalcomfort.readthedocs.io/en/latest/
MIT License
147 stars 52 forks source link

solving procedure for SET #19

Closed eddes closed 1 year ago

eddes commented 2 years ago

Hello there,

Thanks for this great contribution to the field of thermal comfort prediction!

I am currently performing tests on the SET comfort index in the set_optimized function. I noticed that the solving procedures for the clothing temperature and for the SET are respectively Gauss-Seidel and Newton-Raphson algorithms, as per the original code version from the 1970's.

They do work well, however using scipy's fsolve proves to require twice less iterations for the same tolerance on the residual between two iterations. The code ends up being more compact as a by-product.

I am keen to propose the modified version: do you think it would be worth the integration? Using fsolve would also make sense when taken along with the issue on the integration scheme for the SET computation and the choice of time step -on its way to be opened!)

Best regards, Edouard (this proposal could be labelled as "possible improvement"

FedericoTartarini commented 2 years ago

Hi Edouard,

I think your suggestion is very interesting and it would be great if we could implement it. We just need to look at whether the fsolve function can be used inside a function that is already optimized with Numba.

Regarding the workflow, It would be great if you could test if everything is working and then you could send a pull request. What do you think? The most important thing is that the suggested changes still pass all the tests that I have implemented.

Thank you again for looking into it.

FedericoTartarini commented 1 year ago

Hi @eddes I am closing this issue since I did not hear back from you in a while about this. Please write a comment if you would like me to open this issue again.