# NSolve results in imaginary solutions for Physical System

I have the following function:

F[z_,V_] := (h*c*Pi^2*A)/(240*z^4) + eps*A/(2*z^2)*V^2 - k*(g - z);


It's a pyhsical force that depends on the voltage "V" and the gap "g". "z" is the deflection of the object after applying the voltage "V".

And I would like to numerically solve the following system of equations:

h =  6.62607015*10^(\[Minus]34);
c =  299792458 ;
eps = 8.8541878128*10^(\[Minus]12);
w = 1*10^-6;
l = 10*10^-6;
A = w*l;
t =  100*10^-9;
i = w*t^3/12;
e =  120*10^9;
k =  3*e*i/l^3;
g = 50*10^-9;
sol = NSolve[{F[z, V] == 0 , D[F[z, V], z] == 0 } , {V, z}]


The result is:

{{V -> -0.548103 - 0.668107 I,
z -> -5.17747*10^-8 - 4.12381*10^-8 I}, {V -> -0.548103 +
0.668107 I,
z -> -5.17747*10^-8 + 4.12381*10^-8 I}, {V -> 0.548103 - 0.668107 I,
z -> -5.17747*10^-8 + 4.12381*10^-8 I}, {V ->
0.548103 + 0.668107 I,
z -> -5.17747*10^-8 - 4.12381*10^-8 I}, {V -> 0.69165 - 0.342071 I,
z -> 2.88007*10^-8 - 6.63079*10^-8 I}, {V -> 0.69165 + 0.342071 I,
z -> 2.88007*10^-8 + 6.63079*10^-8 I}, {V -> -0.69165 - 0.342071 I,
z -> 2.88007*10^-8 + 6.63079*10^-8 I}, {V -> -0.69165 + 0.342071 I,
z -> 2.88007*10^-8 - 6.63079*10^-8 I}, {V -> 0. - 0.64675 I,
z -> 7.92814*10^-8}, {V -> 0. + 0.64675 I, z -> 7.92814*10^-8}}


As you can see all values are imaginary ! This should not be the case, since it is a pyhsical system, the values should be real and positive.

I have notices that if I increase the gap anything above 130nm it works, and I get one solution that is real and positive for every gap.

I was therefore wondering, if this is a numeric issue for the lower gap values, and how I could solve it ?

Many thanks.

• Should not the function be F[z_,V_] and not F[z_]? This is how you are calling it. Mar 30 '20 at 9:43
• @Nasser Thanks for spotting that typo Mar 30 '20 at 10:00
• This might simply require input that is higher precision than MachinePrecision. Mar 30 '20 at 14:18
• @DanielLichtblau Thanks for your comment. How would you test this ? Mar 30 '20 at 14:22
• I'd give higher precision (or perhaps exact) input and try adjusting the WorkingPrecision option in NSolve. Mar 30 '20 at 14:35

You can add conditions and domain to Solve command:

Solve[F[z] == 0 && D[F[z], z] == 0 && h > 0 && c > 0 && eps > 0 && A > 0, {V, z}, Reals]


This gives ConditionalExpressions:

So, except of all the variables shoud be positive, we have another condition on k, or we can rewrite it in terms of g:

g^5 > (625*c*h*l*Pi^2)/(3072*e*t^3)


and substituting your numnerical values one can find that

g^5 > 3.32395*10^-20


or

g > 0.000127154


the result you mentioned in question.

• Great ! Thanks a lot for your answer. I did not know that one could specify domains too . Mar 30 '20 at 11:32