]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | [/============================================================================ |
2 | Boost.odeint | |
3 | ||
4 | Copyright 2011 Mario Mulansky | |
5 | Copyright 2011-2012 Karsten Ahnert | |
6 | ||
7 | Use, modification and distribution is subject to the Boost Software License, | |
8 | Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at | |
9 | http://www.boost.org/LICENSE_1_0.txt) | |
10 | =============================================================================/] | |
11 | ||
12 | ||
13 | [section Symplectic System] | |
14 | ||
15 | [heading Description] | |
16 | ||
17 | This concept describes how to define a symplectic system written with generalized coordinate `q` and generalized momentum `p`: | |
18 | ||
19 | [' q'(t) = f(p) ] | |
20 | ||
21 | [' p'(t) = g(q) ] | |
22 | ||
23 | Such a situation is typically found for Hamiltonian systems with a separable Hamiltonian: | |
24 | ||
25 | [' H(p,q) = H[sub kin](p) + V(q) ] | |
26 | ||
27 | which gives the equations of motion: | |
28 | ||
29 | [' q'(t) = dH[sub kin] / dp = f(p) ] | |
30 | ||
31 | [' p'(t) = dV / dq = g(q) ] | |
32 | ||
33 | ||
34 | The algorithmic implementation of this situation is described by a pair of callable objects for /f/ and /g/ with a specific parameter signature. | |
35 | Such a system should be implemented as a std::pair of functions or a functors. | |
36 | Symplectic systems are used in symplectic steppers like `symplectic_rkn_sb3a_mclachlan`. | |
37 | ||
38 | [heading Notation] | |
39 | ||
40 | [variablelist | |
41 | [[`System`] [A type that is a model of SymplecticSystem]] | |
42 | [[`Coor`] [The type of the coordinate ['q]]] | |
43 | [[`Momentum`] [The type of the momentum ['p]]] | |
44 | [[`CoorDeriv`] [The type of the derivative of coordinate ['q']]] | |
45 | [[`MomentumDeriv`] [The type of the derivative of momentum ['p']]] | |
46 | [[`sys`] [An object of the type `System`]] | |
47 | [[`q`] [Object of type Coor]] | |
48 | [[`p`] [Object of type Momentum]] | |
49 | [[`dqdt`] [Object of type CoorDeriv]] | |
50 | [[`dpdt`] [Object of type MomentumDeriv]] | |
51 | ] | |
52 | ||
53 | [heading Valid expressions] | |
54 | ||
55 | [table | |
56 | [[Name] [Expression] [Type] [Semantics]] | |
57 | [[Check for pair] [`boost::is_pair< System >::type`] [`boost::mpl::true_`] [Check if System is a pair]] | |
58 | [[Calculate ['dq/dt = f(p)]] [`sys.first( p , dqdt )`] [`void`] [Calculates ['f(p)], the result is stored into `dqdt`] ] | |
59 | [[Calculate ['dp/dt = g(q)]] [`sys.second( q , dpdt )`] [`void`] [Calculates ['g(q)], the result is stored into `dpdt`] ] | |
60 | ] | |
61 | ||
62 | [endsect] | |
63 | ||
64 | ||
65 | [section Simple Symplectic System] | |
66 | ||
67 | [heading Description] | |
68 | ||
69 | In most Hamiltonian systems the kinetic term is a quadratic term in the momentum ['H[sub kin] = p^2 / 2m] and in many cases it is possible to rescale coordinates and set /m=1/ which leads to a trivial equation of motion: | |
70 | ||
71 | [' q'(t) = f(p) = p. ] | |
72 | ||
73 | while for /p'/ we still have the general form | |
74 | ||
75 | [' p'(t) = g(q) ] | |
76 | ||
77 | As this case is very frequent we introduced a concept where only the nontrivial equation for /p'/ has to be provided to the symplectic stepper. | |
78 | We call this concept ['SimpleSymplecticSystem] | |
79 | ||
80 | [heading Notation] | |
81 | ||
82 | [variablelist | |
83 | [[System] [A type that is a model of SimpleSymplecticSystem]] | |
84 | [[Coor] [The type of the coordinate ['q]]] | |
85 | [[MomentumDeriv] [The type of the derivative of momentum ['p']]] | |
86 | [[sys] [An object that models System]] | |
87 | [[q] [Object of type Coor]] | |
88 | [[dpdt] [Object of type MomentumDeriv]] | |
89 | ] | |
90 | ||
91 | [heading Valid Expressions] | |
92 | ||
93 | [table | |
94 | [[Name] [Expression] [Type] [Semantics]] | |
95 | [[Check for pair] [`boost::is_pair< System >::type`] [`boost::mpl::false_`] [Check if System is a pair, should be evaluated to false in this case.]] | |
96 | [[Calculate ['dp/dt = g(q)]] [`sys( q , dpdt )`] [`void`] [Calculates ['g(q)], the result is stored into `dpdt`] ] | |
97 | ] | |
98 | ||
99 | [endsect] |