Thanks Ken. I banged all of that into the PIC and ran it. Its still running I think, Im not hopefull ;-).
I found the answer in another place actually.
"If you want to modify just the red portion, then break it in 3: first and third curves from a lookup table, the second (red) is a linear function ds/dt = constant".
Brilliantly simple and doable

.