Fitting experimental data with experimental references

3 views (last 30 days)
Hi, I have an iron compound that I know that has Fe, Fe2+ and Fe3+. In a XANES experimental data of my compound all the contributions overlap. I already have the expected shape of the Fe, Fe2+ and Fe3+ species. Thus, I need to fit the experimetnal data of my compound using the threee references, and calculate the relative amount of both species.
I believe it is an optimiation problem. Could some one help me to get the script to do it in matlab.
So I far his is what I got
prob = optimproblem('ObjectiveSense','min');
prob.Objective =Ymin ;
initialGuess.w3 = 0.1;
initialGuess.w2 = 0.5;
initialGuess.w1 = 0.4;
[sol,optval] = solve(prob,initialGuess)
w1Opt = sol.w1
w2Opt = sol.w2
w3Opt = sol.w3
However, the values that I got are absurd, too high, like 30 or negative la -50, and they values should renge between 0-1

Accepted Answer

Torsten on 12 Aug 2022
w = [Yls,Yhs,Y3]\Yt
if Yls, Yhs, Y3 and Yt are column vectors of the same size.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!