dcost calculated properly, solveinit uses euler's method and then adjusts to trapezoidal