- 注册时间
- 2021-11-19
- 最后登录
- 1970-1-1
- 威望
- 星
- 金币
- 枚
- 贡献
- 分
- 经验
- 点
- 鲜花
- 朵
- 魅力
- 点
- 上传
- 次
- 下载
- 次
- 积分
- 9086
- 在线时间
- 小时
|
发表于 2025-2-13 09:49:10
|
显示全部楼层
- Clear["Global`*"];(*mathematica11.2,win7(64bit)Clear all variables*)
- (*子函数,海伦公式,利用海伦公式计算三角形的面积*)
- heron[a_,b_,c_]:=Module[{p=(a+b+c)/2},Sqrt[p*(p-a)*(p-b)*(p-c)]]
- f=(heron[a,b,c])^2+x*(3a^2+2b^2+c^2-1)(*海伦公式的平方,拉格朗日乘子法*)
- ans=Solve[D[f,{{a,b,c,x}}]==0,{a,b,c,x}]//FullSimplify(*求解偏导数,解方程组*)
- Grid[ans,Alignment->Left](*列表显示*)
- aaa=Select[ans,(And[a>0,b>0,c>0]/.#)&](*只选择三边大于零的*)
- bbb=Prepend[#,Sqrt[f/.#]//Simplify]&/@aaa(*第一个为面积,需要开平方*)
复制代码
求解结果
\[\begin{array}{llll}
a\to 0 & b\to 0 & c\to -1 & x\to \frac{1}{8} \\
a\to 0 & b\to 0 & c\to 1 & x\to \frac{1}{8} \\
a\to 0 & b\to -\frac{1}{\sqrt{3}} & c\to -\frac{1}{\sqrt{3}} & x\to 0 \\
a\to 0 & b\to -\frac{1}{\sqrt{3}} & c\to \frac{1}{\sqrt{3}} & x\to 0 \\
a\to 0 & b\to \frac{1}{\sqrt{3}} & c\to -\frac{1}{\sqrt{3}} & x\to 0 \\
a\to 0 & b\to \frac{1}{\sqrt{3}} & c\to \frac{1}{\sqrt{3}} & x\to 0 \\
a\to 0 & b\to -\frac{1}{\sqrt{2}} & c\to 0 & x\to \frac{1}{32} \\
a\to 0 & b\to \frac{1}{\sqrt{2}} & c\to 0 & x\to \frac{1}{32} \\
a\to -\sqrt{\frac{3}{22}} & b\to -\sqrt{\frac{2}{11}} & c\to -\sqrt{\frac{5}{22}} & x\to -\frac{1}{88} \\
a\to -\sqrt{\frac{3}{22}} & b\to -\sqrt{\frac{2}{11}} & c\to \sqrt{\frac{5}{22}} & x\to -\frac{1}{88} \\
a\to -\sqrt{\frac{3}{22}} & b\to \sqrt{\frac{2}{11}} & c\to -\sqrt{\frac{5}{22}} & x\to -\frac{1}{88} \\
a\to -\sqrt{\frac{3}{22}} & b\to \sqrt{\frac{2}{11}} & c\to \sqrt{\frac{5}{22}} & x\to -\frac{1}{88} \\
a\to \sqrt{\frac{3}{22}} & b\to -\sqrt{\frac{2}{11}} & c\to -\sqrt{\frac{5}{22}} & x\to -\frac{1}{88} \\
a\to \sqrt{\frac{3}{22}} & b\to -\sqrt{\frac{2}{11}} & c\to \sqrt{\frac{5}{22}} & x\to -\frac{1}{88} \\
a\to \sqrt{\frac{3}{22}} & b\to \sqrt{\frac{2}{11}} & c\to -\sqrt{\frac{5}{22}} & x\to -\frac{1}{88} \\
a\to \sqrt{\frac{3}{22}} & b\to \sqrt{\frac{2}{11}} & c\to \sqrt{\frac{5}{22}} & x\to -\frac{1}{88} \\
a\to -\frac{1}{2} & b\to 0 & c\to -\frac{1}{2} & x\to 0 \\
a\to -\frac{1}{2} & b\to 0 & c\to \frac{1}{2} & x\to 0 \\
a\to \frac{1}{2} & b\to 0 & c\to -\frac{1}{2} & x\to 0 \\
a\to \frac{1}{2} & b\to 0 & c\to \frac{1}{2} & x\to 0 \\
a\to -\frac{1}{\sqrt{3}} & b\to 0 & c\to 0 & x\to \frac{1}{72} \\
a\to \frac{1}{\sqrt{3}} & b\to 0 & c\to 0 & x\to \frac{1}{72} \\
a\to -\frac{1}{\sqrt{5}} & b\to -\frac{1}{\sqrt{5}} & c\to 0 & x\to 0 \\
a\to -\frac{1}{\sqrt{5}} & b\to \frac{1}{\sqrt{5}} & c\to 0 & x\to 0 \\
a\to \frac{1}{\sqrt{5}} & b\to -\frac{1}{\sqrt{5}} & c\to 0 & x\to 0 \\
a\to \frac{1}{\sqrt{5}} & b\to \frac{1}{\sqrt{5}} & c\to 0 & x\to 0 \\
\end{array}\]
只选择三边大于零的
带面积的求解结果
\[\left(
\begin{array}{ccccc}
\frac{1}{4 \sqrt{11}} & a\to \sqrt{\frac{3}{22}} & b\to \sqrt{\frac{2}{11}} & c\to \sqrt{\frac{5}{22}} & x\to -\frac{1}{88} \\
\end{array}
\right)\] |
|