And*_*ein 7 matlab wolfram-mathematica symbolic-math maple
在尝试解决符号数学问题后,我得到了一个大约17000个字符的表达式.我正在使用Matlab的符号工具箱,但我对任何建议(Mathematica,无论如何)都持开放态度.
出于显而易见的原因,我不会将表达式直接复制粘贴到问题中.这是一个链接.
运行Matlab命令simplify和simple,甚至企图collect没有改善的情况(有些我们更糟糕).
但我想知道,我不关心是否使用时间参数逐步评估表达式.就像是:
z1 = a^2*y1;
%Now the expression can be simplified by using z1 as alias!
z1+z1^2 ....
Run Code Online (Sandbox Code Playgroud)
是否有一种自动方法可以通过时间变量逐步简化这种方法?此外,您可以想到的任何其他方法都是合理的.
可以尝试常见的子表达式消除(CSE).这是一个来自的例子
InputForm[Experimental`OptimizeExpression[(3 + 3*a^2 + Sqrt[5 + 6*a + 5*a^2] +
a*(4 + Sqrt[5 + 6*a + 5*a^2]))/6]]
Run Code Online (Sandbox Code Playgroud)
==>
Out[206]//InputForm=
Experimental`OptimizedExpression[Block[{Compile`$1, Compile`$3, Compile`$4,
Compile`$5, Compile`$6}, Compile`$1 = a^2; Compile`$3 = 6*a;
Compile`$4 = 5*Compile`$1; Compile`$5 = 5 + Compile`$3 + Compile`$4;
Compile`$6 = Sqrt[Compile`$5]; (3 + 3*Compile`$1 + Compile`$6 +
a*(4 + Compile`$6))/6]]
Run Code Online (Sandbox Code Playgroud)