function [ fit_diff ] = objectiveFunction_lsq_p1( PAR, fix, tmeas, epsmeas, sig )

  for ii=1:size(tmeas,2)      
    try
      % estimate strain
      eps_calculated(:,ii) = calc_epsilon( tmeas(:,ii), sig, [0 0 0 0], ...
        [PAR(1); PAR(2); PAR(3)], PAR(4), [PAR(5); PAR(6)], ...
        [PAR(7); PAR(6)], [PAR(8); PAR(6)], [PAR(9); PAR(6)], fix(1), ...
        fix(2), fix(3), fix(4), fix(5), 1 ); 
      
      % estimate difference to measurement
      fit_diff(:,ii) = (epsmeas(:,ii)-eps_calculated(:,ii));
    catch
      % if ode isn't solveable during minimization: return nan() -
      % lsqnonlin can deal with that
      fit_diff(:,ii) = nan(size(eps_calculated,1),1);       
    end      
  end
  
  fit_diff = reshape(fit_diff, [], 1);

end

