1
$\begingroup$

I have the following set of equations and paramters (ODE):

u4 = 1 - u1 - u2 - u3 - u6;

d1 = p1 - k1*u2*u5 - k3*u1*u5 - k4*u3*u5 - k5*u5*p4*u4 - p4*k6*u1*u5*u6;
d2 = k1*u2*u5 - k2*u1*p2 - k3*u1*u5 - p4*k6*u1*u5*u6;
d3 = -k1*u2*u5 + k2*u1*p2 + k5*u5*p4*u4 + 2*p4*k6*u1*u5*u6 - k7*(u2 - u6)*p3;
d4 = k3*u1*u5 - k4*u3*u5 ;
d5 = -k6*p4*u1*u5*u6 + k7*(u2 - u6)*p3;

k1 = 1;
k2 = 500;
k3 = 1/10;
k4 = 1/10;
k5 = 1/10;
k6 = 10;
k7 = 1;
p1 = 2/100;
p4 = 1;
p2 = p1;
p3 = 0;
p2 = p1/100;

When I try and solve these equations analytically I get a set of solutions, but when I try to do this numerically, I get an empty set:

Solve[{d1==0,d2==0,d3==0,d4==0,d5==0},{u1,u2,u3,u5,u6},Reals];

returns a set of solutions while

NSolve[{d1==0,d2==0,d3==0,d4==0,d5==0},{u1,u2,u3,u5,u6},Reals];

returns {}.

Why is that so?

$\endgroup$
5
  • $\begingroup$ I am getting a solution set in V11.0 with NSolve. $\endgroup$
    – zhk
    Apr 5 '17 at 10:50
  • $\begingroup$ Solve and NSolve are not equivalent functions providing equivalent sets of solutions. You can find a detailed discussion of this issue here Issue with NSolve. Nonetheless NSolve can also find a solution: NSolve[{d1 == 0, d2 == 0, d3 == 0, d4 == 0, d5 == 0}~Join~ Thread[-1 <= Re[#] <= 1 &@{u1, u2, u3, u5, u6}], {u1, u2, u3, u5, u6}]. One can get rid off big imaginary parts of solutions setting WorkingPrecision -> 10. $\endgroup$
    – Artes
    Apr 5 '17 at 11:00
  • $\begingroup$ hmm.. I'm running this on V10.2, I'll restart it and we'll see what happens $\endgroup$
    – Yotam
    Apr 5 '17 at 11:00
  • $\begingroup$ @Artes I'm not sure I understand your final comment. I'm specifying in my command to solve over the reals. $\endgroup$
    – Yotam
    Apr 5 '17 at 11:15
  • $\begingroup$ Just read Issue with NSolve. I meant to evaluate: NSolve[{d1 == 0, d2 == 0, d3 == 0, d4 == 0, d5 == 0}~Join~ Thread[-1 <= Re[#] <= 1 &@{u1, u2, u3, u5, u6}], {u1, u2, u3, u5, u6}, WorkingPrecision -> 10]. It apears there is some problem with implementation of NSolve, especially related to usage of domains. $\endgroup$
    – Artes
    Apr 5 '17 at 11:29

Browse other questions tagged or ask your own question.