lines['A'].set_data(x * 1E9, onde(lamb, 0, x))
    lines['B'].set_data(x * 1E9, onde(lamb, phi, x))
    lines['somme'].set_data(x * 1E9, interference(lamb, phi, x))

    fig.canvas.draw_idle()


#===========================================================
# --- Création de la figure et mise en page ----------------
#===========================================================

fig = plt.figure()
fig.suptitle(titre)
fig.text(0.02,
         .9,
         justify(description),
         multialignment='left',
         verticalalignment='top')

ax1, ax2, ax3 = fig.subplots(3,
                             1,
                             sharex=True,
                             sharey=True,
                             gridspec_kw={
                                 'left': 0.35,
                                 'bottom': 0.3,
                                 'top': 0.9,
                                 'hspace': 0.05
                             })

lines = {}
    """Résolution de l'equation differentielle pour chaque condition intiale"""

    for dtheta_init in dtheta_init_list:
        etat_init=np.array([0, dtheta_init/omega0])
        solution = odeint(eq_diff, etat_init, t, args=(omega0,))

        ax.plot(solution[:,0], solution[:,1], color='red', linewidth=1)
        ax.plot(-solution[:,0], solution[:,1], color='red', linewidth=1) # la fonction dtheta(theta) etant paire


#===========================================================
# --- Création de la figure et mise en page ----------------
#===========================================================

fig = plt.figure()
fig.suptitle(titre)
fig.text(0.5, .93, justify(description, 120), multialignment='left', verticalalignment='top', horizontalalignment='center')

ax = fig.add_axes([0.1, 0.06, 0.8, 0.8])

ax.set_ylim(-15,15)
ax.set_ylabel(r'$\dot \theta$')
ax.set_xlim(-8,8)
ax.set_xlabel(r'$\theta$')

plot_static_data(ax, omega0=4)
#ax.axis('equal')

if __name__=="__main__":
    plt.show()
Esempio n. 3
0
        lines["spin"].set_visible(True)
        lines["sat"].set_visible(True)
    else:
        lines["spin"].set_visible(False)
        lines["sat"].set_visible(False)

    fig.canvas.draw_idle()


#===========================================================
# --- Création de la figure et mise en page ----------------
#===========================================================

fig = plt.figure()
fig.suptitle(titre)
fig.text(0.02, .93, justify(description, 120), multialignment='left', verticalalignment='top')

ax = fig.add_axes([0.05, 0.16, 0.9, 0.7])

# On trace la courbe spinodale
ax.plot(v_spin, p_spin, 'k--', lw=2, label='Courbe spinodale')

# On trace la courbe de saturation
ax.plot(v_sat, p_sat, 'b--', lw=2, label="Courbe de saturation")

# Affichage du point critique
ax.plot(1.0,1.0,'go')

lines = {}
lines["Courbe spinodale"], = ax.plot([], [], lw=4, color='red', label="Isotherme")
lines["spin"], = ax.plot([], [], 'ko')