Skip to content

Commit 6bd867f

Browse files
committed
Modified limit of series expansion
1 parent 8d05a33 commit 6bd867f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

sfs/mono/drivingfunction.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def esa_edge_2d_plane(omega, x0, n=[0, 1, 0], alpha=3/2*np.pi, Nc=None, c=None):
346346
phi = np.where(phi < 0, phi+2*np.pi, phi)
347347

348348
if Nc is None:
349-
Nc = 2*np.ceil(k * np.max(r))
349+
Nc = np.ceil(2 * k * np.max(r) * alpha/np.pi)
350350

351351
epsilon = np.ones(Nc) # weights for series expansion
352352
epsilon[0] = 2
@@ -403,7 +403,7 @@ def esa_edge_dipole_2d_plane(omega, x0, n=[0, 1, 0], alpha=3/2*np.pi, Nc=None, c
403403
phi = np.where(phi < 0, phi+2*np.pi, phi)
404404

405405
if Nc is None:
406-
Nc = 2*np.ceil(k * np.max(r))
406+
Nc = np.ceil(2 * k * np.max(r) * alpha/np.pi)
407407

408408
epsilon = np.ones(Nc) # weights for series expansion
409409
epsilon[0] = 2
@@ -461,7 +461,7 @@ def esa_edge_2d_line(omega, x0, xs, alpha=3/2*np.pi, Nc=None, c=None):
461461
phi = np.where(phi < 0, phi+2*np.pi, phi)
462462

463463
if Nc is None:
464-
Nc = 2*np.ceil(k * np.max(r))
464+
Nc = np.ceil(2 * k * np.max(r) * alpha/np.pi)
465465

466466
epsilon = np.ones(Nc) # weights for series expansion
467467
epsilon[0] = 2
@@ -568,7 +568,7 @@ def esa_edge_dipole_2d_line(omega, x0, xs, alpha=3/2*np.pi, Nc=None, c=None):
568568
phi = np.where(phi < 0, phi+2*np.pi, phi)
569569

570570
if Nc is None:
571-
Nc = 2*np.ceil(k * np.max(r))
571+
Nc = np.ceil(2 * k * np.max(r) * alpha/np.pi)
572572

573573
epsilon = np.ones(Nc) # weights for series expansion
574574
epsilon[0] = 2

sfs/mono/source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def line_dirichlet_edge(omega, x0, grid, alpha=3/2*np.pi, Nc=None, c=None):
444444
phi = np.where(phi < 0, phi+2*np.pi, phi)
445445

446446
if Nc is None:
447-
Nc = 2*np.ceil(k * np.max(r))
447+
Nc = np.ceil(2 * k * np.max(r) * alpha/np.pi)
448448

449449
epsilon = np.ones(Nc) # weights for series expansion
450450
epsilon[0] = 2

0 commit comments

Comments
 (0)