I need to calculate the integral of a function of interpolating functions. Being more specific, the function I want to integrate is the following
derUp[tau_] = 1/(drad[tau] + Sqrt[drad[tau]^2 + ftau[tau]])
where drad[tau_] = D[rad[tau], tau]
and ftau[tau_] = 1 - (2 mm[tau])/rad[tau]
.
rad[tau]
and mm[tau]
are the numerical solutions of a system of differential equations, and therefore defined as interpolating functions.
The conceptual problem that I seem not being able to overcome/understand is that it seems to be impossible to calculate the following thing
func = Integrate[derUp[tau],{tau, 0, tau'}]
with tau'
being a variable instead of a number. The reason behind this calculation is that I need to obtain func
as a function of tau
.
A solution I have tried to implement is FunctionInterpolation
, that seems to works very well when the function to integrate depends on two variables, as specified in other posts that I have read on this forum, but that does not seem to be applicable to the one-variable case (at least I have not figured it out).
func[taup_?NumericQ] := NIntegrate[derUp[tau],{tau, 0, taup}]
and callfunc[1.]
. $\endgroup$ – march Jun 28 '16 at 21:40Integrate[derUp[tau],tau]
(without explicit limits) give you what you need? $\endgroup$ – mikado Jun 28 '16 at 21:48Integrate[derUp[tau],tau]
. $\endgroup$ – Vale Jun 28 '16 at 21:57Head
InterpolatingFunction
. Can you applyFunctionInterpolation
to reduce your expressions to a singleInterpolatingFunction
? $\endgroup$ – mikado Jun 28 '16 at 22:43NDSolve[]
to construct the required solution. $\endgroup$ – J. M.'s ennui♦ Jun 28 '16 at 23:34