freeze, thaw - Maple Programming Help

freeze, thaw

replace an expression by a name

 Calling Sequence freeze(expr) thaw(var)

Parameters

 expr - the expression to be frozen'' var - the frozen'' variable

Description

 • freeze replaces its argument, expr (not a complex or real numeric constant, a name, or a string), with a name of the form freeze/R0, freeze/R1, ...
 • To return the original expression the thaw function must be used.
 • This can be used to prevent parts of an expression from being subjected to the effects of symbolic manipulation.

Examples

 > z := freeze(x+y);
 ${z}{≔}{\mathrm{freeze/R0}}$ (1)
 > thaw(z);
 ${x}{+}{y}$ (2)
 > e := cos(2*x)+sin(a+b);
 ${e}{≔}{\mathrm{cos}}{}\left({2}{}{x}\right){+}{\mathrm{sin}}{}\left({a}{+}{b}\right)$ (3)
 > expand( e );
 ${2}{}{{\mathrm{cos}}{}\left({x}\right)}^{{2}}{-}{1}{+}{\mathrm{sin}}{}\left({a}\right){}{\mathrm{cos}}{}\left({b}\right){+}{\mathrm{cos}}{}\left({a}\right){}{\mathrm{sin}}{}\left({b}\right)$ (4)
 > subs( 2*x = freeze(2*x), e );
 ${\mathrm{cos}}{}\left({\mathrm{freeze/R1}}\right){+}{\mathrm{sin}}{}\left({a}{+}{b}\right)$ (5)
 > expand((5));
 ${\mathrm{cos}}{}\left({\mathrm{freeze/R1}}\right){+}{\mathrm{sin}}{}\left({a}\right){}{\mathrm{cos}}{}\left({b}\right){+}{\mathrm{cos}}{}\left({a}\right){}{\mathrm{sin}}{}\left({b}\right)$ (6)
 > thaw((6));
 ${\mathrm{cos}}{}\left({2}{}{x}\right){+}{\mathrm{sin}}{}\left({a}\right){}{\mathrm{cos}}{}\left({b}\right){+}{\mathrm{cos}}{}\left({a}\right){}{\mathrm{sin}}{}\left({b}\right)$ (7)