高さ h からの斜方投射の最大水平到達距離を解析的に求める

高さ h からの斜方投射の最大到達距離を求める準備」のページを参照。

最大水平到達距離となる打ち出し角度 $\theta$ を求めるには,平方根を含む非線形方程式を解く必要があるので,SymPy でやってみた。

ライブラリの import

In [1]:
# 1文字変数の Symbol の宣言が省略できる
from sympy.abc import *

from sympy import *

init_printing()

最大水平到達距離となる $\sin\theta_{\rm max}$ を解析的に求める

水平到達距離 $L$ を $s \equiv \sin \theta$ で表す

水平到達距離 $L(\theta)$ を $s \equiv \sin \theta$ を使って表してみます。

\begin{eqnarray}
L(\theta) &=& \left( \sin{\left(\theta \right)} + \sqrt{2 H + \sin^{2}{\left(\theta \right)}}\right) \cos{\left(\theta \right)} \\
&=& \left(s + \sqrt{s^2 + 2H}\right) \, \sqrt{1 -s^2}
\end{eqnarray}

In [2]:
var('H s', positive = True) # H, s > 0

def Ls(s):
    return (s + sqrt(2*H + s**2)) * sqrt(1 - s**2)
Ls(s)
Out[2]:
$\displaystyle \sqrt{1 -s^{2}} \left(s + \sqrt{2 H + s^{2}}\right)$

$L$ が最大となる $\sin\theta$ を求める

dLs$\displaystyle \equiv\frac{d L(s)}{d s} = 0$ となる $s \equiv s_{\rm max}$ を solve() で求めます。

In [3]:
dLs = diff(Ls(s), s)
dLs = dLs.simplify()
dLs
Out[3]:
$\displaystyle \frac{\left(s + \sqrt{2 H + s^{2}}\right) \left(-s^{2} -s \sqrt{2 H + s^{2}} + 1\right)}{\sqrt{1 -s^{2}} \sqrt{2 H + s^{2}}}$

dLs = 0s について解く。

In [4]:
solve(dLs, s)
Out[4]:
$\displaystyle \left[ \frac{\sqrt{2}}{2 \sqrt{H + 1}}\right]$

ということで,最大水平到達距離となる $\sin\theta_{\rm max}$ は

\begin{eqnarray}
\sin\theta_{\rm max} &=& s_{\rm max} = \frac{1}{\sqrt{2 (1 + H)}} \\
\therefore\ \ \theta_{\rm max} &=& \arcsin\left(\frac{1}{\sqrt{2 (1 + H)}}\right)
\end{eqnarray}

最大水平到達距離

そのときの最大水平到達距離 $L_{\rm max} = L(\theta_{\rm max}, H)$ は…

In [5]:
smax = 1/sqrt(2*(1+H))
Ls(smax).simplify()
Out[5]:
$\displaystyle \frac{\sqrt{2 H + 1} \left(\sqrt{4 H \left(H + 1\right) + 1} + 1\right)}{2 \left(H + 1\right)}$

簡単化してくれないなぁ…

最大水平到達距離となる $\tan\theta_{\rm max}$ を解析的に求める

水平到達距離 $L(\theta)$ を $t \equiv \tan \theta$ を使って表してみます。

水平到達距離 $L$ を $t \equiv \tan\theta$ で表す

$t \equiv \tan\theta$ として規格化された水平到達距離 $L$ を $t$ で表すと

\begin{eqnarray}
L(t)
&=& \frac{1}{1+t^2} \left\{t + \sqrt{(1+2H)\, t^2 + 2H} \right\}
\end{eqnarray}

In [6]:
var('t H', positive = True) # positive = True とすると吉

def Lt(t):
    return (t+sqrt((1+2*H)*t**2 + 2*H))/(1 + t**2)
Lt(t)
Out[6]:
$\displaystyle \frac{t + \sqrt{2 H + t^{2} \left(2 H + 1\right)}}{t^{2} + 1}$

$L$ が最大となる $\tan\theta$ を求める

$\displaystyle \frac{d L(t)}{dt} = 0$ となる $t \equiv t_{\rm max}$ を solve() で求めます。

In [7]:
dLt = diff(Lt(t), t)
sols = solve(dLt, t)
sols
Out[7]:
$\displaystyle \left[ \frac{1}{\sqrt{2 H + 1}}\right]$

念のため,本当に解になっているか,確認します。

dLt.subs(t, sols[0]) として,dLttsols[0] を代入し,simplify() で簡単化してみます。

In [8]:
simplify(dLt.subs(t, sols[0]))
Out[8]:
$\displaystyle 0$

よって,$L(t)$ が最大となる $t$ の値 $t_{\rm max}$ は…

In [9]:
tmax =  1/sqrt(1 + 2*H)

最大水平到達距離

In [10]:
simplify(Lt(tmax))
Out[10]:
$\displaystyle \sqrt{2 H + 1}$

つまり,高さ $H$ のときの最大水平到達距離は,

$$L_{\rm max} = \sqrt{1 + 2H}$$

となることがわかります。

このときの滞空時間 $T_1(\theta)$ は…

$$T_1(\theta) = \sin\theta + \sqrt{\sin^2\theta + 2 H}$$

\begin{eqnarray}
t_{\rm max} &=& \tan\theta_{\rm max} = \frac{1}{\sqrt{1 + 2 H}} \\
\therefore\ \ \theta_{\rm max} &=& \arctan \left(\frac{1}{\sqrt{1 + 2 H}}\right)
\end{eqnarray}

で決まる $\theta_{\rm max}$ を代入して…

あるいは,

\begin{eqnarray}
s_{\rm max} &=& \sin\theta_{\rm max} = \frac{1}{\sqrt{2(1 + H)}}
\end{eqnarray}

を使って…

In [11]:
T1 = smax + sqrt(factor(smax**2 + 2*H))
T1.factor()
Out[11]:
$\displaystyle \sqrt{2} \sqrt{H + 1}$
$$T_1 = \sin\theta_{\rm max} + \sqrt{\sin^2\theta_{\rm max} + 2H} = \sqrt{2 (1 + H)}$$