Converting the Excel formula to Grasshopper

Column A is a List of rain data I have got from a sensor (mm/hr)
Column B is the speed of water absorption of a pond (assumed to be -0.116138mm/hr) WHEN there is water left in the pond.

What I am trying to do in this Excel is to calculate the water level
When there is no rain(0 in column A), the absorption doesn’t trigger, but when it starts to rain, the water goes into the pond and the absorption starts. The remaining water (column C) will stay in the next hour even if there is no rain. The absorption will continue until Column C returns to zero, I wanna how I can construct this relationship with Grasshopper component, I hope everyone can give me some advice, thank you very much!

for your reference, I attach the Column A rain data here, column B is always 0.116138, thank you very much
Data.txt (885 Bytes)

at each rain measurement you need to evaluate the water in the pond and decide wether to apply absorption (if pond water > 0) or not, so approaching this with a loop is the simplest thought:

absorption.gh (14.4 KB)

4 Likes

thanks inno!
the solution is amazing!

1 Like