0
$\begingroup$

So I have the following expression that derives from previous computations:

aux=(Sqrt[Im[Rout]^2+Re[Rout]^2])/(\[Sqrt]((-2000 f \[Pi] Im[L1]-2000 f \[Pi] Im[L3]+f^3 \[Pi]^3 (-8000000000 Im[C2] Im[L1] Im[L3]+8000000000 Im[L3] Re[C2] Re[L1]+8000000000 Im[L1] Re[C2] Re[L3]+8000000000 Im[C2] Re[L1] Re[L3])+Re[Rin]+f^2 \[Pi]^2 (4000000 Im[L3] Im[Rin] Re[C2]+4000000 Im[C2] Im[Rin] Re[L3]+4000000 Im[C2] Im[L3] Re[Rin]-4000000 Re[C2] Re[L3] Re[Rin])+Re[Rout]+f^2 \[Pi]^2 (4000000 Im[L1] Im[Rout] Re[C2]+4000000 Im[C2] Im[Rout] Re[L1]+4000000 Im[C2] Im[L1] Re[Rout]-4000000 Re[C2] Re[L1] Re[Rout])+f \[Pi] (2000 Im[C2] Im[Rin] Im[Rout]-2000 Im[Rout] Re[C2] Re[Rin]-2000 Im[Rin] Re[C2] Re[Rout]-2000 Im[C2] Re[Rin] Re[Rout]))^2+(Im[Rin]+Im[Rout]+2000 f \[Pi] Re[L1]+2000 f \[Pi] Re[L3]+f^3 \[Pi]^3 (Im[L3] (8000000000 Im[L1] Re[C2]+8000000000 Im[C2] Re[L1])+(8000000000 Im[C2] Im[L1]-8000000000 Re[C2] Re[L1]) Re[L3])+f^2 \[Pi]^2 (Im[Rin] (4000000 Im[C2] Im[L3]-4000000 Re[C2] Re[L3])+(-4000000 Im[L3] Re[C2]-4000000 Im[C2] Re[L3]) Re[Rin])+f^2 \[Pi]^2 (Im[Rout] (4000000 Im[C2] Im[L1]-4000000 Re[C2] Re[L1])+(-4000000 Im[L1] Re[C2]-4000000 Im[C2] Re[L1]) Re[Rout])+f \[Pi] (Im[Rout] (-2000 Im[Rin] Re[C2]-2000 Im[C2] Re[Rin])+(-2000 Im[C2] Im[Rin]+2000 Re[C2] Re[Rin]) Re[Rout]))^2))

Because all variables are real and positive I do this:

aux = Simplify[aux, {Rin,L1,C2,L3,Rout} \[Element] PositiveReals];

And obtain

Abs[Rout]/Sqrt[(Rin-4000000 C2 f^2 L3 \[Pi]^2 Rin+Rout-4000000 C2 f^2 L1 \[Pi]^2 Rout)^2+4000000 f^2 \[Pi]^2 (L1+L3-4000000 C2 f^2 L1 L3 \[Pi]^2+C2 Rin Rout)^2]

Now why in the world is Mathematica doing Abs[Rout] instead of Rout, how can I bypass this?

My version is 12.3.1.0

$\endgroup$
6
  • 3
    $\begingroup$ With v13.2.1, I cannot reproduce your problem. Have you tried starting with a fresh kernel or restarting Mma? $\endgroup$
    – Bob Hanlon
    Feb 20, 2023 at 2:45
  • 3
    $\begingroup$ On v12.2.0 Win7-x64, I see this. $\endgroup$
    – Syed
    Feb 20, 2023 at 3:14
  • 1
    $\begingroup$ Please edit your question to include further details, like the output of $Version and if you have tried this with fresh Kernel or not. Problem can't be reproduced on 13.2.0 for Linux x86 (64-bit) (December 12, 2022) . $\endgroup$
    – rhermans
    Feb 20, 2023 at 16:31
  • $\begingroup$ Just updated the version $\endgroup$ Feb 20, 2023 at 22:52
  • $\begingroup$ @GrangerObliviate in 12.0 on a mac there's no problem. What I mean is that I don't get Abs[Rout] $\endgroup$
    – bmf
    Feb 21, 2023 at 6:26

1 Answer 1

0
$\begingroup$

I have the same version, 12.3.1.0, on Linux, and the issue does not reproduce. That said the code technically does not seem correct (unless I've missed that feature in the documentation): the code says that a list is an element of PositiveReals instead of saying that each individual element of that list is a positive real number. To make sure it is not the issue, can you try the following?

aux = Simplify[aux, And@@(Element[#,PositiveReals]&/@{Rin,L1,C2,L3,Rout})];
$\endgroup$
1
  • 1
    $\begingroup$ It's easier to write (Rin | L1 | C2 | L3 | Rout) \[Element] PositiveReals. $\endgroup$ Feb 21, 2023 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.