13.07.2015 Views

DOTcvpSB: a Matlab Toolbox for Dynamic Optimization in Systems ...

DOTcvpSB: a Matlab Toolbox for Dynamic Optimization in Systems ...

DOTcvpSB: a Matlab Toolbox for Dynamic Optimization in Systems ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>DOTcvpSB</strong>: a <strong>Matlab</strong> <strong>Toolbox</strong> <strong>for</strong> <strong>Dynamic</strong> <strong>Optimization</strong> <strong>in</strong> <strong>Systems</strong> Biology6 % Tomas Hirmajer et al., thirmajer@gmail.com %7 % %8 % The DOTcvp toolbox is completely free of charge under the creative %9 % commons license. The conditions of the license can be found on the %10 % follow<strong>in</strong>g web page: %11 % http://creativecommons.org/licenses/by-nc-nd/3.0/ %12 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %1314 clear mex; clear all; close all; global data;15 % --------------------------------------------------- %16 % Initialization:17 % --------------------------------------------------- %18 data.name = 'VanDerPolOscillator_simple';1920 % --------------------------------------------------- %21 % Sett<strong>in</strong>gs <strong>for</strong> IVP (ODEs, sensitivities)22 % --------------------------------------------------- %23 data.odes.res(1) = {'(1-y(2)^2)*y(1)-y(2)+u(1)'};24 data.odes.res(2) = {'y(1)'};25 data.odes.res(3) = {'y(1)^2+y(2)^2+u(1)^2'};26 data.odes.ic = [0.0 1.0 0.0];27 data.odes.tf = 5.0; %f<strong>in</strong>al time2829 % --------------------------------------------------- %30 % NLP def<strong>in</strong>ition:31 % --------------------------------------------------- %32 data.nlp.RHO = 10; %number of time <strong>in</strong>tervals33 data.nlp.J0 = 'y(3)'; %cost function: m<strong>in</strong>-max(cost function)34 data.nlp.u0 = [ 0.7]; %<strong>in</strong>itial value <strong>for</strong> control values35 data.nlp.lb = [-0.3]; %lower bounds <strong>for</strong> control values36 data.nlp.ub = [ 1.0]; %upper bounds <strong>for</strong> control values3738 % --------------------------------------------------- %39 % Call of the ma<strong>in</strong> function (you do not change this!):40 % --------------------------------------------------- %41 dotcvp_ma<strong>in</strong>(data)4.1.2 Problem <strong>for</strong>mulation <strong>for</strong> DOTcvp, a regular <strong>in</strong>put fileDOTcvp: cdop_VanDerPolOscillator.mThe second possibility, a more advanced one is to def<strong>in</strong>e a new problem with the full toolbox <strong>in</strong>put file.This <strong>in</strong>put file looks as follows:1 % A MATLAB example described <strong>in</strong> detail <strong>in</strong> the technical report2 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %3 % DOTcvp - <strong>Dynamic</strong> <strong>Optimization</strong> <strong>Toolbox</strong> with CVP approach <strong>for</strong> %4 % handl<strong>in</strong>g cont<strong>in</strong>uous and mixed-<strong>in</strong>teger dynamic optimization problems %5 % Copyright (C) 2007-2010 %6 % Tomas Hirmajer et al., thirmajer@gmail.com %7 % %8 % The DOTcvp toolbox is completely free of charge under the creative %9 % commons license. The conditions of the license can be found on the %10 % follow<strong>in</strong>g web page: %11 % http://creativecommons.org/licenses/by-nc-nd/3.0/ %12 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %1314 clear mex; clear all; close all; global data;15 % --------------------------------------------------- %16 % Initialization:17 % --------------------------------------------------- %18 data.name = 'VanDerPolOscillator';19 data.compiler = 'None'; %['None'|'FORTRAN']2021 % --------------------------------------------------- %22 % Sett<strong>in</strong>gs <strong>for</strong> IVP (ODEs, sensitivities):23 % --------------------------------------------------- %24 data.odes.Def_FORTRAN = {}; %this option is needed only <strong>for</strong> FORTRAN parameters def<strong>in</strong>ition, e.g. {'double precision k10, k20, ..'}25 data.odes.parameters = {}; %constant parameters be<strong>for</strong>e ODE {'T=300','..}26 data.odes.Def_MATLAB = {}; %this option is needed only <strong>for</strong> MATLAB parameters def<strong>in</strong>ition27 data.odes.res(1) = {'(1-y(2)^2)*y(1)-y(2)+u(1)'};28 data.odes.res(2) = {'y(1)'};29 data.odes.res(3) = {'y(1)^2+y(2)^2+u(1)^2'};30 data.odes.black_box = {'None','1','FunctionName'}; %['None'|'Full'],[penalty coefficient <strong>for</strong> all constra<strong>in</strong>ts],[a black box model31 function name]32 data.odes.ic = [0.0 1.0 0.0];33 data.odes.NUMs = size(data.odes.res,2); %number of state variables (y)34 data.odes.t0 = 0.0; %<strong>in</strong>itial time35 data.odes.tf = 5.0; %f<strong>in</strong>al time36 data.odes.Nonl<strong>in</strong>earSolver = 'Newton'; %['Newton'|'Functional'] /Newton <strong>for</strong> stiff problems; Functional <strong>for</strong> non-stiff problems37 data.odes.L<strong>in</strong>earSolver = 'Dense'; %direct ['Dense'|'Diag'|'Band']; iterative ['GMRES'|'BiCGStab'|'TFQMR'] /<strong>for</strong> the Newton NLS38 data.odes.LMM = 'Adams'; %['Adams'|'BDF'] /Adams <strong>for</strong> non-stiff problems; BDF <strong>for</strong> stiff problems39 data.odes.MaxNumStep = 500; %maximum number of steps40 data.odes.RelTol = 1*10^(-7); %IVP relative tolerance level41 data.odes.AbsTol = 1*10^(-7); %IVP absolute tolerance level42 data.sens.SensAbsTol = 1*10^(-7); %absolute tolerance <strong>for</strong> sensitivity variables43 data.sens.SensMethod = 'Simultaneous'; %['Staggered'|'Staggered1'|'Simultaneous']44 data.sens.SensErrorControl= 'on'; %['on'|'off']4546 % --------------------------------------------------- %47 % NLP def<strong>in</strong>ition:48 % --------------------------------------------------- %49 data.nlp.RHO = 30; %number of time <strong>in</strong>tervalsPage – 18

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!