This module has all the classes and functions related to waves in optics.
Contains
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.
It has been represented as \(A \times cos(k*x - \omega \times t + \phi )\) where \(A\) is amplitude, \(\omega\) is angular velocity, \(k`is wavenumber, :math:`x\) is a spatial variable to represent the position on the dimension on which the wave propagates and \(\phi\) is phase angle of the wave.
Raises : | ValueError : When neither frequency nor time period is provided
TypeError : When anyting other than TWave objects is added. |
---|
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*cos(phi1) + A2*cos(phi2), A1*sin(phi1) + A2*sin(phi2)))
>>> w3.amplitude
sqrt(A1**2 + 2*A1*A2*cos(phi1 - phi2) + A2**2)
>>> w3.phase
atan2(A1*cos(phi1) + A2*cos(phi2), A1*sin(phi1) + A2*sin(phi2))
>>> w3.speed
299792458*m/(n*s)
>>> w3.angular_velocity
2*pi*f
Arguments
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
Returns angular velocity 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.angular_velocity
2*pi*f
Returns the frequency 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.frequency
f
Returns the phase angle 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.phase
phi
Returns the speed of travelling wave. It is medium dependent.
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*m/(n*s)
Returns the time period 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.time_period
1/f