SecondOrderConeConstraint
説明
SecondOrderConeConstraint
は、次の 2 次錐制約を表します。
A 行列は、円錐の線形因子を表します。
b ベクトルは、円錐の中心を表します。
d ベクトルは、線形範囲を表します。
γ スカラーは、範囲を表します。
coneprog
関数を使用して、2 次錐制約を含む問題を解きます。
作成
secondordercone
関数を使用して、SecondOrderConeConstraint
オブジェクトを作成します。
プロパティ
A
— 円錐の線形因子
実数行列
円錐の線形因子。実数行列として指定されます。
データ型: double
b
— 円錐の中心
実数ベクトル
円錐の中心。実数ベクトルとして指定されます。
データ型: double
d
— 線形範囲
実数ベクトル
線形範囲。実数ベクトルとして指定されます。
データ型: double
gamma
— 範囲
実数スカラー
範囲。実数スカラーとして指定されます。gamma
の値が小さいほど、制約は緩くなります。
データ型: double
オブジェクト関数
例
単一の錐制約
1 つの 2 次錐制約を含む問題を設定するには、2 次錐制約オブジェクトを作成します。
A = diag([1,1/2,0]); b = zeros(3,1); d = [0;0;1]; gamma = 0; socConstraints = secondordercone(A,b,d,gamma);
目的関数ベクトルを作成します。
f = [-1,-2,0];
この問題には、線形制約がありません。これらの制約用の空行列を作成します。
Aineq = []; bineq = []; Aeq = []; beq = [];
x(3)
の上限と下限を設定します。
lb = [-Inf,-Inf,0]; ub = [Inf,Inf,2];
coneprog
関数を使用して問題を解きます。
[x,fval] = coneprog(f,socConstraints,Aineq,bineq,Aeq,beq,lb,ub)
Optimal solution found.
x = 3×1
0.4851
3.8806
2.0000
fval = -8.2462
解の要素 x(3)
は上限値です。錐制約は次の解においてアクティブです。
norm(A*x-b) - d'*x % Near 0 when the constraint is active
ans = -2.5677e-08
複数の錐制約
複数の 2 次錐制約を含む問題を設定するには、制約オブジェクトの配列を作成します。時間とメモリを節約するために、最初に、最もインデックスの高い制約を作成します。
A = diag([1,2,0]); b = zeros(3,1); d = [0;0;1]; gamma = -1; socConstraints(3) = secondordercone(A,b,d,gamma); A = diag([3,0,1]); d = [0;1;0]; socConstraints(2) = secondordercone(A,b,d,gamma); A = diag([0;1/2;1/2]); d = [1;0;0]; socConstraints(1) = secondordercone(A,b,d,gamma);
線形目的関数ベクトルを作成します。
f = [-1;-2;-4];
coneprog
関数を使用して問題を解きます。
[x,fval] = coneprog(f,socConstraints)
Optimal solution found.
x = 3×1
0.4238
1.6477
2.3225
fval = -13.0089
バージョン履歴
R2020b で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)