川田保知『算法極数小補解義』
山口正義 やまぶき 第26号
https://yamabukiwasan.sakura.ne.jp/ymbk26.pdf
キーワード:円5個
#Julia #SymPy #算額 #和算 #数学
直径 35 寸の 2 個の甲円が交わっている。交わっていない部分に乙円 1 個と丙円 2 個を容れる。丙円の直径が最大になるときの乙円の直径を求めよ。

丙円の半径と中心座標を \(r_3,\ (x_3,\ y_3)\)
乙円の半径と中心座標を \(r_2,\ (r_2,\ 0)\)
甲円の半径と中心座標を \(r_1,\ (r_1,\ 0) および (2r_2 + r_1,\ 0,\ r_1)\)
とおき,以下の連立方程式をとき,r3, \(x_3,\ y_3\)を求める。
それぞれは \(r_1\) と \(r_2\) の関数である。
include("julia-source.txt"); # julia-source.txt ソース
using SymPy
@syms r1::positive, r2::positive,
r3::positive, x3::positive, y3::positive;
eq1 = (2r2 + r1 - x3)^2 + y3^2 - (r1 + r3)^2
eq2 = (x3 - r2)^2 + y3^2 - (r2 + r3)^2
eq3 = (x3 - r1)^2 + y3^2 - (r1 - r3)^2
res = solve([eq1, eq2, eq3], (r3, x3, y3))[1]
(r2*(r1 - r2)*(r1 + r2)/(r1^2 + r2^2), r2*(r1 + r2)^2/(r1^2 + r2^2), 2*r1*r2*sqrt(r1 - r2)*sqrt(r1 + r2)/(r1^2 + r2^2))
r1 = 35//2
f = r2*(r1 - r2)*(r1 + r2)/(r1^2 + r2^2)
f |> println
r2*(35/2 - r2)*(r2 + 35/2)/(r2^2 + 1225/4)
pyplot(size=(400, 200), grid=false, aspectratio=:none, label="", fontfamily="IPAMincho")
plot(f, xlims=(0, r1))

res2 = solve(diff(f, r2))[1]
res2 |> println
res2.evalf() |> println
f(res2).evalf() |> println
35*sqrt(-1/2 + sqrt(5)/4)
8.50269475574130
5.25495435501361
乙円の半径が 8.50269475574130 のときに,丙円の半径が最大値 5.25495435501361 になる。
すなわち,
乙円の直径が 17.0053895114826 のときに,丙円の直径が最大値 10.5099087100272 になる。
\(r_1 = 17.5;\ r_2 = 8.50269;\ r_3 = 5.25495;\ x_3 = 15.1871;\ y_3 = 12.0246\)
描画関数プログラムのソースを見る
function draw(more=false)
pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
r1 = 35//2
r2 = res2
(r3, x3, y3) = (r2*(r1 - r2)*(r1 + r2)/(r1^2 + r2^2), r2*(r1 + r2)^2/(r1^2 + r2^2), 2*r1*r2*sqrt(r1 - r2)*sqrt(r1 + r2)/(r1^2 + r2^2))
@printf("r1 = %g; r2 = %g; r3 = %g; x3 = %g; y3 = %g\n", r1, r2, r3, x3, y3)
plot()
circle(r1, 0, r1, :blue)
circle(2r2 + r1, 0, r1, :blue)
circle(r2, 0, r2)
circle(x3, y3, r3, :green)
circle(x3, -y3, r3, :green)
if more
delta = (fontheight = (ylims()[2]- ylims()[1]) / 500 * 10 * 2) / 3 # size[2] * fontsize * 2
point(r1, 0, " r1,甲円", :blue, delta=-delta)
point(2r2 + r1, 0, " r2r2+1,甲円", :blue, delta=-delta)
point(r2, 0, " r2,乙円", :red, delta=-delta)
point(x3, y3, "丙円:r3\n(x3,y3)", :green, :center, delta=-delta)
vline!([0], color=:black, lw=0.5)
hline!([0], color=:black, lw=0.5)
end
end;
以下のアイコンをクリックして応援してください