Skip to content

Commit

Permalink
Small corrections in user guide
Browse files Browse the repository at this point in the history
  • Loading branch information
jgillis committed Apr 4, 2023
1 parent 6e362d7 commit b1e3f3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/users_guide/source/daebuilder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ list of functions, see the C++ API documentation for |DaeBuilder|.
.. _sec-modelica:

Symbolic import of OCPs from Modelica
----------------------------
-------------------------------------

Note: JModelica.org is no longer offered by Modelon. Its closed-source successor code, OCT,
does retain CasADi interoperability however. Details of how to use OCT to generate CasADi
expressions is best described in OCT's user guide. The text in the following refers to the
legacy Modelica interoperability support.

Legacy symbolic import from XML files
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

An alternative to model directly in |casadi|, as above, is to use an advanced
physical modeling language such as Modelica to specify the model. For this,
Expand Down
6 changes: 3 additions & 3 deletions docs/users_guide/source/function.rst
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ The first input and output are used for accumulating, while the remainder inputs
The ``map``/``mapaccum`` operation exhibits a graph size and initialization time that scales logarithmically with :math:`n`.

Conditional evaluation
^^^^
^^^^^^^^^^^^^^^^^^^^^^

It is possible to include conditional evaluation of expressions in CasADi expression graphs by constucting ``conditional`` function instances. This function takes a number of existing ``Function`` instances, :math:`f_1`, :math:`f_2`, :math:`f_n` as well as a "default" function :math:`f_{def}`. All these functions must have the same input and output signatures, i.e. the same number of inputs and outputs with the same dimensions:

Expand All @@ -823,7 +823,7 @@ It is possible to include conditional evaluation of expressions in CasADi expres
f1 = Function("f1",[x],[cos(x)])
f2 = Function("f2",[x],[tan(x)])
f_cond = Function.conditional('f_cond', [f0, f1], f2)
print(cond_f)
print(f_cond)

.. exec-block:: octave

Expand All @@ -832,7 +832,7 @@ It is possible to include conditional evaluation of expressions in CasADi expres
f1 = Function('f1',{x},{cos(x)});
f2 = Function('f2',{x},{tan(x)});
f_cond = Function.conditional('f_cond', {f0, f1}, f2);
disp(F);
disp(f_cond);

The result is a new function instance with the same input/output signature, but with one additional input corresponding to an index. Its evaluation corresponds to:

Expand Down

0 comments on commit b1e3f3e

Please sign in to comment.