2019년 3월 26일 화요일

Solution of Laplace Equation for Spherical Coordinate

Latex to HTML 변환기를 통해 자동변환된 코드. Reference 및 몇몇 부분에 오류가 있어 수정 필요.

Laplace Equation in Spherical Coordinates

Laplace Equation in spherical coordinates \((r, \theta, \phi)\) becomes

\[\begin{aligned} \nabla^2 V = \frac{1}{r^2}\frac{\partial}{\partial r}\Big( r^2 \frac{\partial V}{\partial r}\Big) + \frac{1}{r^2 \sin\theta}\frac{\partial}{\partial \theta} \Big( \sin\theta \frac{\partial V}{\partial \theta}\Big) + \frac{1}{r^2 \sin^2 \theta}\frac{\partial^2 V}{\partial \phi^2}=0\end{aligned}\]

\[\begin{aligned} \nabla^2 V = \frac{1}{r}\frac{\partial^2}{\partial r^2}\Big(r V\Big) + \frac{1}{r^2 \sin\theta}\frac{\partial}{\partial \theta}\Big(\sin\theta \frac{\partial V}{\partial \theta}\Big) + \frac{1}{r^2 \sin^2\theta}\frac{\partial V}{\partial \phi^2}=0\end{aligned}\]

Step 1: Separation of variables assumption

Assume a product form for the potential \(V\).

\[\begin{aligned} \boxed{V = \frac{R(r)}{r}\Theta(\theta)\Phi(\theta)}\end{aligned}\]

Here, we put \(\frac{R(r)}{r}\) for easy calculation. Then the result equation becomes

\[\begin{aligned} \frac{\Phi \Theta}{r}\frac{d^2}{d r^2}R(r)+\frac{R\Phi}{r^3 \sin\theta}\frac{d}{d \theta}\Big(\sin\theta \frac{d \Theta(\theta)}{d \theta}\Big)+\frac{R\Theta}{r^3\sin^2\theta}\frac{d \Phi(\phi)}{d \phi^2}=0 \label{eq:1} \end{aligned}\]

Step 2: Find the separated equations

If we multiply \(\frac{1}{R \Theta\Phi}\) to \(Eq.\eqref{eq:1}\).

\[\begin{aligned} \frac{1}{rR}\frac{d^2}{dr^2}R(r)+\frac{1}{r^3\sin{\theta}}\frac{1}{\Theta }\frac{d}{d\theta}\Big(\sin\theta \frac{d\Theta(\theta)}{d\theta}\Big)+\frac{1}{r^3\sin^2\theta}\frac{1}{\Phi}\frac{d\Phi(\phi)}{d\phi^2} =0\end{aligned}\]

Nothing separates until we multiply \(r^3\sin^2\theta\).

\[\begin{aligned} \frac{r^2 \sin^2\theta}{R}\frac{d^2}{dr^2}R(r) + \frac{\sin\theta}{\Theta}\frac{d}{d\theta}\Big(\sin\theta \frac{d\Theta(\theta)}{d\theta}\Big) + \frac{1}{\Phi}\frac{d\Phi(\phi)}{d\phi^2} =0\end{aligned}\]

Now, \(\Phi\) term has completely separated. If we take partial derivative with respect to \(\phi\)

\[\begin{aligned} \frac{\partial}{\partial \phi}\Big(\frac{1}{\Phi}\frac{d^2 \Phi}{d\phi^2}\Big) =0\end{aligned}\]

since the first two terms depend only on \(r\) and \(\theta\). Therefor

\[\begin{aligned} \frac{1}{\Phi}\frac{d^2 \Phi}{d\phi^2} = -m^2\end{aligned}\]

The equation for \(\Phi\) is then,

\[\begin{aligned} \boxed{\frac{d^2\Phi}{d\phi^2}+m^2 \Phi=0} \label{eq:sv1}\end{aligned}\]

The remainder of the Laplace equation is

\[\begin{aligned} \frac{r^2 R^{\prime\prime}}{R}+\frac{1}{\Theta \sin\theta}\frac{d}{d\theta}\Big(\sin{\theta}\frac{d\Theta}{d\theta}\Big) -\frac{m^2}{\sin^2\theta}=0\end{aligned}\]

Now, we can separate the functions between \(r\) and \(\theta\). Let us define each term as \(\alpha\).

\[\begin{aligned} {\frac{r^2 R^{\prime\prime}}{R}=\alpha} \label{eq:sv_2}\\ {\frac{1}{\Theta \sin\theta}\frac{d}{d\theta}\Big(\sin{\theta}\frac{d\Theta}{d\theta}\Big)-\frac{m^2}{\sin^2\theta}=-\alpha } \label{eq:sv_3}\end{aligned}\]

Step 3:Solving the equations for each variables

Eq.[eq:sv1] for \(\Phi\)

\[\begin{aligned} \sin^2\theta \{\frac{r^2 R\prime\prime}{R} + \frac{1}{\Theta \sin\theta}\frac{d}{d\theta}(\sin\theta\frac{d\Theta}{d\theta}) \}=-\frac{\Phi\prime\prime}{\Phi}= m^2\end{aligned}\]

