# Reduce or Solve to solve 3 simultaneous equations/inequalities

I've tried both ways, and maybe it justtakes Mathematica a long time to solve this system of equations, but I can't tell if it is hung up or crunching. So, I'm wondering im y approach with mathematica is wrong in the first place:

eq1=(0.0000472222 C1 R1)/(1. C1^2 R1^2 + C2 (0.0051 + (0.0000472222 + 108. C1) R1 + 1. C1 R1^2)) <= \[Pi]/4

eq2=(14.0028 C1 R1 Sqrt[C1 R1 + C2 (108 + R1)] (C1 R1 (1.35525*10^-20 + 1. C1 R1) + C2 (0.0051 + (0.0000472222 + 108. C1) R1 + 1. C1 R1^2)))/(Sqrt[C1 C2 R1] (1. C1^2 R1^2 + C2 (0.0051 + (0.0000472222 + 108. C1) R1 + 1. C1 R1^2))) >= 60

eq3= (2.22861 Sqrt[C1 R1 + C2 (108 + R1)])/Sqrt[C1 C2 R1] >= 220000


I've tried

Reduce[{eq3, eq4, eq5, R1 > 0, C1 > 0, C2 > 0, C1 > C2}, {C1, C2, R1}, Reals]


and

Solve[eq3 && eq4 && eq5 && R1 > 0 && C1 > 0 && C2 > 0 && C1 > C2, {C1, C2, R1}, Reals]


but it's either not working, or just taking a lot longer than I expect it to (and I should just let it run longer)

Is there a way for me to know if it is crunching or hung up? Is there a better way to solve this system in Mathematica? Should I be constraining the possible values of R1, C1, and C2 better or more?

Thanks for the help

• see if FindInstance finds any solution – george2079 Jun 2 '17 at 21:23
• Trying it now...has been crunching for 20min....seems to be similar Solve and Reduce - I'm letting it run for a while to see what happens. Thank you for the suggestion – jrive Jun 2 '17 at 22:24
• Can you plot these three equations to see about where they intersect, or to make sure there is an intersection point? – Tom Mozdzen Jun 3 '17 at 0:15
• it may help if you rationalize all of the floating point stuff ( 0.0051 -> 51/10000 , etc ) – george2079 Jun 3 '17 at 3:01
• Thank you for the suggestions....@Tom, can you suggest how I could plot these equations? – jrive Jun 3 '17 at 15:24

I would rather have seen the inequalities in the Laplace Transform (sL and 1 / (sC)). But it goes like this. First we make equations from the inequalities, apply rationalization, and compute R1. We use FindInstance to find C1 and C2.

eq1 = (0.0000472222 C1 R1)/(1. C1^2 R1^2 + C2 (0.0051 + (0.0000472222 + 108. C1) R1 + 1. C1 R1^2)) - π/4;
eq2 = (14.0028 C1 R1 Sqrt[C1 R1 + C2 (108 + R1)] (C1 R1 (1.35525*10^-20 + 1. C1 R1) + C2 (0.0051 + (0.0000472222 + 108. C1) R1 + 1. C1 R1^2)))/(Sqrt[C1 C2 R1] (1. C1^2 R1^2 +
C2 (0.0051 + (0.0000472222 + 108. C1) R1 + 1. C1 R1^2))) - 60;
eq3 = (2.22861 Sqrt[C1 R1 + C2 (108 + R1)])/Sqrt[C1 C2 R1] - 220000;

eq11 = Rationalize[eq1, 0];
eq22 = Rationalize[eq2, 0];
eq33 = Rationalize[eq3, 0];

R1 = R1 /. First@Solve[eq33 == 0, R1];
solC1C2 = First@FindInstance[{eq11 == 0, eq22 == 0}, {C1, C2}] // N
{C1 -> 6.59944*10^-10, C2 -> 1.21549*10^-10}

R1 /. solC1C2
65772.


The absolute error is in the range of machine accuracy.

{eq1, eq2, eq3} /. solC1C2
{1.45106*10^-13, -1.29887*10^-11, 2.91038*10^-11}


To answer your last question in your comment: Fortunately, the inequalities have the form greater than or equal to and less than or equal to!!!

You can do the same calculation with your inequalities. It's then difficult to calculate R1.

eq1 = (0.0000472222 C1 R1)/(1. C1^2 R1^2 + C2 (0.0051 + (0.0000472222 + 108. C1) R1 + 1. C1 R1^2)) <= π/4;
eq2 = (14.0028 C1 R1 Sqrt[C1 R1 + C2 (108 + R1)] (C1 R1 (1.35525*10^-20 + 1. C1 R1) + C2 (0.0051 + (0.0000472222 + 108. C1) R1 + 1. C1 R1^2)))/(Sqrt[C1 C2 R1] (1. C1^2 R1^2 +
C2 (0.0051 + (0.0000472222 + 108. C1) R1 + 1. C1 R1^2))) >= 60;
eq3 = (2.22861 Sqrt[C1 R1 + C2 (108 + R1)])/Sqrt[C1 C2 R1] >= 220000;

eq11 = Rationalize[eq1, 0];
eq22 = Rationalize[eq2, 0];
eq33 = Rationalize[eq3, 0];

solR1 = Simplify[Reduce[eq33, R1], C1 > 0 && C2 > 0] // N


We already have a solution for R1, C1, and C2 and check whether this condition for R1 is met by using the calculated values.

R1 = 65772;
sol = {C1 -> 6.59944*10^-10, C2 -> 1.21549*10^-10};
solR1 /. sol
{True}

• Success!! Thank you very much! I've been at this for the better part of 2 days trying to manipulate this so that Mathematica could solve the system of equations. Excellent. I tried voting this answer up, but I don't have enough reputation to be able to do so. Apologies. What would the approach to solve these as inequalities instead ? For example, eq1 <= pi/4, eq2 >=60, eq3>=220000? – jrive Jun 3 '17 at 20:37
• @jrive I have tried to answer your last question. – user36273 Jun 4 '17 at 9:55
• Excellent, @rewi- thanks again. I will play with this some more to understand. – jrive Jun 4 '17 at 15:55
• did it take a long time for you as well for Mathematica to do the Reduce function? – jrive Jun 5 '17 at 0:11
• @jrive On my notebook it takes 0.76s, provided the terms were rationalized. – user36273 Jun 5 '17 at 8:32