- 注册时间
- 2021-11-19
- 最后登录
- 1970-1-1
- 威望
- 星
- 金币
- 枚
- 贡献
- 分
- 经验
- 点
- 鲜花
- 朵
- 魅力
- 点
- 上传
- 次
- 下载
- 次
- 积分
- 8645
- 在线时间
- 小时
|
发表于 2023-4-19 12:49:36
|
显示全部楼层
你的距离和,化简的不够简洁:
- Clear["Global`*"];(*清除所有变量*)
- (*子函数,四面体体积公式,a,b,c分别是从一个顶点出发的三条棱,x,y,z分别是对棱*)
- fun[a_,b_,c_,x_,y_,z_]:=Sqrt[Det[{{0,1,1,1,1},{1,0,a^2,b^2,c^2},{1,a^2,0,z^2,y^2},{1,b^2,z^2,0,x^2},{1,c^2,y^2,x^2,0}}]/288]
- (*子函数,利用三边计算角的余弦值,角是c边所对的角*)
- cs[a_,b_,c_]:=((a^2+b^2-c^2)/(2*a*b))
- {a,b,c}={50*Sqrt[5],50,100}(*△ABC三边长度赋值*)
- cond=fun[PA,PB,PC,a,b,c]^2(*四面体PABC体积等于零为约束条件*)
- f=PA+PB+PC+t*(cond-0)(*拉格朗日乘子法建立目标函数*)
- (*求偏导数,解方程组,得到零点*)
- ans=Solve[D[f,{{PA,PB,PC,t}}]==0,{PA,PB,PC,t}]//FullSimplify//ToRadicals
- Grid[ans,Alignment->Left](*列表显示*)
- Grid[Chop@N[ans,10],Alignment->Left](*数值化,列表显示*)
- aaa=Select[ans,(And[PA>=0,PB>=0,PC>=0]/.#)&](*选择大于等于零的变量*)
- bbb=f/.aaa[[1]]//FullSimplify(*求得函数值*)
- Print["长度和数值化:"]
- N[bbb,20](*数值化长度和*)
- ang=ArcCos@cs[PA,c,PB]/.aaa[[1]]//FullSimplify(*计算∠PAB*)
- {Px,Py}=PA*{Cos[ang],Sin[ang]}/.aaa[[1]]//FullSimplify(*计算P点坐标*)
- Print["坐标数值化:"]
- N[{Px,Py},20](*数值化坐标*)
复制代码
利用四面体体积等于零,得到约束条件,建立目标函数如下
\[f=\text{PA}+\text{PB}+\text{PC}+\\ t
\frac{1}{36} (-625) \left(5 \text{PA}^4-2 \text{PA}^2 \text{PB}^2-8 \text{PA}^2 \text{PC}^2+\text{PB}^4-20000 \text{PB}^2+4 \text{PC}^4-20000 \text{PC}^2+125000000\right)
\]
求解偏导数,解方程组,得到
\[\begin{array}{llll}
\text{PA}\to -100 \sqrt{\frac{1}{39} \left(2 \sqrt{3}+5\right)} & \text{PB}\to 100 \sqrt{\frac{1}{39} \left(6 \sqrt{3}+41\right)} & \text{PC}\to -50 \sqrt{\frac{1}{39} \left(11-6 \sqrt{3}\right)} & t\to \frac{27 \sqrt{214 \sqrt{3}+635}}{6875000000} \\
\text{PA}\to 100 \sqrt{\frac{1}{39} \left(2 \sqrt{3}+5\right)} & \text{PB}\to -100 \sqrt{\frac{1}{39} \left(6 \sqrt{3}+41\right)} & \text{PC}\to 50 \sqrt{\frac{1}{39} \left(11-6 \sqrt{3}\right)} & t\to -\frac{27 \sqrt{214 \sqrt{3}+635}}{6875000000} \\
\text{PA}\to -100 \sqrt{\frac{1}{39} \left(5-2 \sqrt{3}\right)} & \text{PB}\to -100 \sqrt{\frac{1}{39} \left(41-6 \sqrt{3}\right)} & \text{PC}\to -50 \sqrt{\frac{1}{39} \left(6 \sqrt{3}+11\right)} & t\to \frac{27 \sqrt{635-214 \sqrt{3}}}{6875000000} \\
\text{PA}\to 100 \sqrt{\frac{1}{39} \left(5-2 \sqrt{3}\right)} & \text{PB}\to 100 \sqrt{\frac{1}{39} \left(41-6 \sqrt{3}\right)} & \text{PC}\to 50 \sqrt{\frac{1}{39} \left(6 \sqrt{3}+11\right)} & t\to -\frac{27 \sqrt{635-214 \sqrt{3}}}{6875000000} \\
\end{array}\]
数值化结果,得到
\[\begin{array}{llll}
\text{PA}\to -46.58629053 & \text{PB}\to 114.7933537 & \text{PC}\to -6.241379463 & t\to \text{1.245421636861549683946648532652$\grave{ }$10.*${}^{\wedge}$-7} \\
\text{PA}\to 46.58629053 & \text{PB}\to -114.7933537 & \text{PC}\to 6.241379463 & t\to -\text{1.245421636861549683946648532652$\grave{ }$10.*${}^{\wedge}$-7} \\
\text{PA}\to -19.84490108 & \text{PB}\to -88.58965494 & \text{PC}\to -37.03108954 & t\to \text{6.38518420159809689762351954332$\grave{ }$10.*${}^{\wedge}$-8} \\
\text{PA}\to 19.84490108 & \text{PB}\to 88.58965494 & \text{PC}\to 37.03108954 & t\to -\text{6.38518420159809689762351954332$\grave{ }$10.*${}^{\wedge}$-8} \\
\end{array}\]
只需要非负数解,得到
\[\left\{\left\{\text{PA}\to 100 \sqrt{\frac{1}{39} \left(5-2 \sqrt{3}\right)},\text{PB}\to 100 \sqrt{\frac{1}{39} \left(41-6 \sqrt{3}\right)},\text{PC}\to 50 \sqrt{\frac{1}{39} \left(6 \sqrt{3}+11\right)},t\to -\frac{27 \sqrt{635-214 \sqrt{3}}}{6875000000}\right\}\right\}\]
代入目标函数得到长度和,得到
\[50 \sqrt{2 \sqrt{3}+5}\]
数值化得到
145.46564555882047323
计算∠PAB的大小,得到
\[\cos ^{-1}\left(\sqrt{\frac{3 \sqrt{3}}{26}+\frac{11}{52}}\right)\]
计算P点坐标,得到
\[\left\{\frac{50}{39} \left(4 \sqrt{3}+3\right),\frac{50}{13} \left(8-\frac{7}{\sqrt{3}}\right)\right\}\]
坐标数值化,得到
{12.728465679840396377, 15.225185060279306340}
|
|