\documentclass[12pt, a4]{ctexart}

\input{setting.tex}

\begin{document}
\pagestyle{heading}
\begin{center}
    \bf 本数据处理中 $N$ 均为计数率 $N/t$，与原始数据记录 $N$ 不同！！！
\end{center}
\section{计算 $\alpha$ 粒子束的强度与能量 $E$}
% 记实验环境压强为 $P$，$120\; \mathrm{s}$ 中打在探测器上的粒子数为 $N$.
\begin{figure}[h]
    \centering
    \includegraphics[scale = 0.6]{pn.png}
    \caption{$P-N$ 曲线.}
\end{figure}
其中拟合曲线：
\begin{align}
        N = -36.0841 P + 1703.
        \label{1}
\end{align}
线性相关程度 $R^2= 0.9991$. 由此可知 $N_0 = 1703$.

\subsection{ $\alpha$ 粒子射程计算}
当计数 $N = \dfrac{N_0}{2} = 851$ 时的粒子运动距离即为射程：
\[
    R' = l_2 = 7.25\;\mathrm{cm}.
\]
对应的压强可以通过公式 \ref{1} 算出，结果为：
\[
    P' = 23.583\;\mathrm{kPa}.
\]
同截面情况下我们有 $\dfrac{R_1}{R_2} = \dfrac{\rho_2}{\rho_1}$，且考虑空气密度公式：
\[
    \rho = 1.293 \times \dfrac{P}{1.325} \times \dfrac{273}{T}.
\]
可以算出温度相同时 $\dfrac{R_1}{R_2} = \dfrac{P_2}{P_1}$，因此我们将 $P' = 23.583 \;\mathrm{kPa}$ 下的射程换算到 $P = 101.235\;\mathrm{kPa}$ 下得到：
\[
    R = 1.69\;\mathrm{cm}.
\]

\subsection{$\alpha$ 粒子能量计算}
考虑公式：
\[
    R = (0.285+ 0.005 E)E^{1.5}.
\]
为超越方程（其中 $R$ 单位为 cm，$E$ 单位为 MeV）. 我们可以考虑利用 Newton 迭代法或弦截法 (Secant Method) 来求解非线性超越方程的根：
\[
    f(x) = (0.285+0.005x)x^{1.5} - 1.69.
\]
代码及结果见附录，最终计算结果为：
\[
    E = 3.16\;\mathrm{MeV}.
\]

\newpage
\section{验证 $N\propto \sin ^{-4}\dfrac{\theta}{2}$ 关系}
\begin{figure}[h]
    \centering
    \includegraphics[scale = 0.6]{thetan.png}
    \caption{$N - \sin^{-4}\dfrac{\theta}{2}$ 曲线.}
\end{figure}
其中拟合曲线：
\begin{align}
    N = 0.0009\sin^{-4}\dfrac{\theta}{2} + 0.5855.
    \label{2}
\end{align}
线性相关程度 $R^2= 0.9905$.

计算 $K = N \sin^4 \dfrac{\theta}{2}$ 理论值：
\begin{align*}
        K_{\rm theoretical} &= 4.8065\times 10^{-34}\dfrac{N_0}{E^2l_1^2} \\
        & = 4.8065\times 10^{-34}\dfrac{1703}{(3.16\times 10^{6}\times 1.6 \times 10^{-19})^2 \times 0.0417^2}\\
        & = 0.0018
\end{align*}
其中 $120$ 是测量 $N_0$ 时所用时间.


\newpage
\section{$K$ 值的实验与理论对比}
\begin{figure}[h]
    \centering
    \includegraphics[scale = 0.6]{k.png}
    \caption{$K - \theta$ 曲线.}
\end{figure}
相比于理论计算 $0.0018$ 误差为 $\dfrac{0.0018-0.0011}{0.0018} = 38.9\%$ .

\newpage
\appendix
\section*{Newton 法与弦截法解非线性方程组}
代码：
\begin{center}
	\begin{lstlisting}
def Newton(f, df, x0, epsilon ,MAXSTEP = 1000):
    iterate = [x0]
    for _ in (range(MAXSTEP+1)):
        if df(x0) != 0:
            x1 = x0 - f(x0)/df(x0)
        else:
            raise ValueError("0 cannot be divided")
        # print(x1)
        iterate.append(x1)
        if abs(x1 - x0) < epsilon:
            return iterate
        else:
            x0 = x1
    return "There's no root around x0.", None

def Secant(f, x1, x2, epsilon, MAXSTEP = 1000):
    iterate = [x1, x2]
    f1 = f(x1)
    for _ in (range(MAXSTEP+1)):
        f2 = f(x2)
        if f2 - f1 != 0:
            x = x2 - f2*(x2-x1)/(f2-f1)
        else:
            raise ValueError("0 cannot be divided")
        # print(x1)
        iterate.append(x)
        if abs(x - x2) < epsilon:
            return iterate
        else:
            f1 = f2
            x1 = x2
            x2 = x
    return "There's no root around x0.", None
        
def f(x):
    return (0.285 + 0.005 * x) * pow(x,1.5) - 1.69

def df(x):
    return 0.4275 * pow(x, 0.5) + 0.0125 * pow(x, 1.5)

if __name__ == "__main__":
    x0_newton = [0.1, 0.2, 0.9, 9.0]
    for i in range(len(x0_newton)):
        res = Newton(f, df, x0_newton[i], 1e-8)
        print(f"Newton: x0 = {x0_newton[i]}, root = {res[-1]}, steps = {len(res) - 1}.")
    x_secant = [[0, 0.1], [0, 0.2], [0, 1.0], [0, 9.0]]
    for j in range(len(x0_newton[:])):
        res = Secant(f, *x_secant[j], 1e-8)
        print(f"Secant: x1 = {x_secant[j][0]}, x2 = {x_secant[j][1]}, root = {res[-1]}, steps = {len(res) - 1}.")
	\end{lstlisting}
\end{center}

输出：

{\tt 
Newton: x0 = 0.1, root = 3.1603667461938865, steps = 7.

Newton: x0 = 0.2, root = 3.1603667461938865, steps = 7.

Newton: x0 = 0.9, root = 3.160366746193886, steps = 6.

Newton: x0 = 9.0, root = 3.1603667461938865, steps = 6.

Secant: x1 = 0, x2 = 0.1, root = 3.1603667461938842, steps = 10.

Secant: x1 = 0, x2 = 0.2, root = 3.1603667461938865, steps = 10.

Secant: x1 = 0, x2 = 1.0, root = 3.160366746193886, steps = 9.

Secant: x1 = 0, x2 = 9.0, root = 3.1603667461938865, steps = 9.}
\end{document}