LoginSignup
12
16

More than 5 years have passed since last update.

[Pythonによる科学・技術計算] 波の"うなり"と群速度,波の重ね合わせ,可視化,高校物理

Last updated at Posted at 2017-08-29

はじめに

普段何気なく耳に入ってくる音の強弱が周期的に変動することがある。この現象は"うなり(beat)"と呼ばれている。

この現象の起源は,1次元の波を例にとると,
波数$k$と角振動数$\omega$が少し違う,同じ向きに進む二つの正弦波の重ね合わされた結果,波の強さ(振幅)がゆっくり周期的に変動することにある。

分散性がある媒質中では,波の角振動数$\omega$は$k$の関数となり,波動を特徴付ける物理量として群速度$v_g = \frac{\partial \omega(k)}{\partial k}$を考えることが重要となる。これは,一様媒質中を伝わる通常の波の速度である位相速度$v_p = \frac{\omega}{k}$とは区別される。

うなり現象は高校物理で学ぶが,時間変動する波の様子を学生自らが想像しなければならず,現象をなかなか把握しにくいかもしれない。そこで本稿ではうなり現象の理解を助けることを目的としてmatplotlibのanimationメソッドを利用してアニメーションの作成を行う。

結果に示したアニメーションをボーッと眺めているだけでもうなり現象と群速度についての理解が深まると思う。


内容

(1) 分散性が無い場合のうなり現象。このとき波の位相速度と群速度は一致する。

(2) 分散性がある場合のうなり現象。群速度は位相速度と一致しない。

(3) 上記(1)と(2)作成したアニメーションを併せる。


コード(1): 分散性が無い場合


"""
うなり現象: 分散性なし

"""

%matplotlib nbagg 
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation


fig = plt.figure(figsize = (8, 6))

L, t_max = 6,12
Nx= 240
Nt = 100

delta_x=L/Nx
delta_t=t_max/Nt
xx=list(range(Nx))

a=1
k1= 2*np.pi/(L/10)
omega1=10
phi1=0

k2= (1+0.15)*k1
omega2=(1+0.15)*omega1
phi2=0

u1=np.zeros([Nx,Nt])
u2=np.zeros([Nx,Nt])
utot=np.zeros([Nx,Nt])


xlis=np.zeros([Nx])

for i in range(Nx):
    x = i*delta_x
    xlis[i] = x
    for j in range(Nt):
        t = j*delta_t
        u1[i,j]=a*np.cos(k1*x-omega1*t-phi1)
        u2[i,j]=a*np.cos(k2*x-omega2*t-phi2)
        utot[i,j]= u1[i,j]+u2[i,j]


def update(j,utot,fig_title):
    if j != 0:
        plt.cla()
    plt.ylim(-3, 3)
    plt.xlim(0, L)
    plt.plot( xlis,u1[:,j],  '--', color='red', linewidth = 1)
    plt.plot( xlis,u2[:,j],  '--', color='blue',linewidth = 1)
    plt.plot( xlis,utot[:,j],  '-', color='purple', linewidth =4)

    plt.title(fig_title  + str("{0:.1f}".format(j*delta_t)))

    plt.xlabel('X')
    plt.ylabel('U')
    plt.legend(['u1','u2', 'u1+u2'], loc='upper right')


ani = animation.FuncAnimation(fig,update,fargs = (utot,'Beat: t ='), interval =1, frames = Nt,blit=False)
fig.show()

ani.save("output.gif", writer="imagemagick")


結果(1)分散性なし

output.gif

うなり現象(合成波の振幅が周期的に変動する現象)がみえている。
このときは位相速度と群速度が一致している。

コード(2): 分散性あり

不均質な波,つまり分散性のある波を重ね合わせるとどうなるか調べる。

"""
分散関係 ω=f(k)がある場合
"""

%matplotlib nbagg 
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation

fig = plt.figure(figsize = (8, 6))


L, t_max = 6,12
Nx= 240
Nt = 100

delta_x=L/Nx
delta_t=t_max/Nt
xx=list(range(Nx))
#X,T = np.meshgrid(x,t)

omega=10
omega0=30

a=1
k1= 2*np.pi/(L/10)

