フィルターのクリア

non linear constrain to solve for Squential Quadratic Programing

2 ビュー (過去 30 日間)
Dai Nguyen
Dai Nguyen 2021 年 5 月 20 日
コメント済み: Dai Nguyen 2021 年 5 月 20 日
Hi I'm trying to minimize the volume of an object with these non linear constraints. How can I put it in my code\
constraints
c(1)= L + R - 131.23; % height of tank
c(2) = 1224.303*RL(1)^2; % height of distance, fuel needed
c(3) = (RL(1)*RL(2))/(2*(RL(2)+RL(1)))- 0.25; % thickness of tank
this is the code
% NOTE: RL(1) is R and RL(2) is L.
V =@(RL) pi*RL(1).^3 + pi*RL(1).^2*RL(2);
Rb = [157,147];
% NOTE: 157<=R<=173; 147<=L<=180; Thus, Rb= [157,147]; and Lb = [173, 180];
Lb = [173, 180];
% No Other constraints are considered here-need to put the constraint
A = [];
b = [];
Aeq = [];
beq = [];
x0 = (Lb + Rb)/2;
RL = fmincon(V,x0,A,b,Aeq,beq,Lb,Rb);
R = RL(1);
L = RL(2);
fprintf('Found values: R = %f [ft] L = %f [ft] \n', [R, L])

回答 (0 件)

カテゴリ

Help Center および File ExchangeQuadratic Programming and Cone Programming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by