Waves¶
This module has all the classes and functions related to waves in optics.
Contains
TWave
- class sympy.physics.optics.waves.TWave(
- amplitude,
- frequency=None,
- phase=0,
- time_period=None,
- n=n,
This is a simple transverse sine wave travelling in a one-dimensional space. Basic properties are required at the time of creation of the object, but they can be changed later with respective methods provided.
- Raises:
ValueError : When neither frequency nor time period is provided
or they are not consistent.
TypeError : When anything other than TWave objects is added.
Explanation
It is represented as \(A \times cos(k*x - \omega \times t + \phi )\), where \(A\) is the amplitude, \(\omega\) is the angular frequency, \(k\) is the wavenumber (spatial frequency), \(x\) is a spatial variable to represent the position on the dimension on which the wave propagates, and \(\phi\) is the phase angle of the wave.
Arguments
- amplitudeSympifyable
Amplitude of the wave.
- frequencySympifyable
Frequency of the wave.
- phaseSympifyable
Phase angle of the wave.
- time_periodSympifyable
Time period of the wave.
- nSympifyable
Refractive index of the medium.
Examples
>>> from sympy import symbols >>> from sympy.physics.optics import TWave >>> A1, phi1, A2, phi2, f = symbols('A1, phi1, A2, phi2, f') >>> w1 = TWave(A1, f, phi1) >>> w2 = TWave(A2, f, phi2) >>> w3 = w1 + w2 # Superposition of two waves >>> w3 TWave(sqrt(A1**2 + 2*A1*A2*cos(phi1 - phi2) + A2**2), f, atan2(A1*sin(phi1) + A2*sin(phi2), A1*cos(phi1) + A2*cos(phi2)), 1/f, n) >>> w3.amplitude sqrt(A1**2 + 2*A1*A2*cos(phi1 - phi2) + A2**2) >>> w3.phase atan2(A1*sin(phi1) + A2*sin(phi2), A1*cos(phi1) + A2*cos(phi2)) >>> w3.speed 299792458*meter/(second*n) >>> w3.angular_velocity 2*pi*f
- property amplitude¶
Returns the amplitude of the wave.
Examples
>>> from sympy import symbols >>> from sympy.physics.optics import TWave >>> A, phi, f = symbols('A, phi, f') >>> w = TWave(A, f, phi) >>> w.amplitude A
- property angular_velocity¶
Returns the angular velocity of the wave, in radians per second.
Examples
>>> from sympy import symbols >>> from sympy.physics.optics import TWave >>> A, phi, f = symbols('A, phi, f') >>> w = TWave(A, f, phi) >>> w.angular_velocity 2*pi*f
- property frequency¶
Returns the frequency of the wave, in cycles per second.
Examples
>>> from sympy import symbols >>> from sympy.physics.optics import TWave >>> A, phi, f = symbols('A, phi, f') >>> w = TWave(A, f, phi) >>> w.frequency f
- property n¶
Returns the refractive index of the medium
- property phase¶
Returns the phase angle of the wave, in radians.
Examples
>>> from sympy import symbols >>> from sympy.physics.optics import TWave >>> A, phi, f = symbols('A, phi, f') >>> w = TWave(A, f, phi) >>> w.phase phi
- property speed¶
Returns the propagation speed of the wave, in meters per second. It is dependent on the propagation medium.
Examples
>>> from sympy import symbols >>> from sympy.physics.optics import TWave >>> A, phi, f = symbols('A, phi, f') >>> w = TWave(A, f, phi) >>> w.speed 299792458*meter/(second*n)
- property time_period¶
Returns the temporal period of the wave, in seconds per cycle.
Examples
>>> from sympy import symbols >>> from sympy.physics.optics import TWave >>> A, phi, f = symbols('A, phi, f') >>> w = TWave(A, f, phi) >>> w.time_period 1/f
- property wavelength¶
Returns the wavelength (spatial period) of the wave, in meters per cycle. It depends on the medium of the wave.
Examples
>>> from sympy import symbols >>> from sympy.physics.optics import TWave >>> A, phi, f = symbols('A, phi, f') >>> w = TWave(A, f, phi) >>> w.wavelength 299792458*meter/(second*f*n)
- property wavenumber¶
Returns the wavenumber of the wave, in radians per meter.
Examples
>>> from sympy import symbols >>> from sympy.physics.optics import TWave >>> A, phi, f = symbols('A, phi, f') >>> w = TWave(A, f, phi) >>> w.wavenumber pi*second*f*n/(149896229*meter)