# Solving an equation with a specific value for $s$

I've the following code:

NSolve[{1/
Sqrt[(1 - ((2*Cx*56000^2*(Cx + C3)))*4*Pi^2*60^2)^2 +
4*Pi^2*60^2*(((4*Cx*56000)) - (Cx^2*C3*56000^3)*4*
Pi^2*60^2)^2] ==
1/Sqrt, (200704000000000000000000000000 Cx^2 60^2 \[Pi]^2 (1 -
11289600000000000000000000000000 C3 Cx \[Pi]^2)^2 + (1 -
90316800000000000000000000000000 Cx (C3 +
Cx) \[Pi]^2)^2)/(7225344000000000000000000000000000000 \
Cx^2 \[Pi]^2 (1 -
112896000000000000000000000000000000 C3 Cx \[Pi]^2)^2 + (1 -
903168000000000000000000000000000000 Cx (C3 +
Cx) \[Pi]^2)^2) == 10^((s)/(10)),
Cx > 0 && C3 > 0 && 0 < C3 < 3 Cx}, {Cx, C3}]


Question: I need to optimize $s$. I now that $s$ is between $-60\le s\le-59$. But how can I aprove my code that is automatically solves the equation with the value for $s$ that is closesed to $-60$?

• Why not add the constraint for s in your NSolve[]? Mar 27, 2018 at 8:49
• @J.M. When I substitute $-59$ or $-59.99$ for $s$ I get 'no solution'. So it would be better if it choose the value for $s$ for itself closesed to $-60$ Mar 27, 2018 at 8:53

If we name the first equation eq1, ContourPlot shows the possible solutions {Cx,C3}

eq1 = 1/Sqrt[(1 - ((2*Cx*56000^2*(Cx + C3)))*4*Pi^2*60^2)^2 +
4*Pi^2*60^2*(((4*Cx*56000)) - (Cx^2*C3*56000^3)*4*
Pi^2*60^2)^2] == 1/Sqrt
ContourPlot[ Evaluate[eq1 ] , {Cx, 0, 3 10^-8}, {C3, 0, 10^-7},FrameLabel -> {Cx, C3}, PlotRange -> {0, Automatic}] Now you can substitute the solution

ergC3 = Solve[eq1, C3](* solution C3[Cx]*)


into the second equation and solve for s[Cx]

eq2 = (200704000000000000000000000000 Cx^2 60^2 \[Pi]^2 (1 -
11289600000000000000000000000000 C3 Cx \[Pi]^2)^2 + (1 -
90316800000000000000000000000000 Cx (C3 +
Cx) \[Pi]^2)^2)/(7225344000000000000000000000000000000 \Cx^2 \[Pi]^2 (1 -112896000000000000000000000000000000 C3 Cx \[Pi]^2)^2 + (1 \- 903168000000000000000000000000000000 Cx (C3 + Cx) \[Pi]^2)^2) ==10^((s)/(10));

ergs = Solve[eq2/.ergC3, s, Reals] [];ergs = Solve[eq2, s, Reals]   /.ergC3;
Plot[{(*C3,*)s /. ergs}, {Cx, 0, 3 10^-8}, PlotRange -> {-150, 0},AxesLabel -> {Cx, s}] The plot shows s~-120!