A symbolic representation of a differential-algebraic equations model. More...
#include <dae_builder.hpp>
t: independent variable (usually time) c: constants p: parameters d: dependent parameters (time independent) u: controls w: dependent variables (time dependent) x: differential states z: algebraic variables q: quadrature states y: outputs
differential equations: \dot{x} == ode(...)
algebraic equations: 0 == alg(...)
quadrature equations: \dot{q} == quad(...)
dependent parameters: d == ddef(d_prev,p)
dependent variables: w == wdef(w_prev,x,z,u,p,t)
output equations: y == ydef(...)
initial equations: init_lhs == init_rhs(...)
events: when when_cond < 0: when_lhs := when_rhs
Extra doc: https://github.com/casadi/casadi/wiki/L_5c
Definition at line 68 of file dae_builder.hpp.


Public Types | |
| using | internal_base_type = SharedObjectInternal |
| using | base_type = SharedObject |
Public Member Functions | |
| std::string | type_name () const |
| Readable name of the class. More... | |
| DaeBuilder () | |
| Default constructor. More... | |
| DaeBuilder (const std::string &name, const std::string &path="", const Dict &opts=Dict()) | |
| Construct a DaeBuilder instance. More... | |
| const std::string & | name () const |
| Name of instance. More... | |
| void | reorder (const std::string &cat, const std::vector< std::string > &v) |
| Reorder variables in a category. More... | |
| void | set_all (const std::string &v, const std::vector< std::string > &name) |
| Set all variables within a a category. More... | |
| Function | create (const std::string &fname, const Dict &opts=Dict()) const |
| Create a function with standard integrator DAE signature. More... | |
| Function | create () const |
| Create a function with standard integrator DAE signature, default naming. More... | |
| Function | dependent_fun (const std::string &fname, const std::vector< std::string > &s_in, const std::vector< std::string > &s_out) const |
| Construct a function for evaluating dependent parameters. More... | |
| Function | transition (const std::string &fname, casadi_int index) const |
| Construct a function describing transition at a specific events. More... | |
| Function | transition (const std::string &fname) const |
| Construct a function describing transition at any events. More... | |
| Function | transition () const |
| Construct an event transition function, default naming. More... | |
| std::vector< std::string > | der () const |
| Model structure: All time derivatives. More... | |
| std::vector< std::string > | der (const std::vector< std::string > &name) const |
| Get the time derivative of model variables. More... | |
| std::vector< std::string > | pre (const std::vector< std::string > &name) const |
| Get the pre-variables of model variables. More... | |
| MX | pre (const MX &v) const |
| Get the pre-expression given variable expression. More... | |
| bool | has_beq (const std::string &name) const |
| Does a variable have a binding equation? More... | |
| MX | beq (const std::string &name) const |
| Get the binding equation for a variable. More... | |
| std::string | causality (const std::string &name) const |
| Get the causality. More... | |
| std::vector< std::string > | categories (const std::string &name) const |
| Which categories are possible for a variable? More... | |
| void | set_causality (const std::string &name, const std::string &val) |
| Set the causality, if permitted. More... | |
| std::string | variability (const std::string &name) const |
| Get the variability. More... | |
| void | set_variability (const std::string &name, const std::string &val) |
| Set the variability, if permitted. More... | |
| std::string | category (const std::string &name) const |
| Get the variable category. More... | |
| void | set_category (const std::string &name, const std::string &val) |
| Set the variable category, if permitted. More... | |
| casadi_int | numel (const std::string &name) const |
| Get the number of elements of a variable. More... | |
| std::vector< casadi_int > | dimension (const std::string &name) const |
| Get the dimensions of a variable. More... | |
| double | start_time () const |
| Get the start time. More... | |
| void | set_start_time (double val) |
| Set the start time. More... | |
| double | stop_time () const |
| Get the stop time. More... | |
| void | set_stop_time (double val) |
| Set the stop time. More... | |
| double | tolerance () const |
| Get the tolerance. More... | |
| void | set_tolerance (double val) |
| Set the tolerance. More... | |
| double | step_size () const |
| Get the step size. More... | |
| void | set_step_size (double val) |
| Set the step size. More... | |
| std::string | der (const std::string &name) const |
| Get the time derivative of model variables, single variable. More... | |
| std::string | pre (const std::string &name) const |
| Get the pre-variables of model variables. More... | |
| double | attribute (const std::string &a, const std::string &name) const |
| Get an attribute, single variable. More... | |
| void | set_attribute (const std::string &a, const std::string &name, double val) |
| Set an attribute, single variable. More... | |
| double | min (const std::string &name) const |
| Get the lower bound, single variable. More... | |
| void | set_min (const std::string &name, double val) |
| Set the lower bound, single variable. More... | |
| double | max (const std::string &name) const |
| Get the upper bound, single variable. More... | |
| void | set_max (const std::string &name, double val) |
| Set the upper bound, single variable. More... | |
| double | nominal (const std::string &name) const |
| Get the nominal value, single variable. More... | |
| void | set_nominal (const std::string &name, double val) |
| Set the nominal value, single variable. More... | |
| std::vector< double > | start (const std::string &name) const |
| Get the start attribute, single variable. More... | |
| void | set_start (const std::string &name, double val) |
| Set the start attribute, single variable. More... | |
| void | set_start (const std::string &name, const std::vector< double > &val) |
| Set the start attribute, vector argument. More... | |
| void | reset () |
| void | set (const std::string &name, double val) |
| void | set (const std::string &name, const std::string &val) |
| GenericType | get (const std::string &name) const |
| Evaluate the values for a set of variables at the initial time, single value. More... | |
| bool | symbolic () const |
| Symbolic DAE instance? More... | |
| std::vector< double > | attribute (const std::string &a, const std::vector< std::string > &name) const |
| Get an attribute. More... | |
| void | set_attribute (const std::string &a, const std::vector< std::string > &name, const std::vector< double > &val) |
| Set an attribute. More... | |
| std::vector< double > | min (const std::vector< std::string > &name) const |
| Get the lower bound. More... | |
| void | set_min (const std::vector< std::string > &name, const std::vector< double > &val) |
| Set the lower bound. More... | |
| std::vector< double > | max (const std::vector< std::string > &name) const |
| Get the upper bound. More... | |
| void | set_max (const std::vector< std::string > &name, const std::vector< double > &val) |
| Set the upper bound. More... | |
| std::vector< double > | nominal (const std::vector< std::string > &name) const |
| Get the nominal value. More... | |
| void | set_nominal (const std::vector< std::string > &name, const std::vector< double > &val) |
| Set the nominal value. More... | |
| std::vector< double > | start (const std::vector< std::string > &name) const |
| Get the start attribute. More... | |
| void | set_start (const std::vector< std::string > &name, const std::vector< double > &val) |
| Set the start attribute. More... | |
| void | set (const std::vector< std::string > &name, const std::vector< double > &val) |
| Set the current value. More... | |
| void | set (const std::vector< std::string > &name, const std::vector< std::string > &val) |
| Set the current value (string) More... | |
| std::vector< GenericType > | get (const std::vector< std::string > &name) const |
| Evaluate the values for a set of variables at the initial time. More... | |
| bool | has (const std::string &name) const |
| Check if a particular variable exists. More... | |
| std::vector< std::string > | all () const |
| Get a list of all variables. More... | |
| std::vector< std::string > | all (const std::string &cat) const |
| Get a list of all variables of a particular category. More... | |
| Function | oracle (bool sx=false, bool elim_w=false, bool lifted_calls=false) const |
| Get the (cached) oracle, SX or MX. More... | |
| Sparsity | jac_sparsity (const std::vector< std::string > &onames, const std::vector< std::string > &inames) const |
| Get Jacobian sparsity. More... | |
| const DaeBuilderInternal * | operator-> () const |
| Access a member function or object. More... | |
| DaeBuilderInternal * | operator-> () |
| Access a member function or object. More... | |
| std::string | class_name () const |
| Get class name. More... | |
| void | disp (std::ostream &stream, bool more=false) const |
| Print a description of the object. More... | |
| std::string | get_str (bool more=false) const |
| Get string representation. More... | |
| void | print_ptr (std::ostream &stream=casadi::uout()) const |
| void | own (SharedObjectInternal *node) |
| void | assign (SharedObjectInternal *node) |
| Assign the node to a node class pointer without reference counting. More... | |
| SharedObjectInternal * | get () const |
| Get a const pointer to the node. More... | |
| casadi_int | getCount () const |
| Get the reference count. More... | |
| void | swap (GenericShared &other) |
| Swap content with another instance. More... | |
| std::string | debug_repr () const |
| bool | is_null () const |
| Is a null pointer? More... | |
| casadi_int | __hash__ () const |
| Returns a number that is unique for a given Node. More... | |
| GenericWeakRef< SharedObject, SharedObjectInternal > * | weak () |
| Get a weak reference to the object. More... | |
Variables and equations | |
| const MX & | time () const |
| Expression for independent variable (usually time) More... | |
| std::vector< std::string > | t_new () const |
| Independent variable (usually time) More... | |
| std::vector< std::string > | x () const |
| Differential states. More... | |
| std::vector< std::string > | y () const |
| Outputs. More... | |
| std::vector< std::string > | z () const |
| Algebraic variables. More... | |
| std::vector< std::string > | q () const |
| Quadrature states. More... | |
| std::vector< MX > | inputs (const std::string &cat) const |
| Input expressions for a specific category. More... | |
| std::vector< MX > | outputs (const std::string &cat) const |
| Output expressions for a specific category. More... | |
| std::vector< MX > | ode () const |
| [DEPRECATED] Replaced with outputs("ode") More... | |
| std::vector< MX > | alg () const |
| [DEPRECATED] Replaced with outputs("alg") More... | |
| std::vector< MX > | quad () const |
| [DEPRECATED] Replaced with outputs("quad") More... | |
| std::vector< MX > | zero () const |
| [DEPRECATED] Replaced with outputs("zero") More... | |
| std::vector< MX > | ydef () const |
| [DEPRECATED] Replaced with outputs("y") More... | |
| void | set_y (const std::vector< std::string > &name) |
| [DEPRECATED] Replaced with set_all("y", name) More... | |
| std::vector< std::string > | u () const |
| Free controls. More... | |
| std::vector< std::string > | p () const |
| Parameters. More... | |
| std::vector< std::string > | c () const |
| Named constants. More... | |
| std::vector< MX > | cdef () const |
| Definitions of named constants. More... | |
| std::vector< std::string > | d () const |
| Dependent parameters. More... | |
| std::vector< MX > | ddef () const |
| Definitions of dependent parameters. More... | |
| std::vector< std::string > | w () const |
| Dependent variables. More... | |
| std::vector< MX > | wdef () const |
| Dependent variables and corresponding definitions. More... | |
| std::vector< MX > | init_lhs () const |
| Initial conditions, left-hand-side. More... | |
| std::vector< MX > | init_rhs () const |
| Initial conditions, right-hand-side. More... | |
| std::vector< std::string > | outputs () const |
| [DEPRECATED] Renamed "y" More... | |
| std::vector< std::string > | derivatives () const |
| [DEPRECATED] Renamed "der" More... | |
| std::vector< std::string > | initial_unknowns () const |
| Model structure: initial unknowns. More... | |
| bool | has_t () const |
| Is there a time variable? More... | |
| casadi_int | nx () const |
| Differential states. More... | |
| casadi_int | nz () const |
| Algebraic variables. More... | |
| casadi_int | nq () const |
| Quadrature states. More... | |
| casadi_int | nzero () const |
| Zero-crossing functions. More... | |
| casadi_int | ny () const |
| Output variables. More... | |
| casadi_int | nu () const |
| Free controls. More... | |
| casadi_int | np () const |
| Parameters. More... | |
| casadi_int | nc () const |
| Named constants. More... | |
| casadi_int | nd () const |
| Dependent parameters. More... | |
| casadi_int | nw () const |
| Dependent variables. More... | |
Symbolic modeling | |
Formulate a dynamic system model | |
| MX | add (const std::string &name, const std::string &causality, const std::string &variability, const Dict &opts=Dict()) |
| Add a new model variable. More... | |
| MX | add (const std::string &name, const std::string &causality, const Dict &opts=Dict()) |
| Add a new model variable, default variability. More... | |
| MX | add (const std::string &name, const Dict &opts=Dict()) |
| Add a new model variable, default variability and causality. More... | |
| void | add (const std::string &name, const std::string &causality, const std::string &variability, const MX &expr, const Dict &opts=Dict()) |
| Add a new model variable, symbolic expression already available. More... | |
| void | eq (const MX &lhs, const MX &rhs, const Dict &opts=Dict()) |
| Add a simple equation. More... | |
| void | when (const MX &cond, const std::vector< std::string > &eqs, const Dict &opts=Dict()) |
| Add when equations. More... | |
| std::string | assign (const std::string &name, const MX &val) |
| Assignment inside a when-equation or if-else equation. More... | |
| std::string | reinit (const std::string &name, const MX &val) |
| Reinitialize a state inside when-equations. More... | |
| void | set_init (const std::string &name, const MX &init_rhs) |
| Specify the initial equation for a variable. More... | |
| void | sanity_check () const |
| Check if dimensions match. More... | |
Manipulation | |
Reformulate the dynamic optimization problem. | |
| void | eliminate (const std::string &cat) |
| Eliminate all dependent parameters. More... | |
| void | sort (const std::string &cat) |
| Sort dependent parameters. More... | |
| void | lift (bool lift_shared=true, bool lift_calls=true) |
| Lift problem formulation by extracting shared subexpressions. More... | |
| void | prune (bool prune_p=true, bool prune_u=true) |
| Prune unused controls. More... | |
| void | tear () |
| Identify iteration variables and residual equations using naming convention. More... | |
Functions | |
Add or load auxiliary functions | |
| Function | add_fun (const std::string &name, const std::vector< std::string > &arg, const std::vector< std::string > &res, const Dict &opts=Dict()) |
| Add a function from loaded expressions. More... | |
| Function | add_fun (const Function &f) |
| Add an already existing function. More... | |
| Function | add_fun (const std::string &name, const Importer &compiler, const Dict &opts=Dict()) |
| Add an external function. More... | |
| bool | has_fun (const std::string &name) const |
| Does a particular function already exist? More... | |
| Function | fun (const std::string &name) const |
| Get function by name. More... | |
| std::vector< Function > | fun () const |
| Get all functions. More... | |
| void | gather_fun (casadi_int max_depth=-1) |
| Collect embedded functions from the expression graph. More... | |
Import and export | |
| void | parse_fmi (const std::string &filename) |
| bool | provides_directional_derivatives () const |
| Does the FMU provide support for analytic derivatives. More... | |
| bool | provides_directional_derivative () const |
| Does the FMU provide support for analytic derivatives (FMI 2 naming) More... | |
| void | load_fmi_description (const std::string &filename) |
| Import problem description from FMI or XML. More... | |
| Dict | export_fmu (const Dict &opts=Dict()) |
| Export instance into an FMU. More... | |
| Dict | compile_fmu (const Dict &files, const Dict &opts=Dict()) |
| Compile the sources produced by export_fmu. More... | |
| std::string | pack_fmu (const Dict &files, const Dict &opts=Dict()) |
| Pack files from export_fmu / compile_fmu into a single .fmu archive. More... | |
| void | add_lc (const std::string &name, const std::vector< std::string > &f_out) |
| Add a named linear combination of output expressions. More... | |
| Function | create (const std::string &fname, const std::vector< std::string > &name_in, const std::vector< std::string > &name_out, bool sx, bool lifted_calls=false) const |
| Construct a function object, legacy syntax. More... | |
| Function | create (const std::string &name, const std::vector< std::string > &name_in, const std::vector< std::string > &name_out, const Dict &opts=Dict()) const |
| Construct a function object, names provided. More... | |
| MX | var (const std::string &name) const |
| MX | operator() (const std::string &name) const |
| MX | der (const MX &v) const |
| MX | der (const MX &v) |
| casadi_int | value_reference (const std::string &name) const |
| void | set_value_reference (const std::string &name, casadi_int val) |
| std::string | description (const std::string &name) const |
| void | set_description (const std::string &name, const std::string &val) |
| std::string | type (const std::string &name, casadi_int fmi_version=3) const |
| void | set_type (const std::string &name, const std::string &val) |
| std::string | initial (const std::string &name) const |
| void | set_initial (const std::string &name, const std::string &val) |
| std::string | unit (const std::string &name) const |
| void | set_unit (const std::string &name, const std::string &val) |
| std::string | display_unit (const std::string &name) const |
| void | set_display_unit (const std::string &name, const std::string &val) |
Static Public Member Functions | |
| static bool | test_cast (const SharedObjectInternal *ptr) |
| Check if a particular cast is allowed. More... | |
Protected Member Functions | |
| void | count_up () |
| void | count_down () |
|
inherited |
Definition at line 103 of file shared_object.hpp.
|
inherited |
Definition at line 102 of file shared_object.hpp.
| casadi::DaeBuilder::DaeBuilder | ( | ) |
Definition at line 51 of file dae_builder.cpp.
|
explicit |
Definition at line 54 of file dae_builder.cpp.
References load_fmi_description(), name(), casadi::GenericShared< SharedObject, SharedObjectInternal >::own(), and casadi::path().
|
inherited |
If the Object does not point to any node, "0" is returned.
Extra doc: https://github.com/casadi/casadi/wiki/L_av
Definition at line 123 of file generic_shared_impl.hpp.
| MX casadi::DaeBuilder::add | ( | const std::string & | name, |
| const std::string & | causality, | ||
| const Dict & | opts = Dict() |
||
| ) |
Definition at line 352 of file dae_builder.cpp.
References causality(), and name().
| MX casadi::DaeBuilder::add | ( | const std::string & | name, |
| const std::string & | causality, | ||
| const std::string & | variability, | ||
| const Dict & | opts = Dict() |
||
| ) |
Definition at line 341 of file dae_builder.cpp.
References causality(), name(), and variability().
| void casadi::DaeBuilder::add | ( | const std::string & | name, |
| const std::string & | causality, | ||
| const std::string & | variability, | ||
| const MX & | expr, | ||
| const Dict & | opts = Dict() |
||
| ) |
Definition at line 370 of file dae_builder.cpp.
References causality(), casadi::MX::is_symbolic(), name(), casadi::MX::name(), and variability().
Definition at line 795 of file dae_builder.cpp.
| Function casadi::DaeBuilder::add_fun | ( | const std::string & | name, |
| const Importer & | compiler, | ||
| const Dict & | opts = Dict() |
||
| ) |
Definition at line 814 of file dae_builder.cpp.
References add_fun(), casadi::external(), has_fun(), and name().
| Function casadi::DaeBuilder::add_fun | ( | const std::string & | name, |
| const std::vector< std::string > & | arg, | ||
| const std::vector< std::string > & | res, | ||
| const Dict & | opts = Dict() |
||
| ) |
Definition at line 804 of file dae_builder.cpp.
References name().
Referenced by add_fun(), and gather_fun().
| void casadi::DaeBuilder::add_lc | ( | const std::string & | name, |
| const std::vector< std::string > & | f_out | ||
| ) |
|
inline |
Definition at line 135 of file dae_builder.hpp.
| std::vector< std::string > casadi::DaeBuilder::all | ( | ) | const |
| std::vector< std::string > casadi::DaeBuilder::all | ( | const std::string & | cat | ) | const |
Definition at line 272 of file dae_builder.cpp.
| std::string casadi::DaeBuilder::assign | ( | const std::string & | name, |
| const MX & | val | ||
| ) |
|
inherited |
improper use will cause memory leaks!
Extra doc: https://github.com/casadi/casadi/wiki/L_at
Definition at line 96 of file generic_shared_impl.hpp.
| double casadi::DaeBuilder::attribute | ( | const std::string & | a, |
| const std::string & | name | ||
| ) | const |
| std::vector< double > casadi::DaeBuilder::attribute | ( | const std::string & | a, |
| const std::vector< std::string > & | name | ||
| ) | const |
| MX casadi::DaeBuilder::beq | ( | const std::string & | name | ) | const |
Definition at line 520 of file dae_builder.cpp.
References casadi::Variable::bind, name(), and casadi::Variable::v.
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_5p
Definition at line 163 of file dae_builder.hpp.
References casadi::all().
| std::vector< std::string > casadi::DaeBuilder::categories | ( | const std::string & | name | ) | const |
| std::string casadi::DaeBuilder::category | ( | const std::string & | name | ) | const |
| std::string casadi::DaeBuilder::causality | ( | const std::string & | name | ) | const |
Definition at line 590 of file dae_builder.cpp.
References name(), and casadi::to_string().
Referenced by add().
| std::vector< MX > casadi::DaeBuilder::cdef | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_5q
Definition at line 91 of file dae_builder.cpp.
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_au
Definition at line 31 of file shared_object.cpp.
Referenced by casadi::FmuFunction::check_mem_count(), casadi::MXFunction::export_code_body(), and casadi::BlazingSplineFunction::merge().
| files | the {local_file -> archive path} map returned by export_fmu |
| opts | compile options: compiler, compiler_options, include_dirs |
Extra doc: https://github.com/casadi/casadi/wiki/L_2iq
Definition at line 220 of file dae_builder.cpp.
|
protectedinherited |
Definition at line 133 of file generic_shared_impl.hpp.
|
protectedinherited |
Definition at line 132 of file generic_shared_impl.hpp.
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_2c1
Definition at line 448 of file dae_builder.hpp.
References create().
| name | Name assigned to the resulting function object |
| opts | Optional settings |
Extra doc: https://github.com/casadi/casadi/wiki/L_2c0
Definition at line 786 of file dae_builder.cpp.
References casadi::dyn_in(), casadi::dyn_out(), and name().
| Function casadi::DaeBuilder::create | ( | const std::string & | fname, |
| const std::vector< std::string > & | name_in, | ||
| const std::vector< std::string > & | name_out, | ||
| bool | sx, | ||
| bool | lifted_calls = false |
||
| ) | const |
Definition at line 764 of file dae_builder.cpp.
| Function casadi::DaeBuilder::create | ( | const std::string & | name, |
| const std::vector< std::string > & | name_in, | ||
| const std::vector< std::string > & | name_out, | ||
| const Dict & | opts = Dict() |
||
| ) | const |
| name | Name assigned to the resulting function object |
| name_in | Names of all the inputs |
| name_out | Names of all the outputs |
| opts | Optional settings |
Extra doc: https://github.com/casadi/casadi/wiki/L_6e
Definition at line 775 of file dae_builder.cpp.
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_5r
Definition at line 173 of file dae_builder.hpp.
References casadi::all().
| std::vector< MX > casadi::DaeBuilder::ddef | ( | ) | const |
Interdependencies are allowed but must be non-cyclic.
Extra doc: https://github.com/casadi/casadi/wiki/L_5s
Definition at line 100 of file dae_builder.cpp.
References casadi::DDEF.
|
inherited |
Definition at line 112 of file generic_shared_impl.hpp.
| Function casadi::DaeBuilder::dependent_fun | ( | const std::string & | fname, |
| const std::vector< std::string > & | s_in, | ||
| const std::vector< std::string > & | s_out | ||
| ) | const |
Definition at line 871 of file dae_builder.cpp.
| std::vector< std::string > casadi::DaeBuilder::der | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_2fz
Definition at line 126 of file dae_builder.cpp.
Referenced by der().
Differentiate an expression with respect to time
Definition at line 921 of file dae_builder.cpp.
Differentiate an expression with respect to time
Definition at line 912 of file dae_builder.cpp.
| std::string casadi::DaeBuilder::der | ( | const std::string & | name | ) | const |
| std::vector< std::string > casadi::DaeBuilder::der | ( | const std::vector< std::string > & | name | ) | const |
Definition at line 489 of file dae_builder.cpp.
|
inline |
Definition at line 209 of file dae_builder.hpp.
| std::string casadi::DaeBuilder::description | ( | const std::string & | name | ) | const |
| std::vector< casadi_int > casadi::DaeBuilder::dimension | ( | const std::string & | name | ) | const |
Definition at line 683 of file dae_builder.cpp.
References name().
|
inherited |
Definition at line 35 of file shared_object.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::is_null().
Referenced by casadi::Nlpsol::disp_more(), and casadi::CsparseInterface::nfact().
| std::string casadi::DaeBuilder::display_unit | ( | const std::string & | name | ) | const |
| void casadi::DaeBuilder::eliminate | ( | const std::string & | cat | ) |
Definition at line 530 of file dae_builder.cpp.
Definition at line 385 of file dae_builder.cpp.
Definition at line 211 of file dae_builder.cpp.
| std::vector< Function > casadi::DaeBuilder::fun | ( | ) | const |
Definition at line 858 of file dae_builder.cpp.
| Function casadi::DaeBuilder::fun | ( | const std::string & | name | ) | const |
| void casadi::DaeBuilder::gather_fun | ( | casadi_int | max_depth = -1 | ) |
Definition at line 837 of file dae_builder.cpp.
References add_fun(), casadi::Function::find_functions(), and has_fun().
|
inherited |
Definition at line 99 of file generic_shared_impl.hpp.
| GenericType casadi::DaeBuilder::get | ( | const std::string & | name | ) | const |
Definition at line 1151 of file dae_builder.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::get(), and name().
| std::vector< GenericType > casadi::DaeBuilder::get | ( | const std::vector< std::string > & | name | ) | const |
Definition at line 1155 of file dae_builder.cpp.
References create(), casadi::Variable::get_attribute(), name(), casadi::Variable::numel, casadi::Function::stats(), casadi::STRING, casadi::STRINGVALUE, symbolic(), casadi::Variable::type, and casadi::VALUE.
|
inlineinherited |
Definition at line 91 of file shared_object.hpp.
|
inherited |
Definition at line 102 of file generic_shared_impl.hpp.
| bool casadi::DaeBuilder::has | ( | const std::string & | name | ) | const |
| bool casadi::DaeBuilder::has_beq | ( | const std::string & | name | ) | const |
| bool casadi::DaeBuilder::has_fun | ( | const std::string & | name | ) | const |
Definition at line 819 of file dae_builder.cpp.
References name().
Referenced by add_fun(), and gather_fun().
| bool casadi::DaeBuilder::has_t | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_64
Definition at line 144 of file dae_builder.cpp.
| std::vector< MX > casadi::DaeBuilder::init_lhs | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_2b1
Definition at line 118 of file dae_builder.cpp.
| std::vector< MX > casadi::DaeBuilder::init_rhs | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_2b2
Definition at line 122 of file dae_builder.cpp.
Referenced by set_init().
| std::string casadi::DaeBuilder::initial | ( | const std::string & | name | ) | const |
Get/set the initial property
Definition at line 655 of file dae_builder.cpp.
References name(), and casadi::to_string().
| std::vector< std::string > casadi::DaeBuilder::initial_unknowns | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_63
Definition at line 135 of file dae_builder.cpp.
| std::vector< MX > casadi::DaeBuilder::inputs | ( | const std::string & | cat | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_2fx
Definition at line 73 of file dae_builder.cpp.
|
inherited |
Definition at line 116 of file generic_shared_impl.hpp.
| Sparsity casadi::DaeBuilder::jac_sparsity | ( | const std::vector< std::string > & | onames, |
| const std::vector< std::string > & | inames | ||
| ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_6g
Definition at line 1207 of file dae_builder.cpp.
| void casadi::DaeBuilder::lift | ( | bool | lift_shared = true, |
| bool | lift_calls = true |
||
| ) |
Definition at line 546 of file dae_builder.cpp.
| void casadi::DaeBuilder::load_fmi_description | ( | const std::string & | filename | ) |
Definition at line 193 of file dae_builder.cpp.
References casadi::filename().
Referenced by DaeBuilder().
| double casadi::DaeBuilder::max | ( | const std::string & | name | ) | const |
| std::vector< double > casadi::DaeBuilder::max | ( | const std::vector< std::string > & | name | ) | const |
| double casadi::DaeBuilder::min | ( | const std::string & | name | ) | const |
| std::vector< double > casadi::DaeBuilder::min | ( | const std::vector< std::string > & | name | ) | const |
| const std::string & casadi::DaeBuilder::name | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_5d
Definition at line 59 of file dae_builder.cpp.
Referenced by add(), add_fun(), add_lc(), assign(), attribute(), beq(), categories(), category(), causality(), create(), DaeBuilder(), der(), description(), dimension(), display_unit(), fun(), get(), has(), has_beq(), has_fun(), initial(), max(), min(), nominal(), numel(), pre(), reinit(), set(), set_all(), set_attribute(), set_category(), set_causality(), set_description(), set_display_unit(), set_init(), set_initial(), set_max(), set_min(), set_nominal(), set_start(), set_type(), set_unit(), set_value_reference(), set_variability(), start(), type(), unit(), value_reference(), var(), and variability().
| casadi_int casadi::DaeBuilder::nc | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_6b
Definition at line 181 of file dae_builder.cpp.
References casadi::C.
| casadi_int casadi::DaeBuilder::nd | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_6c
Definition at line 185 of file dae_builder.cpp.
References casadi::D.
| double casadi::DaeBuilder::nominal | ( | const std::string & | name | ) | const |
| std::vector< double > casadi::DaeBuilder::nominal | ( | const std::vector< std::string > & | name | ) | const |
| casadi_int casadi::DaeBuilder::np | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_6a
Definition at line 177 of file dae_builder.cpp.
References casadi::P.
| casadi_int casadi::DaeBuilder::nq | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_67
Definition at line 161 of file dae_builder.cpp.
References casadi::Q.
| casadi_int casadi::DaeBuilder::nu | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_69
Definition at line 173 of file dae_builder.cpp.
References casadi::U.
| casadi_int casadi::DaeBuilder::numel | ( | const std::string & | name | ) | const |
Definition at line 679 of file dae_builder.cpp.
References name().
| casadi_int casadi::DaeBuilder::nw | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_6d
Definition at line 189 of file dae_builder.cpp.
References casadi::W.
| casadi_int casadi::DaeBuilder::nx | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_65
Definition at line 153 of file dae_builder.cpp.
References casadi::X.
| casadi_int casadi::DaeBuilder::ny | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_68
Definition at line 169 of file dae_builder.cpp.
References casadi::Y.
Referenced by set_all().
| casadi_int casadi::DaeBuilder::nz | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_66
Definition at line 157 of file dae_builder.cpp.
References casadi::Z.
| casadi_int casadi::DaeBuilder::nzero | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_2cb
Definition at line 165 of file dae_builder.cpp.
References casadi::ZERO.
|
inline |
Definition at line 132 of file dae_builder.hpp.
|
inline |
| DaeBuilderInternal * casadi::DaeBuilder::operator-> | ( | ) |
Definition at line 904 of file dae_builder.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::operator->().
| const DaeBuilderInternal * casadi::DaeBuilder::operator-> | ( | ) | const |
Definition at line 908 of file dae_builder.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::operator->().
| Function casadi::DaeBuilder::oracle | ( | bool | sx = false, |
| bool | elim_w = false, |
||
| bool | lifted_calls = false |
||
| ) | const |
|
inline |
Definition at line 206 of file dae_builder.hpp.
| std::vector< MX > casadi::DaeBuilder::outputs | ( | const std::string & | cat | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_2fy
Definition at line 82 of file dae_builder.cpp.
|
inherited |
Assign the node to a node class pointer (or null)
Definition at line 89 of file generic_shared_impl.hpp.
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_5o
Definition at line 158 of file dae_builder.hpp.
References casadi::all().
| files | the {local_file -> archive path} map to pack |
| opts | packaging options: path (default '<name>.fmu') |
Extra doc: https://github.com/casadi/casadi/wiki/L_2ir
Definition at line 229 of file dae_builder.cpp.
|
inline |
Import existing problem from FMI/XML
Definition at line 384 of file dae_builder.hpp.
References casadi::filename().
Definition at line 474 of file dae_builder.cpp.
| std::string casadi::DaeBuilder::pre | ( | const std::string & | name | ) | const |
| std::vector< std::string > casadi::DaeBuilder::pre | ( | const std::vector< std::string > & | name | ) | const |
Definition at line 500 of file dae_builder.cpp.
References name().
|
inherited |
Print the pointer to the internal class
Definition at line 43 of file shared_object.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::get().
|
inline |
Definition at line 390 of file dae_builder.hpp.
| bool casadi::DaeBuilder::provides_directional_derivatives | ( | ) | const |
| void casadi::DaeBuilder::prune | ( | bool | prune_p = true, |
| bool | prune_u = true |
||
| ) |
Definition at line 238 of file dae_builder.cpp.
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_2fw
Definition at line 118 of file dae_builder.hpp.
References casadi::all().
|
inline |
Definition at line 138 of file dae_builder.hpp.
| std::string casadi::DaeBuilder::reinit | ( | const std::string & | name, |
| const MX & | val | ||
| ) |
| void casadi::DaeBuilder::reorder | ( | const std::string & | cat, |
| const std::vector< std::string > & | v | ||
| ) |
| void casadi::DaeBuilder::reset | ( | ) |
Definition at line 1110 of file dae_builder.cpp.
| void casadi::DaeBuilder::sanity_check | ( | ) | const |
Definition at line 427 of file dae_builder.cpp.
| void casadi::DaeBuilder::set | ( | const std::string & | name, |
| const std::string & | val | ||
| ) |
| void casadi::DaeBuilder::set | ( | const std::string & | name, |
| double | val | ||
| ) |
| void casadi::DaeBuilder::set | ( | const std::vector< std::string > & | name, |
| const std::vector< double > & | val | ||
| ) |
| void casadi::DaeBuilder::set | ( | const std::vector< std::string > & | name, |
| const std::vector< std::string > & | val | ||
| ) |
| void casadi::DaeBuilder::set_all | ( | const std::string & | v, |
| const std::vector< std::string > & | name | ||
| ) |
Definition at line 281 of file dae_builder.cpp.
References all(), casadi::is_input_category(), casadi::is_output_category(), name(), ny(), reorder(), set_category(), set_causality(), y(), and casadi::Y.
| void casadi::DaeBuilder::set_attribute | ( | const std::string & | a, |
| const std::string & | name, | ||
| double | val | ||
| ) |
| void casadi::DaeBuilder::set_attribute | ( | const std::string & | a, |
| const std::vector< std::string > & | name, | ||
| const std::vector< double > & | val | ||
| ) |
| void casadi::DaeBuilder::set_category | ( | const std::string & | name, |
| const std::string & | val | ||
| ) |
The following changes are permitted: Controls 'u' can be changed to/from tunable parameters 'p' or fixed parameters 'c' Differential states that do not appear in the right-hand-sides can be changed between regular states 'x', quadrature states 'q' and no category '0'.
Other changes are not permitted. Causality and variability is updated accordingly.
Extra doc: https://github.com/casadi/casadi/wiki/L_2c4
Definition at line 646 of file dae_builder.cpp.
References name(), and casadi::NUMEL.
Referenced by set_all().
| void casadi::DaeBuilder::set_causality | ( | const std::string & | name, |
| const std::string & | val | ||
| ) |
The following changes are permitted: For controls 'u' (variability 'continuous', causality 'input'), free parameters 'p' (variability 'tunable', causality 'parameter') and fixed parameters 'c' (variability 'fixed', causality 'parameter'), causality can only be changed indirectly, by updating the variability Add or remove an output 'y' by setting the causality to 'output' or 'local', respectively
No other changes are permitted.
Extra doc: https://github.com/casadi/casadi/wiki/L_2c2
Definition at line 612 of file dae_builder.cpp.
References name().
Referenced by set_all().
| void casadi::DaeBuilder::set_description | ( | const std::string & | name, |
| const std::string & | val | ||
| ) |
| void casadi::DaeBuilder::set_display_unit | ( | const std::string & | name, |
| const std::string & | val | ||
| ) |
| void casadi::DaeBuilder::set_init | ( | const std::string & | name, |
| const MX & | init_rhs | ||
| ) |
Definition at line 419 of file dae_builder.cpp.
References init_rhs(), and name().
| void casadi::DaeBuilder::set_initial | ( | const std::string & | name, |
| const std::string & | val | ||
| ) |
| void casadi::DaeBuilder::set_max | ( | const std::string & | name, |
| double | val | ||
| ) |
| void casadi::DaeBuilder::set_max | ( | const std::vector< std::string > & | name, |
| const std::vector< double > & | val | ||
| ) |
| void casadi::DaeBuilder::set_min | ( | const std::string & | name, |
| double | val | ||
| ) |
| void casadi::DaeBuilder::set_min | ( | const std::vector< std::string > & | name, |
| const std::vector< double > & | val | ||
| ) |
| void casadi::DaeBuilder::set_nominal | ( | const std::string & | name, |
| double | val | ||
| ) |
| void casadi::DaeBuilder::set_nominal | ( | const std::vector< std::string > & | name, |
| const std::vector< double > & | val | ||
| ) |
| void casadi::DaeBuilder::set_start | ( | const std::string & | name, |
| const std::vector< double > & | val | ||
| ) |
| void casadi::DaeBuilder::set_start | ( | const std::string & | name, |
| double | val | ||
| ) |
| void casadi::DaeBuilder::set_start | ( | const std::vector< std::string > & | name, |
| const std::vector< double > & | val | ||
| ) |
| void casadi::DaeBuilder::set_start_time | ( | double | val | ) |
Definition at line 696 of file dae_builder.cpp.
| void casadi::DaeBuilder::set_step_size | ( | double | val | ) |
Definition at line 747 of file dae_builder.cpp.
| void casadi::DaeBuilder::set_stop_time | ( | double | val | ) |
Definition at line 713 of file dae_builder.cpp.
| void casadi::DaeBuilder::set_tolerance | ( | double | val | ) |
Definition at line 730 of file dae_builder.cpp.
| void casadi::DaeBuilder::set_type | ( | const std::string & | name, |
| const std::string & | val | ||
| ) |
Get/set the type
Definition at line 581 of file dae_builder.cpp.
References casadi::from_fmi2(), and name().
| void casadi::DaeBuilder::set_unit | ( | const std::string & | name, |
| const std::string & | val | ||
| ) |
| void casadi::DaeBuilder::set_value_reference | ( | const std::string & | name, |
| casadi_int | val | ||
| ) |
| void casadi::DaeBuilder::set_variability | ( | const std::string & | name, |
| const std::string & | val | ||
| ) |
For controls 'u' (variability 'continuous', causality 'input'), free parameters 'p' (variability 'tunable', causality 'parameter') and fixed parameters 'c' (variability 'fixed', causality 'parameter'), update variability in order to change the category. Causality is updated accordingly.
Other changes are not permitted
Extra doc: https://github.com/casadi/casadi/wiki/L_2c3
Definition at line 629 of file dae_builder.cpp.
References name().
|
inline |
Definition at line 147 of file dae_builder.hpp.
| void casadi::DaeBuilder::sort | ( | const std::string & | cat | ) |
Definition at line 538 of file dae_builder.cpp.
| std::vector< double > casadi::DaeBuilder::start | ( | const std::string & | name | ) | const |
| std::vector< double > casadi::DaeBuilder::start | ( | const std::vector< std::string > & | name | ) | const |
| double casadi::DaeBuilder::start_time | ( | ) | const |
| double casadi::DaeBuilder::step_size | ( | ) | const |
| double casadi::DaeBuilder::stop_time | ( | ) | const |
|
inherited |
Definition at line 105 of file generic_shared_impl.hpp.
| bool casadi::DaeBuilder::symbolic | ( | ) | const |
Definition at line 1198 of file dae_builder.cpp.
Referenced by get(), and provides_directional_derivatives().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_2bz
Definition at line 98 of file dae_builder.hpp.
References casadi::all().
| void casadi::DaeBuilder::tear | ( | ) |
Definition at line 246 of file dae_builder.cpp.
|
static |
Definition at line 900 of file dae_builder.cpp.
| const MX & casadi::DaeBuilder::time | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_2by
Definition at line 63 of file dae_builder.cpp.
| double casadi::DaeBuilder::tolerance | ( | ) | const |
|
inline |
Definition at line 462 of file dae_builder.hpp.
References transition().
Referenced by transition().
| Function casadi::DaeBuilder::transition | ( | const std::string & | fname | ) | const |
Definition at line 891 of file dae_builder.cpp.
| Function casadi::DaeBuilder::transition | ( | const std::string & | fname, |
| casadi_int | index | ||
| ) | const |
Definition at line 882 of file dae_builder.cpp.
| std::string casadi::DaeBuilder::type | ( | const std::string & | name, |
| casadi_int | fmi_version = 3 |
||
| ) | const |
Get/set the type
Definition at line 570 of file dae_builder.cpp.
References name(), casadi::to_fmi2(), and casadi::to_string().
|
inline |
Definition at line 74 of file dae_builder.hpp.
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_5n
Definition at line 153 of file dae_builder.hpp.
References casadi::all().
| std::string casadi::DaeBuilder::unit | ( | const std::string & | name | ) | const |
| casadi_int casadi::DaeBuilder::value_reference | ( | const std::string & | name | ) | const |
| MX casadi::DaeBuilder::var | ( | const std::string & | name | ) | const |
| std::string casadi::DaeBuilder::variability | ( | const std::string & | name | ) | const |
Definition at line 620 of file dae_builder.cpp.
References name(), and casadi::to_string().
Referenced by add().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_5t
Definition at line 185 of file dae_builder.hpp.
References casadi::all().
| std::vector< MX > casadi::DaeBuilder::wdef | ( | ) | const |
Interdependencies are allowed but must be non-cyclic.
Extra doc: https://github.com/casadi/casadi/wiki/L_5u
Definition at line 109 of file dae_builder.cpp.
References casadi::WDEF.
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_aw
Definition at line 130 of file generic_shared_impl.hpp.
| void casadi::DaeBuilder::when | ( | const MX & | cond, |
| const std::vector< std::string > & | eqs, | ||
| const Dict & | opts = Dict() |
||
| ) |
Definition at line 393 of file dae_builder.cpp.
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_5f
Definition at line 103 of file dae_builder.hpp.
References casadi::all().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_2fu
Definition at line 108 of file dae_builder.hpp.
References casadi::all().
Referenced by set_all().
|
inline |
Definition at line 144 of file dae_builder.hpp.
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_2fv
Definition at line 113 of file dae_builder.hpp.
References casadi::all().
|
inline |
Definition at line 141 of file dae_builder.hpp.