Energy minimization
1-D example:  approximating splines
dx,y
zx,y