This shows you the differences between two versions of the page.
documentation:ref:expandall [2015/11/21 12:33] |
documentation:ref:expandall [2015/11/21 12:33] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== ExpandAll ====== | ||
+ | ---- | ||
+ | ====Description==== | ||
+ | * ''ExpandAll'' expands out all products and integer powers in any parts of expressions. | ||
+ | |||
+ | * ''ExpandAll[transformations]'' expands out products and positive integer powers in any parts of expressions and applies ''transformations'' at each level of expand procedure. | ||
+ | |||
+ | |||
+ | ====Examples==== | ||
+ | |||
+ | Expand polynomials anywhere inside an expression: | ||
+ | |||
+ | <sxh groovy; gutter: false> | ||
+ | println ExpandAll >> '1/(1 + x)**3 + Sin[(1 + x)**3]'.t | ||
+ | </sxh> | ||
+ | <sxh plain; gutter: false> | ||
+ | > 1/(x**3 + 3*x**2+3*x+1) + Sin[x**3 + 3*x**2+3*x+1] | ||
+ | </sxh> | ||
+ | <sxh groovy; gutter: false> | ||
+ | println Expand >> '1/(1 + x)**3 + Sin[(1 + x)**3]'.t | ||
+ | </sxh> | ||
+ | <sxh plain; gutter: false> | ||
+ | > 1/(1 + x)**3 + Sin[(1 + x)**3]' | ||
+ | </sxh> | ||
+ | |||
+ | ====Details==== | ||
+ | ''ExpanAll[transformations]'' will additionally apply transformations during expand procedure (same as ''Expand''): | ||
+ | <sxh groovy; gutter false> | ||
+ | def t = ''' 1/((g_mn + t_mn)*(g^mn + t^mn)) + | ||
+ | + Sin[((g_mn + t_mn)*(g^mn + t^mn))]'''.t | ||
+ | //expand all and eliminate metrics in 4 dimensions | ||
+ | println ExpandAll[EliminateMetrics & 'd^i_i = 4'.t] >> t | ||
+ | </sxh> | ||
+ | <sxh plain; gutter false> | ||
+ | > 1/(t^{mn}*t_{mn}+4+2*t_{n}^{n}) + Sin[t^{mn}*t_{mn}+4+2*t_{n}^{n}] | ||
+ | </sxh> | ||
+ | |||
+ | For examples see also [[documentation:ref:expand#Details|Expand]]. | ||
+ | ====See also==== | ||
+ | * Related guides: [[documentation:guide:applying_and_manipulating_transformations]], [[documentation:guide:list_of_transformations]] | ||
+ | * Related transformations: [[documentation:ref:expand]], [[documentation:ref:expandnumerator]], [[documentation:ref:expanddenominator]] | ||
+ | * JavaDocs: [[http://api.redberry.cc/redberry/1.1.9/java-api/cc/redberry/core/transformations/expand/ExpandAllTransformation.html|ExpandAllTransformation]] | ||
+ | * Source code: [[https://bitbucket.org/redberry/redberry/src/tip/core/src/main/java/cc/redberry/core/transformations/expand/ExpandAllTransformation.java|ExpandAllTransformation.java]] | ||