Exemplo n.º 1
0
def pr2a(file_prefix=None):
    lfunc = lorenz.lorenz(16, 45, 4)
    ts, xxs = rungekutta.rk4(lfunc, 0.0, numpy.array([-13.0, -12.0, 52.0], dtype=numpy.float64), 0.0001, 300000)
    xs = xxs.transpose()[:, 0]
    data = numpy.array(zip(xs, ts), dtype=numpy.float64)
    ms = tispy.mutual("-D", 16000, input=data)
    tau = first_min(ms)
    ws = tispy.delay("-d", int(tau), "-m", 7, input=data)
    x0 = numpy.array([-35, -35], dtype=numpy.float64)
    zs = numpy.array(zip(ws[100000:, 0], ws[100000:, 5]), dtype=numpy.float64)
    d_cap = find_loglog_slope(zs, x0, file_prefix=suffixed(file_prefix, "_2a"))
    print "Lorenz\tembed\td_cap = {0:.6f}".format(d_cap)
Exemplo n.º 2
0
def pr2a(file_prefix=None):
    lfunc = lorenz.lorenz(16, 45, 4)
    ts, xxs = rungekutta.rk4(
        lfunc, 0.0, numpy.array([-13.0, -12.0, 52.0], dtype=numpy.float64),
        0.0001, 300000)
    xs = xxs.transpose()[:, 0]
    data = numpy.array(zip(xs, ts), dtype=numpy.float64)
    ms = tispy.mutual('-D', 16000, input=data)
    tau = first_min(ms)
    ws = tispy.delay('-d', int(tau), '-m', 7, input=data)
    x0 = numpy.array([-35, -35], dtype=numpy.float64)
    zs = numpy.array(zip(ws[100000:, 0], ws[100000:, 5]), dtype=numpy.float64)
    d_cap = find_loglog_slope(zs, x0, file_prefix=suffixed(file_prefix, '_2a'))
    print 'Lorenz\tembed\td_cap = {0:.6f}'.format(d_cap)
Exemplo n.º 3
0
def extrema():
    lfunc = lorenz.lorenz(16, 45, 4)
    ts, xxs = rungekutta.rk4(lfunc, 0.0, numpy.array([-13.0, -12.0, 52.0], dtype=numpy.float64), 0.0001, 300000)
    xs = xxs.transpose()[:, 0]
    data = numpy.array(zip(xs, ts), dtype=numpy.float64)
    ms = tispy.mutual("-D", 16000, input=data)
    tau = first_min(ms)
    print "Tau: {0:.6f}".format(tau)
    ws = tispy.delay("-d", int(tau), "-m", 7, input=data)
    zs = ws[100000:, :]
    mins = numpy.empty(7, dtype=numpy.float64)
    maxs = numpy.empty(7, dtype=numpy.float64)
    for i in xrange(7):
        mins[i] = min(zs[:, i])
        maxs[i] = max(zs[:, i])
    print "Mins: {0}".format(mins)
    print "Maxs: {0}".format(maxs)
Exemplo n.º 4
0
def pr4(file_prefix=None):
    data = numpy.loadtxt("data/ps8/data2.first250sec", dtype=numpy.float64)
    vs = tispy.delay("-d", "155", "-m", "8", input=data)
    plot.embedded(
        vs,
        0,
        2,
        "k.",
        markersize=0.6,
        ybound=(0, 2 * numpy.pi),
        yticks=(0, numpy.pi / 2, numpy.pi, 3 * numpy.pi / 2, 2 * numpy.pi),
        yticklabels=("0", r"$\frac{\pi}{2}$", r"$\pi$", r"$\frac{3\pi}{2}$", r"$2\pi$"),
        title=r"Delay Coordinate Embedding: {0}, $\tau={1}$ s".format("data2", _get_actual_delay("data2", 1, 155)),
        xlabel=r"$\theta(t + {0})$".format(_get_actual_delay("data2", 0, 155)),
        ylabel=r"$\theta(t + {0})$".format(_get_actual_delay("data2", 2, 155)),
        aspect="equal",
        file_prefix=suffixed(file_prefix, "_3"),
    )
