0
$\begingroup$

In my notebook, I obtain an expression that I can't figure out how to reduce to it's simplest form. I've recreated it below to show what I am trying to simplify.

Iratio2to1 = -(L1/Sqrt[L1 L2])
L2=(N2/N1)^2*L1 
Assuming[{L1, L2} > 0 && {L1, L2} \[Element] Reals,Cancel[Iratio2to1]] 

this returns:

$$-\frac{L1}{4\sqrt{L1^2}}$$

I cannot figure out how to have Mathematica reduce this to $-\frac{1}{4}$.

I've tried Simplify, FullSimplify, Cancel, now Assuming... I dont' get it!

$\endgroup$
  • $\begingroup$ Since Greater does not have the attribute Listable then {L1, L2} > 0 does not do what you expect. Use either L1 > 0 && L2 > 0 or And@@Thread[{L1,L2} > 0]. Cancel does not use the option Assumptions so the Assuming has no effect. Use Simplify or FullSimplify since they use the option Assumptions. Any variable used in an inequality (e.g., Greater) is assumed real so the {L1, L2} \[Element] Reals is redundant. $\endgroup$ – Bob Hanlon Apr 20 '18 at 21:35
  • $\begingroup$ Thank you for your help. $\endgroup$ – jrive Apr 21 '18 at 11:56
1
$\begingroup$

Because it's equal to:

$$-\mathrm{sgn}(L1)\frac{1}{4}$$

You can approach in multiple ways:

Simplify for real L1:

FullSimplify[Iratio2to1, Element[L1, Reals]]
(* -(Sign[L1]/4) *)

Or for positive L1:

FullSimplify[Iratio2to1, L1 > 0]
(* -(1/4) *)

But for complex L1 it won't cancel:

FullSimplify[Iratio2to1, Element[L1, Complexes]]
(* -(L1/(4 Sqrt[L1^2])) *)
| improve this answer | |
$\endgroup$
  • $\begingroup$ Thank you for the detailed explanation. $\endgroup$ – jrive Apr 21 '18 at 11:57
0
$\begingroup$

Not sure why your Assuming doesn't work, but this works:

$Assumptions = L1 > 0

Simplify[-L1/(4 Sqrt[L1^2])]
(* -(1/4) *)
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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