I use Reduce to solve an 3rd order equation, and the output is given as the OR'd combination the solution variable. Normally, I can do a replacement to assign the value to a variable, but that doesn't work on Reduce. I found that I need to use ToRules to do so, but I still can't get it to work.
Vout = Vin/(C1*C2*L1*R1*s^3 + C1*R1*s + C2*L1*s^2 + C2*R1*s + 1)
s = I ω;
values = {
R1 -> 2000,
C1 -> 10e-9,
L1 -> 500u,
C2 -> 1.2n
};
sol2 = Reduce[ComplexExpand[Im[Vout/Vin /. values]] = =0, ω]
Here's what I see in my notebook:
Normally, I'd do
ω = (ω /. sol2[[3])
to grab the 3rd item from the similar list resulting from Solve
. However, Reduce
doesn't provide a list, so it doesn't work. How do I use ToRules
correctly? Or is there another way to grab a specific output from the expression returned by Reduce
?
ToRules
? $\endgroup$ – Michael E2 Oct 15 '20 at 18:29{ToRules[sol2]}[[3]]
instead. $\endgroup$ – Sjoerd Smit Oct 15 '20 at 18:34\[Omega] /. Solve[sol2, \[Omega]]
$\endgroup$ – Jason B. Oct 15 '20 at 19:04Solve
, e.g.,sol2 = Solve[ComplexExpand[Im[Vout/Vin /. (values // Rationalize)]] == 0, \[Omega]]
. In some cases you may wish/need to add the optionMethod -> Reduce
$\endgroup$ – Bob Hanlon Oct 15 '20 at 19:12