You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the DFTInterpolator is used in the singular integral routine the results are not correct, and also not deterministic on my machine. Running this test multiple times gives different results. Attached is example output.
@pytest.mark.unitdeftest_singular_integral_vac_estell(self):
"""Test calculating Bplasma for vacuum estell, which should be near 0."""eq=get("ESTELL")
grid=LinearGrid(M=25, N=25, NFP=eq.NFP)
keys= [
"K_vc",
"B",
"|B|^2",
"R",
"phi",
"Z",
"e^rho",
"n_rho",
"|e_theta x e_zeta|",
]
data=eq.compute(keys, grid=grid)
k=min(grid.num_theta, grid.num_zeta*grid.NFP)
s=k-1q=k//2+int(np.sqrt(k))
interpolator=DFTInterpolator(grid, grid, s, q)
Bplasma=virtual_casing_biot_savart(data, data, interpolator, loop=True)
# need extra factor of B/2 bc we're evaluating on plasma surfaceBplasma+=data["B"] /2Bplasma=np.linalg.norm(Bplasma, axis=-1)
# scale by total field magnitudeB=Bplasma/np.linalg.norm(data["B"], axis=-1).mean()
np.testing.assert_allclose(B, 0, atol=0.005)
The text was updated successfully, but these errors were encountered:
The issue occurs more often on larger problem sizes.
I suspect there might be a numerics issue caused by computing the pseudoinverse of the vandermonde matrix A. A solution would be to compute $c = A^{-1} f$ directly with a Fourier transform and then retain the other basis matrix to interpolate via B@c.
When the
DFTInterpolator
is used in the singular integral routine the results are not correct, and also not deterministic on my machine. Running this test multiple times gives different results. Attached is example output.The text was updated successfully, but these errors were encountered: