Esempio n. 1
0
def __main__():
    from chaos_class import Chaos
    import matplotlib.pyplot as plt    
    
    ch = Chaos(0.1, 4.0) # x0 = 0.1 and r = 0.4
    ts_length = 250    
    
    fig, ax = plt.subplots()
    ax.set_xlabel(r'$t$', fontsize=14)
    ax.set_ylabel(r'$x_t$', fontsize=14)
    x = ch.generate_sequence(ts_length)
    ax.plot(range(ts_length), x, 'bo-', alpha=0.5, lw=2, label=r'$x_t$')
    plt.show()
    return None
Esempio n. 2
0
"""
Filename: bifurcation_diagram.py
Reference: http://quant-econ.net/py/python_oop.html
"""
from chaos_class import Chaos
import matplotlib.pyplot as plt

fig, ax = plt.subplots()
ch = Chaos(0.1, 4)
r = 2.5
while r < 4:
    ch.r = r
    t = ch.generate_sequence(1000)[950:]
    ax.plot([r] * len(t), t, 'b.', ms=0.6)
    r = r + 0.005

ax.set_xlabel(r'$r$', fontsize=16)
plt.show()
"""
Filename: choatic_ts.py
Reference: http://quant-econ.net/py/python_oop.html
"""
from chaos_class import Chaos
import matplotlib.pyplot as plt

ch = Chaos(0.1, 4.0) 
ts_length = 250

fig, ax = plt.subplots()
ax.set_xlabel(r'$t$', fontsize=14)
ax.set_ylabel(r'$x_t$', fontsize=14)
x = ch.generate_sequence(ts_length)
ax.plot(range(ts_length), x, 'bo-', alpha=0.5, lw=2, label=r'$x_t$')
plt.show()
Esempio n. 4
0
"""
Filename: choatic_ts.py
Reference: http://quant-econ.net/py/python_oop.html
"""
from chaos_class import Chaos
import matplotlib.pyplot as plt

ch = Chaos(0.1, 4.0)
ts_length = 250

fig, ax = plt.subplots()
ax.set_xlabel(r'$t$', fontsize=14)
ax.set_ylabel(r'$x_t$', fontsize=14)
x = ch.generate_sequence(ts_length)
ax.plot(range(ts_length), x, 'bo-', alpha=0.5, lw=2, label=r'$x_t$')
plt.show()