Message Boards Message Boards

0
|
5328 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Why the Mathematica Simplify can be so unstable?

Posted 9 years ago

Dear Mathematica users:

As attached. I have two very long trigonometric expressions (Expression1 and Expression2). I try to Simplify Expression1 however it fails. Then, I try to use MySimplify (defined by Simplify[ExpToTrig[Simplify[TrigToExp[x]]]]), it gets a simplified expression (SExpression1) easily. Ok, this may indicate that I should always use MySimplify for long trigonometric expressions.

However, when I use MySimplify to simplify the second Expression2, it fails again. However, I can straightly use the default Simplify to get SExpression2.

This is so crazy. Why the Mathematica Simplify can be so unstable? I don't require the Mathematica Simplify to find the most simplified expression every time. However, I need it to have a solution every time. Don't just stop there arbitrarily. This makes my research so difficult since I have a program that need to simplify long trigonometric expressions several times in a loop.

ps, I use Mathematica 8 with 32 GB RAM.

CC Tsai

Attachments:
POSTED BY: Chia-Cheng Tsai
2 Replies

Simplifying an expression is essentially a optimization problem. Except in very specific cases, optimization problems are very difficult and has the kinds of issues you're describing.

When using FullSimplify, please check that:

  • The ComplexityFunction is acceptable. Mathematica judges expressions with lower LeafCount to be simpler than ones higher LeafCount. For specific purposes you may want a different metric.
  • There aren't any obvious transformations that you can provide it with TransformationFunctions. If you have a some algebraic technique or trick in mind, TransformationFunctions is how you would let FullSimplify know to use it.

For examples like the one in your notebook, you might want to try Common Sub-Expression Elimination. If you search online, you can find examples of how to do that in Mathematica, including a function called Experimental`OptimizeExpression.

POSTED BY: Sean Clarke

Dear Clarke,

Many thanks for your prompt reply. You do provide me valuable information. I will try to figure out how to deal with long trigonometric expression simplification and give my feedback later.

CC

POSTED BY: Chia-Cheng Tsai
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract