% p=fit_Jhosc(p0,f,Jdata)
% the best fit parameters p are found by minimizing the variance
% between data and theory as a function of the parameters.
% p0 are the initial trial parameters
function p=fit_Jhosc(p0,f,Jdata)
options=optimset('Display','iter');
p=fminsearch('Jhosc_var',p0,options,f,Jdata);