Fitting experimental data with experimental references
显示 更早的评论
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
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Biological and Health Sciences 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!