non linear constrain to solve for Squential Quadratic Programing
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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])
Antworten (0)
Siehe auch
Kategorien
Mehr zu Quadratic Programming and Cone Programming finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!