Optimizing 1 equation with 7 variables
Mostra commenti meno recenti
I have the following function:
f= (a^2/x^2)-((a*(2*b))/x^2)+(2*(b^2)/y^2)+((1/x^2)-(2/y^2))*b^2+((2*(2*d)^2)/s^2)+(((y^2)^-1)-(4*x^2)^-1)*((2*z)^2);
I want to find all possible combinations of a,b,d,s,x,y,z for which f = 1 subject to the following constraints:
y<2*x
0=< a,b,d,s,x,y,z <= 1
I keep getting the "not enough input arguments" error when I try to run fmincon. Is this even a valid problem or it's too broad?
Risposta accettata
Più risposte (1)
Alan Weiss
il 20 Set 2021
0 voti
I think that you would have an easier time formulating your problem by using the problem-based approach.
However, if you really want to use the fmincon solver using its default syntax, you have to reformulate your problem so that there is just one optimization variable vector, typically called x, possibly along with other variables representing fixed parameters or data. See Writing Scalar Objective Functions and Passing Extra Parameters.
Alan Weiss
MATLAB mathematical toolbox documentation
Categorie
Scopri di più su Choose a Solver in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





