声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1087|回复: 2

[工具箱] 遗传算法工具箱 非线性条件如何编写

[复制链接]
发表于 2007-9-6 10:52 | 显示全部楼层 |阅读模式

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

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

x
Aeq=[1 1];
H =[2.54 0;0 3.7];
非线性限制条件为Aeq*x’-0.5*x*H*x‘-13=0
但是不知道在遗传算法工具箱中的Nonlinear constraint 该如何编写?
请教高手指点
回复
分享到:

使用道具 举报

发表于 2007-9-6 11:53 | 显示全部楼层
doc ga

x = ga(fitnessfcn,nvars,A,b,Aeq,beq,LB,UB,nonlcon) subjects
the minimization to the constraints defined in nonlcon.
The function nonlcon accepts x and
returns the vectors C and Ceq, representing
the nonlinear inequalities and equalities respectively. ga minimizes
the fitnessfcn such that C(x)≤0 and Ceq(x)=0.
(Set LB=[] and UB=[] if no bounds exist.)

所以 x = ga(fitnessfcn,nvars,A,b,Aeq,beq,LB,UB,@mynoncon)

其中
function [c ceq]= mynoncon(x)

c=...
ceq = ...
发表于 2007-9-6 11:55 | 显示全部楼层
另外,你用help ga能够看到说明里给举了例子的,仔细看一下吧
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-10-2 22:30 , Processed in 0.051875 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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