One example for coupled ODEs from the Mathemtica help center reads
a = NDSolve[{x'[t] == -3 (x[t] - y[t]),
y'[t] == -x[t] z[t] + 26.5 x[t] - y[t],
z'[t] == x[t] y[t] - z[t], x[0] == z[0] == 0,
y[0] == 1}, {x, y, z}, {t, 0, 5}]
Now we can for example extend this expression by replacing
x'[t] == -3 (x[t] - y[t]) -> x['t] == -3* (x[t] - y[t])*int[t]
with
f[t_] := Sin[t^2]
int[t_?NumericQ] := NIntegrate[Exp[-f[t]]*v^2, {v, 0, 1}]
This works indeed fine, but now I would like to extend the integral expression further by making the integrand dependent on the current solution of z[t] i.e.
int[t_?NumericQ] := NIntegrate[Exp[-f[t]*Evaluate[z[t]/.a]*v^2], {v, 0, 1}]
But this expression returns a bunch of errors. Does anyone know how to make this work?
z
norf
are dependent onv
, no? $\endgroup$