Optimization of multivariable function
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi everybody!
I'm having some trouble trying to optimize a function. I want to minimize the function F defined as:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/285331/image.png)
where Aexp is a vector containing experimental data and Asim is a vector of simulated data. The true problem comes when defining the simulation function:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/285332/image.png)
So the optimization needs to be carried out changing a1, sigma and a2 values in order to make F minimum.
However I'm really stuck as I have been using symbolic functions but turns out the result is always 1. I don't know any other way to use integral fucntions, even if this one does not look like working.
Any ideas? Thanks!
5 Kommentare
Walter Roberson
am 20 Apr. 2020
With that sigma, a1, a2, then the results of Asim are not exactly 0, but they are smaller than 10^(-7000) so double() converts them to 0.
You can, by the way, rewrite:
sigma=5;
a1=1000000;
a2=126;
iarray=linspace(150,400,30);
i1=iarray(1);
syms x y I2
fun1(x,y)=exp(-x/y);
Int1 = int(fun1, y, [i1, I2]);
fun2 = exp((-a1/5)*Int1-(((x-a2)^2)/(2*sigma^2)));
Int2 = int(fun2, x, [0 inf]);
coef=1/(sigma*(2*pi())^0.5);
AAsim = coef*Int2;
aasim = subs(AAsim, I2, iarray);
asim = double(aasim); %fails, values too small for MuPAD to work with
Antworten (0)
Siehe auch
Kategorien
Mehr zu Special Values finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!