公告:本站正式转型为非交互式静态网站!
转型:本站将通过笔记和博客的形式继续为大家服务,关于 Mathematica 问答服务请移步至QQ群:365716997
联系:如有问题请联系QQ群管理员,或发送邮件至:lixuan.xyz@qq.com。
感谢:最后非常感谢大家多年来的支持与帮助!
参考《互联网跟帖评论服务管理规定》《中华人民共和国网络安全法》《网络信息内容生态治理规定》《互联网用户账号信息管理规定》

—— 2022-11-27

欢迎来到 Mathematica 问答社区

提问时请贴上文本代码

语法高亮:在编辑器中点击

被禁止的话题:广告破解

请阅读:《提问的智慧》

备用域名:mma.ooo

支持LaTex数学公式
行内公式标识符:\$ 或“$\backslash ($”+“$\backslash )$”,
行间公式标识符:\$\$ 或 “$\backslash [$”+“$\backslash ]$”

社区建议QQ群:365716997

分类

0 投票
1.1k 浏览
h = 1.;
p1 = {Sqrt[8], -1, h};
p2 = {0, 3.3, h};
p3 = {-Sqrt[8], -1, h};
n1 = Normalize[p1]; n2 = Normalize[p2]; n3 = Normalize[p3];

mg = 3;
\[Mu]1 = \[Mu]2 = \[Mu]3 = 1;
\[Omega][x_] = ArcTan[x];
\[Omega]1 = \[Omega][\[Mu]1];
\[Omega]2 = \[Omega][\[Mu]2];
\[Omega]3 = \[Omega][\[Mu]3];

{r, \[Theta]0, \[Phi]0} ={2.57776, 0.16065, 1.5708}

angle ={{0.16065, 1.5708}, {0.259131, 1.58816}, {0.254619, 1.605}, {0.247253,
1.6208}, {0.237255, 1.63508}, {0.224929, 1.6474}, {0.21065,
1.6574}, {0.194852, 1.66477}, {0.178015, 1.66928}, {0.16065,
1.6708}, {0.143285, 1.66928}, {0.126448, 1.66477}, {0.11065,
1.6574}, {0.0963714, 1.6474}, {0.0840457, 1.63508}, {0.0740476,
1.6208}, {0.0666809, 1.605}, {0.0621693, 1.58816}, {0.0606501,
1.5708}, {0.0621693, 1.55343}, {0.0666809, 1.53659}, {0.0740476,
1.5208}, {0.0840457, 1.50652}, {0.0963714, 1.49419}, {0.11065,
1.48419}, {0.126448, 1.47683}, {0.143285, 1.47232}, {0.16065,
1.4708}, {0.178015, 1.47232}, {0.194852, 1.47683}, {0.21065,
1.48419}, {0.224929, 1.49419}, {0.237255, 1.50652}, {0.247253,
1.5208}, {0.254619, 1.53659}, {0.259131, 1.55343}, {0.26065,
1.5708}}



For[i = 1, i <= nn, i++,
 \[Theta]1 = angle[[i, 1]];
 \[Phi]1 = angle[[i, 2]];
 xa = {a, b, c};
 a = r1 Sin[\[Theta]1] Cos[\[Phi]1];
 b = r1 Sin[\[Theta]1] Sin[\[Phi]1];
 c = r1 Cos[\[Theta]1];
 f = Solve[(1 + \[Mu]1^2) (n1.(xa - p1)) (n1 .(xa - p1)) - ((xa - 
          p1). (xa - p1)) (n1. n1) == 0];
 Print[f, {\[Theta]1}, {\[Phi]1}]
 ]


 

 

如上方程,解出的答案r与对应的φθ差了一位

例如{r1->2.55592}}{0.16065}{1.5708}
和{r1->2.57776}}{0.259131}{1.58816}

复制之后代回原方程第二行的r对应的是第一行的φθ
 


r3 = 2.55592
\[Theta]3 = 0.16065011224930292`
\[Phi]3 = 1.5707963267948966`

xa3 = {a3, b3, c3};
a3 = r3 Sin[\[Theta]3] Cos[\[Phi]3];
b3 = r3 Sin[\[Theta]3] Sin[\[Phi]3];
c3 = r3 Cos[\[Theta]3];

(1 + \[Mu]1^2) (n1.(xa3 - p1)) (n1 .(xa3 - p1)) - ((xa3 - p1). (xa3 -
       p1)) (n1. n1) == 0

 

分类:方程 | 用户: liii (11 分)
修改于 用户:liii
代码粘错了吧,中括号不匹配
已经修改了,您再看看
在For循环中,有好多问题啊,比如nn没有定义,xa的定义写在了a,b,c的前面,Solve中没有指定未知变量,n1.n1本身等于1,没有必要乘。
另外,在Mma中应该尽量避免使用For。

登录 或者 注册 后回答这个问题。

...