non linear constraint optimization
14 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi, I have a problem into declaring some non linear constraint for an optimization to be solved with globalsearch method. From physic point of view, the problem I want to solve is the optimization of a Rankine cycle, where my variables are presseure (X(1)) and temperature (X(2)) of the boiler. The constraint I'm not able to code is on the output of the turbine, and regards the temperature, which has to be higher than a predetermined value. Mathematically, I'm using a function called XSteam which is able to compute the properties of the vapor and accepts as input 2 variables.
The property z is computed from x and y as following: XSteam('z', x, y).
The constraint i want to express is then of course dependent on the two variable X(1) and X(2), but cant' be written directly from them, it can be written on a parameter calcualted starting from the intial variables.
So, given my P and T I compute some properties and declare other parameters, in order to obtain the value on which i want to impose the limitation.
h1=XSteam('h_pT', X(1), X(2));
s1=XSteam('s_pT', X(1), X(2));
p2=2.7;
n_ad=0.6;
s2_iso=s1;
h2_iso=XSteam('h_ps', p2, s2_iso);
h2=h1-n_ad*(h1-h2_iso);
t2=XSteam('t_ph', p2, h2);
And I want this t2 to be higher of 135.
How may I write this constraint?
thanks in advance for your help.
GC
0 Commenti
Risposta accettata
Matt J
il 15 Gen 2014
Modificato: Matt J
il 15 Gen 2014
For each of the globalsearch sub-problems, you would use a solver that can handle nonlinear constraints (e.g., fmincon), and use its nonlcon input argument. The code you've shown would go inside the function specified by nonlcon and it would return,
c=135-t2;
ceq=[];
I'm taking it for granted that t2 is twice differentiable in X(i). The solvers have smoothness requirements.
2 Commenti
Matt J
il 15 Gen 2014
Modificato: Matt J
il 15 Gen 2014
Being the smoothness of my objective function a strong hypotesis, can yu suggest me how to verify it?
You need to analyze the operations that your Xsteam function consists of. If they are all smooth operations on X, then the overall composition of them should be smooth, by virtue of the chain rule. Conversely, operations like round(), ceil(), linear interpolation, etc... will ruin differentiability.
If you have a non-smooth problem, GA might be the thing to use, although sometimes there are ways to reformulate nonsmooth problems as smooth ones.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Genetic Algorithm in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!