How can I solve a min problem for integral?
이전 댓글 표시
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.
답변 (1개)
Alan Weiss
2013년 4월 11일
편집: Alan Weiss
2013년 4월 11일
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
카테고리
도움말 센터 및 File Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!