开发者

Correct use of Simplify in Mathematica (with multiphase trig)

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 we开发者_C百科re 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?


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