1
$\begingroup$

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[2], (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$?

$\endgroup$
2
  • $\begingroup$ Why not add the constraint for s in your NSolve[]? $\endgroup$ Mar 27, 2018 at 8:49
  • $\begingroup$ @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$ $\endgroup$
    – Looper
    Mar 27, 2018 at 8:53

1 Answer 1

1
$\begingroup$

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[2]   
ContourPlot[ Evaluate[eq1 ] , {Cx, 0, 3 10^-8}, {C3, 0, 10^-7},FrameLabel -> {Cx, C3}, PlotRange -> {0, Automatic}]

enter image description here

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] [[1]];ergs = Solve[eq2, s, Reals]   /.ergC3;
Plot[{(*C3,*)s /. ergs}, {Cx, 0, 3 10^-8}, PlotRange -> {-150, 0},AxesLabel -> {Cx, s}]

enter image description here

The plot shows s~-120!

$\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.