V0= omega/k1

omega1=np.sqrt((V0*k1)**2+omega0**2)
phi1=0

k2= (1+0.15)*k1
omega2=np.sqrt((V0*k2)**2+omega0**2)
phi2=0

u1=np.zeros([Nx,Nt])
u2=np.zeros([Nx,Nt])
utot=np.zeros([Nx,Nt])


xlis=np.zeros([Nx])
for i in range(Nx):
    x = i*delta_x
    xlis[i] = x
    for j in range(Nt):
        t = j*delta_t
        u1[i,j]=a*np.cos(k1*x-omega1*t-phi1)
        u2[i,j]=a*np.cos(k2*x-omega2*t-phi2)
        utot[i,j]= u1[i,j]+u2[i,j]



def update(j,utot,fig_title):
    if j != 0:
        plt.cla()
    plt.ylim(-3, 3)
    plt.xlim(0, L)
    plt.plot( xlis,u1[:,j],  '--', color='red', linewidth = 1)
    plt.plot( xlis,u2[:,j],  '--', color='blue',linewidth = 1)
    plt.plot( xlis,utot[:,j],  '-', color='green', linewidth =4)

    plt.title(fig_title  + str("{0:.1f}".format(j*delta_t)))

    plt.xlabel('X')
    plt.ylabel('U')
    plt.legend(['u1','u2', 'u1+u2'], loc='upper right')


ani = animation.FuncAnimation(fig,update,fargs = (utot,'Beat: t ='), interval =1, frames = Nt,blit=False)
fig.show()

ani.save("output2.gif", writer="imagemagick")


結果(2) 分散性あり

output2.gif

この場合,群速度(包絡線("うなり波形")の動く速度)と 位相速度(波そのものの動く速度)との間に違いが生じている。"うなりの波形"は群速度で移動し,波そのものは位相速度で動く。


結果(3): 分散性あり・なしのアニメーション: 比較

output3.gif

分散性あり(緑線)と分散性なし(紫線)との運動の違いは明かである。


補遺

(1) 本稿で用いた分散関係について

一次元の弦の波動方程式,
$\frac{\partial^2 u(x,t)}{\partial t^2} = v^2 \frac{\partial^2 u(x,t)}{\partial x^2} \tag{1} $
に,弦の構成粒子がそれぞれの位置におさえられる復元力$-\omega_0^2 u(x,t) \tag{2}$が加わると,波動方程式は

$\frac{\partial^2 u(x,t)}{\partial t^2} = v^2 \frac{\partial^2 u(x,t)}{\partial x^2} -\omega_0^2 u(x,t) \tag{3}$
となる。実際の物質に生じる振動にもこれと類似の方程式にしたがうものがある(原子内電子の振動など)。

この波動方程式の解は,

$\omega(k)=(v^2k^2+\omega_0^2)^\frac{1}{2} \tag{4}$として

$u(x,t) = a cos(k x-\omega(k)t-\phi \tag{5}$

となることが分かる。本稿の内容(2)では上の分散関係(式.4)を用いた。

(2) 種々の媒質においてさまざまな分散関係が知られている。
一例を挙げる。

  • 深い水の水面を伝わる波の分散式: $\omega(k)=\sqrt(g k + T k^3/\rho)\tag{6}$ (gは重力加速度,Tは表面張力, $\rho$は密度。

  • 最近接相互作用のみを考慮した2原子系(それぞれのイオン質量は$m_1$と$m_2$)の格子振動の分散関係:
    $\omega^2(k)= \frac{f}{m_\mu} \left ( 1 \pm \sqrt{1-\frac{4m_\mu^{\, 2}}{m_1m_2} \sin^2{ka} } \right ),
    \quad \frac{1}{m_\mu}=\frac{1}{m_1} + \frac{1}{m_2}\tag{7}$


参考文献

[1] アニメーション作成については,AnchorBlues様のQiita記事: matplotlibのanimation.FuncAnimationを用いて柔軟にアニメーション作成が分かりやすく参考になった。

[2]群速度については,たとえば, 長岡洋介著「振動と波」に初等的で分かりやすい解説がある。

12
16
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
16