symplectic_system.qbk 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. [/============================================================================
  2. Boost.odeint
  3. Copyright 2011 Mario Mulansky
  4. Copyright 2011-2012 Karsten Ahnert
  5. Use, modification and distribution is subject to the Boost Software License,
  6. Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  7. http://www.boost.org/LICENSE_1_0.txt)
  8. =============================================================================/]
  9. [section Symplectic System]
  10. [heading Description]
  11. This concept describes how to define a symplectic system written with generalized coordinate `q` and generalized momentum `p`:
  12. [' q'(t) = f(p) ]
  13. [' p'(t) = g(q) ]
  14. Such a situation is typically found for Hamiltonian systems with a separable Hamiltonian:
  15. [' H(p,q) = H[sub kin](p) + V(q) ]
  16. which gives the equations of motion:
  17. [' q'(t) = dH[sub kin] / dp = f(p) ]
  18. [' p'(t) = dV / dq = g(q) ]
  19. The algorithmic implementation of this situation is described by a pair of callable objects for /f/ and /g/ with a specific parameter signature.
  20. Such a system should be implemented as a std::pair of functions or a functors.
  21. Symplectic systems are used in symplectic steppers like `symplectic_rkn_sb3a_mclachlan`.
  22. [heading Notation]
  23. [variablelist
  24. [[`System`] [A type that is a model of SymplecticSystem]]
  25. [[`Coor`] [The type of the coordinate ['q]]]
  26. [[`Momentum`] [The type of the momentum ['p]]]
  27. [[`CoorDeriv`] [The type of the derivative of coordinate ['q']]]
  28. [[`MomentumDeriv`] [The type of the derivative of momentum ['p']]]
  29. [[`sys`] [An object of the type `System`]]
  30. [[`q`] [Object of type Coor]]
  31. [[`p`] [Object of type Momentum]]
  32. [[`dqdt`] [Object of type CoorDeriv]]
  33. [[`dpdt`] [Object of type MomentumDeriv]]
  34. ]
  35. [heading Valid expressions]
  36. [table
  37. [[Name] [Expression] [Type] [Semantics]]
  38. [[Check for pair] [`boost::is_pair< System >::type`] [`boost::mpl::true_`] [Check if System is a pair]]
  39. [[Calculate ['dq/dt = f(p)]] [`sys.first( p , dqdt )`] [`void`] [Calculates ['f(p)], the result is stored into `dqdt`] ]
  40. [[Calculate ['dp/dt = g(q)]] [`sys.second( q , dpdt )`] [`void`] [Calculates ['g(q)], the result is stored into `dpdt`] ]
  41. ]
  42. [endsect]
  43. [section Simple Symplectic System]
  44. [heading Description]
  45. 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:
  46. [' q'(t) = f(p) = p. ]
  47. while for /p'/ we still have the general form
  48. [' p'(t) = g(q) ]
  49. 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.
  50. We call this concept ['SimpleSymplecticSystem]
  51. [heading Notation]
  52. [variablelist
  53. [[System] [A type that is a model of SimpleSymplecticSystem]]
  54. [[Coor] [The type of the coordinate ['q]]]
  55. [[MomentumDeriv] [The type of the derivative of momentum ['p']]]
  56. [[sys] [An object that models System]]
  57. [[q] [Object of type Coor]]
  58. [[dpdt] [Object of type MomentumDeriv]]
  59. ]
  60. [heading Valid Expressions]
  61. [table
  62. [[Name] [Expression] [Type] [Semantics]]
  63. [[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.]]
  64. [[Calculate ['dp/dt = g(q)]] [`sys( q , dpdt )`] [`void`] [Calculates ['g(q)], the result is stored into `dpdt`] ]
  65. ]
  66. [endsect]