Fitting experimental data with experimental references
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Biological and Health Sciences en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!