MATLAB で離散刻みの変数に対​する最適化を行うには​どうすればよいですか​?

조회 수: 8 (최근 30일)
MathWorks Support Team
MathWorks Support Team 2019년 8월 21일
답변: MathWorks Support Team 2019년 8월 21일
Global Optimization Toolbox の ga 関数を使うと整数最適化を扱うことができますが、例えば、x = 0:0.1:10 などの 0.1 刻みの目的変数に対して、最適化問題を解く方法を教えてください。

채택된 답변

MathWorks Support Team
MathWorks Support Team 2019년 8월 21일
基本的には、ga 関数の整数制約を利用して実装します。
具体的な例が以下の URL にて閲覧可能です。
・Solving a Mixed Integer Engineering Design Problem Using the Genetic Algorithm
デモを実行するには、MATLAB ヘルプドキュメントにて上記ページを開き、右上にある "Open Script"を 押下するか、以下のコマンドを実行することで、デモファイルがあるフォルダに移動できます。
openExample('globaloptim/steppedCantileverExample')
処理のポイントとしては、"Add Discrete Non-Integer Variable Constraints" の項目に記載された部分で、変数の下限(lb)・上限(ub)は、lb と ub の設定は整数(1 - 4)で行っていますが、 そのインデックスに対応するベクトルに変換する関数を別途作成し、対応しています。
例えば、
>> edit cantileverVolumeWithDisc
で目的関数を開くと、内部で、変数 x を別関数 cantileverMapVariables で変換していることが分かります。 この関数の詳細は、
>> edit cantileverMapVariables
を実行することで内部をご覧いただけます。

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

제품


릴리스

R2016b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!