Ask Your Question

how to find root of a spline

asked 2012-09-18 04:41:52 +0200

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-18 05:48:58 +0200

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 09:27:06 +0200 )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-18 04:41:52 +0200

Seen: 462 times

Last updated: Sep 18 '12