I have a second order ODE which I would like to solve numerically:
$\frac{d^2 y}{dx^2}+f(y)=0$
BCs: $ y(0) = c$, $y(L)=0$
Where $c$ is a known constant and $f(y)$ is a complicated user defined function, which includes the use of FindRoot.
Naturally, this can be written as a first order system:
$\frac{dy}{dx}=\rho$
$\rho\frac{d\rho}{dy} + f(y) = 0$
If $f(y)$ was a nice simple function this could be solved fairly easily since it is separable. However, I'm not sure how to proceed in the case where $f(y)$ is a user defined function which is not known in closed form.
Any suggestions of how to proceed?
f[y]
would make it easier for people to try out their ideas. Also, since it is separable, one can useNDSolve
to integrate $\int f(y)\; dy$. $\endgroup$NDSolve
, and if so, what did you do and what went wrong? $\endgroup$