From 43447660636263a2b52020cbfdc8588848dc389f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20K=C3=B6hler?= <27728103+Ceyron@users.noreply.github.com> Date: Tue, 22 Oct 2024 12:07:38 +0200 Subject: [PATCH] Add comment on why there is a 2.0 in denominator --- exponax/ic/_gaussian_random_field.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/exponax/ic/_gaussian_random_field.py b/exponax/ic/_gaussian_random_field.py index e18478a..42d46ee 100644 --- a/exponax/ic/_gaussian_random_field.py +++ b/exponax/ic/_gaussian_random_field.py @@ -64,6 +64,9 @@ def __call__( self.num_spatial_dims, self.domain_extent, num_points ) wavenumer_norm_grid = jnp.linalg.norm(wavenumber_grid, axis=0, keepdims=True) + # Further division by 2.0 in the exponent is because we want to have the + # **power-spectrum** follow a **power-law**. See + # https://github.com/Ceyron/exponax/issues/9 for more details. amplitude = jnp.power(wavenumer_norm_grid, -self.powerlaw_exponent / 2.0) amplitude = ( amplitude.flatten().at[0].set(1.0).reshape(wavenumer_norm_grid.shape)