Define Piecewise Function from Input Table
- October 3, 2018
- 6 replies
- 7939 views
All,
I'm attempting to start what should be a simple geotechnical effective stress calculation. My first step is defining a soil unit weight profile as a function of depth (z) in an efficient and robust method. In the past, I've used "if statements" to control this however they are cumbersome and not very sophisticated. An example of what I've done in the past is shown on Page 2 of the attached worksheet.
On Page 1 I attempted using "vlookup", however I ran into numerical issues and precision errors due to TOL...ideally, I would like to end up with a function that is as simple as the "vlookup" approach, but with the precision of the function defined by the "if statement". Any suggestions would be appreciated...I've attempted "for loops" and "while loops" without any success.
Thanks in advance!