We let \(m^2\) to be positive because we want periodic answer for \(Q\). Hence

\[\begin{aligned} \Phi \propto e^{\pm im\phi}\end{aligned}\]

Eq.[eq:sv_2] for R

\[\begin{aligned} r^2 R^{\prime\prime}-\alpha R = 0\end{aligned}\]

Notice that re-scaling \(r\) leaves this equation unchanged. This is a clue that powers of \(r\) may work. Substituting a power-law solution, \(\frac{R(r)}{r}=r^{l}\); (notice that in the beginning, we divide extra \(r\) for convenience).

\[\begin{aligned} r^2 (r^{(l+1) \prime\prime})-\alpha r^{l+1}&=0 \\ (l(l+1)-\alpha)r^{l+1} &= 0\\ \alpha &= l(l+1)\end{aligned}\]

with \(a=l(l+1)\), we have a solution for every number \(l\).Since it is a quadratic equation, there are two values of \(l\).

\[\begin{aligned} l^2 + l - \alpha =0\end{aligned}\]

Let \(l\) have some value \(x\), so that \(\alpha = x(x+1)\). Then, the value \(l=-(x+1)\) gives the same \(\alpha\).

\[\begin{aligned} \alpha = (-(x+1))(-(x+1)+1)=x(x+1)\end{aligned}\]

with \(\alpha = l(l+1)\), we now have to solve for \(\Theta\).

\[\begin{aligned} \frac{1}{\sin\theta}\frac{d}{d\theta}\Big( \sin\theta \frac{d\Theta}{d\theta}\Big) + \Big( l(l+1) - \frac{m^2}{\sin^2\theta}\Big)\Theta = 0 \label{eq:theta_1}\end{aligned}\]

  • Legendre polynomials: The solution to the \(\theta\) equation with \(m=0\).

  • associated Legendre polynomials: Solutions with general \(m\).

Eq.[eq:sv_3] for \(\Theta\)

Legendre polynomials, \(m=0\)
Now \(\sin\theta d\theta = d\cos\theta\). Hence, define \(x=\cos\theta\). Then,

\[\begin{aligned} \frac{d}{d\theta}&=\frac{dx}{d\theta}\frac{d}{dx}\\ &=-\sin\theta \frac{d}{dx}\\ \frac{d}{dx}&=-\frac{1}{\sin\theta}\frac{d}{d\theta}\end{aligned}\]

When we substitute this to Eq.[eq:theta_1] with \(m=0\),

\[\begin{aligned} \frac{d}{dx}\Big((1-x^2)\frac{d\Theta}{dx}\Big) + l(l+1)\Theta = 0\end{aligned}\]

Notice that \(\sin^2\theta=1-\cos^2\theta=1-x^2\). The solutions are polynomials, \(P_l(x)=P_l(\cos\theta)\)

Legendre Polynomial

Let us consider azimuthally symmetric case, meaning \(m=0\).

\[\begin{aligned} \frac{d}{dx}[(1-x^2)\frac{dP}{dx}]+[l(l+1)]P=0\end{aligned}\]

This equation is called Legendre Equation. The range of \(x\) is \(-1 \leq x \leq 1\) because the range of \(\cos\theta\) is \(0 \leq \cos\theta \leq \pi\)

\[\begin{aligned} \sum_{j=0}^{\infty} & \{[(a+j)(a+j-1)]a_j x^{\alpha+j-2} \nonumber \\ & -[(a+j)(a+j+1)+2(a+j)-l(l+1)]a_jx^{\alpha+j}\}\end{aligned}\]

\[\begin{aligned} l=0 P_0(x)&=1 \nonumber \\ l=1 P_1(x)&=x \nonumber \\ l=2 P_2(x)&=\frac{1}{2}(3x^2-1) \nonumber \\ l=3 P_3(x)&=\frac{1}{2}(5x^3-3x) \nonumber \\ l=4 P_4(x)&=\frac{1}{8}(35x^4-30x^2+3) \end{aligned}\]

\(\rightarrow\) \(P_1\) is an even function for even \(l\), and odd for odd \(l\).

\(\rightarrow\) Legendre polynomials can be represented by Rodrigues’ formula

\[\begin{aligned} P_l(x)=\frac{1}{2^{l}l!}\frac{d^l}{dx^l}(x^2-1)^l\end{aligned}\]

Example

\[\begin{aligned} P_2(x)&=\frac{1}{2^2 2!}\frac{d^2}{dx^2}(x^2-1)^2 \nonumber \\ &=\frac{1}{8} \frac{d^2}{dx^2}(x^4-2x^2+1) \nonumber \\ &=\frac{1}{8}(12x^2-4)=\frac{3x^2-1}{2} \nonumber\end{aligned}\]

\(\rightarrow\) \(P_l\) is orthogonal

\[\begin{aligned} \int_{-1}^{1} P_l(x) P_{l\prime}(x)dx =\frac{2}{2l+1}\delta_{ll\prime}\end{aligned}\]

