mirror of
https://github.com/vale981/stocproc
synced 2025-03-04 17:21:42 -05:00
Deploy to GitHub Pages c87507069b
This commit is contained in:
parent
c87507069b
commit
84e12b876b
7 changed files with 83 additions and 87 deletions
|
@ -1,4 +1,4 @@
|
|||
# Sphinx build info version 1
|
||||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
||||
config: 15d805035fb96b3ef529c38366090a8a
|
||||
config: 4c8dc62b8acdea34cc0cac470e559d64
|
||||
tags: 645f666f9bcd5a90fca523b33c5a78b7
|
||||
|
|
|
@ -176,12 +176,12 @@
|
|||
spectral density <span class="math">\(J(\omega)\)</span>. The integral can be approximated by a discrete integration scheme</p>
|
||||
<div class="math">
|
||||
\[\alpha(\tau) = \int_{\omega_\mathrm{min}}^{\omega_\mathrm{max}} \mathrm{d}\omega \, \frac{J(\omega)}{\pi} e^{-\mathrm{i}\omega \tau}
|
||||
\approx \sum_{k=0}^{N-1} w_k \frac{J(\omega_k)}{\pi} e^{-\mathrm{i} \omega_k \tau}\]</div>
|
||||
\approx \sum_{k=0}^{N-1} w_k \frac{J(\omega_k)}{\pi} e^{-\mathrm{i} k \omega_k \tau}\]</div>
|
||||
<p>where the weights <span class="math">\(\omega_k\)</span> depend on the particular integration scheme. For a process defined as</p>
|
||||
<div class="math">
|
||||
\[Z(t) = \sum_{k=0}^{N-1} \sqrt{\frac{w_k J(\omega_k)}{\pi}} Y_k \exp^{-\mathrm{i}\omega_k t}\]</div>
|
||||
<p>with independent complex random variables <span class="math">\(Y_k\)</span> such that <span class="math">\(\langle Y_k \rangle = 0\)</span>,
|
||||
<span class="math">\(\langle Y_k Y_{k'}\rangle = 0\)</span> and <span class="math">\(\langle Y_k Y^\ast_{k'}\rangle = \delta_{k,k'}\)</span>
|
||||
<span class="math">\(\langle Y_k Y_{k'}\rangle = 0\)</span> and <span class="math">\(\langle Y_k Y^\ast_{k'}\rangle = \Delta \omega \delta_{k,k'}\)</span>
|
||||
it is easy to see that its auto correlation function will be exactly the approximated auto correlation function.</p>
|
||||
<div class="math">
|
||||
\[\begin{split}\begin{align}
|
||||
|
@ -217,13 +217,13 @@ criterion from the interpolation is met.</p>
|
|||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>spectral_density</strong> – the spectral density <span class="math">\(J(\omega)\)</span> as callable function object</li>
|
||||
<li><strong>t_max</strong> – <span class="math">\([0,t_\mathrm{max}]\)</span> is the interval for which the process will be calculated</li>
|
||||
<li><strong>bcf_ref</strong> – a callable which evaluates the Fourier integral exactly</li>
|
||||
<li><strong>intgr_tol</strong> – tolerance for the integral approximation</li>
|
||||
<li><strong>intpl_tol</strong> – tolerance for the interpolation</li>
|
||||
<li><strong>seed</strong> – if not None, use this seed to seed the random number generator</li>
|
||||
<li><strong>negative_frequencies</strong> – if False, keep <span class="math">\(\omega_\mathrm{min} = 0\)</span> otherwise
|
||||
<li><strong>spectral_density</strong> – the spectral density <span class="math">\(J(\omega)\)</span> as callable function object</li>
|
||||
<li><strong>t_max</strong> – <span class="math">\([0,t_\mathrm{max}]\)</span> is the interval for which the process will be calculated</li>
|
||||
<li><strong>bcf_ref</strong> – a callable which evaluates the Fourier integral exactly</li>
|
||||
<li><strong>intgr_tol</strong> – tolerance for the integral approximation</li>
|
||||
<li><strong>intpl_tol</strong> – tolerance for the interpolation</li>
|
||||
<li><strong>seed</strong> – if not None, use this seed to seed the random number generator</li>
|
||||
<li><strong>negative_frequencies</strong> – if False, keep <span class="math">\(\omega_\mathrm{min} = 0\)</span> otherwise
|
||||
find a negative <span class="math">\(\omega_\mathrm{min}\)</span> appropriately just like :math:<a href="#id1"><span class="problematic" id="id2">`</span></a>omega_mathrm{max}</li>
|
||||
</ul>
|
||||
</td>
|
||||
|
@ -277,8 +277,8 @@ find a negative <span class="math">\(\omega_\mathrm{min}\)</span> appropriately
|
|||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>y</strong> – independent normal distributed complex valued random variables with <span class="math">\(\sigma_{ij}^2 = \langle y_i y_j^\ast \rangle = 2 \delta_{ij}\)</span></li>
|
||||
<li><strong>seed</strong> – if not None set seed to seed before generating samples</li>
|
||||
<li><strong>y</strong> – independent normal distributed complex valued random variables with <span class="math">\(\sigma_{ij}^2 = \langle y_i y_j^\ast \rangle = 2 \delta_{ij}\)</span></li>
|
||||
<li><strong>seed</strong> – if not None set seed to seed before generating samples</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -170,7 +170,7 @@
|
|||
<h1>StocProc_KLE<a class="headerlink" href="#stocproc-kle" title="Permalink to this headline">¶</a></h1>
|
||||
<dl class="class">
|
||||
<dt id="stocproc.StocProc_KLE">
|
||||
<em class="property">class </em><code class="descclassname">stocproc.</code><code class="descname">StocProc_KLE</code><span class="sig-paren">(</span><em>r_tau</em>, <em>t_max</em>, <em>tol=0.01</em>, <em>ng_fac=4</em>, <em>meth='fourpoint'</em>, <em>diff_method='full'</em>, <em>dm_random_samples=10000</em>, <em>seed=None</em>, <em>align_eig_vec=False</em>, <em>scale=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/stocproc/stocproc.html#StocProc_KLE"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#stocproc.StocProc_KLE" title="Permalink to this definition">¶</a></dt>
|
||||
<em class="property">class </em><code class="descclassname">stocproc.</code><code class="descname">StocProc_KLE</code><span class="sig-paren">(</span><em>r_tau</em>, <em>t_max</em>, <em>tol=0.01</em>, <em>ng_fac=4</em>, <em>meth=’fourpoint’</em>, <em>diff_method=’full’</em>, <em>dm_random_samples=10000</em>, <em>seed=None</em>, <em>align_eig_vec=False</em>, <em>scale=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/stocproc/stocproc.html#StocProc_KLE"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#stocproc.StocProc_KLE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>A class to simulate stochastic processes using Karhunen-Loève expansion (KLE) method.
|
||||
The idea is that any stochastic process can be expressed in terms of the KLE</p>
|
||||
<div class="math">
|
||||
|
@ -200,21 +200,21 @@ for details).</p>
|
|||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>r_tau</strong> – the idesired auto correlation function of a single parameter tau</li>
|
||||
<li><strong>t_max</strong> – specifies the time interval [0, t_max] for which the processes in generated</li>
|
||||
<li><strong>tol</strong> – maximal deviation of the auto correlation function of the sampled processes from
|
||||
<li><strong>r_tau</strong> – the idesired auto correlation function of a single parameter tau</li>
|
||||
<li><strong>t_max</strong> – specifies the time interval [0, t_max] for which the processes in generated</li>
|
||||
<li><strong>tol</strong> – maximal deviation of the auto correlation function of the sampled processes from
|
||||
the given auto correlation r_tau.</li>
|
||||
<li><strong>ngfac</strong> – specifies the fine grid to use for the spline interpolation, the intermediate points are
|
||||
<li><strong>ngfac</strong> – specifies the fine grid to use for the spline interpolation, the intermediate points are
|
||||
calculated using integral interpolation</li>
|
||||
<li><strong>meth</strong> – the method for calculation integration weights and times, a callable or one of the following strings
|
||||
‘midpoint’ (‘midp’), ‘trapezoidal’ (‘trapz’), ‘simpson’ (‘simp’), ‘fourpoint’ (‘fp’),
|
||||
‘gauss_legendre’ (‘gl’), ‘tanh_sinh’ (‘ts’)</li>
|
||||
<li><strong>diff_method</strong> – either ‘full’ or ‘random’, determines the points where the above success criterion is evaluated,
|
||||
‘full’: full grid in between the fine grid, such that the spline interpolation error is expected to be maximal
|
||||
‘random’: pick a fixed number of random times t and s within the interval [0, t_max]</li>
|
||||
<li><strong>dm_random_samples</strong> – the number of random times used for diff_method ‘random’</li>
|
||||
<li><strong>seed</strong> – if not None seed the random number generator on init of this class with seed</li>
|
||||
<li><strong>align_eig_vec</strong> – assures that <span class="math">\(re(u_i(0)) \leq 0\)</span> and <span class="math">\(im(u_i(0)) = 0\)</span> for all i</li>
|
||||
<li><strong>meth</strong> – the method for calculation integration weights and times, a callable or one of the following strings
|
||||
‘midpoint’ (‘midp’), ‘trapezoidal’ (‘trapz’), ‘simpson’ (‘simp’), ‘fourpoint’ (‘fp’),
|
||||
‘gauss_legendre’ (‘gl’), ‘tanh_sinh’ (‘ts’)</li>
|
||||
<li><strong>diff_method</strong> – either ‘full’ or ‘random’, determines the points where the above success criterion is evaluated,
|
||||
‘full’: full grid in between the fine grid, such that the spline interpolation error is expected to be maximal
|
||||
‘random’: pick a fixed number of random times t and s within the interval [0, t_max]</li>
|
||||
<li><strong>dm_random_samples</strong> – the number of random times used for diff_method ‘random’</li>
|
||||
<li><strong>seed</strong> – if not None seed the random number generator on init of this class with seed</li>
|
||||
<li><strong>align_eig_vec</strong> – assures that <span class="math">\(re(u_i(0)) \leq 0\)</span> and <span class="math">\(im(u_i(0)) = 0\)</span> for all i</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -240,7 +240,7 @@ diff_method, dm_random_samples can be found at <a class="reference internal" hre
|
|||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>t</strong> – time to evaluate the stochastic process at, float of array of floats, if t is None
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>t</strong> – time to evaluate the stochastic process at, float of array of floats, if t is None
|
||||
return the discrete process <span class="math">\(z_k\)</span> which corresponds to the times <span class="math">\(t_k\)</span> given by the
|
||||
integration weights method</td>
|
||||
</tr>
|
||||
|
@ -291,8 +291,8 @@ to approximate the auto correlation kernel.</p>
|
|||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>y</strong> – independent normal distributed complex valued random variables with <span class="math">\(\sigma_{ij}^2 = \langle y_i y_j^\ast \rangle = 2 \delta_{ij}\)</span></li>
|
||||
<li><strong>seed</strong> – if not None set seed to seed before generating samples</li>
|
||||
<li><strong>y</strong> – independent normal distributed complex valued random variables with <span class="math">\(\sigma_{ij}^2 = \langle y_i y_j^\ast \rangle = 2 \delta_{ij}\)</span></li>
|
||||
<li><strong>seed</strong> – if not None set seed to seed before generating samples</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -331,8 +331,8 @@ with leads to the equivalent expression:</p>
|
|||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>r</strong> – correlation matrix <span class="math">\(R(t_j-s_i)\)</span></li>
|
||||
<li><strong>w</strong> – integrations weights <span class="math">\(w_i\)</span>
|
||||
<li><strong>r</strong> – correlation matrix <span class="math">\(R(t_j-s_i)\)</span></li>
|
||||
<li><strong>w</strong> – integrations weights <span class="math">\(w_i\)</span>
|
||||
(they have to correspond to the discrete time <span class="math">\(t_i\)</span>)</li>
|
||||
</ul>
|
||||
</td>
|
||||
|
@ -356,7 +356,7 @@ to approximate the integral over the interval [0, t_max] using ng points.</p>
|
|||
<div class="admonition note">
|
||||
<p class="first admonition-title">Note</p>
|
||||
<p class="last">It has been noticed that the performance of the various weights depends on the auto correlation
|
||||
function. As default one should use the ‘simpson weights’. ‘four point’, ‘gauss legendre’ and ‘tanh sinh’
|
||||
function. As default one should use the ‘simpson weights’. ‘four point’, ‘gauss legendre’ and ‘tanh sinh’
|
||||
might perform better for auto correlation function that decay slowly. Their advantage becomes evident
|
||||
for a large numbers of grid points only. So if one cares about relative differences below 1e-4
|
||||
the more sophisticated weights are suitable.</p>
|
||||
|
@ -372,8 +372,8 @@ the more sophisticated weights are suitable.</p>
|
|||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>t_max</strong> – end of the interval for the time grid <span class="math">\([0,t_\mathrm{max}]\)</span></li>
|
||||
<li><strong>num_grid_points</strong> – number of grid points N</li>
|
||||
<li><strong>t_max</strong> – end of the interval for the time grid <span class="math">\([0,t_\mathrm{max}]\)</span></li>
|
||||
<li><strong>num_grid_points</strong> – number of grid points N</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -403,8 +403,8 @@ stationary stochastic processes which allows <span class="math">\(\alpha(t_i+\De
|
|||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>t_max</strong> – end of the interval for the time grid <span class="math">\([0,t_\mathrm{max}]\)</span></li>
|
||||
<li><strong>num_grid_points</strong> – number of grid points N</li>
|
||||
<li><strong>t_max</strong> – end of the interval for the time grid <span class="math">\([0,t_\mathrm{max}]\)</span></li>
|
||||
<li><strong>num_grid_points</strong> – number of grid points N</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -431,8 +431,8 @@ stationary stochastic processes which allows <span class="math">\(\alpha(t_i+\De
|
|||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>t_max</strong> – end of the interval for the time grid <span class="math">\([0,t_\mathrm{max}]\)</span></li>
|
||||
<li><strong>num_grid_points</strong> – number of grid points N (needs to be odd)</li>
|
||||
<li><strong>t_max</strong> – end of the interval for the time grid <span class="math">\([0,t_\mathrm{max}]\)</span></li>
|
||||
<li><strong>num_grid_points</strong> – number of grid points N (needs to be odd)</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -460,8 +460,8 @@ stationary stochastic processes which allows <span class="math">\(\alpha(t_i+\De
|
|||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>t_max</strong> – end of the interval for the time grid <span class="math">\([0,t_\mathrm{max}]\)</span></li>
|
||||
<li><strong>num_grid_points</strong> – number of grid points N (needs to be (4k+1) where k is an integer greater 0)</li>
|
||||
<li><strong>t_max</strong> – end of the interval for the time grid <span class="math">\([0,t_\mathrm{max}]\)</span></li>
|
||||
<li><strong>num_grid_points</strong> – number of grid points N (needs to be (4k+1) where k is an integer greater 0)</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -496,8 +496,8 @@ by expanding the function in terms of Legendre Polynomials.</p>
|
|||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>t_max</strong> – end of the interval for the time grid <span class="math">\([0,t_\mathrm{max}]\)</span></li>
|
||||
<li><strong>num_grid_points</strong> – number of grid points N</li>
|
||||
<li><strong>t_max</strong> – end of the interval for the time grid <span class="math">\([0,t_\mathrm{max}]\)</span></li>
|
||||
<li><strong>num_grid_points</strong> – number of grid points N</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -517,14 +517,14 @@ transform the integral over a finite interval <span class="math">\(x \in [-1, 1]
|
|||
\[x = \tanh(\pi/2 \sinh(t))\]</div>
|
||||
<p>to a integral over the entire real axis <span class="math">\(t \in [-\infty,\infty]\)</span> but where the new
|
||||
transformed integrand decay rapidly such that a simply midpoint rule performs very well.</p>
|
||||
<p>inspired by ‘Tanh-Sinh High-Precision Quadrature - David H. Bailey’</p>
|
||||
<p>inspired by ‘Tanh-Sinh High-Precision Quadrature - David H. Bailey’</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>t_max</strong> – end of the interval for the time grid <span class="math">\([0,t_\mathrm{max}]\)</span></li>
|
||||
<li><strong>num_grid_points</strong> – number of grid points N (needs to be odd)</li>
|
||||
<li><strong>t_max</strong> – end of the interval for the time grid <span class="math">\([0,t_\mathrm{max}]\)</span></li>
|
||||
<li><strong>num_grid_points</strong> – number of grid points N (needs to be odd)</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -547,7 +547,7 @@ scaled such that <span class="math">\(x_{-(N-1)/2} = 0\)</span> and <span class=
|
|||
|
||||
<dl class="function">
|
||||
<dt id="stocproc.method_kle.auto_ng">
|
||||
<code class="descclassname">stocproc.method_kle.</code><code class="descname">auto_ng</code><span class="sig-paren">(</span><em>corr</em>, <em>t_max</em>, <em>ngfac=2</em>, <em>meth=<function get_mid_point_weights_times></em>, <em>tol=0.001</em>, <em>diff_method='full'</em>, <em>dm_random_samples=10000</em>, <em>ret_eigvals=False</em>, <em>relative_difference=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/stocproc/method_kle.html#auto_ng"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#stocproc.method_kle.auto_ng" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="descclassname">stocproc.method_kle.</code><code class="descname">auto_ng</code><span class="sig-paren">(</span><em>corr</em>, <em>t_max</em>, <em>ngfac=2</em>, <em>meth=<function get_mid_point_weights_times></em>, <em>tol=0.001</em>, <em>diff_method=’full’</em>, <em>dm_random_samples=10000</em>, <em>ret_eigvals=False</em>, <em>relative_difference=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/stocproc/method_kle.html#auto_ng"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#stocproc.method_kle.auto_ng" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>increase the number of gridpoints until the desired accuracy is met</p>
|
||||
<p>This function increases the number of grid points of the discrete Fredholm equation exponentially until
|
||||
a given accuracy is met. The accuracy is determined from the deviation of the approximated
|
||||
|
@ -559,20 +559,20 @@ auto correlation of the Karhunen-Loève expansion from the given reference auto
|
|||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>corr</strong> – the auto correlation function</li>
|
||||
<li><strong>t_max</strong> – specifies the interval [0, t_max] for which the stochastic process can be evaluated</li>
|
||||
<li><strong>ngfac</strong> – specifies the fine grid to use for the spline interpolation, the intermediate points are
|
||||
<li><strong>corr</strong> – the auto correlation function</li>
|
||||
<li><strong>t_max</strong> – specifies the interval [0, t_max] for which the stochastic process can be evaluated</li>
|
||||
<li><strong>ngfac</strong> – specifies the fine grid to use for the spline interpolation, the intermediate points are
|
||||
calculated using integral interpolation</li>
|
||||
<li><strong>meth</strong> – the method for calculation integration weights and times, a callable or one of the following strings
|
||||
‘midpoint’ (‘midp’), ‘trapezoidal’ (‘trapz’), ‘simpson’ (‘simp’), ‘fourpoint’ (‘fp’),
|
||||
‘gauss_legendre’ (‘gl’), ‘tanh_sinh’ (‘ts’)</li>
|
||||
<li><strong>tol</strong> – defines the success criterion max(abs(corr_exact - corr_reconstr)) < tol</li>
|
||||
<li><strong>diff_method</strong> – either ‘full’ or ‘random’, determines the points where the above success criterion is evaluated,
|
||||
‘full’: full grid in between the fine grid, such that the spline interpolation error is expected to be maximal
|
||||
‘random’: pick a fixed number of random times t and s within the interval [0, t_max]</li>
|
||||
<li><strong>dm_random_samples</strong> – the number of random times used for diff_method ‘random’</li>
|
||||
<li><strong>ret_eigvals</strong> – if True, return also the eigen values</li>
|
||||
<li><strong>relative_difference</strong> – if True, use relative difference instead of absolute</li>
|
||||
<li><strong>meth</strong> – the method for calculation integration weights and times, a callable or one of the following strings
|
||||
‘midpoint’ (‘midp’), ‘trapezoidal’ (‘trapz’), ‘simpson’ (‘simp’), ‘fourpoint’ (‘fp’),
|
||||
‘gauss_legendre’ (‘gl’), ‘tanh_sinh’ (‘ts’)</li>
|
||||
<li><strong>tol</strong> – defines the success criterion max(abs(corr_exact - corr_reconstr)) < tol</li>
|
||||
<li><strong>diff_method</strong> – either ‘full’ or ‘random’, determines the points where the above success criterion is evaluated,
|
||||
‘full’: full grid in between the fine grid, such that the spline interpolation error is expected to be maximal
|
||||
‘random’: pick a fixed number of random times t and s within the interval [0, t_max]</li>
|
||||
<li><strong>dm_random_samples</strong> – the number of random times used for diff_method ‘random’</li>
|
||||
<li><strong>ret_eigvals</strong> – if True, return also the eigen values</li>
|
||||
<li><strong>relative_difference</strong> – if True, use relative difference instead of absolute</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -603,7 +603,7 @@ usefull to set ngfac to 1 which will skip the integral interpolation</p>
|
|||
</li>
|
||||
<li><p class="first">Use the eigenfunction on the fine grid to setup a cubic spline interpolation.</p>
|
||||
</li>
|
||||
<li><p class="first">Use the spline interpolation to estimate the deviation <span class="math">\(\Delta(n)\)</span>. When using diff_method = ‘full’
|
||||
<li><p class="first">Use the spline interpolation to estimate the deviation <span class="math">\(\Delta(n)\)</span>. When using diff_method = ‘full’
|
||||
the maximization is performed over all <span class="math">\(t'_i, s'_j\)</span> where <span class="math">\(t'_i = (t_i + t_{i+1})/2\)</span> and
|
||||
<span class="math">\(s'_i = (s_i + s_{i+1})/2\)</span> with <span class="math">\(i,j = 0, \, ...\, , ng_\mathrm{fine}-2\)</span>. It is expected that
|
||||
the interpolation error is maximal when beeing in between the reference points.</p>
|
||||
|
@ -611,7 +611,7 @@ the interpolation error is maximal when beeing in between the reference points.<
|
|||
<li><p class="first">Now calculate the deviation <span class="math">\(\Delta(n)\)</span> for sequential n starting at n=0. Stop if
|
||||
<span class="math">\(\Delta(n) < tol\)</span>. If the deviation does not drop below tol for all <span class="math">\(0 \leq n < ng-1\)</span> increase
|
||||
ng as follows <span class="math">\(ng = 2*ng-1\)</span> and start over at 1). (This update scheme for ng asured that ng is odd
|
||||
which is needed for the ‘simpson’ and ‘fourpoint’ integration weights)</p>
|
||||
which is needed for the ‘simpson’ and ‘fourpoint’ integration weights)</p>
|
||||
</li>
|
||||
</ol>
|
||||
</dd>
|
||||
|
|
|
@ -583,9 +583,6 @@
|
|||
<span class="n">t0</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="c1"># efficient way to calculate the auto correlation</span>
|
||||
<span class="n">alpha_k</span> <span class="o">=</span> <span class="n">_calc_corr_min_t_plus_t</span><span class="p">(</span><span class="n">tfine</span><span class="p">,</span> <span class="n">corr</span><span class="p">)</span> <span class="c1"># from -tmax untill tmax on the fine grid</span>
|
||||
<span class="n">time_calc_ac</span> <span class="o">+=</span> <span class="p">(</span><span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">-</span> <span class="n">t0</span><span class="p">)</span> <span class="c1"># needed for integral interpolation</span>
|
||||
<span class="n">alpha_k_is_real</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">isrealobj</span><span class="p">(</span><span class="n">alpha_k</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">alpha_k_is_real</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"alpha_k is real"</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">diff_method</span> <span class="o">==</span> <span class="s1">'full'</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">is_equi</span><span class="p">:</span>
|
||||
|
@ -615,7 +612,7 @@
|
|||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">sqrt_lambda_ui_fine</span> <span class="o">=</span> <span class="n">stocproc_c</span><span class="o">.</span><span class="n">eig_func_interp</span><span class="p">(</span><span class="n">delta_t_fac</span><span class="o">=</span><span class="n">ngfac</span><span class="p">,</span>
|
||||
<span class="n">time_axis</span><span class="o">=</span><span class="n">t</span><span class="p">,</span>
|
||||
<span class="n">alpha_k</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">asarray</span><span class="p">(</span><span class="n">alpha_k</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">complex128</span><span class="p">),</span>
|
||||
<span class="n">alpha_k</span><span class="o">=</span><span class="n">alpha_k</span><span class="p">,</span>
|
||||
<span class="n">weights</span><span class="o">=</span><span class="n">w</span><span class="p">,</span>
|
||||
<span class="n">eigen_val</span><span class="o">=</span><span class="n">sqrt_eval</span><span class="p">,</span>
|
||||
<span class="n">eigen_vec</span><span class="o">=</span><span class="n">evec</span><span class="p">)</span>
|
||||
|
@ -640,10 +637,7 @@
|
|||
<span class="k">if</span> <span class="n">diff_method</span> <span class="o">==</span> <span class="s1">'random'</span><span class="p">:</span>
|
||||
<span class="n">ui_t</span> <span class="o">=</span> <span class="n">sqrt_lambda_ui_spl</span><span class="p">(</span><span class="n">t_rand</span><span class="p">)</span>
|
||||
<span class="n">ui_s</span> <span class="o">=</span> <span class="n">sqrt_lambda_ui_spl</span><span class="p">(</span><span class="n">s_rand</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">alpha_k_is_real</span><span class="p">:</span>
|
||||
<span class="n">diff</span> <span class="o">+=</span> <span class="n">np</span><span class="o">.</span><span class="n">real</span><span class="p">(</span><span class="n">ui_t</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">conj</span><span class="p">(</span><span class="n">ui_s</span><span class="p">))</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">diff</span> <span class="o">+=</span> <span class="n">ui_t</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">conj</span><span class="p">(</span><span class="n">ui_s</span><span class="p">)</span>
|
||||
<span class="n">diff</span> <span class="o">+=</span> <span class="n">ui_t</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">conj</span><span class="p">(</span><span class="n">ui_s</span><span class="p">)</span>
|
||||
<span class="k">elif</span> <span class="n">diff_method</span> <span class="o">==</span> <span class="s1">'full'</span><span class="p">:</span>
|
||||
<span class="n">ui_super_fine</span> <span class="o">=</span> <span class="n">sqrt_lambda_ui_spl</span><span class="p">(</span><span class="n">tsfine</span><span class="p">)</span>
|
||||
<span class="n">diff</span> <span class="o">+=</span> <span class="n">ui_super_fine</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">conj</span><span class="p">(</span><span class="n">ui_super_fine</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">))</span>
|
||||
|
|
|
@ -313,7 +313,6 @@
|
|||
<span class="k">if</span> <span class="n">y</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="c1">#random complex normal samples</span>
|
||||
<span class="n">y</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">normal</span><span class="p">(</span><span class="n">scale</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_one_over_sqrt_2</span><span class="p">,</span> <span class="n">size</span> <span class="o">=</span> <span class="mi">2</span><span class="o">*</span><span class="bp">self</span><span class="o">.</span><span class="n">get_num_y</span><span class="p">())</span><span class="o">.</span><span class="n">view</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">complex</span><span class="p">)</span>
|
||||
<span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">_z</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_z</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_calc_scaled_z</span><span class="p">(</span><span class="n">y</span><span class="p">)</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"proc_cnt:</span><span class="si">{}</span><span class="s2"> new process generated [</span><span class="si">{:.2e}</span><span class="s2">s]"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_proc_cnt</span><span class="p">,</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">-</span> <span class="n">t0</span><span class="p">))</span>
|
||||
<span class="n">t0</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
|
||||
|
@ -405,8 +404,8 @@
|
|||
<span class="n">state</span> <span class="o">=</span> <span class="n">sqrt_lambda_ui_fine</span><span class="p">,</span> <span class="n">t</span><span class="p">,</span> <span class="n">seed</span><span class="p">,</span> <span class="n">scale</span><span class="p">,</span> <span class="n">key</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">__setstate__</span><span class="p">(</span><span class="n">state</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@staticmethod</span>
|
||||
<div class="viewcode-block" id="StocProc_KLE.get_key"><a class="viewcode-back" href="../../StocProc_KLE.html#stocproc.stocproc.StocProc_KLE.get_key">[docs]</a> <span class="k">def</span> <span class="nf">get_key</span><span class="p">(</span><span class="n">r_tau</span><span class="p">,</span> <span class="n">t_max</span><span class="p">,</span> <span class="n">tol</span><span class="o">=</span><span class="mf">1e-2</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="StocProc_KLE.get_key"><a class="viewcode-back" href="../../StocProc_KLE.html#stocproc.stocproc.StocProc_KLE.get_key">[docs]</a> <span class="nd">@staticmethod</span>
|
||||
<span class="k">def</span> <span class="nf">get_key</span><span class="p">(</span><span class="n">r_tau</span><span class="p">,</span> <span class="n">t_max</span><span class="p">,</span> <span class="n">tol</span><span class="o">=</span><span class="mf">1e-2</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="n">r_tau</span><span class="p">,</span> <span class="n">t_max</span><span class="p">,</span> <span class="n">tol</span></div>
|
||||
|
||||
|
||||
|
@ -448,14 +447,14 @@
|
|||
|
||||
<span class="sd"> .. math::</span>
|
||||
<span class="sd"> \alpha(\tau) = \int_{\omega_\mathrm{min}}^{\omega_\mathrm{max}} \mathrm{d}\omega \, \frac{J(\omega)}{\pi} e^{-\mathrm{i}\omega \tau}</span>
|
||||
<span class="sd"> \approx \sum_{k=0}^{N-1} w_k \frac{J(\omega_k)}{\pi} e^{-\mathrm{i} \omega_k \tau}</span>
|
||||
<span class="sd"> \approx \sum_{k=0}^{N-1} w_k \frac{J(\omega_k)}{\pi} e^{-\mathrm{i} k \omega_k \tau}</span>
|
||||
|
||||
<span class="sd"> where the weights :math:`\omega_k` depend on the particular integration scheme. For a process defined as</span>
|
||||
|
||||
<span class="sd"> .. math:: Z(t) = \sum_{k=0}^{N-1} \sqrt{\frac{w_k J(\omega_k)}{\pi}} Y_k \exp^{-\mathrm{i}\omega_k t}</span>
|
||||
|
||||
<span class="sd"> with independent complex random variables :math:`Y_k` such that :math:`\langle Y_k \rangle = 0`,</span>
|
||||
<span class="sd"> :math:`\langle Y_k Y_{k'}\rangle = 0` and :math:`\langle Y_k Y^\ast_{k'}\rangle = \delta_{k,k'}`</span>
|
||||
<span class="sd"> :math:`\langle Y_k Y_{k'}\rangle = 0` and :math:`\langle Y_k Y^\ast_{k'}\rangle = \Delta \omega \delta_{k,k'}`</span>
|
||||
<span class="sd"> it is easy to see that its auto correlation function will be exactly the approximated auto correlation function.</span>
|
||||
|
||||
<span class="sd"> .. math::</span>
|
||||
|
@ -521,7 +520,7 @@
|
|||
<span class="n">tol</span> <span class="o">=</span> <span class="n">intgr_tol</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span>
|
||||
<span class="n">ref_val</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span>
|
||||
<span class="n">max_val</span> <span class="o">=</span> <span class="mf">1e6</span><span class="p">,</span>
|
||||
<span class="n">x0</span> <span class="o">=</span> <span class="mf">0.777</span><span class="p">)</span>
|
||||
<span class="n">x0</span> <span class="o">=</span> <span class="mi">1</span><span class="p">)</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"upper int bound b </span><span class="si">{:.3e}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">b</span><span class="p">))</span>
|
||||
<span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">N</span><span class="p">,</span> <span class="n">dx</span><span class="p">,</span> <span class="n">dt</span> <span class="o">=</span> <span class="n">method_fft</span><span class="o">.</span><span class="n">calc_ab_N_dx_dt</span><span class="p">(</span><span class="n">integrand</span> <span class="o">=</span> <span class="n">spectral_density</span><span class="p">,</span>
|
||||
<span class="n">intgr_tol</span> <span class="o">=</span> <span class="n">intgr_tol</span><span class="p">,</span>
|
||||
|
@ -541,12 +540,12 @@
|
|||
<span class="n">tol</span> <span class="o">=</span> <span class="n">intgr_tol</span><span class="p">,</span>
|
||||
<span class="n">ref_val</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span>
|
||||
<span class="n">max_val</span> <span class="o">=</span> <span class="mf">1e6</span><span class="p">,</span>
|
||||
<span class="n">x0</span> <span class="o">=</span> <span class="mf">0.777</span><span class="p">)</span>
|
||||
<span class="n">x0</span> <span class="o">=</span> <span class="mi">1</span><span class="p">)</span>
|
||||
<span class="n">a</span> <span class="o">=</span> <span class="n">method_fft</span><span class="o">.</span><span class="n">find_integral_boundary</span><span class="p">(</span><span class="n">integrand</span> <span class="o">=</span> <span class="n">spectral_density</span><span class="p">,</span>
|
||||
<span class="n">tol</span> <span class="o">=</span> <span class="n">intgr_tol</span><span class="p">,</span>
|
||||
<span class="n">ref_val</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span>
|
||||
<span class="n">max_val</span> <span class="o">=</span> <span class="mf">1e6</span><span class="p">,</span>
|
||||
<span class="n">x0</span> <span class="o">=</span> <span class="o">-</span><span class="mf">0.777</span><span class="p">)</span>
|
||||
<span class="n">x0</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
|
||||
<span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">N</span><span class="p">,</span> <span class="n">dx</span><span class="p">,</span> <span class="n">dt</span> <span class="o">=</span> <span class="n">method_fft</span><span class="o">.</span><span class="n">calc_ab_N_dx_dt</span><span class="p">(</span><span class="n">integrand</span> <span class="o">=</span> <span class="n">spectral_density</span><span class="p">,</span>
|
||||
<span class="n">intgr_tol</span> <span class="o">=</span> <span class="n">intgr_tol</span><span class="p">,</span>
|
||||
<span class="n">intpl_tol</span> <span class="o">=</span> <span class="n">intpl_tol</span><span class="p">,</span>
|
||||
|
@ -559,11 +558,7 @@
|
|||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"required tol result in N </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">N</span><span class="p">))</span>
|
||||
|
||||
<span class="k">assert</span> <span class="nb">abs</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">np</span><span class="o">.</span><span class="n">pi</span> <span class="o">-</span> <span class="n">N</span><span class="o">*</span><span class="n">dx</span><span class="o">*</span><span class="n">dt</span><span class="p">)</span> <span class="o"><</span> <span class="mf">1e-12</span>
|
||||
|
||||
<span class="n">num_grid_points</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">ceil</span><span class="p">(</span><span class="n">t_max</span><span class="o">/</span><span class="n">dt</span><span class="p">))</span><span class="o">+</span><span class="mi">1</span>
|
||||
|
||||
<span class="k">assert</span> <span class="n">num_grid_points</span> <span class="o"><=</span> <span class="n">N</span>
|
||||
|
||||
<span class="n">t_max</span> <span class="o">=</span> <span class="p">(</span><span class="n">num_grid_points</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span><span class="o">*</span><span class="n">dt</span>
|
||||
|
||||
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">t_max</span> <span class="o">=</span> <span class="n">t_max</span><span class="p">,</span>
|
||||
|
@ -571,12 +566,13 @@
|
|||
<span class="n">seed</span> <span class="o">=</span> <span class="n">seed</span><span class="p">,</span>
|
||||
<span class="n">scale</span> <span class="o">=</span> <span class="n">scale</span><span class="p">)</span>
|
||||
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">yl</span> <span class="o">=</span> <span class="n">spectral_density</span><span class="p">(</span><span class="n">dx</span><span class="o">*</span><span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="n">N</span><span class="p">)</span> <span class="o">+</span> <span class="n">a</span> <span class="o">+</span> <span class="n">dx</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span> <span class="o">*</span> <span class="n">dx</span> <span class="o">/</span> <span class="n">np</span><span class="o">.</span><span class="n">pi</span>
|
||||
<span class="n">omega</span> <span class="o">=</span> <span class="n">dx</span><span class="o">*</span><span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">yl</span> <span class="o">=</span> <span class="n">spectral_density</span><span class="p">(</span><span class="n">omega</span> <span class="o">+</span> <span class="n">a</span> <span class="o">+</span> <span class="n">dx</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span> <span class="o">*</span> <span class="n">dx</span> <span class="o">/</span> <span class="n">np</span><span class="o">.</span><span class="n">pi</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">yl</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">yl</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">omega_min_correction</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="n">j</span><span class="o">*</span><span class="p">(</span><span class="n">a</span><span class="o">+</span><span class="n">dx</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span><span class="o">*</span><span class="bp">self</span><span class="o">.</span><span class="n">t</span><span class="p">)</span> <span class="c1">#self.t is from the parent class</span>
|
||||
|
||||
<span class="nd">@staticmethod</span>
|
||||
<div class="viewcode-block" id="StocProc_FFT.get_key"><a class="viewcode-back" href="../../StocProc_FFT.html#stocproc.stocproc.StocProc_FFT.get_key">[docs]</a> <span class="k">def</span> <span class="nf">get_key</span><span class="p">(</span><span class="n">t_max</span><span class="p">,</span> <span class="n">bcf_ref</span><span class="p">,</span> <span class="n">intgr_tol</span><span class="o">=</span><span class="mf">1e-2</span><span class="p">,</span> <span class="n">intpl_tol</span><span class="o">=</span><span class="mf">1e-2</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="StocProc_FFT.get_key"><a class="viewcode-back" href="../../StocProc_FFT.html#stocproc.stocproc.StocProc_FFT.get_key">[docs]</a> <span class="nd">@staticmethod</span>
|
||||
<span class="k">def</span> <span class="nf">get_key</span><span class="p">(</span><span class="n">t_max</span><span class="p">,</span> <span class="n">bcf_ref</span><span class="p">,</span> <span class="n">intgr_tol</span><span class="o">=</span><span class="mf">1e-2</span><span class="p">,</span> <span class="n">intpl_tol</span><span class="o">=</span><span class="mf">1e-2</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="n">bcf_ref</span><span class="p">,</span> <span class="n">t_max</span><span class="p">,</span> <span class="n">intgr_tol</span><span class="p">,</span> <span class="n">intpl_tol</span></div>
|
||||
|
||||
<span class="k">def</span> <span class="nf">__getstate__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
|
@ -597,8 +593,7 @@
|
|||
|
||||
<span class="sd"> and return values with :math:`t_l < t_\mathrm{max}`</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">z_fft</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">fft</span><span class="o">.</span><span class="n">fft</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">yl</span> <span class="o">*</span> <span class="n">y</span><span class="p">)</span>
|
||||
<span class="n">z</span> <span class="o">=</span> <span class="n">z_fft</span><span class="p">[</span><span class="mi">0</span><span class="p">:</span><span class="bp">self</span><span class="o">.</span><span class="n">num_grid_points</span><span class="p">]</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">omega_min_correction</span>
|
||||
<span class="n">z</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">fft</span><span class="o">.</span><span class="n">fft</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">yl</span> <span class="o">*</span> <span class="n">y</span><span class="p">)[</span><span class="mi">0</span><span class="p">:</span><span class="bp">self</span><span class="o">.</span><span class="n">num_grid_points</span><span class="p">]</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">omega_min_correction</span>
|
||||
<span class="k">return</span> <span class="n">z</span></div>
|
||||
|
||||
<div class="viewcode-block" id="StocProc_FFT.get_num_y"><a class="viewcode-back" href="../../StocProc_FFT.html#stocproc.stocproc.StocProc_FFT.get_num_y">[docs]</a> <span class="k">def</span> <span class="nf">get_num_y</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
|
|
|
@ -398,6 +398,13 @@ table.field-list td, table.field-list th {
|
|||
margin: 0;
|
||||
}
|
||||
|
||||
.field-name {
|
||||
-moz-hyphens: manual;
|
||||
-ms-hyphens: manual;
|
||||
-webkit-hyphens: manual;
|
||||
hyphens: manual;
|
||||
}
|
||||
|
||||
/* -- other body styles ----------------------------------------------------- */
|
||||
|
||||
ol.arabic {
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue