Exemple #1
0
def pr1c(file_prefix):
    drive_freq = 7.4246
    pfunc2 = pendulum.pendulum(0.1, 0.1, 0.25, ampl=1, freq=drive_freq)
    ts2, xs2 = rungekutta.rk4(
                            pfunc2, 
                            0.0, 
                            numpy.array([3.0, 0.1], dtype=numpy.float64), 
                            0.005, 
                            1000000
                        )
    xs2[0,:] = numpy.array(
                        [pendulum.mod2pi(x) for x in xs2[0,:]], 
                        dtype=numpy.float64
                    )
    points2 = xs2.transpose()
    ps3 = poincare.section(ts2, points2, interval=2*numpy.pi/drive_freq)
    plot.mod2pi(
            ps3[:,0],
            ps3[:,1],
            'k.',
            xlabel=r'$\theta$', 
            ylabel=r'$\omega$', 
            markersize=0.6,
            title='Poincare Section (Chaotic Trajectory)',
            file_prefix=_suffixed(file_prefix, '_1c')
        )
Exemple #2
0
def pr1d(file_prefix):
    drive_freq = 7.4246
    pfunc2 = pendulum.pendulum(0.1, 0.1, 0.25, ampl=1, freq=drive_freq)
    ts3, xs3 = rungekutta.rk4(
                            pfunc2,
                            0.0, 
                            numpy.array([3.0, 0.1], dtype=numpy.float64),
                            0.02,
                            250000
                        )
    xs3[0,:] = numpy.array(
                        [pendulum.mod2pi(x) for x in xs3[0,:]], 
                        dtype=numpy.float64
                    )
    points3 = xs3.transpose()
    ps4 = poincare.section(ts3, points3, interval=2*numpy.pi/drive_freq)
    plot.mod2pi(
            ps4[:,0],
            ps4[:,1],
            'k.',
            xlabel=r'$\theta$', 
            ylabel=r'$\omega$', 
            markersize=0.6,
            title='Poincare section, increased step size',
            file_prefix=_suffixed(file_prefix, '_1d')
        )
Exemple #3
0
def pr1b(file_prefix, ts, points):
    ps2 = poincare.section(ts, points, interval=0.51)
    plot.render(ps2[:, 0],
                ps2[:, 1],
                'k.',
                xbound=(-0.015, 0.015),
                ybound=(-0.15, 0.15),
                xlabel=r'$\theta$',
                ylabel=r'$\omega$',
                markersize=0.6,
                title='Poincare Section (Irrational Frequency)',
                file_prefix=_suffixed(file_prefix, '_1b'))
Exemple #4
0
def pr1b(file_prefix, ts, points):
    ps2 = poincare.section(ts, points, interval=0.51)
    plot.render(
            ps2[:,0],
            ps2[:,1],
            'k.',
            xbound=(-0.015, 0.015),
            ybound=(-0.15, 0.15),
            xlabel=r'$\theta$', 
            ylabel=r'$\omega$', 
            markersize=0.6,
            title='Poincare Section (Irrational Frequency)',
            file_prefix=_suffixed(file_prefix, '_1b')
        )
Exemple #5
0
def pr1d(file_prefix):
    drive_freq = 7.4246
    pfunc2 = pendulum.pendulum(0.1, 0.1, 0.25, ampl=1, freq=drive_freq)
    ts3, xs3 = rungekutta.rk4(pfunc2, 0.0,
                              numpy.array([3.0, 0.1], dtype=numpy.float64),
                              0.02, 250000)
    xs3[0, :] = numpy.array([pendulum.mod2pi(x) for x in xs3[0, :]],
                            dtype=numpy.float64)
    points3 = xs3.transpose()
    ps4 = poincare.section(ts3, points3, interval=2 * numpy.pi / drive_freq)
    plot.mod2pi(ps4[:, 0],
                ps4[:, 1],
                'k.',
                xlabel=r'$\theta$',
                ylabel=r'$\omega$',
                markersize=0.6,
                title='Poincare section, increased step size',
                file_prefix=_suffixed(file_prefix, '_1d'))
Exemple #6
0
def pr1c(file_prefix):
    drive_freq = 7.4246
    pfunc2 = pendulum.pendulum(0.1, 0.1, 0.25, ampl=1, freq=drive_freq)
    ts2, xs2 = rungekutta.rk4(pfunc2, 0.0,
                              numpy.array([3.0, 0.1], dtype=numpy.float64),
                              0.005, 1000000)
    xs2[0, :] = numpy.array([pendulum.mod2pi(x) for x in xs2[0, :]],
                            dtype=numpy.float64)
    points2 = xs2.transpose()
    ps3 = poincare.section(ts2, points2, interval=2 * numpy.pi / drive_freq)
    plot.mod2pi(ps3[:, 0],
                ps3[:, 1],
                'k.',
                xlabel=r'$\theta$',
                ylabel=r'$\omega$',
                markersize=0.6,
                title='Poincare Section (Chaotic Trajectory)',
                file_prefix=_suffixed(file_prefix, '_1c'))
Exemple #7
0
def pr1a(file_prefix):
    pfunc = pendulum.pendulum(0.1, 0.1, 0)
    ts, xs = rungekutta.rk4(pfunc, 0.0,
                            numpy.array([0.01, 0.0], dtype=numpy.float64),
                            0.005, 80000)
    points = xs.transpose()
    ps = poincare.section(ts, points, interval=0.6346975625940523)
    plot.render(ps[:, 0],
                ps[:, 1],
                'k.',
                xbound=(-0.015, 0.015),
                ybound=(-0.15, 0.15),
                xlabel=r'$\theta$',
                ylabel=r'$\omega$',
                markersize=0.6,
                title='Poincare Section (Natural Frequency)',
                file_prefix=_suffixed(file_prefix, '_1a'))
    return ts, points
Exemple #8
0
def pr1a(file_prefix):
    pfunc = pendulum.pendulum(0.1, 0.1, 0)
    ts, xs = rungekutta.rk4(
                            pfunc, 
                            0.0,
                            numpy.array([0.01, 0.0], dtype=numpy.float64),
                            0.005,
                            80000
                        )
    points = xs.transpose()
    ps = poincare.section(ts, points, interval=0.6346975625940523)
    plot.render(
            ps[:,0], 
            ps[:,1], 
            'k.',
            xbound=(-0.015, 0.015),
            ybound=(-0.15, 0.15),
            xlabel=r'$\theta$', 
            ylabel=r'$\omega$', 
            markersize=0.6,
            title='Poincare Section (Natural Frequency)',
            file_prefix=_suffixed(file_prefix, '_1a')
        )
    return ts, points
Exemple #9
0
 def poincare_section(self, **kwargs):
     t, theta, omega = self.__call__(**kwargs)
     return poincare.section(t, theta, omega,
                             2 * np.pi / self.params["Omega_D"])