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

write_chua: pas en argument pour écrire le temps et non le numéro.

changé alpha en 10 pour éviter le hole-filling
parent 8c7f0d89
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ def main():
# Résolution
m0, m1 = -1/7, 2/7
alpha, beta = 9.85, 14.3
alpha, beta = 10, 14.3
Y0 = np.array([.7, 0, 0])
y_full = odeint(Chua, Y0, t, args=(alpha, beta, m0, m1))
......@@ -23,7 +23,7 @@ def main():
y = y_full[ttrans:, ].copy()
# Ecriture
write_chua(y)
write_chua(y, h)
# Diagramme y_{n+1} = f(y_n)
poincare_val = poincare_map(y)
......@@ -117,12 +117,17 @@ def write_dots_pgfplots(diag, name):
f.write("{},{}\n".format(elt[0], elt[1]))
def write_chua(points):
def write_chua(points, h):
"""
\'Ecris les coordonnées dans un fichier pour pgfplot. h pour avoir le temps
et non le numéro de point
"""
N = points.shape[0]
with open('chua.csv', 'w') as f:
f.write("a,b,c,d\n")
for i in range(N):
f.write("{},{},{},{}\n".format(i, points[i, 0], points[i, 1],
it = i*h
f.write("{},{},{},{}\n".format(it, points[i, 0], points[i, 1],
points[i, 2]))
......
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