Find independent variables that minimize function
이전 댓글 표시
Hey,
I have a mathematical function with around 5 independent variables. I want to find the values of the independent variables for which the function is minimal. All the independent variables have certain boundaries that need to be satisfied.
Up until now I use the Excel plugin "Solver" for this. But my task becomes a bit too complex for Excel, thus I want to switch to Matlab.
This is my function:
st1_l = ((a-real(0.5*(a-(sqrt(a*(a-4*b))))))*(b^2))/((b^2)-(1.22*(0.0004)*c*(1-((-d/(a - b1)) * e)/d))*c*((a - real(0.5*(a-(sqrt(a*(a-4*b))))))+b))
Boundaries are something like this:
318<a<1000
10<b<100
...
The parameters should now be changed within these boundaries, so that st1_l becomes minimal. I already tried fmincon. However, I can't find a way to pass all the parameters and boundaries to fmincon. Just in case it makes clearer what I want to do, here an screenshot from the Excel solver I am using at the moment:

Thank you for any help.
댓글 수: 2
Mario Malic
2020년 3월 3일
편집: Mario Malic
2020년 3월 3일
fmincon(fun,x0,A,b)
Refer to documentation, with ~~variables A and b, you supply inequalities.~~
Edit: I am sorry, I made a silly mistake suggesting you inequalities. Better option is to use bounds as Fabio suggested.
채택된 답변
추가 답변 (1개)
댓글 수: 1
Fabio Freschi
2020년 3월 4일
fmincon allows the use of nonlinear constraints
look at the documentation
x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon)
카테고리
도움말 센터 및 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!