erk_meta.cpp
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  #include "erk.hpp"
27  #include <string>
28 
29  const std::string casadi::Erk::meta_doc=
30  "\n"
31 "\n"
32 "\n"
33 "Explicit Runge-Kutta integrator for ODEs: a pair of order 5(4) with \n"
34 "adaptive or fixed steps, or the classical method of order 4 with fixed\n"
35 " steps.\n"
36 "\n"
37 "Steps are independent of the output times. Adaptive steps are chosen \n"
38 "by error control on the nominal states; with fixed steps, each run of \n"
39 "steps over a control group (or up to the end) is divided into equal \n"
40 "steps of at most step_size. Outputs inside a step come from a dense \n"
41 "output (order 4 and 3 respectively) at no extra cost. Forward \n"
42 "sensitivities are the exact derivatives of the discrete solution and \n"
43 "adjoint sensitivities are the exact discrete adjoint of the taped \n"
44 "steps. With fixed steps the tape has a known bound, so adjoints can be\n"
45 " code-generated; with adaptive steps, set max_tape_steps.\n"
46 "\n"
47 "Zero-crossing events (DAE output zero, option transition) are located \n"
48 "on the dense output of the step in which a function becomes negative; \n"
49 "integration restarts from the state after the transition. \n"
50 "Sensitivities, forward, adjoint and forward-over-adjoint, include \n"
51 "those of the event times.\n"
52 "\n"
53 "Extra doc: https://github.com/casadi/casadi/wiki/L_2kb \n"
54 "\n"
55 "\n"
56 ">List of available options\n"
57 "\n"
58 "+--------------------+--------------+--------------------------------------+\n"
59 "| Id | Type | Description |\n"
60 "+====================+==============+======================================+\n"
61 "| abstol | OT_DOUBLE | Absolute tolerance [1e-8] |\n"
62 "+--------------------+--------------+--------------------------------------+\n"
63 "| control_group_size | OT_INTVECTOR | Number of output intervals in each |\n"
64 "| | | control group, over which the |\n"
65 "| | | controls, one column each, are |\n"
66 "| | | constant: a run of steps [default: 1 |\n"
67 "| | | for each output interval] |\n"
68 "+--------------------+--------------+--------------------------------------+\n"
69 "| max_num_steps | OT_INT | Adaptive steps: maximum number of |\n"
70 "| | | steps per output interval [10000] |\n"
71 "+--------------------+--------------+--------------------------------------+\n"
72 "| max_step_size | OT_DOUBLE | Adaptive steps: maximum step size |\n"
73 "| | | [default: unbounded] |\n"
74 "+--------------------+--------------+--------------------------------------+\n"
75 "| max_tape_steps | OT_INT | Adaptive steps: capacity, in steps, |\n"
76 "| | | of a tape in the work vector, for |\n"
77 "| | | adjoint sensitivities; needed for |\n"
78 "| | | code generation [0: tape of |\n"
79 "| | | unbounded size]. With fixed steps, |\n"
80 "| | | the tape is sized exactly. |\n"
81 "+--------------------+--------------+--------------------------------------+\n"
82 "| method | OT_STRING | Runge-Kutta method: 'rk45' (pair of |\n"
83 "| | | order 5(4), adaptive unless |\n"
84 "| | | step_size is set) or 'rk4' |\n"
85 "| | | (classical, order 4, fixed steps |\n"
86 "| | | only; default step_size (tf - |\n"
87 "| | | t0)/20) [rk45] |\n"
88 "+--------------------+--------------+--------------------------------------+\n"
89 "| min_step_size | OT_DOUBLE | Adaptive steps: minimum step size |\n"
90 "| | | [1e-14] |\n"
91 "+--------------------+--------------+--------------------------------------+\n"
92 "| quad_err_con | OT_BOOL | Adaptive steps: include the |\n"
93 "| | | quadratures in the error control |\n"
94 "| | | [true] |\n"
95 "+--------------------+--------------+--------------------------------------+\n"
96 "| reltol | OT_DOUBLE | Relative tolerance [1e-6] |\n"
97 "+--------------------+--------------+--------------------------------------+\n"
98 "| step0 | OT_DOUBLE | Adaptive steps: initial step size |\n"
99 "| | | [default: estimated] |\n"
100 "+--------------------+--------------+--------------------------------------+\n"
101 "| step_size | OT_DOUBLE | Fixed steps: each run of steps, over |\n"
102 "| | | a control group or up to the end |\n"
103 "| | | without controls, is divided into |\n"
104 "| | | equal steps of at most step_size [0: |\n"
105 "| | | adaptive steps] |\n"
106 "+--------------------+--------------+--------------------------------------+\n"
107 "\n"
108 "\n"
109 "\n"
110 "\n"
111 ;
static const std::string meta_doc
A documentation string.
Definition: erk.hpp:109