Ask Your Question
0

problem plotting numerical integral

asked 2015-07-09 11:34:34 +0100

Gustav Delius gravatar image

Why does the following give an error "TypeError: unable to simplify to float approximation"?

def f(y): return numerical_integral(1,0,y)[0]
plot(f(y),(y,0,1))
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-07-09 16:55:43 +0100

tmonteil gravatar image

The way you define f is a Python function, not a symbolic expression. In particular, the name of the input does not matter. So, there is no point to deal with f(y) which requires that y is defined (as a symbol).

What you can do is the following:

sage: plot(f,(0,1))
Launched png viewer for Graphics object consisting of 1 graphics primitive
edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-07-09 11:34:34 +0100

Seen: 1,938 times

Last updated: Jul 09 '15