Upper and Lower Boundaries in fmincon



Hi,

I am tryin to optimize an input signal to a certain Model
(Powerplant). I'd like to put limits (upper and lower) on the
parameters which I want to optimize. I hence use the to vectors that
fmincon accepts for this. the problem is the following:

I have put the lower limit on the parameters to 0.2 and upper to 1.0
(otherwise my plant cannot operate, and behaves inaccurate) despite
this fmincon "guesses" on negative values on the parameters. I find
it strange because it is not following the lower limits obviously. Is
this common or am I totally lost ?

The code for further clarification :

%%%%%%%%%%%%%%%%%%%MAIN %%%%%%%%%%%%%%%%%%%%%%%%%
clear all

global GT_var HP_stress DR_HPp extThermStress q

%REINIT TEMPERATURES T[1]-T[10]
Tmin = 520;
Tmax = 570;
NoPoints = 10;
ThermoMechStressHPT = linspace(Tmin,Tmax,NoPoints);

q=0;

% Initial value guesses for GTLoad Levels

theta0(1)= 0.44;
theta0(2)= 0.6;
theta0(3) = 0.8;

theta0(4) = 2000;
theta0(5) = 2000;
theta0(6) = 1000;
theta0(7) = 500;

GTlevels_max = 1;
dt = 50; % minimum relative time between intervals
thetamin=[0.2 0.2 0.2 dt dt dt dt];
thetamax=[GTlevels_max GTlevels_max GTlevels_max 1e6 1e6 1e6 1e6 ];
%options = optimset('TypicalX', [1 1 1 1000 1000 1000 1000],
'TolCon', 1e-6,
'TolX',1e-8,'TolFun',1e-8,'DiffMinChange',0.05,'DiffMaxChange',0.5);
options = optimset('TypicalX', [1000 1000], 'TolCon', 1e-1,
'TolX',1e-4,'TolFun',1e-1,'DiffMinChange',4,'DiffMaxChange',400,
'MaxFunEvals',1e4);
xott=fmincon('OptimTimeJT',theta0,[],[],[],[],thetamin,thetamax,'Optim
TimeConstT',options);
%%%%%%%%%%%%%%%%%%%%%END MAIN %%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%% NONLINEAR CONSTRAINTS %%%%%%%%%%%%%%%%%%%%%%%%
function [C,Ceq]=OptimTimeConstT(theta)
global GT_var HP_stress DR_HPp extThermStress q

v2 = min(max(theta(1),0),1.0);
v3 = min(max(theta(2),0),1.0);
v4 = min(max(theta(3),0),1.0);

t1 = max(theta(4),1)+ 0;
t2 = max(theta(5),1)+t1;
t3 = max(theta(6),1)+t2;
t4 = max(theta(7),1)+t3;

[theta(4:7)]
[theta(1:3)]
[v2 v3 v4]
q = q+1
pause(0.01);

%GTLoad Signal
GT_timein=[0 t1 t2 t3 t4]';
GT_signals=[0.2 v2 v3 v4 1.0]';
GT_var = [GT_timein GT_signals];

sim('plant2',t4)

%pause(10)
%format long
% Desired DrumPressure
DR_HPpDesire = 8.5e6;
max_slope = 8.3e-4;
DR_HPp(end);
Ceq=[];

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% THERMAL STRESS CONSTRAINTS IN INTERVALS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Limit on the extThermalStress
%ThermStressMaxAllowed = 60e8
ThermStressMaxAllowed = 2.9e8;

Times = extThermStress.time;
size(Times);
lastTime = floor(Times(end));
Values = extThermStress.signals.values;
size(Values);
lastVal = Values(end);
FixedTime = 12000;
% first column time, second column values
newThermalStress=[lastTime+1:FixedTime;
ones(1,FixedTime-lastTime)*lastVal]';
%lastvalue and Time

externalThermalStress = [Times Values];

% Puts together the new and the old to an extended
extendedThermalStress = [externalThermalStress; newThermalStress];
extendedThermalStressValues = extendedThermalStress(:,2);
extendedThermalStressTimes = extendedThermalStress(:,1);

%Number of windows
Windows = 2;
TimeFrames = FixedTime / Windows;
ThermalStress = zeros(Windows,1);

% Intervalise

for s=1:Windows
select = (extendedThermalStressTimes >= TimeFrames*(s-1)) &
(extendedThermalStressTimes <= TimeFrames*s);
maxStress = max(extendedThermalStressValues(select));
if s == 1
StressBound = linterp(extendedThermalStressTimes,
extendedThermalStressValues,[TimeFrames*s]);
elseif s==Windows
StressBound = linterp(extendedThermalStressTimes,
extendedThermalStressValues,[TimeFrames*(s-1)]);
else
StressBound = linterp(extendedThermalStressTimes,
extendedThermalStressValues,[TimeFrames*(s-1) TimeFrames*s]);
end


ThermalStress(s) = max(maxStress, StressBound);
end

ThermalStres
.



Relevant Pages

  • Re: Current Directory Structure (CDS) limitations
    ... || internal stack overflow" at the 16th level. ... | not be accessed at all, if I booted to plain 4DOS, without Windows. ... I tried with LFN support both on and off. ... | limits, and enabling LFN support does not remove some of those ...
    (comp.os.msdos.4dos)
  • Re: Thread Limits
    ... Threads are expensive resources in Windows use them sparingly, ... has it's own stack space which limits the number of ... Is there a limit for threads on Windows? ...
    (microsoft.public.dotnet.framework.performance)
  • Re: Thread Limits
    ... Threads are expensive resources in Windows use them sparingly, ... has it's own stack space which limits the number of ... Is there a limit for threads on Windows? ...
    (microsoft.public.dotnet.general)
  • Re: Need help w/ Weight Formula
    ... It sounds (at least from this descrition) as if the lower and upper ... to you to set the lower and upper limits. ... want cosistency in repeated tests. ...
    (microsoft.public.excel.misc)
  • Re: writing overlays with VB6
    ... But there have been aditional limits in windows like system resources which disallowed programs to grow up and use all of the available virtual memory. ... only to find they confer no actual improvement whatsoever. ...
    (microsoft.public.vb.winapi)

Loading