How do i write the code of lagrange multiplier in lagrange function?
8 次查看(过去 30 天)
显示 更早的评论
How do i write the code of lagrange multiplier in lagrange function ? Because the lagrange multiplier is a varible ,like x,y,z.not a random value,so for example,the function i want to optimize is as below
![lagrange.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/201334/lagrange.png)
then how do i write the matlab code of lagrage multiplier ? because there are lots of a_k and b_k,and they all should be calculated,so i can't just use "rand" to produce them.
Does anyone know how to write the code of this? or is there any reference i can refer?
2 个评论
Torsten
2019-1-24
Which of the K k's do you mean when you define your objective function as
min: x_k^2+y_k^2
?
采纳的回答
Stephan
2019-1-24
Hi,
here is an example, which you can use to learn how you can tackle this problem in Matlab:
Best regards
Stephan
1 个评论
Taiwo Fasae
2021-10-12
编辑:Taiwo Fasae
2021-10-12
I beg to differ. That link didn't lead to a solution for dealing with nonlinear constraints in langrange multipliers. Please show me one when you find it.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Problem-Based Optimization Setup 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!