Example

  1. Problem description
  2. Problem formulation for DOTcvpSB, a simple input file
  3. Optimization progress
  4. Graphical results

1. Problem description

Consider a drug displacement problem (case A - without the path constraint) solved e.g. in [DDP1]. The problem consists of the right rate projection of phenylbutazone infusion to minimize the time needed to reach in a patient's bloodstream a desired level of two drugs. The performance index is given by the following equation

drug displacement problem

subject to

drug displacement problem

with coefficients defined as follows

drug displacement problem
where the state variables represent the concentration of warfarin and phenylbutazone drugs. The initial values were set for the process and decisions variables at the value of x0 = [0.02; 2.00] and u0 = [4], respectively. The boundaries of the decision variables are as follows:

drug displacement problem

The equality point constraints on the final amount of displacement drugs are given by

drug displacement problem

Reference

[DDP1] E. Balsa-Canto, V. S. Vassiliadis, and J. R. Banga. Dynamic optimization of single- and multi- stage systems using a hybrid stochastic-deterministic method. Industrial and Engineering Chemistry Research, 44(5):1514-1523, 2005.

2. Problem formulation for DOTcvpSB, a simple input file

Introducing a new problem is very easy. Only a modification of one Matlab input file is needed, everything else is generated automatically. This file looks as follows:

drug displacement problem

3. Optimization progress

________________________________________________________

 DOTcvp: Dynamic Optimization Toolbox with CVP approach
  for handling continuous and mixed-integer DO problems

  Main author: Tomas Hirmajer, thirmajer@gmail.com
    Coauthors: Eva Balsa-Canto and Julio R. Banga
    Web pages: http://www.iim.csic.es/~dotcvp/
               http://www.iim.csic.es/~dotcvpsb/
 Core version: DOTcvp_R2010_E3
________________________________________________________

________________________________________________________

 DOTcvp - a Module for Single Optimization
________________________________________________________

Saving of the ODE ................................................. done!
Generation of the file: cvm_rhs.m (ODE - MATLAB) .................. done!
Saving of the parameters .......................................... done!
Generation of the file: cvm_d/bjac.m (Jacobian - MATLAB) .......... done!
Saving of the cost function (J0) .................................. done!
Generation of the file: temp_TimeDiscontinuity .................... done!
Generation of the gradients (J0) .................................. done!
Generation of the file: cvm_rhsS.m (sensitivities - MATLAB) ....... done!
Saving of the in/equality constraints (Ji) ........................ done!
Generation of the gradients (Ji) .................................. done!
Generation of the file: temp_cvfdx.m (main IVP file) .............. done!
Optimizing of the process (N=5; min(J0); IPOPT; DrugDisplacementProblemA) ... in progress
Default settings are loading ...................................... done!
Generation of the file: cvm_rhs.m (ODE - MATLAB) .................. done!
Generation of the file: temp_cvfdx.m (main IVP file) .............. done!
Simulation of the process ......................................... done!
Save of the data .................................................. done!
Deleting of the temporary files ................................... done!
____________________________
Final results [single-optimization]:
 ............. Problem name: DrugDisplacementProblemA
 ...... NLP or MINLP solver: IPOPT
 . Number of time constants: 5
 ... IVP relative tolerance: 1.000000e-008
 ... IVP absolute tolerance: 1.000000e-008
 . Sens. absolute tolerance: 1.000000e-008
 ............ NLP tolerance: 1.000000e-005
 ....... Final state values: 1.999983e-002 1.999939e+000 2.212446e+002
 ...... 1th optimal control: 7.999636e+000 7.999636e+000 7.999636e+000 8.000000e+000 5.451808e-007
 ..... Final size of the dt: 1.000090e-002 1.000090e-002 1.000090e-002 1.888942e+002 3.232038e+001
 ..... Final time [sum(dt)]: 2.212446e+002
____________________________
 ............ Final CPUtime: 9.01562500 seconds
 . Cost function [min(J_0)]: 221.24459910

 The detailed information is saved to the workspace structure with the name 'data'.
>> data

data = 

        name: 'DrugDisplacementProblemA'
    compiler: 'None'
        odes: [1x1 struct]
        sens: [1x1 struct]
         nlp: [1x1 struct]
     options: [1x1 struct]
     version: 'DOTcvp_R2010_E3'
      output: [1x1 struct]
           p: [5.4518e-007 5]
      gradJ0: [0 0 0 0 0 1 1 1 1 1]
      gradJi: [2x10 double]
          J0: 221.2446

4. Graphical results

drug displacement problem