Fitting experimental data with experimental references

3 Ansichten (letzte 30 Tage)
Ramón
Ramón am 12 Aug. 2022
Kommentiert: Ramón am 12 Aug. 2022
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');
w1=optimvar("w1");
w2=optimvar("w2");
w3=optimvar("w3");
Yt2=Yls*w1+Yhs*w2+Y3*w3;
Ymin=Yt2-Yt;
prob.Objective =Ymin ;
show(prob)
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

Akzeptierte Antwort

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

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by