I am a relative beginner when it comes to python, and I currently am trying to figure out some python for a problem I have. I am attempting to calculate the lyapunov exponent of a bifurcation diagram I am supposed to be creating.
The equation is X_(n+1) = asin(pi x_(n)), where a = 0.9 (for when I calculate the exponent)
This is currently the code that i have set up to create an array of values becoming large.
import numpy as np
np.set_printoptions(threshold=np.nan)
import matplotlib.pyplot as plt
a = np.linspace(0,1)
xn = np.array([.001], dtype = float)
for i in range(0,10000):
y = a*np.sin(np.pi*xn[i])
xn = np.append(xn,y)
plt.plot(a,xn[-1])
However, very obviously, when i plot xn, i just get a mad mess of dots instead of a bifurcation diagram. I was hoping I could get some guidance as to moving towards the correct diagram which i can hopefully use to get closer to my end goal.
Thanks for any help, I appreciate it!