How can I solve a min problem for integral?
Afficher commentaires plus anciens
Hello.
I've been looking through optimization problem examples and I am not sure how I should solve my problem. The problem is to find a minimum of definite integral such as int(f1(x)-f2(A,B,C,x)). I.e. I want to find A, B and C which will give me minimum value of that integral.
Any advice would be nice.
Réponses (1)
Alan Weiss
le 11 Avr 2013
Modifié(e) : Alan Weiss
le 11 Avr 2013
Let's reformulate your problem as numerical, not symbolic, because you are going to want a numeric answer.
Also, let's call your three parameters [A,B,C] = y.
So you have a function of y that you want to minimize. Is this a constrained or unconstrained problem? I mean, are there limits on the values in y?
Suppose not. Then for any value of y, I suppose you have a function defined on your MATLAB path that accepts a vector of points x and returns a vector of integrand values:
myintegrand(x,y) = f1(x) - f2(x,y);
Your objective function is
r = @(y)integral(@(x)myintegrand(x,y),xmin,xmax);
Then solve the problem starting from an initial guess y0 to the unknown parameters:
ysolution = fminunc(r,y0)
Alan Weiss
MATLAB mathematical toolbox documentation
Catégories
En savoir plus sur Solver Outputs and Iterative Display dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!