Mathematica 中 Simplify 的正确使用(使用多相三角函数)

发布于 2024-10-17 11:52:37 字数 762 浏览 5 评论 0原文

我刚刚开始第一次使用 Mathematica (5.0),虽然手册很有帮助,但我不完全确定我使用 (Full)Simplify 的技术是否正确。我正在使用该程序来检查我在参考系之间进行更改的派生变换的工作,其中包括将三个相对较大的方阵相乘。

我和一位同事分别手工完成这项工作,以确保没有错误。我们希望从该程序中得到第三次检查,这似乎很容易询问。由于矩阵大小,手工计算花费了一些时间,但我们得出了相同的结论。当程序产生不同的结果时,我们得到相同的答案这一事实让我感到怀疑。

  • 我已经检查并仔细检查了我的输入。
  • 我绝对是.(点乘)正确乘法的矩阵。
  • FullSimplify 没有什么区别。
  • 两者都没有与 TrigReduce 组合/在简化之前进行代数扩展。
  • 我从最终的矩阵中获取了索引,并尝试在隔离时简化它们,但无济于事,因此问题不是由于使用矩阵造成的。
  • 我还尝试将前两个矩阵相乘,简化,然后将其与第三个矩阵相乘;然而,这产生了与之前相同的结果。

我认为 Simplify 自动跨越到 Heads 的所有级别,因此我不需要担心映射,但即使在矩阵中预期输出为零的地方,也有术语,并且我们会在哪里除了项之外,还有接近的答案,加上大量不减少的正弦和余弦项。

与单独使用 Simplify 相比,是否有人经常使用 Simplify 来获得更好的结果?

I just started working with Mathematica (5.0) for the first time, and while the manual has been helpful, I'm not entirely sure my technique has been correct using (Full)Simplify. I am using the program to check my work on a derived transform to change between reference frames, which consisted of multiplying a trio of relatively large square matrices.

A colleague and I each did the work by hand, separately, to make sure there were no mistakes. We hoped to get a third check from the program, which seemed that it would be simple enough to ask. The hand calculations took some time due to matrix size, but we came to the same conclusions. The fact that we had the same answer made me skeptical when the program produced different results.

  • I've checked and double checked my inputs.
  • I am definitely . (dot-multiplying) the matrices for correct multiplication.
  • FullSimplify made no difference.
  • Neither have combinations with TrigReduce / expanding algebraically before simplifying.
  • I've taken indices from the final matrix and tryed to simplify them while isolated, to no avail, so the problem isn't due to the use of matrices.
  • I've also tried to multiply the first two matrices, simplify, and then multiply that with the third matrix; however, this produced the same results as before.

I thought Simplify automatically crossed into all levels of Heads, so I didn't need to worry about mapping, but even where zeros would be expected as outputs in the matrix, there are terms, and where we would expect terms, there are close answers, plus a host of sin and cosine terms that do not reduce.

Does anyone frequent any type of technique with Simplify to get more preferable results, in contrast to solely using Simplify?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

安穩 2024-10-24 11:52:37

如果对参数范围有假设,您需要将它们提供给 Simplify。以下简单示例将说明为什么这可能有用。

In[218]:= Simplify[a*Sqrt[1 - x^2] - Sqrt[a^2 - a^2*x^2]]
Out[218]= a Sqrt[1 - x^2] - Sqrt[-a^2 (-1 + x^2)]

In[219]:= Simplify[a*Sqrt[1 - x^2] - Sqrt[a^2 - a^2*x^2], 
 Assumptions -> a > 0]
Out[219]= 0

假设这个和其他响应没有达到目标,如果您能提供一个以某种方式显示可能的不良行为的示例,那将非常有帮助。为了隐藏专有功能,可以采取任何必要的方式进行伪装:漂白水印、记录注册号,甚至留上小胡子。

丹尼尔·利希布劳
沃尔夫勒姆研究公司

If there are assumptions on parameter ranges you will want to feed them to Simplify. The following simple examples will indicate why this might be useful.

In[218]:= Simplify[a*Sqrt[1 - x^2] - Sqrt[a^2 - a^2*x^2]]
Out[218]= a Sqrt[1 - x^2] - Sqrt[-a^2 (-1 + x^2)]

In[219]:= Simplify[a*Sqrt[1 - x^2] - Sqrt[a^2 - a^2*x^2], 
 Assumptions -> a > 0]
Out[219]= 0

Assuming this and other responses miss the mark, if you could provide an example that in some way shows the possibly bad behavior, that would be very helpful. Disguise it howsoever necessary in order to hide proprietary features: bleach out watermarks, file down registration numbers, maybe dress it in a moustache.

Daniel Lichtblau
Wolfram Research

岁月蹉跎了容颜 2024-10-24 11:52:37

由于你没有提供太多细节来咀嚼,我只能给你一些提示:

  1. Mma5 已经很老了。当前版本是 8。如果您可以访问拥有 8 的人,您可能会要求他尝试一下,看看是否有区别。您还可以在线尝试 WolframAlpha (http://www.wolframalpha.com/),它也可以理解一些(全部?)Mma 语法。

  2. 您是否尝试过以数字方式比较您自己的结果和 Mma 的结果?生成各种参数值的差异表或使用绘图。如果差异可以忽略不计(使用 Chop 去除小的残差),则结果可能是相同的。

干杯——索尔德

As you didn't give much details to chew on I can only give you a few tips:

  1. Mma5 is pretty old. The current version is 8. If you have access to someone with 8 you might ask him to try it to see whether that makes a difference. You could also try WolframAlpha online (http://www.wolframalpha.com/), which also understands some (all?) Mma syntax.

  2. Have you tried comparing your own and Mma's result numerically? Generate a Table of differences for various parameter values or use Plot. If the differences are negligable (use Chop to cut off small residuals) the results are probably equivalent.

Cheers -- Sjoerd

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文