solve() gives incorrect answer
Show older comments
I am having trouble with the solve() command in Matlab R2012a 64 bit. I will supply an example to show what I mean. I stated the specificiation of my computer as well, I do not know if that is considered useful.
----------------------------
COMPUTER SPECIFICATIONS
----------------------------
Windows 7 Enterprise SP 1
64-bit OS
Intel Core i7-2670QM CPU 2.2 GHz
8,00 GB RAM
----------------------------
EXAMPLE
----------------------------
I have a function
G = (- 13*x^2 + 2*x + 1)/(10*(x^5)^(1/2)).
I am interested in the intersection with y = -1.
Both
solve(G+1)
and
solve('(- 13*x^2 + 2*x + 1)/(10*(x^5)^(1/2)) == -1')
give me
ans =
1
This is only one of the intersections, as can be seen from the figure below. Does anyone have an idea what I might be overlooking?
Thanks in advance,
Jori

1 Comment
Walter Roberson
on 6 Nov 2012
The other solution is the rather messy
69/400 + (1/1200)*3^(1/2)*((27883*(127918+30*315201^(1/2))^(1/3) + 400*(127918+30*315201^(1/2))^(2/3) + 1009600)/(127918 + 30*315201^(1/2))^(1/3))^(1/2) + (1/1200)*6^(1/2)*((27883*(127918 + 30*315201^(1/2))^(1/3) - 200*(127918 + 30*315201^(1/2))^(2/3) - 504800 + 1193127*3^(1/2)*((127918 + 30*315201^(1/2))^(1/3)/(27883*(127918 + 30*315201^(1/2))^(1/3) + 400*(127918 + 30*315201^(1/2))^(2/3) + 1009600))^(1/2)*(127918 + 30*315201^(1/2))^(1/3))/(127918 + 30*315201^(1/2))^(1/3))^(1/2)
... for whatever that is worth ;-)
Accepted Answer
More Answers (1)
Matt Fig
on 6 Nov 2012
Try this way:
>> solve('(- 13*x^2 + 2*x + 1)/(10*(x^5)^(1/2))+1')
ans =
1
0.804852915577
0.293548879142
- 0.204200897359 + 0.0250516778169*i
- 0.204200897359 - 0.0250516778169*i
1 Comment
Categories
Find more on Code Performance in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!