How do I program a Step Function in Mathcad?
- February 9, 2011
- 2 replies
- 12576 views
I have a data set that fluctuates between high and low values. For context, the data set represents the number of wells needed by month. It is a 12x1 vector (see attached worksheet). I need to program a loop (see my attempt) that can calculate the total number of wells needed when the number of wells increases. For instance, if in month 1, I have 10 wells and month 2 has 9 wells, I still need a total of ten wells. However, if in month 3, I need 12 wells, then I need 2 additional wells, for a total of 12 wells. I need to graph the number of wells needed over time, so it would be helpful to not have any zeros in my vector, and rather maintain the same value until the value increases. Also, if I reach the maximum number of wells, I need to be able to reflect this in the vector for the rest of the year (i.e. (10,9,12,12,12,12,12.etc.).

