ADMITvariable
ADMITvariable creates a ADMITvariable object
VAR = ADMITvariable(STR)
VAR = ADMITvariable(STR,varargin)
Parses the string STR and generates a ADMITvariable object from it.
Syntax description is also found in "./examples/OPTFILE_TEMPLATE.opt".
If additional arguments are provided, then this is equivalent to
CON = ADMITvariable(sprintf(STR,varargin))
In principle you can provide any string satisfying the syntax.
Syntax
General syntax is:
NAME {TYPE:TIMEDEP} or {TYPE:TIMEDEP:OFINTEREST}
Notes
- default options for all non-specified variables {real:timeInvariant}
- possible settings for TYPE : real | integer | binary
- possible settings for TIMEDEPendency : timeInvariant | timeVariant
- possible settings for OFINTEREST : ofInterest or ofInterest(TIME)
if TIME is provided, then the variable is 'of interest' for all
time-points of the specified set; syntax for TIME see below.
- capitalization of options/settings doesn't matter
- variables don't have to be specified explicitly in this section; all
variables found in the constraints are automatically added to the
opttask-object; the type and time-variance properties are
automatically detected
Examples
The following examples show how to define variables. You can use any
one of the strings below and pass it to ADMITconstraint, e.g.
ADMITvariable('A {real:timeVariant}')
Add a variable to an ADMITproject by using the "+"-operator
opt = ADMITproject();
opt = opt + ADMITvariable('A {real:timeVariant}')
Remove a variable from an ADMITproject by using the "-"-operator
opt = ADMITproject();
opt = opt + ADMITvariable('A')
Note: In this case, the variable 'A' is removed from the ADMITproject by
replace each occurrence of 'A' by its definition (IF IT CAN BE DETERMINED):
opt = opt + ADMITconstraint('A := [1]')
opt = opt + ADMITconstraint('A*B > 1')
opt = opt - ADMITvariable('A')
In the previous example A is replace by constant value 1; the value for a
is determined from the "constant" bounds.
or:
opt = ADMITproject();
opt = opt + ADMITvariable('A')
opt = opt + ADMITconstraint('A := A = 2')
opt = opt + ADMITconstraint('A*B > 1')
opt = opt - ADMITvariable('A')
In the previous example A is replace by constant value 2; the value of
the A is determined by looking for the constraint named 'A' and by
solving for A.
Setting type of an variable
opt = ADMITproject();
default type for variables is 'real'
opt = opt + ADMITvariable('A')
opt = opt + ADMITvariable('A {binary}')
opt = opt + ADMITvariable('A {integer}')
Note that you cannot change the time-variance property of a variable once
it has been added!
Setting a variable to be "of-interest"
opt = ADMITproject();
opt = opt + ADMITtime('t_sim := {0:10}');
opt = opt + ADMITconstraint('C(t_sim) := C(t) = C(t-1) - lambda*C(t-1)');
opt = opt + ADMITconstraint('C(*) := [0,1]');
opt = opt + ADMITconstraint('C(1) := [0.5,0.6]')
If you want to do parameter estimation, you can set time-invariant
variables to be "of-interest" as follows:
opt = opt + ADMITvariable('lambda {ofInterest}')
To estimate the initial conditions of C, you can do the following:
opt = opt + ADMITtime('t_0 := 0')
opt = opt + ADMITvariable('C {timeVariant:ofInterest(t_0)}');
Note that you have to define "t_0" and that you must not change the
time-variance property of "C".
To do state-estimate for C, you can do the following:
opt = opt + ADMITvariable('C {ofInterest(*)}');
Then by calling ADMITestimate(...), consistent bounds for the
variables of interest are determined.
Defining variables and their properties
A {real:timeVariant}
B {real:timeVariant}
C {binary:timeInvariant:ofInterest}
D {integer:timeVariant:ofInterest(t_0)}
E {real:timeVariant}