As a chemical engineer this is really interesting, I once worked on a problem similar to this but ran out of time. I tried running your notebook but it ran with errors. I find the code to be a little inefficient. Other than that, great documentation and this has very practical applications, thanks for sharing!