State Variables of type Float

The Tangram-II simulator can deal with float state variables. This feature allows construction of continuous-state models, which cannot be solved analytically. There are two types of float state variables: scalars and vectors. The new syntax of the state variable declaration is

  Declaration =
    Var:
      Integer: Status;
      Float: Fvar;
      Float: Fvec[10];
The use of these new variables is similar to that of the integer ones. The difference is in the use of local variables of float type to avoid type cast errors:
  float fvar;
  fvar = 1.0/3*Fvar;
  set_st( Fvar, fvar );
or for vectors,
  float fvec[10], aux;
  get_st( fvec, "Fvec[]" );
  ...
  fvec[2] = aux;
  set_st( "Fvec[]" , fvec);



Guilherme Dutra Gonzaga Jaime 2010-10-27