I have generated energy change (gammas.mat) of a simulation cell as a function of rigid displacement (ubp.mat) of upper half of the simulation cell with respect to to the lower half from atomistic calculations. I was trying to fit the energy vs displacement data to continous function of the displacement. I have tried using the curve fitting tool and the sum of sine model with 6 terms shows good agreement except at zero displacement where the fitting produces a negative value for the energy which is not physical since no change in energy before the displacement is initiated. I have attached a screenshot of the curve fitting tool's attempt.
I am looking for suggestions if I the data fitting can be done with a zero energy at zero displacement. Thanks!