Hi, Matt and EXAFS experts
Thank you so much. Our sample is porous silica + PO4 ligand on surface/pore, then react with LaNO3 in solution. The model is that La is bonding with PO4 through both mono- (corner-sharing) and di-dentate (edge sharing) modes.
Please see the attachment. The first three fits in history are fits with increasing paths, with fixed CN for the La-P11 and La-P14 path, the ss parameters are reasonable, but to fix CN at 3 for La-P14 is unreasonable, which requires La to bind with three different PO4 groups.
The last three fits are fits with increasing paths, in which CN was fitted, the fitted parameters are reasonable, EXCEPT for the negative ss parameters for the path La-P11 (edge sharing) and La-P14 (corner sharing). By the way, the length for La-P14 is +0.3 A, it is large, but not completely unreasonable, because the bond distances of La-O polyhedron may change from 2.4 to 3.1 A.
Is it possible to constrain ss parameter? If so, how to set up this constrain? Thank you so much for your further instruction.
Dien
-----Original Message-----
From: Ifeffit
Dear All
I am doing Temperature-dependent EXAFS experiment with a lot of data.
Usually, we do these kinds of data fitting by several steps, like below:
First, put every parameter free, and obtain the averaged value of amp.
Second, set the amp to the averaged value, put other parameters free, and then obtain the averaged value of del_e0.
Third, set the amp and del_e0 to the averaged value, and fit again.
In my case, my sample is perovskite structure (Ti K-edge of SrTiO3).
To increase the fitting accuracy, I use three del_e0 for O, Ti, Sr as suggested in paper: Haskel, D., et al. Physica B: Condensed Matter 208 (1995): 151-153.
The fitting parameters of Cubic model is this:
setattr(pars, f'alpha', param(0, vary=True))
setattr(pars, f'amp', param(0, vary=True))
setattr(pars, f'del_e0_O', param(0, vary=True))
setattr(pars, f'del_e0_Sr', param(0, vary=True))
setattr(pars, f'del_e0_Ti', param(0, vary=True))
setattr(pars, f'sig2_O', param(.002, vary=True))
setattr(pars, f'sig2_Sr', param(.002, vary=True))
setattr(pars, f'sig2_Ti', param(.002, vary=True))
setattr(pars, f'sig2_Tr1', param(.002, vary=True))
setattr(pars, f'sig2_p', param(.002, vary=True))
setattr(pars, f'sig2_Tr2', param(.002, vary=True))
#del_e0 for each path
pars.del_e0_1=param(expr='del_e0_O')
pars.del_e0_2=param(expr='del_e0_O')
pars.del_e0_3=param(expr='del_e0_Sr')
pars.del_e0_4=param(expr='del_e0_Ti')
pars.del_e0_5=param(expr='del_e0_O')
pars.del_e0_6=param(expr='0.5*del_e0_O+0.5*del_e0_Ti')
pars.del_e0_7=param(expr='(2*del_e0_O+del_e0_Ti)/3')
pars.del_e0_8=param(expr='(2*del_e0_O+del_e0_Ti)/3')
pars.del_e0_9=param(expr='(2*del_e0_O+del_e0_Ti)/3')
pars.del_e0_10=param(expr='(2*del_e0_O+del_e0_Ti)/3')
pars.del_e0_11=param(expr='0.5*del_e0_O+0.5*del_e0_Sr')
In the first step, the fitting is fine, I obtained the averaged amp.
However, in the second step, when I set amp to the averaged value, Error happens for ?some? of the data.
When I use different averaged amp value, the data that happens error is different.
The error is:
Traceback (most recent call last):
File "STO16_C_2.py", line 250, in <module>
out = feffit(pars, dset)
File "D:\anaconda3\envs\xraylarch\lib\site-packages\larch\xafs\feffit.py", line 557, in feffit
result = fit.leastsq()
File "D:\anaconda3\envs\xraylarch\lib\site-packages\lmfit\minimizer.py", line 1689, in leastsq
lsout = scipy_leastsq(self.__residual, variables, **lskws)
File "D:\anaconda3\envs\xraylarch\lib\site-packages\scipy\optimize\minpack.py", line 423, in leastsq
retval = _minpack._lmdif(func, x0, args, full_output, ftol, xtol,
File "D:\anaconda3\envs\xraylarch\lib\site-packages\lmfit\minimizer.py", line 601, in __residual
return _nan_policy(np.asarray(out).ravel(),
File "D:\anaconda3\envs\xraylarch\lib\site-packages\lmfit\minimizer.py", line 2436, in _nan_policy
raise ValueError(msg)
ValueError: NaN values detected in your input data or the output of your objective/model function - fitting algorithms cannot handle this! Please read https://lmfit.github.io/lmfit-py/faq.html#i-get-errors-from-nan-in-my-fit-wh... for more information.
I don?t know what happened, can somebody help me figure this out?
PS: when I use only one del_e0 for every path, no such error happens.
Best regards
Fan _______________________________________________ Ifeffit mailing list Ifeffit@millenia.cars.aps.anl.gov http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit Unsubscribe: http://millenia.cars.aps.anl.gov/mailman/options/ifeffit
-- --Matt Newville <newville at cars.uchicago.edu> 630-327-7411