Exemplo n.º 5
0
def extrema():
    lfunc = lorenz.lorenz(16, 45, 4)
    ts, xxs = rungekutta.rk4(
        lfunc, 0.0, numpy.array([-13.0, -12.0, 52.0], dtype=numpy.float64),
        0.0001, 300000)
    xs = xxs.transpose()[:, 0]
    data = numpy.array(zip(xs, ts), dtype=numpy.float64)
    ms = tispy.mutual('-D', 16000, input=data)
    tau = first_min(ms)
    print 'Tau: {0:.6f}'.format(tau)
    ws = tispy.delay('-d', int(tau), '-m', 7, input=data)
    zs = ws[100000:, :]
    mins = numpy.empty(7, dtype=numpy.float64)
    maxs = numpy.empty(7, dtype=numpy.float64)
    for i in xrange(7):
        mins[i] = min(zs[:, i])
        maxs[i] = max(zs[:, i])
    print 'Mins: {0}'.format(mins)
    print 'Maxs: {0}'.format(maxs)
Exemplo n.º 6
0
Arquivo: ps9.py Projeto: owingit/chaos
def pr4(file_prefix=None):
    data = numpy.loadtxt('data/ps8/data2.first250sec', dtype=numpy.float64)
    vs = tispy.delay('-d', '155', '-m', '8', input=data)
    plot.embedded(
        vs,
        0,
        2,
        'k.',
        markersize=0.6,
        ybound=(0, 2 * numpy.pi),
        yticks=(0, numpy.pi / 2, numpy.pi, 3 * numpy.pi / 2, 2 * numpy.pi),
        yticklabels=('0', r'$\frac{\pi}{2}$', r'$\pi$', r'$\frac{3\pi}{2}$',
                     r'$2\pi$'),
        title=r'Delay Coordinate Embedding: {0}, $\tau={1}$ s'.format(
            'data2', _get_actual_delay('data2', 1, 155)),
        xlabel=r'$\theta(t + {0})$'.format(_get_actual_delay('data2', 0, 155)),
        ylabel=r'$\theta(t + {0})$'.format(_get_actual_delay('data2', 2, 155)),
        aspect='equal',
        file_prefix=suffixed(file_prefix, '_3'))
Exemplo n.º 7
0
def pr6(file_prefix=None):
    lfunc = lorenz.lorenz(16, 45, 4)
    ts, vs = rungekutta.rk4(lfunc, 0.0, numpy.array([-13.0, -12.0, 52.0], dtype=numpy.float64), 0.001, 30000)
    xs = vs.transpose()[:, 0]
    data = numpy.array(zip(xs, ts), dtype=numpy.float64)
    ms = tispy.mutual("-D", 1600, input=data)
    tau = first_min(ms)
    ws = tispy.delay("-d", int(tau), "-m", 7, input=data)
    col1 = 0
    col2 = 5
    plot.render(
        ws[:, col1],
        ws[:, col2],
        "k.",
        markersize=0.6,
        title=r"Delay Coordinate Embedding: {0}, $\tau={1}$ s".format(r"lorenz", 0.001 * tau),
        xlabel=r"$x(t+{0:.3f})$".format(col1 * 0.001 * tau),
        ylabel=r"$x(t+{0:.3f})$".format(col2 * 0.001 * tau),
        file_prefix=suffixed(file_prefix, "_6"),
    )
    return tau
Exemplo n.º 8
0
Arquivo: ps9.py Projeto: owingit/chaos
def pr6(file_prefix=None):
    lfunc = lorenz.lorenz(16, 45, 4)
    ts, vs = rungekutta.rk4(
        lfunc, 0.0, numpy.array([-13.0, -12.0, 52.0], dtype=numpy.float64),
        0.001, 30000)
    xs = vs.transpose()[:, 0]
    data = numpy.array(zip(xs, ts), dtype=numpy.float64)
    ms = tispy.mutual('-D', 1600, input=data)
    tau = first_min(ms)
    ws = tispy.delay('-d', int(tau), '-m', 7, input=data)
    col1 = 0
    col2 = 5
    plot.render(ws[:, col1],
                ws[:, col2],
                'k.',
                markersize=0.6,
                title=r'Delay Coordinate Embedding: {0}, $\tau={1}$ s'.format(
                    r'lorenz', 0.001 * tau),
                xlabel=r'$x(t+{0:.3f})$'.format(col1 * 0.001 * tau),
                ylabel=r'$x(t+{0:.3f})$'.format(col2 * 0.001 * tau),
                file_prefix=suffixed(file_prefix, '_6'))
    return tau