constrained optimization with Matlab, symbolic function
Mostrar comentarios más antiguos
Hello, I want to perform a simple optimization in Matlab
syms f(x,a) x a n
over
Max
Max
such that
and for each i 

and n are known I dont know how to define the constraints on Matlab and the Max optimization
Thanks
Respuestas (1)
If your function f is symbolic, you first have to convert it to a numerical function by using "matlabFunction".
k_tot = ...;
a = ...;
x = ...;
f = @(x,a) ...;
obj = @(k) sum(k.*f(x,a).^k)
Aeq = ones(n,1);
beq = k_tot;
lb = ones(n,1);
ub = inf(n,1);
k0 = k_tot/n*ones(1,n)
k = fmincon(obj,k0,[],[],Aeq,beq,lb,ub)
Categorías
Más información sobre Nonlinear Optimization en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!