This means that any function defined for \([-1,1]\) can be represented by expansion by \(P_i\)

\[\begin{aligned} f(x) = \sum_{l=0}^{\infty}A_l P_l(x), \quad \quad A_l=\frac{2l+1}{2}\int_{-1}^{1}f(x)P_l(x)dx\end{aligned}\]

Step 4:Putting all together.

For general \(m\), the full solution is

\[\boxed{V(r,\theta,\phi) = \sum_{l=0}^{\infty} \sum_{m=-l}^{l} \Big( A_{lm}r^l + \frac{B_{lm}}{r^{l+1}} \Big) P_{l}^{m}( \cos \theta) e^{i m \phi}}\]

2019년 3월 20일 수요일

상대론적 그리고 비상대론적 운동에너지 (KE 비교 그래프)


질문


전자의 상대론적, 그리고 비상대론적 운동에너지를 수식으로 표현하고 속도에 대한 그래프로 나타내어 설명해보라.

정답



Github

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import math
= 9.11e-31
= np.arange(0,3e+8,5000000)
=  0.5*m*(v**2)
K_r = m*c*c*(1/(np.sqrt(1-(v**2)/(c**2))) - 1)
plt.plot(v,K, 'r',label='non-relativistic KE')
plt.plot(v,K_r,'b', label='relativistic KE')
plt.title('KE for relativistic and non relativistic case')
plt.xlabel('Velocity')
plt.ylabel('Kinetic Energy')
plt.legend(loc='upper left')
plt.show()
cs



2019년 3월 18일 월요일

20190319 핵력의 존재 유무를 유추하기

Question
$^{56}Fe$ 핵의 반지름은 $R = R_0 A^{\frac{1}{3}} = 1.2 \times 10^{-15}[m] \times 56^{\frac{1}{3}} \simeq 4.6 \times 10^{-15}[m] $ 이다. 핵의 반지름 길이만큼 떨어진 두 양성자의 정전기력의 크기는 얼마인가?

Answer
\begin{align} \vec{F} &= \frac{1}{4 \pi \epsilon_0}\frac{q_1 q_2}{r^2}\hat{r}\\ &=\frac{1}{4 \pi 8.85\times 10^-12 [\frac{C^2}{N m^2}]}\frac{(1.6\times 10^-10 [C])^2}{(4.6\times 10^{-15}[m])^2}\\ &=11[N] \end{align}



설명
$F=ma$라는 수식을 생각해볼때, 양성자의 질량은 $m_p=1.67 \times 10^{-27}$으로 매우 작아, 이러한 미시적인 물체에게는 매우 큰 힘이다. 그렇지만 우리는 핵이 깨지지 않고 존재함을 알고 있다. (러더퍼드의 산란 실험) 그럼으로 핵안에는 이 정전기력의 척력의 극복하고 모아주는 또 다른 힘이 존재함을 예측할 수 있다.

2018년 10월 10일 수요일

[EPICs]Experimental Physics and Industrial Control System / Python / PAL-XFEL / 연습 로그 2번째

[EPICs]Experimental Physics and  Industrial Control System

EPICs 파일 만들기




[일크무크]오류 수정 및 업데이트

[일크무크 오류 수정 및 업데이트



I looked in the spam and tried to register with UNIST email,
still didn’t receive any activation email. 


gmail과 UNIST 계정에서 이메일으 도착함을 확인하였다.
지난주 SMTP서버 관련 파일중 로그인 이메일과 암호가 잘못 세팅되었음을 확인하여
이를 수정한 후 계속해서 activation e-mail 혹은 암호 찾기 등의
로그인 계정에 대한 문제들을 찾고있다.





20181011일 기준 서버가 여전히 한번씩 다운된다.
이것은 서버 자체의 문제가 아니라
현재 서버를 열어둔 상태에서 몇가지 테스르를 진행하고 있어서 그렇다.

[EPICs]Experimental Physics and Industrial Control System / Python / PAL-XFEL / 연습 로그

[EPICs]Experimental Physics and  Industrial Control System

Python을 다운받아 파일을 만들고 실행시키기


작업환경: Widows 10


1. Python 다운 파일: python-3.5.4-amd64.exe


2. Window 키를누른후 IDLE 검색 및 실행

Python Shell이 실행되면 설치 완료





3. Pyepics 다운 파일: pyepics-3.2.5.win32-py3.5.exe

파일을 실행하니 python 3.5를 요구해서
파이썬 3.5를 다운받았다.






Shell 안에서 코딩을 작성할 수 있지만
수정이 불가능하다.



그래서 우리는 파일을 작성하는데
Ctrl + N 혹은 File -> New File을 눌러 코딩을 할 수 있다.

완성된 파일을 실행하고자 하면
Run -> Run Module을 누르면 된다.
혹은 시작위치를 바꾼 후
Python shell에서 아래 명령어를 통해 파일을 실행

1
exec(open("epicex.py").read())
cs

참고로 저는 바탕화면에
Python_Script라는 폴더를 만들고
epicex.py라는 파일을 만들었습니다.





참고자료