non linear constrain to solve for Squential Quadratic Programing
2 次查看(过去 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!