Solving a second order BVP for $y(x)$ with a singularity in $y$.

boundary value problemMATLABnumerical methodsordinary differential equations

I am looking to find a numerical solution to the following second order non-linear BVP for $x \in (-100,0)$ with k,$\gamma$>0.

$$ \frac{d^2y}{dx^2} = k(y-1) – \frac{1}{y} \frac{dy}{dx}(\gamma + \frac{dy}{dx}) $$
with boundary conditions,
$$ \frac{dy}{dx}(-100) = 0, \quad y(0)=0. $$
I've attempted to solve this problem with MATLAB's boundary value solver BVP4C; however there is a problem with the $1/y$ term (I believe). When I remove this term I get a sensible solution. Any suggestions about how I can either overcome this problem and use BVP4C, or use a different method to get the solution? Many thanks.

Best Answer

You can transform the equation to $$ \frac12(y^2)''=ky(y−1)−γy'\\ ((y^2)'+2γy)'=2ky(y-1) $$ Thus formulate the first order system for $u=y^2$, $v=u'+2γ\sqrt{u}$ as $$ u'=v-2γ\sqrt{u}\\ v'=2k(u-\sqrt{u}) $$ or with the other sign of the root to explore a negative solution for $y$.

The roots might still render the Jacobian in the BVP solver singular which should be less singular.

Related Question