dae_builder.hpp
1 /*
2  * This file is part of CasADi.
3  *
4  * CasADi -- A symbolic framework for dynamic optimization.
5  * Copyright (C) 2010-2023 Joel Andersson, Joris Gillis, Moritz Diehl,
6  * KU Leuven. All rights reserved.
7  * Copyright (C) 2011-2014 Greg Horn
8  *
9  * CasADi is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 3 of the License, or (at your option) any later version.
13  *
14  * CasADi is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with CasADi; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  *
23  */
24 
25 
26 #ifndef CASADI_DAE_BUILDER_HPP
27 #define CASADI_DAE_BUILDER_HPP
28 
29 #include "function.hpp"
30 
31 namespace casadi {
32 
33 // Forward declarations
34 class DaeBuilderInternal;
35 
145 class CASADI_EXPORT DaeBuilder
146  : public SharedObject,
147  public SWIG_IF_ELSE(PrintableCommon, Printable<DaeBuilder>) {
148  public:
149 
151  std::string type_name() const {return "DaeBuilder";}
152 
155 
243  explicit DaeBuilder(const std::string& name, const std::string& path = "",
244  const Dict& opts = Dict());
245 
279  const std::string& name() const;
280 
283 
350  const MX& time() const;
351 
360  std::vector<std::string> t_new() const {return all("t");}
361 
412  std::vector<std::string> x() const {return all("x");}
413 
486  std::vector<std::string> y() const {return all("y");}
487 
497  std::vector<std::string> z() const {return all("z");}
498 
555  std::vector<std::string> q() const {return all("q");}
556 
621  std::vector<MX> inputs(const std::string& cat) const;
622 
688  std::vector<MX> outputs(const std::string& cat) const;
689 
690 #ifdef WITH_DEPRECATED_FEATURES
692  std::vector<MX> ode() const {return outputs("ode");}
693 
695  std::vector<MX> alg() const {return outputs("alg");}
696 
698  std::vector<MX> quad() const {return outputs("quad");}
699 
701  std::vector<MX> zero() const {return outputs("zero");}
702 
704  std::vector<MX> ydef() const {return outputs("y");}
705 
707  void set_y(const std::vector<std::string>& name) {set_all("y", name);}
708 #endif // WITH_DEPRECATED_FEATURES
709 
718  std::vector<std::string> u() const {return all("u");}
719 
761  std::vector<std::string> p() const {return all("p");}
762 
772  std::vector<std::string> c() const {return all("c");}
773 
783  std::vector<MX> cdef() const;
784 
795  std::vector<std::string> d() const {return all("d");}
796 
806  std::vector<MX> ddef() const;
807 
863  std::vector<std::string> w() const {return all("w");}
864 
874  std::vector<MX> wdef() const;
875 
917  std::vector<MX> init_lhs() const;
918 
926  std::vector<MX> init_rhs() const;
927 
928 #ifdef WITH_DEPRECATED_FEATURES
930  std::vector<std::string> outputs() const {return y();}
931 
933  std::vector<std::string> derivatives() const {return der();}
934 #endif // WITH_DEPRECATED_FEATURES
935 
944  std::vector<std::string> initial_unknowns() const;
945 
948 
957  bool has_t() const;
958 
997  casadi_int nx() const;
998 
1006  casadi_int nz() const;
1007 
1015  casadi_int nq() const;
1016 
1025  casadi_int nzero() const;
1026 
1034  casadi_int ny() const;
1035 
1043  casadi_int nu() const;
1044 
1052  casadi_int np() const;
1053 
1061  casadi_int nc() const;
1062 
1070  casadi_int nd() const;
1071 
1079  casadi_int nw() const;
1081 
1086 
1218  MX add(const std::string& name,
1219  const std::string& causality,
1220  const std::string& variability,
1221  const Dict& opts=Dict());
1222 
1230  MX add(const std::string& name,
1231  const std::string& causality,
1232  const Dict& opts=Dict());
1233 
1240  MX add(const std::string& name,
1241  const Dict& opts=Dict());
1242 
1250  void add(const std::string& name,
1251  const std::string& causality,
1252  const std::string& variability,
1253  const MX& expr,
1254  const Dict& opts=Dict());
1255 
1400  void eq(const MX& lhs, const MX& rhs, const Dict& opts=Dict());
1401 
1483  void when(const MX& cond, const std::vector<std::string>& eqs, const Dict& opts=Dict());
1484 
1573  std::string assign(const std::string& name, const MX& val);
1574 
1633  std::string reinit(const std::string& name, const MX& val);
1634 
1697  void set_init(const std::string& name, const MX& init_rhs);
1698 
1726  void sanity_check() const;
1728 
1803  void reorder(const std::string& cat, const std::vector<std::string>& v);
1804 
1899  void set_all(const std::string& v, const std::vector<std::string>& name);
1900 
1905 
1906 
1975  void eliminate(const std::string& cat);
1976 
2045  void sort(const std::string& cat);
2046 
2143  void lift(bool lift_shared = true, bool lift_calls = true);
2144 
2156  void prune(bool prune_p = true, bool prune_u = true);
2157 
2168  void tear();
2170 
2175 
2246  Function add_fun(const std::string& name,
2247  const std::vector<std::string>& arg,
2248  const std::vector<std::string>& res, const Dict& opts=Dict());
2249 
2292 
2299  Function add_fun(const std::string& name, const Importer& compiler,
2300  const Dict& opts=Dict());
2301 
2309  bool has_fun(const std::string& name) const;
2310 
2360  Function fun(const std::string& name) const;
2361 
2363  std::vector<Function> fun() const;
2364 
2420  void gather_fun(casadi_int max_depth = -1);
2422 
2427  void parse_fmi(const std::string& filename) {load_fmi_description(filename); }
2428 
2438 
2440  bool provides_directional_derivative() const {return provides_directional_derivatives();}
2441 
2458  void load_fmi_description(const std::string& filename);
2459 
2477  Dict export_fmu(const Dict& opts=Dict());
2478 
2495  Dict compile_fmu(const Dict& files, const Dict& opts=Dict());
2496 
2509  std::string pack_fmu(const Dict& files, const Dict& opts=Dict());
2510 
2571  void add_lc(const std::string& name, const std::vector<std::string>& f_out);
2572 
2580  Function create(const std::string& fname,
2581  const std::vector<std::string>& name_in,
2582  const std::vector<std::string>& name_out, bool sx, bool lifted_calls = false) const;
2583 
2717  Function create(const std::string& name,
2718  const std::vector<std::string>& name_in,
2719  const std::vector<std::string>& name_out,
2720  const Dict& opts=Dict()) const;
2722 
2780  Function create(const std::string& fname, const Dict& opts=Dict()) const;
2781 
2787  Function create() const {return create(name() + "_dae");}
2788 
2865  Function dependent_fun(const std::string& fname,
2866  const std::vector<std::string>& s_in,
2867  const std::vector<std::string>& s_out) const;
2868 
2940  Function transition(const std::string& fname, casadi_int index) const;
2941 
2995  Function transition(const std::string& fname) const;
2996 
3002  Function transition() const {return transition(name() + "_transition");}
3003 
3005 
3061  MX var(const std::string& name) const;
3062  MX operator()(const std::string& name) const {return var(name);}
3064 
3114  std::vector<std::string> der() const;
3115 
3173  std::vector<std::string> der(const std::vector<std::string>& name) const;
3174 
3176 
3277  MX der(const MX& v) const;
3278  MX der(const MX& v);
3280 
3288  std::vector<std::string> pre(const std::vector<std::string>& name) const;
3289 
3299  MX pre(const MX& v) const;
3300 
3310  bool has_beq(const std::string& name) const;
3311 
3353  MX beq(const std::string& name) const;
3354 
3356 
3400  casadi_int value_reference(const std::string& name) const;
3401  void set_value_reference(const std::string& name, casadi_int val);
3403 
3405 
3446  std::string description(const std::string& name) const;
3447  void set_description(const std::string& name, const std::string& val);
3449 
3451 
3512  std::string type(const std::string& name, casadi_int fmi_version = 3) const;
3513  void set_type(const std::string& name, const std::string& val);
3515 
3557  std::string causality(const std::string& name) const;
3558 
3609  std::vector<std::string> categories(const std::string& name) const;
3610 
3679  void set_causality(const std::string& name, const std::string& val);
3680 
3688  std::string variability(const std::string& name) const;
3689 
3771  void set_variability(const std::string& name, const std::string& val);
3772 
3781  std::string category(const std::string& name) const;
3782 
3874  void set_category(const std::string& name, const std::string& val);
3875 
3877 
3926  std::string initial(const std::string& name) const;
3927  void set_initial(const std::string& name, const std::string& val);
3929 
3931 
3972  std::string unit(const std::string& name) const;
3973  void set_unit(const std::string& name, const std::string& val);
3975 
3977 
3983  std::string display_unit(const std::string& name) const;
3984  void set_display_unit(const std::string& name, const std::string& val);
3986 
4027  casadi_int numel(const std::string& name) const;
4028 
4037  std::vector<casadi_int> dimension(const std::string& name) const;
4038 
4087  double start_time() const;
4088 
4090  void set_start_time(double val);
4091 
4093  double stop_time() const;
4094 
4096  void set_stop_time(double val);
4097 
4099  double tolerance() const;
4100 
4102  void set_tolerance(double val);
4103 
4105  double step_size() const;
4106 
4108  void set_step_size(double val);
4109 
4110  // The following routines are not needed in MATLAB and would cause ambiguity
4111  // Note that a multirow strings can be interpreted as a vector of strings
4112 #if !(defined(SWIG) && defined(SWIGMATLAB))
4118  std::string der(const std::string& name) const;
4119 
4121  std::string pre(const std::string& name) const;
4122 
4194  double attribute(const std::string& a, const std::string& name) const;
4195 
4197  void set_attribute(const std::string& a, const std::string& name, double val);
4198 
4249  double min(const std::string& name) const;
4250 
4252  void set_min(const std::string& name, double val);
4253 
4255  double max(const std::string& name) const;
4256 
4258  void set_max(const std::string& name, double val);
4259 
4261  double nominal(const std::string& name) const;
4262 
4264  void set_nominal(const std::string& name, double val);
4265 
4345  std::vector<double> start(const std::string& name) const;
4346 
4348  void set_start(const std::string& name, double val);
4349 
4351  void set_start(const std::string& name, const std::vector<double>& val);
4352 
4361  void reset();
4362 
4489  void set(const std::string& name, double val);
4490 
4492  void set(const std::string& name, const std::string& val);
4493 
4503  GenericType get(const std::string& name) const;
4504 
4527  bool symbolic() const;
4528 
4529 #endif // !SWIGMATLAB
4530 
4532  std::vector<double> attribute(const std::string& a, const std::vector<std::string>& name) const;
4533 
4535  void set_attribute(const std::string& a, const std::vector<std::string>& name,
4536  const std::vector<double>& val);
4537 
4539  std::vector<double> min(const std::vector<std::string>& name) const;
4540 
4542  void set_min(const std::vector<std::string>& name, const std::vector<double>& val);
4543 
4545  std::vector<double> max(const std::vector<std::string>& name) const;
4546 
4548  void set_max(const std::vector<std::string>& name, const std::vector<double>& val);
4549 
4551  std::vector<double> nominal(const std::vector<std::string>& name) const;
4552 
4554  void set_nominal(const std::vector<std::string>& name, const std::vector<double>& val);
4555 
4557  std::vector<double> start(const std::vector<std::string>& name) const;
4558 
4565  void set_start(const std::vector<std::string>& name, const std::vector<double>& val);
4566 
4568  void set(const std::vector<std::string>& name, const std::vector<double>& val);
4569 
4571  void set(const std::vector<std::string>& name, const std::vector<std::string>& val);
4572 
4574  std::vector<GenericType> get(const std::vector<std::string>& name) const;
4575 
4616  bool has(const std::string& name) const;
4617 
4669  std::vector<std::string> all() const;
4670 
4677  std::vector<std::string> all(const std::string& cat) const;
4678 
4760  Function oracle(bool sx = false, bool elim_w = false, bool lifted_calls = false) const;
4761 
4808  Sparsity jac_sparsity(const std::vector<std::string>& onames,
4809  const std::vector<std::string>& inames) const;
4810 
4811 #ifndef SWIG
4813  const DaeBuilderInternal* operator->() const;
4814 
4816  DaeBuilderInternal* operator->();
4817 
4819  static bool test_cast(const SharedObjectInternal* ptr);
4820 
4821 #endif // SWIG
4822 };
4823 
4824 } // namespace casadi
4825 
4826 #endif // CASADI_DAE_BUILDER_HPP
A symbolic representation of a differential-algebraic equations model.
double start_time() const
Get the start time.
const MX & time() const
Expression for independent variable (usually time)
std::vector< MX > outputs(const std::string &cat) const
Output expressions for a specific category.
DaeBuilder(const std::string &name, const std::string &path="", const Dict &opts=Dict())
Construct a DaeBuilder instance.
void when(const MX &cond, const std::vector< std::string > &eqs, const Dict &opts=Dict())
Add when equations.
bool has_fun(const std::string &name) const
Does a particular function already exist?
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.
void set_start(const std::string &name, const std::vector< double > &val)
Set the start attribute, vector argument (length numel, or 1 to broadcast)
void set(const std::vector< std::string > &name, const std::vector< std::string > &val)
Set the current value (string) for several string variables.
void set_stop_time(double val)
Set the stop time of the default experiment.
std::vector< std::string > q() const
Quadrature states.
casadi_int nu() const
Free controls.
double nominal(const std::string &name) const
Get the nominal value, single variable (1 by default)
Function add_fun(const std::string &name, const Importer &compiler, const Dict &opts=Dict())
Add an external function.
void sanity_check() const
Check if dimensions match.
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.
bool has(const std::string &name) const
Check if a particular variable exists.
std::string variability(const std::string &name) const
Get the variability.
std::vector< double > min(const std::vector< std::string > &name) const
Get the lower bound for several (scalar) variables.
void set_value_reference(const std::string &name, casadi_int val)
Get/set value reference.
casadi_int nx() const
Differential states.
void set_start(const std::string &name, double val)
Set the start attribute, single variable (all elements for a vector-valued variable)
Function transition(const std::string &fname, casadi_int index) const
Construct a function describing transition at a specific events.
double tolerance() const
Get the tolerance of the default experiment, nan when unknown.
std::string initial(const std::string &name) const
Get/set the initial property.
std::vector< double > attribute(const std::string &a, const std::vector< std::string > &name) const
Get an attribute for several variables, concatenated ("start"/"value" per element)
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.
double max(const std::string &name) const
Get the upper bound, single variable (inf by default)
std::vector< MX > cdef() const
Definitions of named constants.
void set(const std::string &name, const std::string &val)
Set the current value, single value (string), for variables of type "String"
std::string unit(const std::string &name) const
Get/set the unit.
MX der(const MX &v)
Differentiate an expression with respect to time.
void set_min(const std::vector< std::string > &name, const std::vector< double > &val)
Set the lower bound for several variables.
void set_max(const std::string &name, double val)
Set the upper bound, single variable.
std::string der(const std::string &name) const
Get the time derivative of model variables, single variable.
Function oracle(bool sx=false, bool elim_w=false, bool lifted_calls=false) const
Get the (cached) oracle, SX or MX.
Function fun(const std::string &name) const
Get function by name.
std::vector< std::string > c() const
Named constants.
std::string category(const std::string &name) const
Get the variable category.
casadi_int nd() const
Dependent parameters.
void set_attribute(const std::string &a, const std::string &name, double val)
Set an attribute, single variable (vector-valued variables get all elements set)
void reorder(const std::string &cat, const std::vector< std::string > &v)
Reorder variables in a category.
MX der(const MX &v) const
Differentiate an expression with respect to time.
std::vector< double > start(const std::string &name) const
Get the start attribute, single variable.
std::vector< std::string > der(const std::vector< std::string > &name) const
Get the time derivative of model variables.
double step_size() const
Get the step size of the default experiment, nan when unknown.
void parse_fmi(const std::string &filename)
void gather_fun(casadi_int max_depth=-1)
Collect embedded functions from the expression graph.
const std::string & name() const
Name of instance.
std::string pre(const std::string &name) const
Get the pre-variables of model variables, single variable (not implemented)
std::string causality(const std::string &name) const
Get the causality.
std::vector< double > start(const std::vector< std::string > &name) const
Get the start attribute for several variables, concatenated.
casadi_int nc() const
Named constants.
bool provides_directional_derivatives() const
Does the FMU provide support for analytic derivatives.
MX add(const std::string &name, const Dict &opts=Dict())
Add a new model variable, default variability and causality.
void set_tolerance(double val)
Set the tolerance of the default experiment.
void set_min(const std::string &name, double val)
Set the lower bound, single variable.
std::vector< MX > wdef() const
Dependent variables and corresponding definitions.
std::string assign(const std::string &name, const MX &val)
Assignment inside a when-equation or if-else equation.
void tear()
Identify iteration variables and residual equations using naming convention.
Function transition() const
Construct an event transition function, default naming.
Function create(const std::string &fname, const Dict &opts=Dict()) const
Create a function with standard integrator DAE signature.
std::string type_name() const
Readable name of the class.
void set_type(const std::string &name, const std::string &val)
Get/set the type.
double attribute(const std::string &a, const std::string &name) const
Get an attribute, single variable.
void set_unit(const std::string &name, const std::string &val)
Get/set the unit.
void sort(const std::string &cat)
Sort dependent parameters.
std::vector< std::string > derivatives() const
[DEPRECATED] Renamed "der"
bool provides_directional_derivative() const
Does the FMU provide support for analytic derivatives (FMI 2 naming)
double stop_time() const
Get the stop time of the default experiment, nan when unknown.
Function create() const
Create a function with standard integrator DAE signature, default naming.
std::vector< Function > fun() const
Get all functions.
double min(const std::string &name) const
Get the lower bound, single variable.
std::vector< std::string > all() const
Get a list of all variables.
void set_max(const std::vector< std::string > &name, const std::vector< double > &val)
Set the upper bound for several variables.
Function add_fun(const Function &f)
Add an already existing function.
Function transition(const std::string &fname) const
Construct a function describing transition at any events.
std::vector< std::string > all(const std::string &cat) const
Get a list of all variables of a particular category.
void set_display_unit(const std::string &name, const std::string &val)
Get/set the display unit.
std::string reinit(const std::string &name, const MX &val)
Reinitialize a state inside when-equations.
std::vector< double > max(const std::vector< std::string > &name) const
Get the upper bound for several (scalar) variables.
MX operator()(const std::string &name) const
Get variable expression by name.
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.
std::vector< double > nominal(const std::vector< std::string > &name) const
Get the nominal value for several (scalar) variables.
std::vector< MX > alg() const
[DEPRECATED] Replaced with outputs("alg")
void set_init(const std::string &name, const MX &init_rhs)
Specify the initial equation for a variable.
void add_lc(const std::string &name, const std::vector< std::string > &f_out)
Add a named linear combination of output expressions.
void eq(const MX &lhs, const MX &rhs, const Dict &opts=Dict())
Add a simple equation.
void set_y(const std::vector< std::string > &name)
[DEPRECATED] Replaced with set_all("y", name)
std::vector< std::string > x() const
Differential states.
void set_category(const std::string &name, const std::string &val)
Set the variable category, if permitted.
casadi_int nz() const
Algebraic variables.
std::vector< std::string > y() const
Outputs.
bool has_beq(const std::string &name) const
Does a variable have a binding equation?
std::string display_unit(const std::string &name) const
Get/set the display unit.
MX add(const std::string &name, const std::string &causality, const Dict &opts=Dict())
Add a new model variable, default variability.
void set_nominal(const std::string &name, double val)
Set the nominal value, single variable.
std::vector< casadi_int > dimension(const std::string &name) const
Get the dimensions of a variable.
MX pre(const MX &v) const
Get the pre-expression given variable expression.
void set_causality(const std::string &name, const std::string &val)
Set the causality, if permitted.
void prune(bool prune_p=true, bool prune_u=true)
Prune unused controls.
casadi_int nq() const
Quadrature states.
std::string pack_fmu(const Dict &files, const Dict &opts=Dict())
Pack files from export_fmu / compile_fmu into a single .fmu archive.
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.
std::vector< std::string > z() const
Algebraic variables.
void set_attribute(const std::string &a, const std::vector< std::string > &name, const std::vector< double > &val)
Set an attribute, one value per variable or one value per element.
void set_variability(const std::string &name, const std::string &val)
Set the variability, if permitted.
MX add(const std::string &name, const std::string &causality, const std::string &variability, const Dict &opts=Dict())
Add a new model variable.
std::vector< MX > ode() const
[DEPRECATED] Replaced with outputs("ode")
std::vector< std::string > der() const
Model structure: All time derivatives.
bool has_t() const
Is there a time variable?
void set_start_time(double val)
Set the start time of the default experiment.
DaeBuilder()
Default constructor: a null instance, not usable until assigned.
void set(const std::string &name, double val)
Set the current value, single value.
std::vector< std::string > t_new() const
Independent variable (usually time)
void eliminate(const std::string &cat)
Eliminate all dependent parameters.
std::vector< std::string > initial_unknowns() const
Model structure: initial unknowns.
void reset()
Clear all set values.
std::vector< MX > init_lhs() const
Initial conditions, left-hand-side.
casadi_int value_reference(const std::string &name) const
Get/set value reference.
std::vector< MX > ydef() const
[DEPRECATED] Replaced with outputs("y")
std::vector< std::string > p() const
Parameters.
Sparsity jac_sparsity(const std::vector< std::string > &onames, const std::vector< std::string > &inames) const
Get Jacobian sparsity.
casadi_int np() const
Parameters.
std::vector< std::string > categories(const std::string &name) const
Which categories are possible for a variable?
std::vector< std::string > pre(const std::vector< std::string > &name) const
Get the pre-variables of model variables.
std::vector< std::string > d() const
Dependent parameters.
void lift(bool lift_shared=true, bool lift_calls=true)
Lift problem formulation by extracting shared subexpressions.
MX var(const std::string &name) const
Get variable expression by name.
casadi_int ny() const
Output variables.
void set(const std::vector< std::string > &name, const std::vector< double > &val)
Set the current value for several variables (one per variable or one per element)
Dict compile_fmu(const Dict &files, const Dict &opts=Dict())
Compile the sources produced by export_fmu.
std::vector< MX > zero() const
[DEPRECATED] Replaced with outputs("zero")
void set_all(const std::string &v, const std::vector< std::string > &name)
Set all variables within a a category.
std::vector< std::string > outputs() const
[DEPRECATED] Renamed "y"
void load_fmi_description(const std::string &filename)
Import problem description from FMI or XML.
std::vector< GenericType > get(const std::vector< std::string > &name) const
Evaluate the values for a set of variables at the initial time, one entry per name.
casadi_int numel(const std::string &name) const
Get the number of elements of a variable.
GenericType get(const std::string &name) const
Evaluate the values for a set of variables at the initial time, single value.
std::vector< std::string > w() const
Dependent variables.
Dict export_fmu(const Dict &opts=Dict())
Export instance into an FMU.
std::vector< MX > ddef() const
Definitions of dependent parameters.
casadi_int nw() const
Dependent variables.
bool symbolic() const
Symbolic DAE instance?
std::vector< MX > init_rhs() const
Initial conditions, right-hand-side.
std::vector< MX > inputs(const std::string &cat) const
Input expressions for a specific category.
void set_step_size(double val)
Set the step size of the default experiment.
casadi_int nzero() const
Zero-crossing functions.
std::string description(const std::string &name) const
Get/set description.
void set_initial(const std::string &name, const std::string &val)
Get/set the initial property.
std::vector< std::string > u() const
Free controls.
void set_nominal(const std::vector< std::string > &name, const std::vector< double > &val)
Set the nominal value for several variables.
void set_start(const std::vector< std::string > &name, const std::vector< double > &val)
Set the start attribute for several variables.
std::vector< MX > quad() const
[DEPRECATED] Replaced with outputs("quad")
MX beq(const std::string &name) const
Get the binding equation for a variable.
std::string type(const std::string &name, casadi_int fmi_version=3) const
Get/set the type.
void set_description(const std::string &name, const std::string &val)
Get/set description.
Function object.
Definition: function.hpp:126
Generic data type, can hold different types such as bool, casadi_int, std::string etc.
Importer.
Definition: importer.hpp:86
MX - Matrix expression.
Definition: mx.hpp:145
GenericShared implements a reference counting framework similar for efficient and.
General sparsity class.
Definition: sparsity.hpp:200
The casadi namespace.
Definition: archiver.hpp:32
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.