DEtools - Maple Programming Help

Home : Support : Online Help : Mathematics : Differential Equations : DEtools : Poincare : DEtools/generate_ic

DEtools

 generate_ic
 generate a set of lists of initial conditions satisfying a given Hamiltonian constraint

 Calling Sequence generate_ic(H, ic, N)

Parameters

 H - any algebraic expression representing the Hamiltonian ic - set of single initial conditions for the time t, p's, q's, and the energy N - positive integer representing the number of desired lists of initial conditions

Description

 • The numerical study of a given Hamiltonian system usually requires a lot of suitable lists of initial conditions (ICs) satisfying the Hamiltonian constraint. The generate_ic command is a tool for the fast generation of a set of such lists, with the appropriate syntax as required by the poincare command.
 • The first argument received by generate_ic is the Hamiltonian.
 • The second argument is a single specification of ICs in the form t=X1, p1=X2, .., qn=Xk, energy=X2n+2, where the Xi are numbers or ranges of numbers, representing initial values for the time, p's, q's, and the energy. The ICs must be given for all but one of the following: t,p's,q's,H_0. If ICs are specified for all these variables, the command checks the values against H for consistency. The IC for a given variable may be a fixed number or a numerical range.
 • The third argument is the number of requested lists of ICs. Faced with the request of, for example, N ICs giving ranges or fixed numbers for all variables but one, say x, the routine proceeds as follows. The received ICs are separated into numerical ranges and fixed numbers. Each range is then uniformly divided into N numbers, and the command builds N lists by taking one number from each divided range, together with the received fixed numbers for the other variables. These lists are sequentially introduced in H, resulting in N algebraic equations for x. Each equation is then numerically solved, and a set of N lists of complete ICs satisfying the Hamiltonian constraint, with values inside the given ranges, is returned. Remarkably, though generate_ic is a very simple command, it plays a fundamental role in speeding up the numerical studies.
 • This function is part of the DEtools package, and so it can be used in the form generate_ic(..) only after executing the command with(DEtools). However, it can always be accessed through the long form of the command by using DEtools[generate_ic](..).

Examples

 > $\mathrm{with}\left(\mathrm{DEtools}\right):$

The Henon-Heiles Hamiltonian

 > $H≔\frac{1}{2}\left({\mathrm{p1}}^{2}+{\mathrm{p2}}^{2}+{\mathrm{q1}}^{2}+{\mathrm{q2}}^{2}\right)+{\mathrm{q1}}^{2}\mathrm{q2}-\frac{{\mathrm{q2}}^{3}}{3}$
 ${H}{≔}\frac{{1}}{{2}}{}{{\mathrm{p1}}}^{{2}}{+}\frac{{1}}{{2}}{}{{\mathrm{p2}}}^{{2}}{+}\frac{{1}}{{2}}{}{{\mathrm{q1}}}^{{2}}{+}\frac{{1}}{{2}}{}{{\mathrm{q2}}}^{{2}}{+}{{\mathrm{q1}}}^{{2}}{}{\mathrm{q2}}{-}\frac{{1}}{{3}}{}{{\mathrm{q2}}}^{{3}}$ (1)

The initial conditions for numerical experiments that display the progressive disintegration of KAM surfaces are generated by the following for loop.  Here, we obtain six sets, related to each value of H_0 respectively, with three different initial conditions each.

 > $\mathbf{for}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}h\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{in}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left[\frac{1}{24},\frac{1}{18},\frac{1}{12},\frac{1}{8},\frac{1}{7},\frac{1}{6}\right]\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{ics}\left[h\right]≔\mathrm{generate_ic}\left(H,\left\{\mathrm{energy}=h,\mathrm{p2}=0.1,\mathrm{q1}=-0.2..-0.1,\mathrm{q2}=-0.2..0.2,t=0\right\},3\right)\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}$
 $\left\{\left[{0.}{,}{0.5039841267}{,}{0.1}{,}{-0.2}{,}{-0.2}\right]{,}\left[{0.}{,}{0.5240865070}{,}{0.1}{,}{-0.1000000000}{,}{0.2000000000}\right]{,}\left[{0.}{,}{0.5484827558}{,}{0.1}{,}{-0.1500000000}{,}{0.}\right]\right\}$ (2)

A Hamiltonian in the context of general relativity

 > $H≔\frac{1}{2}\left(-{\mathrm{p1}}^{2}-{\mathrm{q1}}^{2}+2\cdot 0.125{\mathrm{q1}}^{4}+{\mathrm{p2}}^{2}+{\mathrm{q2}}^{2}+{0.65}^{2}{\mathrm{q1}}^{2}{\mathrm{q2}}^{2}\right)$
 ${H}{≔}{-}\frac{{1}}{{2}}{}{{\mathrm{p1}}}^{{2}}{-}\frac{{1}}{{2}}{}{{\mathrm{q1}}}^{{2}}{+}{0.1250000000}{}{{\mathrm{q1}}}^{{4}}{+}\frac{{1}}{{2}}{}{{\mathrm{p2}}}^{{2}}{+}\frac{{1}}{{2}}{}{{\mathrm{q2}}}^{{2}}{+}{0.2112500000}{}{{\mathrm{q1}}}^{{2}}{}{{\mathrm{q2}}}^{{2}}$ (3)

Generate a set of one hundred lists of initial conditions, with t=0, q1=0, q2=0, p1 between -.2 and -.812, and p2 taking values to satisfy H=0.

 > $\mathrm{ics}≔\mathrm{generate_ic}\left(H,\left\{\mathrm{energy}=0,\mathrm{p1}=-0.2..-0.812,\mathrm{q1}=0,\mathrm{q2}=0,t=0\right\},100\right)$

Distribute the 100 lists of initial conditions in a nonhomogeneous manner.

 > $\mathrm{ic1}≔\mathrm{generate_ic}\left(H,\left\{\mathrm{energy}=0,\mathrm{p1}=-0.2..-0.7,\mathrm{q1}=0,\mathrm{q2}=0,t=0\right\},15\right)$
 > $\mathrm{ic2}≔\mathrm{generate_ic}\left(H,\left\{\mathrm{energy}=0,\mathrm{p1}=-0.7..-0.812,\mathrm{q1}=0,\mathrm{q2}=0,t=0\right\},85\right)$

Finally, create just one set with the desired ICs.

 > $\mathrm{ics}≔\mathrm{ic1}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{union}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{ic2}$