How set properly a multiobjective optimization problem

3 visualizzazioni (ultimi 30 giorni)
Hello everyone
I am trying to use multiobjective genetic algorithim to find the values for the variables r1,r2,r3,l1,l2,l3 that produces the minimum pressure drop and minimum volumen, this are the equations:
Delta_pressure = ((2*k*l1)/r1)*(((3+1/n)*v_melt)/(pi*r1^3))^n + ((2*k*l2)/r2)*(((3+1/n)*v_melt)/(pi*r2^3))^n + ((2*k*l3)/r3)*(((3+1/n)*v_melt)/(pi*r3^3))^n;
and
volume = (pi*r1^2)*l1+(pi*r2^2)*l2+(pi*r3^2)*l3
Where k,n, v_melt are constant
I am using the optimize live editor, but so far I dont know how to use properly
This is one of my attemps to make it work, I use the volume equation as constrain function, train to make the volumen always minor that 1.5 times the part volume (v_part)
I am not sure what should write on "fixed input a" or "optimization input"
Thanks for any help

Risposta accettata

Alan Weiss
Alan Weiss il 17 Ago 2021
Modificato: Alan Weiss il 17 Ago 2021
I think that you need to understand that the optimization variables all need to be in one variable, typically called x. See Writing Scalar Objective Functions. Furthermore, if you choose gamultiobj before you try to create the objective function, you will get a more useful template than the one you are using. Finally, your nonlinear constraint function must return c(x) that is less than zero for feasible points. I think that you need
c = (pi*r1^2)*l1 + pi*(r2^2*l2) + (pi*r3^2)*l3 - 1.5*v_part;
One more thing. You might want to set r and l as vectors, not as separate variables for each component. So you would write r(2) instead of r2. Again, these woould be parts of the x vector. So you might have something like
function f1 = obj(x)
r = x(1:3);
l = x(4:6);
% Then write things in terms of r and l.
end
You might need to use extra variables for fixed parameters such as k and v_melt. You would put them in your workspace and then your function might look like
function f1 = obj(x,k,v_melt)
% Code goes here
end
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by