波浪#

该模块具有光学中与波有关的所有类和函数。

Contains

  • TWave

class sympy.physics.optics.waves.TWave(amplitude, frequency=None, phase=0, time_period=None, n=n)[源代码]#

这是在一维空间中传播的简单的横向正弦波。基本属性在创建对象时是必需的,但是它们可以在以后通过提供相应的方法进行更改。

加薪:

ValueError :既没有提供频率也没有提供时间段

或者它们不一致。

TypeError :当添加除TWave对象以外的任何对象时。

解释

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.

争论

振幅值得同情的

波的振幅。

频率值得同情的

波的频率。

阶段值得同情的

波的相位角。

time_period值得同情的

波的时间周期。

N号值得同情的

介质的折射率。

实例

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

返回波的振幅。

实例

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

返回波的角速度,以弧度/秒为单位。

实例

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

返回波的频率,以周期/秒为单位。

实例

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

返回波的相位角,以弧度为单位。

实例

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

返回波的传播速度,以米/秒为单位。它取决于传播介质。

实例

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

返回波的时间周期,以每周期秒为单位。

实例

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

返回波的波长(空间周期),单位为米/周期。这取决于波的介质。

实例

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

返回波的波数,以弧度/米为单位。

实例

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