What's the difference in all the polynomial solve/root/zero functions?

09072015, 09:28 PM
Post: #7




RE: What's the difference in all the polynomial solve/root/zero functions?
There are some subtle differences.
Take, for example, the polynomial (x2)^2*(x+1) with roots {2,2,1}. solve((x2)^2*(x+1)=0,x) returns {1,2} in a list as integers zeros((x2)^2*(x+1),x) returns [2,1] in a vector as integers and proot((x2)^2*(x+1),x) returns all three roots [1. 2. 2.] in a vector as reals. proot also takes a vector with the coefficients as an argument, which can be nice, e.g., proot([1 3 0 4]) returns the same solution as above. I say it is good to have choices! And for fun, try solving this polynomial (in expanded form) with fsolve between, say, 5 and 5, fsolve(x^33*x^2+4,x,5..5) returns [1. 0. 2.] !! 

« Next Oldest  Next Newest »

Messages In This Thread 
What's the difference in all the polynomial solve/root/zero functions?  ewjax  09072015, 04:59 AM
RE: What's the difference in all the polynomial solve/root/zero functions?  parisse  09072015, 06:35 AM
RE: What's the difference in all the polynomial solve/root/zero functions?  ewjax  09072015, 03:25 PM
RE: What's the difference in all the polynomial solve/root/zero functions?  parisse  09072015, 04:09 PM
RE: What's the difference in all the polynomial solve/root/zero functions?  ewjax  09072015, 06:11 PM
RE: What's the difference in all the polynomial solve/root/zero functions?  Terje Vallestad  09072015, 07:44 PM
RE: What's the difference in all the polynomial solve/root/zero functions?  Helge Gabert  09072015 09:28 PM
RE: What's the difference in all the polynomial solve/root/zero functions?  parisse  09082015, 06:11 AM

User(s) browsing this thread: 1 Guest(s)