You want evaluate=False, like Mul(sin(x), cos(x), cos(x), evaluate=False), or
with evaluate(False):
sin(x)*cos(x)*cos(x)
Aaron Meurer
On Mon, Apr 27, 2020 at 3:22 AM Bracket Master
<[email protected]> wrote:
>
> Hello all,
> Say I have the following:
>
> ```python
> >>> sin(x)*cos(x)*cos(x)
> sin(x)*cos(x)**2
> ```
>
> How can I have sympy not rewrite/simplify when creating and expression.
> That is, I want this:
>
>
> ```python
> >>> sin(x)*cos(x)*cos(x)
> sin(x)*cos(x)*cos(x)
> ```
>
> I see something [here](https://docs.sympy.org/latest/modules/rewriting.html)
> about term rewriting, but I would like to turn it off.
>
> Basically, my use case is, I'm working with phasors, and I don't want
> sympy distributing the magnitude into the expression.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/ab11114c-25c9-47a1-b774-077a0696fed7%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/CAKgW%3D6LhUfVZxYaokQHxPu4-kmCmHv-69MihfP4AyR7z6eCpWg%40mail.gmail.com.