0

再会

我正在使用全局优化工具箱在 MATLAB 中使用遗传算法。我在这方面很有经验。我的问题如下:

如何指定不仅仅依赖于输入变量的约束。即可能是输出或中间变量的函数的约束。

注意:这个系统的输出是从一个“黑匣子”计算出来的(它是一个 PSS SINCAL 模拟)。

在这个阶段,我一直在使用一种解决方法——当输出不在约束范围内时,使适应度函数的值非常高。寻找更优雅的解决方案。

谢谢

猫王

4

1 回答 1

0

You could use nested functions for your objective and constraint functions. That would allow you to have MATLAB variables (other than the input variables) that are visible to both the objective and constraint functions.

This example uses nested functions in order to use results from running a simulation in both the objective and constraint functions. It also shows how to check to see if the simulation needs to be run again, which is necessary if either the objective function or constraint function is called with new values for the input variables.

于 2013-06-10T17:14:26.927 回答