声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1402|回复: 2

[编程技巧] 急求:请问fmincon优化函数中非线性约束

[复制链接]
发表于 2009-5-27 15:53 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
请问一下各位高手,如果函数中有很多非线性约束应该怎么表示啊
比如:x(1)*x(2)-x(3)=0
          x(4)*x(5)-x(6)=0
谢谢啊!急啊!请知道的帮帮忙吧!
回复
分享到:

使用道具 举报

发表于 2009-5-27 17:20 | 显示全部楼层
看 help fmincon 里面很清楚

评分

1

查看全部评分

发表于 2009-5-27 18:11 | 显示全部楼层
copy from matlab help

nonlcon
The function that computes the nonlinear inequality constraints c(x)<= 0 and the nonlinear equality constraints ceq(x) = 0. The function nonlcon accepts a vector x and returns two vectors c and ceq. The vector c contains the nonlinear inequalities evaluated at x, and ceq contains the nonlinear equalities evaluated at x. The function nonlcon can be specified as a function handle.
x = fmincon(@myfun,x0,A,b,Aeq,beq,lb,ub,@mycon)
where mycon is a MATLAB function such as
function [c,ceq] = mycon(x)
c = ...     % Compute nonlinear inequalities at x.
ceq = ...   % Compute nonlinear equalities at x

评分

1

查看全部评分

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-22 13:34 , Processed in 0.051041 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表