Finding solutions to expression with initial estimates

I need to find solutions to Zo==50 with 4 variables w,s,h1 and h2. I have initial estimates for these variables that will come close to solving the equation, however I need to 'optimise' w,s,h1 and h2 to give me solution/s to Zo=50. Is there a way I can include these estimates in NSolve or something similar to compute s,w,h1 and h2 within a certain range?

In[142]:= Zo = Sqrt[Ll/Cl]

Out[142]= 94.2185 Sqrt[EllipticK[Sqrt[1 - w^2/(2 s +
w)^2]]^2/(EllipticK[w/(2 s + w)]^2 (1 + (5.34 EllipticK[Sqrt[1 - w^2/(2 s +
w)^2]]EllipticK[Csch[(\[Pi] (2 s + w))/(4 h1)] Sinh[(\[Pi] w)/(4 h1)]])/(
EllipticK[w/(2 s + w)] EllipticK[Sqrt[1 - Csch[(\[Pi] (2 s + w))/(4 h1)]^2
Sinh[(\[Pi] w)/(4 h1)]^2]]) - (3.89 EllipticK[Sqrt[1 - w^2/(2 s + w)^2]]
EllipticK[Csch[(\[Pi] (2 s + w))/(4 h2)] Sinh[(\[Pi] w)/(4 h2)]])/(
EllipticK[w/(2 s + w)] EllipticK[Sqrt[1 - Csch[(\[Pi] (2 s + w))/(4 h2)]^2
Sinh[(\[Pi] w)/(4 h2)]^2]])))]

In[179]:= Clear[s, h1, h2, w]

In[xx]:=NSolve[{Zo == 50, 0.1*10^-6 < w < 100*10^-6,
0.1*10^-6 < s < 100*10^-6, 100*10^-6 < h1 < 1000*10^-6,
100*10^-9 < h2 < 100*10^-9}, {w, s, h1, h2}]

Out[xx]:{}


I am unsure of NSolve syntax; i gave this a crack but it doesn't find any solutions

Thanks!

• If you have initial sufficiently good estimates, then FindRoot should be the method of choice. Commented Apr 5, 2018 at 6:23

Clear[Zo]

Zo = (94.2185 Sqrt[
EllipticK[
Sqrt[1 - w^2/(2 s + w)^2]]^2/(EllipticK[
w/(2 s +
w)]^2 (1 + (5.34 EllipticK[
Sqrt[1 - w^2/(2 s + w)^2]] EllipticK[
Csch[(π (2 s +
w))/(4 h1)] Sinh[(π w)/(4 h1)]])/(EllipticK[
w/(2 s + w)] EllipticK[
Sqrt[1 -
Csch[(π (2 s +
w))/(4 h1)]^2 Sinh[(π w)/(4 h1)]^2]]) -
(3.89 EllipticK[Sqrt[1 - w^2/(2 s + w)^2]] EllipticK[Csch[(π (2 s +
w))/(4 h2)] Sinh[(π w)/(4 h2)]])/(EllipticK[
w/(2 s + w)] EllipticK[
Sqrt[1 -
Csch[(π (2 s +
w))/(4 h2)]^2 Sinh[(π w)/(4 h2)]^2]])))] /.
x_Real :> Rationalize[x]) // Simplify;

NMinimize[{Abs[Zo - 50], 10^-7 < w < 10^-4, 10^-7 < s < 10^-4,
10^-4 < h1 < 10^-3, 10^-8 < h2 < 10^-7}, {w, s, h1, h2},
WorkingPrecision -> 50] // N

(* {3.41649*10^-21, {w -> 0.0000874514, s -> 0.0000441351,
h1 -> 0.000236364, h2 -> 7.19451*10^-8}} *)