Code covered by the BSD License  

Highlights from
Fitting Harmonic Potential

Fitting Harmonic Potential

by

 

This is a simple function for Harmonic Potential Fitting

fit_harm(R,POT)
function fit_h2_harm = fit_harm(R,POT)
% fit_harm(X,POT) make a fit between POT potential energy surface and 
% R grid value
%% f=fittype('a*(x-b)^2+c');

f=fittype('a*(x-b)^2+c');
g=fit(R,POT,f);
result=coeffvalues(g);
plot(R,POT,R,result(1)*(R-result(2)).^2+result(3));

Contact us