def f(t, alpha, omega):
    """Computes and returns exp(-alpha*t) * cos(omega*t)"""
    return exp(-alpha * t) * cos(omega * t)

"""
Explanation: Title of investigation
Want to understand $f(t) = \exp(-\alpha t) \cos(\omega t)$
End of explanation
"""


f(t=0.1, alpha=1, omega=10)

"""
Explanation: We can execute the function for valuel of $\alpha$ and $\omega$:
End of explanation
"""


def plot_f(alpha, omega):
    ts = linspace(0, 5, 400)    # many points in the interval [0, 5]
    ys = f(ts, alpha, omega)
    pylab.plot(ts, ys, '-')

plot_f(alpha=0.1, omega=12)

"""
Explanation: Although sometimes a plot is more instructive:
End of explanation
"""


interact(plot_f, alpha=(0, 2, 0.1), omega=(0, 20, 0.5))

"""
Explanation: A wide range of convenience tools, for example graphical interaction elements called Widgets:
End of explanation
"""


