Skip to content
Snippets Groups Projects
Commit e71355af authored by Gabriel Hondet's avatar Gabriel Hondet
Browse files

ajoute la creation du bitmap

parent c4df9809
No related branches found
No related tags found
No related merge requests found
......@@ -100,7 +100,7 @@ de Poincaré $\pi$ telle que $y_{i+1} = \pi(y_i)$.
L'argument $\alpha$ sera ici une liste. Par exemple, dans ce document on a
\texttt{alpha = np.arange(8.43, 8.8, 0.001)}.
\begin{minted}[fontsize=\footnotesize, linenos]{python}
def orb_diag_chua(alpha, beta, m0, m1):
def orb_diag_chua(alpha, beta, m0, m1):
diag = []
ttrans = 200
for a in alpha:
......@@ -109,3 +109,31 @@ L'argument $\alpha$ sera ici une liste. Par exemple, dans ce document on a
for o in poincare_perdbl:
diag.append((a, o))
\end{minted}
\subsection{Image ``bitmap''}
On doit d'abord prendre une valeur toutes les 3 secondes:
\begin{minted}[fontsize=\footnotesize, linenos]{python}
def sequence_gpa(x):
"""
x = chua_sol(alpha, beta, m0, m1), un array
"""
x2 = []
i = 200 # Pour enlever le régime transitoire
shift = 3000 # Temps entre deux valeurs (en ms)
while i < len(x):
x2.append(x[i,0]) # On prend la première coordonnée (x)
i += shift
return x2
\end{minted}
\begin{minted}[fontsize=\footnotesize, linenos]{python}
def create_bitmap(x2)
"""
x2 = sequence_gpa(x), une liste de réels
"""
dim = int(np.sqrt(len(x2)))
x2arr = np.array(x2)
x2arr = x2arr[:dim**2].reshape((dim,dim)).copy() # Transforme en matrice
x2arr = x2arr.astype('uint8')*255 # Changement du type des valeurs
im = Image.fromarray(x2arr)
im.save("bitmap_chua_seq", "bmp")
\end{minted}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment