function module¶
Mathematical functions.
- Date
2019-10-27
-
cosine_wave(A=1, k=1, f=1, phi=0, D=0, degree=False)[source]¶ A cosine wave is said to be sinusoidal, because, \(\cos(x) = \sin(x + \pi/2)\), 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.
- Parameters
A (float or int) – amplitude
k (float or int) – (angular) wave number
f (float or int) – ordinary frequency
phi (float or int) – phase
D (float or int) – non-zero center amplitude
degree – boolean to switch between radians and degree. If False phi is interpreted in radians and if True then phi is interpreted in degrees.
See also
function_sine_wave_degree()
-
sine_wave(A=1, k=1, f=1, phi=0, D=0, degree=False)[source]¶ A sine wave or sinusoid is a mathematical curve that describes a smooth periodic oscillation.
- Parameters
A (float or int) – amplitude
k (float or int) – (angular) wave number
f (float or int) – ordinary frequency
phi (float or int) – phase
D (float or int) – non-zero center amplitude
degree – boolean to switch between radians and degree. If False phi is interpreted in radians and if True then phi is interpreted in degrees.
In general, the function is:
\[\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}\]where:
A, amplitude, the peak deviation of the function from zero.
f, ordinary frequency, the number of oscillations (cycles) that occur each second of time.
ω = 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.
φ, phase, specifies (in radians) where in its cycle the oscillation is at t = 0.
x, spatial variable that represents the position on the dimension on which the wave propagates.
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) ν.
D, non-zero center amplitude.
The wavenumber is related to the angular frequency by:
\[k={\omega \over v}={2\pi f \over v}={2\pi \over \lambda }\]where λ (lambda) is the wavelength, f is the frequency, and v is the linear speed.
See also
function_cosine_wave_degree()