I'm a bit embarrassed not to be able to work this out for myself, but, anyway... Now that I've discovered the joys of the NumericalQuadrature package, I want to use it to calculate the total variation of some functions; the total variation being defined (for differentiable functions) as the integral of the absolute value of the derivative. So I'd like to use something like
romberg(x+->abs(D(x/(x^3+1),x)),0.0,1.0,0.1,0.1,10,10)
But this doesn't work. Romberg requires an anonymous function float -> float, but the use of D returns an _expression_. (_expression_ integer, in this example). How, and where, do I place the type conversions so that romberg will do its job?
Thanks,
Alasdair
--
Blog:
http://amca01.wordpress.com