190 lines
7.9 KiB
HTML
190 lines
7.9 KiB
HTML
|
||
<!DOCTYPE html>
|
||
|
||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<title>function module — pylib 2019.5.19 documentation</title>
|
||
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
|
||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||
<script type="text/javascript" src="_static/language_data.js"></script>
|
||
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||
<link rel="index" title="Index" href="genindex.html" />
|
||
<link rel="search" title="Search" href="search.html" />
|
||
|
||
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||
|
||
</head><body>
|
||
|
||
|
||
<div class="document">
|
||
<div class="documentwrapper">
|
||
<div class="bodywrapper">
|
||
|
||
|
||
<div class="body" role="main">
|
||
|
||
<div class="section" id="module-function">
|
||
<span id="function-module"></span><h1>function module<a class="headerlink" href="#module-function" title="Permalink to this headline">¶</a></h1>
|
||
<p>Mathematical functions.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Date</dt>
|
||
<dd class="field-odd"><p>2019-10-27</p>
|
||
</dd>
|
||
</dl>
|
||
<span class="target" id="module-function"></span><dl class="function">
|
||
<dt id="function.cosine_wave">
|
||
<code class="sig-name descname">cosine_wave</code><span class="sig-paren">(</span><em class="sig-param">A=1</em>, <em class="sig-param">k=1</em>, <em class="sig-param">f=1</em>, <em class="sig-param">phi=0</em>, <em class="sig-param">D=0</em>, <em class="sig-param">degree=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/function.html#cosine_wave"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#function.cosine_wave" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>A cosine wave is said to be sinusoidal, because,
|
||
<span class="math notranslate nohighlight">\(\cos(x) = \sin(x + \pi/2)\)</span>, which is also a sine wave with a
|
||
phase-shift of π/2 radians. Because of this head start, it is often
|
||
said that the cosine function leads the sine function or the sine
|
||
lags the cosine.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>A</strong> (<em>float</em><em> or </em><em>int</em>) – amplitude</p></li>
|
||
<li><p><strong>k</strong> (<em>float</em><em> or </em><em>int</em>) – (angular) wave number</p></li>
|
||
<li><p><strong>f</strong> (<em>float</em><em> or </em><em>int</em>) – ordinary frequency</p></li>
|
||
<li><p><strong>phi</strong> (<em>float</em><em> or </em><em>int</em>) – phase</p></li>
|
||
<li><p><strong>D</strong> (<em>float</em><em> or </em><em>int</em>) – non-zero center amplitude</p></li>
|
||
<li><p><strong>degree</strong> – boolean to switch between radians and degree. If
|
||
False phi is interpreted in radians and if True then phi is
|
||
interpreted in degrees.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<div class="admonition seealso">
|
||
<p class="admonition-title">See also</p>
|
||
<p><code class="xref py py-meth docutils literal notranslate"><span class="pre">function_sine_wave_degree()</span></code></p>
|
||
</div>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="function.sine_wave">
|
||
<code class="sig-name descname">sine_wave</code><span class="sig-paren">(</span><em class="sig-param">A=1</em>, <em class="sig-param">k=1</em>, <em class="sig-param">f=1</em>, <em class="sig-param">phi=0</em>, <em class="sig-param">D=0</em>, <em class="sig-param">degree=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/function.html#sine_wave"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#function.sine_wave" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>A sine wave or sinusoid is a mathematical curve that describes a
|
||
smooth periodic oscillation.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>A</strong> (<em>float</em><em> or </em><em>int</em>) – amplitude</p></li>
|
||
<li><p><strong>k</strong> (<em>float</em><em> or </em><em>int</em>) – (angular) wave number</p></li>
|
||
<li><p><strong>f</strong> (<em>float</em><em> or </em><em>int</em>) – ordinary frequency</p></li>
|
||
<li><p><strong>phi</strong> (<em>float</em><em> or </em><em>int</em>) – phase</p></li>
|
||
<li><p><strong>D</strong> (<em>float</em><em> or </em><em>int</em>) – non-zero center amplitude</p></li>
|
||
<li><p><strong>degree</strong> – boolean to switch between radians and degree. If
|
||
False phi is interpreted in radians and if True then phi is
|
||
interpreted in degrees.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<p>In general, the function is:</p>
|
||
<div class="math notranslate nohighlight">
|
||
\[\begin{split}y(x,t) = A\sin(kx + 2\pi f t + \varphi) + D \\
|
||
y(x,t) = A\sin(kx + \omega t + \varphi) + D\end{split}\]</div>
|
||
<p>where:</p>
|
||
<blockquote>
|
||
<div><ul class="simple">
|
||
<li><p>A, amplitude, the peak deviation of the function from zero.</p></li>
|
||
<li><p>f, ordinary frequency, the number of oscillations (cycles) that
|
||
occur each second of time.</p></li>
|
||
<li><p>ω = 2πf, angular frequency, the rate of change of the function
|
||
argument in units of radians per second. If ω < 0 the wave is
|
||
moving to the right, if ω > 0 the wave is moving to the left.</p></li>
|
||
<li><p>φ, phase, specifies (in radians) where in its cycle the
|
||
oscillation is at t = 0.</p></li>
|
||
<li><p>x, spatial variable that represents the position on the
|
||
dimension on which the wave propagates.</p></li>
|
||
<li><p>k, characteristic parameter called wave number (or angular wave
|
||
number), which represents the proportionality between the
|
||
angular frequency ω and the linear speed (speed of propagation)
|
||
ν.</p></li>
|
||
<li><p>D, non-zero center amplitude.</p></li>
|
||
</ul>
|
||
</div></blockquote>
|
||
<p>The wavenumber is related to the angular frequency by:</p>
|
||
<div class="math notranslate nohighlight">
|
||
\[k={\omega \over v}={2\pi f \over v}={2\pi \over \lambda }\]</div>
|
||
<p>where λ (lambda) is the wavelength, f is the frequency, and v is the
|
||
linear speed.</p>
|
||
<div class="admonition seealso">
|
||
<p class="admonition-title">See also</p>
|
||
<p><code class="xref py py-meth docutils literal notranslate"><span class="pre">function_cosine_wave_degree()</span></code></p>
|
||
</div>
|
||
</dd></dl>
|
||
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||
<div class="sphinxsidebarwrapper">
|
||
<h1 class="logo"><a href="index.html">pylib</a></h1>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<h3>Navigation</h3>
|
||
|
||
<div class="relations">
|
||
<h3>Related Topics</h3>
|
||
<ul>
|
||
<li><a href="index.html">Documentation overview</a><ul>
|
||
</ul></li>
|
||
</ul>
|
||
</div>
|
||
<div id="searchbox" style="display: none" role="search">
|
||
<h3 id="searchlabel">Quick search</h3>
|
||
<div class="searchformwrapper">
|
||
<form class="search" action="search.html" method="get">
|
||
<input type="text" name="q" aria-labelledby="searchlabel" />
|
||
<input type="submit" value="Go" />
|
||
</form>
|
||
</div>
|
||
</div>
|
||
<script type="text/javascript">$('#searchbox').show(0);</script>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="clearer"></div>
|
||
</div>
|
||
<div class="footer">
|
||
©2019, Daniel Weschke.
|
||
|
||
|
|
||
Powered by <a href="http://sphinx-doc.org/">Sphinx 2.2.0</a>
|
||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
||
|
||
|
|
||
<a href="_sources/function.rst.txt"
|
||
rel="nofollow">Page source</a>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
</body>
|
||
</html> |