1 /*
2  *    This file is part of CasADi.
3  *
4  *    CasADi -- A symbolic framework for dynamic optimization.
5  *    Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl,
6  *                            K.U. 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 "cvodes_interface.hpp"
27       #include <string>
28 
29       const std::string casadi::CvodesInterface::meta_doc=
30       "\n"
31 "Interface to CVodes from the Sundials suite.\n"
32 "\n"
33 "A call to evaluate will integrate to the end.\n"
34 "\n"
35 "You can retrieve the entire state trajectory as follows, after the\n"
36 "evaluate call: Call reset. Then call integrate(t_i) and getOuput for a\n"
37 "series of times t_i.\n"
38 "\n"
39 "Note: depending on the dimension and structure of your problem, you\n"
40 "may experience a dramatic speed-up by using a sparse linear solver:\n"
41 "\n"
42 "\n"
43 "\n"
44 "::\n"
45 "\n"
46 "     intg.setOption(\"linear_solver\",\"csparse\")\n"
47 "     intg.setOption(\"linear_solver_type\",\"user_defined\")\n"
48 "\n"
49 "\n"
50 "\n"
51 "\n"
52 ">List of available options\n"
53 "\n"
54 "+-----------------+-----------------+-----------------+-----------------+\n"
55 "|       Id        |      Type       |     Default     |   Description   |\n"
56 "+=================+=================+=================+=================+\n"
57 "| abstol          | OT_DOUBLE         | 0.000           | Absolute        |\n"
58 "|                 |                 |                 | tolerence for   |\n"
59 "|                 |                 |                 | the IVP         |\n"
60 "|                 |                 |                 | solution        |\n"
61 "+-----------------+-----------------+-----------------+-----------------+\n"
62 "| abstolB         | OT_DOUBLE         | GenericType()   | Absolute        |\n"
63 "|                 |                 |                 | tolerence for   |\n"
64 "|                 |                 |                 | the adjoint     |\n"
65 "|                 |                 |                 | sensitivity     |\n"
66 "|                 |                 |                 | solution        |\n"
67 "|                 |                 |                 | [default: equal |\n"
68 "|                 |                 |                 | to abstol]      |\n"
69 "+-----------------+-----------------+-----------------+-----------------+\n"
70 "| disable_interna | OT_BOOL      | false           | Disable CVodes  |\n"
71 "| l_warnings      |                 |                 | internal        |\n"
72 "|                 |                 |                 | warning         |\n"
73 "|                 |                 |                 | messages        |\n"
74 "+-----------------+-----------------+-----------------+-----------------+\n"
75 "| exact_jacobian  | OT_BOOL      | true            | Use exact       |\n"
76 "|                 |                 |                 | Jacobian        |\n"
77 "|                 |                 |                 | information for |\n"
78 "|                 |                 |                 | the forward     |\n"
79 "|                 |                 |                 | integration     |\n"
80 "+-----------------+-----------------+-----------------+-----------------+\n"
81 "| exact_jacobianB | OT_BOOL      | GenericType()   | Use exact       |\n"
82 "|                 |                 |                 | Jacobian        |\n"
83 "|                 |                 |                 | information for |\n"
84 "|                 |                 |                 | the backward    |\n"
85 "|                 |                 |                 | integration     |\n"
86 "|                 |                 |                 | [default: equal |\n"
87 "|                 |                 |                 | to              |\n"
88 "|                 |                 |                 | exact_jacobian] |\n"
89 "+-----------------+-----------------+-----------------+-----------------+\n"
90 "| finite_differen | OT_BOOL      | false           | Use finite      |\n"
91 "| ce_fsens        |                 |                 | differences to  |\n"
92 "|                 |                 |                 | approximate the |\n"
93 "|                 |                 |                 | forward         |\n"
94 "|                 |                 |                 | sensitivity     |\n"
95 "|                 |                 |                 | equations (if   |\n"
96 "|                 |                 |                 | AD is not       |\n"
97 "|                 |                 |                 | available)      |\n"
98 "+-----------------+-----------------+-----------------+-----------------+\n"
99 "| fsens_abstol    | OT_DOUBLE         | GenericType()   | Absolute        |\n"
100 "|                 |                 |                 | tolerence for   |\n"
101 "|                 |                 |                 | the forward     |\n"
102 "|                 |                 |                 | sensitivity     |\n"
103 "|                 |                 |                 | solution        |\n"
104 "|                 |                 |                 | [default: equal |\n"
105 "|                 |                 |                 | to abstol]      |\n"
106 "+-----------------+-----------------+-----------------+-----------------+\n"
107 "| fsens_all_at_on | OT_BOOL      | true            | Calculate all   |\n"
108 "| ce              |                 |                 | right hand      |\n"
109 "|                 |                 |                 | sides of the    |\n"
110 "|                 |                 |                 | sensitivity     |\n"
111 "|                 |                 |                 | equations at    |\n"
112 "|                 |                 |                 | once            |\n"
113 "+-----------------+-----------------+-----------------+-----------------+\n"
114 "| fsens_err_con   | OT_BOOL      | true            | include the     |\n"
115 "|                 |                 |                 | forward         |\n"
116 "|                 |                 |                 | sensitivities   |\n"
117 "|                 |                 |                 | in all error    |\n"
118 "|                 |                 |                 | controls        |\n"
119 "+-----------------+-----------------+-----------------+-----------------+\n"
120 "| fsens_reltol    | OT_DOUBLE         | GenericType()   | Relative        |\n"
121 "|                 |                 |                 | tolerence for   |\n"
122 "|                 |                 |                 | the forward     |\n"
123 "|                 |                 |                 | sensitivity     |\n"
124 "|                 |                 |                 | solution        |\n"
125 "|                 |                 |                 | [default: equal |\n"
126 "|                 |                 |                 | to reltol]      |\n"
127 "+-----------------+-----------------+-----------------+-----------------+\n"
128 "| fsens_scaling_f | OT_DOUBLEVECTOR   | GenericType()   | Scaling factor  |\n"
129 "| actors          |                 |                 | for the         |\n"
130 "|                 |                 |                 | components if   |\n"
131 "|                 |                 |                 | finite          |\n"
132 "|                 |                 |                 | differences is  |\n"
133 "|                 |                 |                 | used            |\n"
134 "+-----------------+-----------------+-----------------+-----------------+\n"
135 "| fsens_sensitivi | OT_INTVECTO | GenericType()   | Specifies which |\n"
136 "| y_parameters    | R               |                 | components will |\n"
137 "|                 |                 |                 | be used when    |\n"
138 "|                 |                 |                 | estimating the  |\n"
139 "|                 |                 |                 | sensitivity     |\n"
140 "|                 |                 |                 | equations       |\n"
141 "+-----------------+-----------------+-----------------+-----------------+\n"
142 "| interpolation_t | OT_STRING       | \"hermite\"       | Type of         |\n"
143 "| ype             |                 |                 | interpolation   |\n"
144 "|                 |                 |                 | for the adjoint |\n"
145 "|                 |                 |                 | sensitivities ( |\n"
146 "|                 |                 |                 | hermite|polynom |\n"
147 "|                 |                 |                 | ial)            |\n"
148 "+-----------------+-----------------+-----------------+-----------------+\n"
149 "| iterative_solve | OT_STRING       | \"gmres\"         | (gmres|bcgstab| |\n"
150 "| r               |                 |                 | tfqmr)          |\n"
151 "+-----------------+-----------------+-----------------+-----------------+\n"
152 "| iterative_solve | OT_STRING       | GenericType()   | (gmres|bcgstab| |\n"
153 "| rB              |                 |                 | tfqmr)          |\n"
154 "+-----------------+-----------------+-----------------+-----------------+\n"
155 "| linear_multiste | OT_STRING       | \"bdf\"           | Integrator      |\n"
156 "| p_method        |                 |                 | scheme          |\n"
157 "|                 |                 |                 | (bdf|adams)     |\n"
158 "+-----------------+-----------------+-----------------+-----------------+\n"
159 "| linear_solver   | OT_STRING       | GenericType()   | A custom linear |\n"
160 "|                 |                 |                 | solver creator  |\n"
161 "|                 |                 |                 | function        |\n"
162 "+-----------------+-----------------+-----------------+-----------------+\n"
163 "| linear_solverB  | OT_STRING       | GenericType()   | A custom linear |\n"
164 "|                 |                 |                 | solver creator  |\n"
165 "|                 |                 |                 | function for    |\n"
166 "|                 |                 |                 | backwards       |\n"
167 "|                 |                 |                 | integration     |\n"
168 "|                 |                 |                 | [default: equal |\n"
169 "|                 |                 |                 | to              |\n"
170 "|                 |                 |                 | linear_solver]  |\n"
171 "+-----------------+-----------------+-----------------+-----------------+\n"
172 "| linear_solver_o | OT_DICT   | GenericType()   | Options to be   |\n"
173 "| ptions          |                 |                 | passed to the   |\n"
174 "|                 |                 |                 | linear solver   |\n"
175 "+-----------------+-----------------+-----------------+-----------------+\n"
176 "| linear_solver_o | OT_DICT   | GenericType()   | Options to be   |\n"
177 "| ptionsB         |                 |                 | passed to the   |\n"
178 "|                 |                 |                 | linear solver   |\n"
179 "|                 |                 |                 | for backwards   |\n"
180 "|                 |                 |                 | integration     |\n"
181 "|                 |                 |                 | [default: equal |\n"
182 "|                 |                 |                 | to linear_solve |\n"
183 "|                 |                 |                 | r_options]      |\n"
184 "+-----------------+-----------------+-----------------+-----------------+\n"
185 "| linear_solver_t | OT_STRING       | \"dense\"         | (user_defined|d |\n"
186 "| ype             |                 |                 | ense|banded|ite |\n"
187 "|                 |                 |                 | rative)         |\n"
188 "+-----------------+-----------------+-----------------+-----------------+\n"
189 "| linear_solver_t | OT_STRING       | GenericType()   | (user_defined|d |\n"
190 "| ypeB            |                 |                 | ense|banded|ite |\n"
191 "|                 |                 |                 | rative)         |\n"
192 "+-----------------+-----------------+-----------------+-----------------+\n"
193 "| lower_bandwidth | OT_INT      | GenericType()   | Lower band-     |\n"
194 "|                 |                 |                 | width of banded |\n"
195 "|                 |                 |                 | Jacobian        |\n"
196 "|                 |                 |                 | (estimations)   |\n"
197 "+-----------------+-----------------+-----------------+-----------------+\n"
198 "| lower_bandwidth | OT_INT      | GenericType()   | lower band-     |\n"
199 "| B               |                 |                 | width of banded |\n"
200 "|                 |                 |                 | jacobians for   |\n"
201 "|                 |                 |                 | backward        |\n"
202 "|                 |                 |                 | integration     |\n"
203 "|                 |                 |                 | [default: equal |\n"
204 "|                 |                 |                 | to lower_bandwi |\n"
205 "|                 |                 |                 | dth]            |\n"
206 "+-----------------+-----------------+-----------------+-----------------+\n"
207 "| max_krylov      | OT_INT      | 10              | Maximum Krylov  |\n"
208 "|                 |                 |                 | subspace size   |\n"
209 "+-----------------+-----------------+-----------------+-----------------+\n"
210 "| max_krylovB     | OT_INT      | GenericType()   | Maximum krylov  |\n"
211 "|                 |                 |                 | subspace size   |\n"
212 "+-----------------+-----------------+-----------------+-----------------+\n"
213 "| max_multistep_o | OT_INT      | 5               |                 |\n"
214 "| rder            |                 |                 |                 |\n"
215 "+-----------------+-----------------+-----------------+-----------------+\n"
216 "| max_num_steps   | OT_INT      | 10000           | Maximum number  |\n"
217 "|                 |                 |                 | of integrator   |\n"
218 "|                 |                 |                 | steps           |\n"
219 "+-----------------+-----------------+-----------------+-----------------+\n"
220 "| nonlinear_solve | OT_STRING       | \"newton\"        | (newton|functio |\n"
221 "| r_iteration     |                 |                 | nal)            |\n"
222 "+-----------------+-----------------+-----------------+-----------------+\n"
223 "| pretype         | OT_STRING       | \"none\"          | (none|left|righ |\n"
224 "|                 |                 |                 | t|both)         |\n"
225 "+-----------------+-----------------+-----------------+-----------------+\n"
226 "| pretypeB        | OT_STRING       | GenericType()   | (none|left|righ |\n"
227 "|                 |                 |                 | t|both)         |\n"
228 "+-----------------+-----------------+-----------------+-----------------+\n"
229 "| quad_err_con    | OT_BOOL      | false           | Should the      |\n"
230 "|                 |                 |                 | quadratures     |\n"
231 "|                 |                 |                 | affect the step |\n"
232 "|                 |                 |                 | size control    |\n"
233 "+-----------------+-----------------+-----------------+-----------------+\n"
234 "| reltol          | OT_DOUBLE         | 0.000           | Relative        |\n"
235 "|                 |                 |                 | tolerence for   |\n"
236 "|                 |                 |                 | the IVP         |\n"
237 "|                 |                 |                 | solution        |\n"
238 "+-----------------+-----------------+-----------------+-----------------+\n"
239 "| reltolB         | OT_DOUBLE         | GenericType()   | Relative        |\n"
240 "|                 |                 |                 | tolerence for   |\n"
241 "|                 |                 |                 | the adjoint     |\n"
242 "|                 |                 |                 | sensitivity     |\n"
243 "|                 |                 |                 | solution        |\n"
244 "|                 |                 |                 | [default: equal |\n"
245 "|                 |                 |                 | to reltol]      |\n"
246 "+-----------------+-----------------+-----------------+-----------------+\n"
247 "| sensitivity_met | OT_STRING       | \"simultaneous\"  | (simultaneous|s |\n"
248 "| hod             |                 |                 | taggered)       |\n"
249 "+-----------------+-----------------+-----------------+-----------------+\n"
250 "| steps_per_check | OT_INT      | 20              | Number of steps |\n"
251 "| point           |                 |                 | between two     |\n"
252 "|                 |                 |                 | consecutive     |\n"
253 "|                 |                 |                 | checkpoints     |\n"
254 "+-----------------+-----------------+-----------------+-----------------+\n"
255 "| stop_at_end     | OT_BOOL      | true            | Stop the        |\n"
256 "|                 |                 |                 | integrator at   |\n"
257 "|                 |                 |                 | the end of the  |\n"
258 "|                 |                 |                 | interval        |\n"
259 "+-----------------+-----------------+-----------------+-----------------+\n"
260 "| upper_bandwidth | OT_INT      | GenericType()   | Upper band-     |\n"
261 "|                 |                 |                 | width of banded |\n"
262 "|                 |                 |                 | Jacobian        |\n"
263 "|                 |                 |                 | (estimations)   |\n"
264 "+-----------------+-----------------+-----------------+-----------------+\n"
265 "| upper_bandwidth | OT_INT      | GenericType()   | Upper band-     |\n"
266 "| B               |                 |                 | width of banded |\n"
267 "|                 |                 |                 | jacobians for   |\n"
268 "|                 |                 |                 | backward        |\n"
269 "|                 |                 |                 | integration     |\n"
270 "|                 |                 |                 | [default: equal |\n"
271 "|                 |                 |                 | to upper_bandwi |\n"
272 "|                 |                 |                 | dth]            |\n"
273 "+-----------------+-----------------+-----------------+-----------------+\n"
274 "| use_preconditio | OT_BOOL      | false           | Precondition an |\n"
275 "| ner             |                 |                 | iterative       |\n"
276 "|                 |                 |                 | solver          |\n"
277 "+-----------------+-----------------+-----------------+-----------------+\n"
278 "| use_preconditio | OT_BOOL      | GenericType()   | Precondition an |\n"
279 "| nerB            |                 |                 | iterative       |\n"
280 "|                 |                 |                 | solver for the  |\n"
281 "|                 |                 |                 | backwards       |\n"
282 "|                 |                 |                 | problem         |\n"
283 "|                 |                 |                 | [default: equal |\n"
284 "|                 |                 |                 | to use_precondi |\n"
285 "|                 |                 |                 | tioner]         |\n"
286 "+-----------------+-----------------+-----------------+-----------------+\n"
287 "\n"
288 "\n"
289 ">List of available monitors\n"
290 "\n"
291 "+---------+\n"
292 "|   Id    |\n"
293 "+=========+\n"
294 "| djacB   |\n"
295 "+---------+\n"
296 "| psetupB |\n"
297 "+---------+\n"
298 "| res     |\n"
299 "+---------+\n"
300 "| resB    |\n"
301 "+---------+\n"
302 "| resQB   |\n"
303 "+---------+\n"
304 "| reset   |\n"
305 "+---------+\n"
306 "\n"
307 "\n"
308 ">List of available stats\n"
309 "\n"
310 "+-------------+\n"
311 "|     Id      |\n"
312 "+=============+\n"
313 "| nlinsetups  |\n"
314 "+-------------+\n"
315 "| nlinsetupsB |\n"
316 "+-------------+\n"
317 "| nsteps      |\n"
318 "+-------------+\n"
319 "| nstepsB     |\n"
320 "+-------------+\n"
321 "\n"
322 "\n"
323 "\n"
324 "\n"
325 ;
326