constrained optimization with Matlab, symbolic function
显示 更早的评论
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
回答(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)
类别
在 帮助中心 和 File Exchange 中查找有关 Nonlinear Optimization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!