# Generated by pandoc-plot 1.6.1
import matplotlib.pyplot as plt
import numpy as np
import math
omega = 3.0
t = np.linspace(0, 2, 500) # Sample data.
plt.figure(figsize=(5, 2.7), layout='constrained')
plt.plot(t, 0.5*np.ones(t.size), label='puiss. moy.') # Plot some data on the (implicit) axes.
plt.plot(t, np.sin(2*math.pi*omega*t)**2, label='puiss. inst.') # etc.
plt.xlabel('temps [s]')
plt.ylabel('puissance [W]')
plt.title("Puissance instantanée et moyenne du courant alternatif.")
plt.legend()