How can i write optimal control objective with fmincon?
1 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/241176/image.png)
and my constraint is:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/241177/image.png)
0 个评论
采纳的回答
Matt J
2019-10-4
编辑:Matt J
2019-10-4
Same as any objective...
Knowns=[lambda1,lambda2];
Jfun=@(Unknowns) objective(Unknowns,Knowns);
fmincon(Jfun , InitialGuess,[],[],[],[],lb,ub )
function J=objective(Unknowns,Knowns)
x=Unknowns(1:N);
u=Unknowns(N+1:M);
eps=Unknowns(M+1);
lambda1=Knowns(1);
lambda2=Knowns(2);
J=lambda2*eps^2+___________;
end
2 个评论
Matt J
2019-10-4
You're welcome, but please Accept-click the answer if your question has been resolved.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Refinement 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!