Skip to content

Commit 111a485

Browse files
committed
Import pi from the numpy package
This fixes the following error: .../fdm-book/src/wave/wave1D/wave1D_u0.py in guitar(C) 207 wavelength = 2*L 208 c = freq*wavelength --> 209 omega = 2*pi*freq 210 num_periods = 1 211 T = 2*pi/omega*num_periods NameError: global name 'pi' is not defined
1 parent b5ef132 commit 111a485

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/wave/wave1D/wave1D_u0.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ def guitar(C):
206206
freq = 440
207207
wavelength = 2*L
208208
c = freq*wavelength
209-
omega = 2*pi*freq
209+
omega = 2*np.pi*freq
210210
num_periods = 1
211-
T = 2*pi/omega*num_periods
211+
T = 2*np.pi/omega*num_periods
212212
# Choose dt the same as the stability limit for Nx=50
213213
dt = L/50./c
214214

0 commit comments

Comments
 (0)