Waves

This module has all the classes and functions related to waves in optics.

Contains

  • TWave

class sympy.physics.optics.waves.TWave(*args)[source]

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 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

or they are not consistent.

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*meter/(second*n)
>>> w3.angular_velocity
2*pi*f

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.

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 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
property frequency

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
property phase

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
property speed

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*meter/(second*n)
property time_period

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
property wavelength

Returns wavelength of the wave. 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 wavenumber 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.wavenumber
pi*second*f*n/(149896229*meter)