公告:1)网站程序升级:Q2A升级到1.8.6,Wordpress升级到5.7.2
2)修复了头像加载慢与提交问题反应慢等问题
2021-06-16

欢迎来到 Mathematica 问答社区

提问时请贴上文本代码

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

被禁止的话题:广告破解

请阅读:《提问的智慧》

备用域名:mma.ooo

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

社区建议QQ群:365716997

分类

0 投票
359 浏览
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。

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

...