#2397 Solve returns [] when solutions exists

open
nobody
5
2012-11-18
2012-04-24
No

When exponents contain decimals with many figures you risk:

Maxima v. 5.25.1
(%i1) solve(%e^(0.0057195*x)+%e^(-0.0057195*x)=1,x);
(%o1) []
But solutions exist. Removing a decimal in the exponents:

(%i1) solve(%e^(0.005719*x)+%e^(-0.005719*x)=1,x);
<< expression too long ... >>

Removing 1 more returns a list of result.

A warning would be nice.

Discussion

  • Raymond Toy

    Raymond Toy - 2012-04-24

    A warning about what?

    Note also that your expression is equivalent to 2*cosh(.0057195*x)=1, which has no solution for real x. There is, of course, a solution for imaginary values of x, and maxima can solve 2*cosh(.0057195*x)=1.

    And maxima 5.27 appears to be finding roots of the original equation, but I didn't wait. For .00571, maxima returns a long list, but they're not actually solutions because x appears on both the lhs and the rhs. That's a bug in solve.

     
  • Mikael Samsøe Sørensen

    Good point. I tried to find a simpler version version of the actual equation that had the problem. But failed to see that it didn't have soutions. here is the right equation

    solve(112.02267*%e^(-0.0057195*x)/(1.80517*%e^(-0.0057195*x)+1)^2-1.97=0,x)
    it has a real solution at x=694.8

     
  • Raymond Toy

    Raymond Toy - 2012-04-27

    I think that if you are seeking numerical answers you should use a numerical method. find_root works great on this example:

    find_root(112.02267*%e^(-0.0057195*x)/(1.80517*%e^(-0.0057195*x)+1)^2-1.97,x,0,1000)

    694.8021925434504

     
  • Mikael Samsøe Sørensen

    True, but I still think it is inappropriate that Maxima returns []. Unable to solve or return the original equation would be better.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks