This document explains how to plot a graph of displacement y
versus position x
, and a graph of pressure fluctuation p
versus position x
at time t = 0
, using Python.
- The displacement
y(x)
is modeled as a sine wave:y(x) = A * sin(kx)
. - The pressure fluctuation
p(x)
is modeled as a cosine wave:p(x) = B * cos(kx)
. A
andB
represent the amplitudes, andk
is the wave number.
The following Python script uses Matplotlib to plot these functions