0

Would be grateful for your help in tackling this complex polynomial where I am trying to solve for x. When I run the code below, I get the message:

value x of the domain argument should be Complexes, Reals, Algebraics, Rationals, Integers, Primes or Automatic.

What would be the best way to address this?

sol = 
  NSolve[
    (g+0.4*(1/s)(Log[k*(1+x)*E^-r]/k +(r+s^2/2)-s)-0.16(1/s)(Log[k*(1+x)*E^-r]/k +(r+s^2/2)-s)^3+0.025(1/s)(Log[k*(1+x)*E^-r]/k +(r+s^2/2)-s)^5-0.003(1/s)(Log[k*(1+x)*E^-r]/k +(r+s^2/2)-s)^7) /
    (0.4*(1/s)(Log[k*(1+x)*E^-r]/k +(r+s^2/2))-0.16(1/s)(Log[k*(1+x)*E^-r]/k +(r+s^2/2))^3+0.025(1/s)(Log[k*(1+x)*E^-r]/k +(r+s^2/2))^5-0.003(1/s)(Log[k*(1+x)*E^-r]/k +(r+s^2/2))^7)==x, 
  0 < x < 10, 
  {x, 0.25}, x]
m_goldberg
  • 107,779
  • 16
  • 103
  • 257
MZC
  • 1
  • 1
  • r, g, s, and k are other variables. I am trying to solve x in terms of these variables. I fixed the bracket issue but it is still giving me the same error. – MZC Aug 27 '19 at 19:56
  • Can you post the correction and that extra bit of information? – Moo Aug 27 '19 at 19:59
  • 1
    To solve the equation numerically, all parameters (i.e., {r, g, s, k}) must have numeric values. To use Manipulate to find solutions for various numeric values of the parameters, you need to specify the range of feasible values for these parameters. – Bob Hanlon Aug 27 '19 at 20:22
  • Thank you Bob Hanlon, is there a command that would give me x in terms of these variables without specifying a range for them? I tried simplify before, but it was just taking forever...Thank you Moo, I am in Africa, and currently have to ask a colleague to run it for me every time I have a correction...So he emails me back the code in this form, in his code the bracket issue is correctly enclosed and he gets the same error. – MZC Aug 27 '19 at 20:33
  • anyone out there to help me with this problem? getting desperate here in Africa, but the result will help me solve a very interesting question. Would very much appreciate any suggestions. Bob Hanlon, what would be the syntax in specifying the range of feasible values for these variables? And how would I visualize the result? Thank you. – MZC Aug 28 '19 at 20:35
  • Your equation dose not involve polynomials by any definition of polynomial that I understand. NSolve does not support the syntax you are using. You might look at FindRoot which has a syntax closer to what you are giving NSolve. Unless you supply values for the all the undefined parameters, it will be impossible to give more specific help. – m_goldberg Sep 01 '19 at 14:56
  • For me NSolve work fine: r = 1; k = 2; s = 3; g = 4; e = 5;NSolve[eq, x, Reals] give me: {{x -> -0.973348}, {x -> -0.0412105}}. – Mariusz Iwaniuk Sep 01 '19 at 15:21
  • Thank you so much for taking the time to you especially Mariusz. You just inspired me to a solution for my paper!! I think an analytical answer to this equation is hopeless through manipulation (at least for me!), but perhaps there is an analytical solution through iterations of values for these 5 other parameters if for example for some of them there is convergence, e is the natural log. – MZC Sep 01 '19 at 18:08
  • Mariusz, could you kindly share with me the syntax you used? For some reason my colleague could not get the right form? Also, is there a command that would show me the steps used by Mathematica to arrive at the solution? Or what would be the most simplified expression just in terms of x after plugging these values... – MZC Sep 05 '19 at 17:15

0 Answers0