non linear constraint optimization

14 次查看(过去 30 天)
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

采纳的回答

Matt J
Matt J 2014-1-15
编辑:Matt J 2014-1-15
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 个评论
Guido
Guido 2014-1-15
Thank you Matt. Being the smoothness of my objective function a strong hypotesis, can yu suggest me how to verify it?
The sensitivity analysis on some of the variables suggests me that, in some points, the function is not differentiable.
Is to switch to genetic algorithm the best option in your opinion?
Matt J
Matt J 2014-1-15
编辑:Matt J 2014-1-15
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Genetic Algorithm 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by