non linear constrain to solve for Squential Quadratic Programing
조회 수: 1 (최근 30일)
이전 댓글 표시
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 Exchange에서 Quadratic Programming and Cone Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!