I am trying to solve the differential equation(adsbygoogle = window.adsbygoogle || []).push({});

##\frac{d^{2}y}{dr^2}+(\frac{1}{r}+1)y=0##

with the boundary conditions

##y(r) \rightarrow r \frac{dy}{dr}(0)## as ##r \rightarrow 0## and ##y(r) \rightarrow \sin(kr+\delta)## as ##r \rightarrow \infty##.

I know that the shooting method is the way to go, but am having trouble figuring out how to implement the boundary conditions.

Are the following lines of code in Mathematica alright? I have not yet wrapped it around a root-finding algorithm.

diffeq = {y''[r] + ((1/r) + 1) y[r] == 0, y[0] == 0, y'[0] == 5};

sol = NDSolve[diffeq, y, {r, 0, 200}, Method -> "ExplicitRungeKutta"];

Now, how do I change y[0]=0 in the code above to the first boundary condition.

Also, I know that the value of y[0] is to be changed and the code run until the second boundary condition is satisfied. What check should I use for that? Do I just check if the solution lies between -1 and 1 as ##r \rightarrow \infty##

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Boundary conditions shooting method

Loading...

Similar Threads - Boundary conditions shooting | Date |
---|---|

Implementing symmetry boundary condition for the diffusion equation | Jul 23, 2017 |

C++ matrix boundary condition problems | Apr 30, 2016 |

FEM: periodic boundary conditions (1D) | Jun 12, 2015 |

Periodic boundary conditions for 2d grid | Aug 6, 2012 |

Shooting method and a shock wave (discontinuity at the inner boundary condition) | Jul 7, 2008 |

**Physics Forums - The Fusion of Science and Community**