mirror of
https://github.com/vale981/stocproc
synced 2025-03-05 17:51:42 -05:00
fix in fft stocproc, factor of one oder pi missing
This commit is contained in:
parent
8c8871b474
commit
6a22a4ca09
1 changed files with 3 additions and 3 deletions
|
@ -178,7 +178,7 @@ class StocProc_FFT(_absStocProc):
|
||||||
r"""
|
r"""
|
||||||
Simulate Stochastic Process using FFT method
|
Simulate Stochastic Process using FFT method
|
||||||
"""
|
"""
|
||||||
def __init__(self, spectral_density, t_max, num_grid_points, seed=None, verbose=1, k=3):
|
def __init__(self, spectral_density, t_max, num_grid_points, seed=None, verbose=0, k=3):
|
||||||
super().__init__(t_max = t_max,
|
super().__init__(t_max = t_max,
|
||||||
num_grid_points = num_grid_points,
|
num_grid_points = num_grid_points,
|
||||||
seed = seed,
|
seed = seed,
|
||||||
|
@ -192,7 +192,7 @@ class StocProc_FFT(_absStocProc):
|
||||||
#omega axis
|
#omega axis
|
||||||
omega = self.delta_omega*np.arange(self.n_dft)
|
omega = self.delta_omega*np.arange(self.n_dft)
|
||||||
#reshape for multiplication with matrix xi
|
#reshape for multiplication with matrix xi
|
||||||
self.sqrt_spectral_density_times_sqrt_delta_omega = np.sqrt(spectral_density(omega)) * np.sqrt(self.delta_omega)
|
self.sqrt_spectral_density_over_pi_times_sqrt_delta_omega = np.sqrt(spectral_density(omega) / np.pi) * np.sqrt(self.delta_omega)
|
||||||
|
|
||||||
if self._verbose > 0:
|
if self._verbose > 0:
|
||||||
print("stoc proc fft, spectral density sampling information:")
|
print("stoc proc fft, spectral density sampling information:")
|
||||||
|
@ -203,7 +203,7 @@ class StocProc_FFT(_absStocProc):
|
||||||
print(" delta_omega:", (self.delta_omega))
|
print(" delta_omega:", (self.delta_omega))
|
||||||
|
|
||||||
def _calc_z(self, y):
|
def _calc_z(self, y):
|
||||||
weighted_integrand = self.sqrt_spectral_density_times_sqrt_delta_omega * y
|
weighted_integrand = self.sqrt_spectral_density_over_pi_times_sqrt_delta_omega * y
|
||||||
#compute integral using fft routine
|
#compute integral using fft routine
|
||||||
if self._verbose > 1:
|
if self._verbose > 1:
|
||||||
print("calc process via fft ...")
|
print("calc process via fft ...")
|
||||||
|
|
Loading…
Add table
Reference in a new issue