I need to use NIntegrate inside NDSolve, for example:
NDSolve[{y'[x] == x + NIntegrate[r, {r, 1, y[x]}], y[2] == 0.5}, y, {x, 0, 1}]
How can I make this work?
I need to use NIntegrate inside NDSolve, for example:
NDSolve[{y'[x] == x + NIntegrate[r, {r, 1, y[x]}], y[2] == 0.5}, y, {x, 0, 1}]
How can I make this work?
This may be a perverse way of solving the problem as stated, but as general technique it may be useful. Define an auxiliary function that is only evaluated for numeric arguments, e.g.
f[y_?NumericQ] := NIntegrate[r, {r, 1, y}]
m = NDSolve[{y'[x] == x + f[y[x]], y[2] == 0.5}, y, {x, 0, 1}]
NIntegrate if ODE is intended for ParametricNDSolveValue? So far I tried someting like A1N[k_?IntegerQ, bv_?NumericQ, p_?NumericQ] := bva2D1N[k, bv, p]/bva2N[k, bv, p]; where p is free parameter and bv is substituted by bv[z] in final form of ODE for function phi[z]. All functions with names ended by N are some call to NIntegrate.
`
– Igor Kotelnikov
Sep 03 '22 at 11:06