I am new to Mathematica and am doing work involving interpolating functions from NDSolve
. I would like to use the interpolating functions from NDSolve
in calculations but I can't seem to figure out the proper way to do this. So say I have the following interpolating function:
myInt = Interpolation[{{0, 0}, {1, 3}, {4, 2}, {7, 9}}]
InterpolatingFunction[{{0, 7}}, <>]
I would then like to take this interpolating function and use it like a variable or function and perform math operations on it like:
modMyInt = myInt*3 + 1
1 + 3 InterpolatingFunction[{{0, 7}}, <>]
But when I plot modMyInt
I get an empty plot.
Plot[modMyInt[t], {t, 0, 9}]
I think I am misunderstanding what interpolating functions are; can someone please explain how to do this?
modMyInt = myInt[t]*3 + 1; Plot[modMyInt, {t, 0, 9}]
. You can't do arithmetic operations with interpolation functions, but you can include them in expressions. Interpolation functions are black boxes; things like addition and multiplication are not defined for them. $\endgroup$ – C. E. Apr 5 '17 at 23:27