1

I am trying to solve a system of 3 equations using Ryacas package in R.

library(Ryacas)
 yacas("OldSolve({(f*Reg/(k + Reg)) - r*BB - ab * BB - a1*f1*BB*AA*P - fp*BB*P==0,(ab * BB + a1*f1*BB*AA*P)/e1 - m1 * AA == 0, (fp * BB * P)/ep - f1*AA*P - mp * P ==0 },{BB,AA,P})")

But I get the following answer in R

expression(list(list(BB == BB, AA == (f * Reg/(k + Reg) - r * 
    BB - ab * BB - fp * BB * P)/(P * (a1 * f1 * BB)), P == P)))

However, I'm supposed to get the following answer if I solve on other software (Its too big to write it out on stackoverflow)

Basically of the form

{BB -> some value, AA -> some value, P-> 0}, {BB -> some value, AA -> some value, P-> some value}, 
{BB -> some value, AA -> some value, P-> some value}
Rspacer
  • 2,369
  • 1
  • 14
  • 40

1 Answers1

1

It's hard to fully prove it, but it's most likely that OldSolve is too weak for this system.

A couple of important points from the manual:

This command tries to solve one or more equations.

Hence, no guarantees.

Note that only one solution is found and returned.

Meaning that there surely is no way to get all three solutions that you mentioned.

Again, at most a single solution is returned.

The fact that you got BB == BB and P == P means infinitely many solutions, so possibly we can see it as an evidence of failure to solve the system.

Multiple equations are solved recursively: firstly, an equation is sought in which one of the variables occurs exactly once; then this equation is solved with SuchThat; and finally the solution is substituted in the other equations by Eliminate decreasing the number of equations by one. This suffices for all linear equations and a large group of simple nonlinear equations

So, this kind of explains why OldSolve may fail in your system. First, it's nonlinear, giving no guarantees. Second, each of the variables appears in each of the equations 1-4 times. If I understand the algorithm correctly, after solving one equation (w.r.t. AA, say) and substituting the solution to the other two - we are done. That's because then both BB and P appear in both of the remaining equations more than once (and, as a result, OldSolve fails to solve any of them). You can also try to switch the order of the equations; you will see that then a different variable gets solved for.

Julius Vainora
  • 47,421
  • 9
  • 90
  • 102