For the purpose of this minimal example, let's say we have a list of functions, like this:
f[y_?NumericQ] := {NIntegrate[z*y, {z, 0, 1}], a y}
I want to integrate an expression involving f
, say
NDSolve[{y'[t] == f[y[t]][[1]], y[0] == 1}, y[t], {t, 0, 5}]
Now, the problem is that this doesn't return the expected result, because f[y[t]][[1]]
evaluates to y[t]
inside the NDSolve
.
How can this be done correctly?