1
$\begingroup$

Here I have one problem how to solve numerically equation for different values of one parameter x. I used just two digits because of length, but for x=0.57 I should have one real root and for others 0.6, 0.7 ... complex roots. These seven points I want to plot in complex (Re,Im) plane with line. The first problem is that NSolve doesn't work, with Reduce I can obtain some results with problems. Another problem is to understand what's happen when x-> Infinity

      x = {0.57, 0.6, 0.7, 0.8, 0.9, 1, 1.1};

      NSolve[1/Sqrt[y]
      0.02 (1.`5. I (64.`5. + 2.10 Sqrt[y]) Sqrt[-64.`5. + 
      4.21 Sqrt[y]] + (64.`5. - 2.10 Sqrt[y]) Sqrt[
      64.`5. + 4.21 Sqrt[y]]) Sqrt[-64.`5. + 4.21 Sqrt[y]] Sqrt[
      64.`5. + 4.21 Sqrt[y]] + 0.03 Sqrt[y] - # == 0, y] & /@ x
$\endgroup$
4
  • $\begingroup$ I've no idea what you mean by "NSolve doesn't work". You might find this formulation useful though. soln[x_] := NSolve[(1/ Sqrt[y] 0.02 (1.5. I (64.5. + 2.10 Sqrt[y]) Sqrt[-64.5. + 4.21 Sqrt[y]] + (64.5. - 2.10 Sqrt[y]) Sqrt[ 64.5. + 4.21 Sqrt[y]]) Sqrt[-64.5. + 4.21 Sqrt[y]] Sqrt[ 64.5. + 4.21 Sqrt[y]] + 0.03 Sqrt[y] - # == 0), y] &[x]` $\endgroup$ Commented Mar 4, 2014 at 0:00
  • $\begingroup$ @DanielLichtblau NSolve tells me that there are no roots, while Reduce returns solutions. I tested on a rationalized version of the system but I didn't verify if the results returned by Reduce are correct. $\endgroup$
    – Szabolcs
    Commented Mar 4, 2014 at 2:18
  • $\begingroup$ @Pipe Use SetPreicision[..., 100] on your equation and use WorkingPrecision -> 100 in NSolve. Then it will be able to return the same results Reduce gives you. Sorry, no time for writing this in an answer. Anyone reading this feel free to post it. $\endgroup$
    – Szabolcs
    Commented Mar 4, 2014 at 2:23
  • $\begingroup$ @Szabolcs Thanks for the clarification. I see where I went astray: I simply missed the first line that defined x. The issue I believe is in verification-- without using high precision NSolve seems to think the roots it finds are all parasites. $\endgroup$ Commented Mar 4, 2014 at 15:06

1 Answer 1

2
$\begingroup$

Per Szabolcs's comment:

x = SetPrecision[{0.57, 0.6, 0.7, 0.8, 0.9, 1, 1.1}, 100];

N@NSolve[SetPrecision[
     1/Sqrt[y] 0.02 (1.`5. I (64.`5. + 2.10 Sqrt[y]) Sqrt[-64.`5. + 
             4.21 Sqrt[y]] + (64.`5. - 2.10 Sqrt[y]) Sqrt[64.`5. +
             4.21 Sqrt[y]]) Sqrt[-64.`5. + 4.21 Sqrt[y]] Sqrt[64.`5. +
             4.21 Sqrt[y]] + 0.03 Sqrt[y] - # == 0,
     100], y, WorkingPrecision -> 100] & /@ x
(*
  {{{y -> 231.101 - 0.0000358251 I}}, {{y -> 231.103 - 0.0000722172 I}},
   {{y -> 231.112 - 0.000351306 I}}, {{y -> 231.127 - 0.000983853 I}},
   {{y -> 231.146 - 0.0021135 I}}, {{y -> 231.171 - 0.00388268 I}},
   {{y -> 231.2 - 0.00643228 I}}}
*)

Check:

Reduce[
   1/Sqrt[y] 0.02 (1.`5. I (64.`5. + 2.10 Sqrt[y]) Sqrt[-64.`5. + 
           4.21 Sqrt[y]] + (64.`5. - 2.10 Sqrt[y]) Sqrt[64.`5. +
           4.21 Sqrt[y]]) Sqrt[-64.`5. + 4.21 Sqrt[y]] Sqrt[64.`5. +
           4.21 Sqrt[y]] + 0.03 Sqrt[y] - # == 0, y] & /@ N@x

Reduce::ratnz: Reduce was unable to solve the system with inexact coefficients. The answer was obtained by solving a corresponding exact system and numericizing the result. >>
...
General::stop: Further output of Reduce::ratnz will be suppressed during this calculation. >>

{y == 231.101 - 0.0000358251 I, y == 231.103 - 0.0000722172 I, 
 y == 231.112 - 0.000351306 I, y == 231.127 - 0.000983853 I, 
 y == 231.146 - 0.0021135 I, y == 231.171 - 0.00388268 I, 
 y == 231.2 - 0.00643228 I}
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.