Skip to content
Joris Gillis edited this page Apr 4, 2023 · 2 revisions

Standard documentation for pw_const:

 Create a piecewise constant function.

::

 pw_const(DM t, DM tval, DM val) -> DM
 pw_const(SX t, SX tval, SX val) -> SX

Create a piecewise constant function with n=val.size() intervals

Inputs:

Parameters:

t: a scalar variable (e.g. time)

tval: vector with the discrete values of t at the interval transitions

(length n-1)

val: vector with the value of the function for each interval (length n)

Extra doc: https://github.com/casadi/casadi/wiki/L_193

Doc source: https://github.com/casadi/casadi/blob/develop/casadi/core/matrix_decl.hpp#L635

Implementation: https://github.com/casadi/casadi/blob/develop/casadi/core/matrix_decl.hpp#L635-L639

Extra documentation

To edit, see writing tips.

Clone this wiki locally