- 注册时间
- 2013-12-9
- 最后登录
- 1970-1-1
- 威望
- 星
- 金币
- 枚
- 贡献
- 分
- 经验
- 点
- 鲜花
- 朵
- 魅力
- 点
- 上传
- 次
- 下载
- 次
- 积分
- 941
- 在线时间
- 小时
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?欢迎注册
×
本帖最后由 cn8888 于 2014-6-30 09:00 编辑
http://bbs.emath.ac.cn/forum.php ... 11&fromuid=8888
问题来自这里.
代码如下
- Clear["Global`*"];(*Clear all variables*)
- (*把三维空间中的三角形转化成球面a^2+b^2+c^2==1*)
- fun=(2*a^2-b^2)(2*b^2-c^2)(2*c^2-a^2)+x*(a^2+b^2+c^2-1)
- fa=D[fun,a]
- fb=D[fun,b]
- fc=D[fun,c]
- fx=D[fun,x]
- sol1=Solve[{fa==0,fb==0,fc==0,fx==0},{a,b,c,x}]
- Print["显示三角形内部的最值"]
- sol11=fun/.sol1
- Print["数值化"]
- N@sol1
- N@sol11
复制代码
其中的一行代码如下:
- sol1=Solve[{fa==0,fb==0,fc==0,fx==0},{a,b,c,x}]
复制代码
求解结果数值化如下:
{{x -> -0.111111, b -> -0.57735, c -> -0.57735,
a -> -0.57735}, {x -> -0.111111, b -> -0.57735, c -> -0.57735,
a -> 0.57735}, {x -> -0.111111, b -> -0.57735, c -> 0.57735,
a -> -0.57735}, {x -> -0.111111, b -> -0.57735, c -> 0.57735,
a -> 0.57735}, {x -> -0.111111, b -> 0.57735, c -> -0.57735,
a -> -0.57735}, {x -> -0.111111, b -> 0.57735, c -> -0.57735,
a -> 0.57735}, {x -> -0.111111, b -> 0.57735, c -> 0.57735,
a -> -0.57735}, {x -> -0.111111, b -> 0.57735, c -> 0.57735,
a -> 0.57735}, {x -> 0., a -> -1., c -> 0., b -> 0.}, {x -> 0.,
a -> 1., c -> 0., b -> 0.}, {x -> 0., b -> -1., c -> 0.,
a -> 0.}, {x -> 0., b -> 1., c -> 0., a -> 0.}, {x -> 0.,
b -> -0.534522, c -> -0.755929, a -> -0.377964}, {x -> 0.,
b -> -0.534522, c -> -0.755929, a -> 0.377964}, {x -> 0.,
b -> -0.534522, c -> 0.755929, a -> -0.377964}, {x -> 0.,
b -> -0.534522, c -> 0.755929, a -> 0.377964}, {x -> 0.,
b -> 0.534522, c -> -0.755929, a -> -0.377964}, {x -> 0.,
b -> 0.534522, c -> -0.755929, a -> 0.377964}, {x -> 0.,
b -> 0.534522, c -> 0.755929, a -> -0.377964}, {x -> 0.,
b -> 0.534522, c -> 0.755929, a -> 0.377964}, {x -> 0.,
b -> -0.755929, c -> -0.377964, a -> -0.534522}, {x -> 0.,
b -> -0.755929, c -> -0.377964, a -> 0.534522}, {x -> 0.,
b -> -0.755929, c -> 0.377964, a -> -0.534522}, {x -> 0.,
b -> -0.755929, c -> 0.377964, a -> 0.534522}, {x -> 0.,
b -> -0.377964, c -> -0.534522, a -> -0.755929}, {x -> 0.,
b -> -0.377964, c -> -0.534522, a -> 0.755929}, {x -> 0.,
b -> -0.377964, c -> 0.534522, a -> -0.755929}, {x -> 0.,
b -> -0.377964, c -> 0.534522, a -> 0.755929}, {x -> 0.,
b -> 0.377964, c -> -0.534522, a -> -0.755929}, {x -> 0.,
b -> 0.377964, c -> -0.534522, a -> 0.755929}, {x -> 0.,
b -> 0.377964, c -> 0.534522, a -> -0.755929}, {x -> 0.,
b -> 0.377964, c -> 0.534522, a -> 0.755929}, {x -> 0.,
b -> 0.755929, c -> -0.377964, a -> -0.534522}, {x -> 0.,
b -> 0.755929, c -> -0.377964, a -> 0.534522}, {x -> 0.,
b -> 0.755929, c -> 0.377964, a -> -0.534522}, {x -> 0.,
b -> 0.755929, c -> 0.377964, a -> 0.534522}, {x -> 0., c -> -1.,
a -> 0., b -> 0.}, {x -> 0., c -> 1., a -> 0.,
b -> 0.}, {x -> -0.420754, a -> -0.921698, c -> -0.387907,
b -> 0.}, {x -> -0.420754, a -> -0.921698, c -> 0.387907,
b -> 0.}, {x -> -0.420754, a -> 0.921698, c -> -0.387907,
b -> 0.}, {x -> -0.420754, a -> 0.921698, c -> 0.387907,
b -> 0.}, {x -> -0.420754, b -> -0.387907, c -> -0.921698,
a -> 0.}, {x -> -0.420754, b -> -0.387907, c -> 0.921698,
a -> 0.}, {x -> -0.420754, b -> 0.387907, c -> -0.921698,
a -> 0.}, {x -> -0.420754, b -> 0.387907, c -> 0.921698,
a -> 0.}, {x -> -0.420754, b -> -0.921698, a -> -0.387907,
c -> 0.}, {x -> -0.420754, b -> -0.921698, a -> 0.387907,
c -> 0.}, {x -> -0.420754, b -> 0.921698, a -> -0.387907,
c -> 0.}, {x -> -0.420754, b -> 0.921698, a -> 0.387907,
c -> 0.}, {x -> 1.40841, a -> -0.511452, c -> -0.859312,
b -> 0.}, {x -> 1.40841, a -> -0.511452, c -> 0.859312,
b -> 0.}, {x -> 1.40841, a -> 0.511452, c -> -0.859312,
b -> 0.}, {x -> 1.40841, a -> 0.511452, c -> 0.859312,
b -> 0.}, {x -> 1.40841, b -> -0.511452, a -> -0.859312,
c -> 0.}, {x -> 1.40841, b -> -0.511452, a -> 0.859312,
c -> 0.}, {x -> 1.40841, b -> 0.511452, a -> -0.859312,
c -> 0.}, {x -> 1.40841, b -> 0.511452, a -> 0.859312,
c -> 0.}, {x -> 1.40841, b -> -0.859312, c -> -0.511452,
a -> 0.}, {x -> 1.40841, b -> -0.859312, c -> 0.511452,
a -> 0.}, {x -> 1.40841, b -> 0.859312, c -> -0.511452,
a -> 0.}, {x -> 1.40841, b -> 0.859312, c -> 0.511452, a -> 0.}}
我明明是按照{a,b,c,x}列举求解变量的.但是....................
求解结果让我很不爽,简直就是胡乱排列有{x,a,c,b}有{x,b,c,a}
请问如何把他们都搞成{a,b,c,x}的?
请问如何让每个求解结果{x -> 1.40841, b -> 0.859312, c -> 0.511452, a -> 0.}一行显示呢?
@hujunhua @wayne @chyanog
你们觉得应该如何弄呢? |
|