Ask Your Question

how to find root of a spline

asked 2012-09-17 21:41:52 -0600

wizulis gravatar image

Basicaly the title says it: I have data points for which i need to find the x value where y is a known value. I tried it like this, but it seems that it should be done differently:

from sage.gsl.all import spline
..[Error message with main idea - TypeError: unable to simplify to float approximation]
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2012-09-17 22:48:58 -0600

achrzesz gravatar image
sage: find_root(func,0,6)   
sage: plot(func,[x,0,6])
edit flag offensive delete link more


Just to elaborate, when you did `func(x)`, you wanted Sage to evaluate the spline at the symbolic variable `x`. But our splines aren't (yet) symbolic, so it raised an error because it wanted an actual numeric input.

kcrisman gravatar imagekcrisman ( 2012-09-18 02:27:06 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-09-17 21:41:52 -0600

Seen: 344 times

Last updated: Sep 17 '12