1
$\begingroup$

I am using matlab to solve the following ODE

0.02K^2 F''(K)-3.45 F'(K)-3.45=0.08 F(K)

subject to boundary conditions

$F(K=0)=63.09$ and $ F(K=700)=0.$

I found that I had to give bvpinit an offset such as bvpinit(linspace(1e-3,700,10000),[1 0.1]) from the left boundary 0 because otherwise, I would get an error

Error using ==> bvp4c Unable to solve the collocation equations -- a singular Jacobian encountered

But this isn't really elegant, because the offset seems arbitary. This also did not extend the solution all the way to the left end point 0. Would appreciate if someone can provide a better solution to this problem. Many thanks.

  • 0
    @Damian: I have converted your answer to a comment. Because you do not have 50 reputation points yet, [you can only comment on your own questions and answers](http://meta.stackexchange.com/questions/19756/how-do-comments-work/19757#19757). So, you didn't do anything wrong; the "add comment" button will only appear for you once you gain 50 points. Here is an [explanation of reputation points](http://meta.stackexchange.com/questions/7237/how-does-reputation-work/7238#7238).2011-08-11

1 Answers 1

1

This is called a singular boundary-value problem. Matlab can handle some singular BVPs (look at the documentation for bvp4c and the SingularTerm option in bvpset) so you need to bring your equation in the form that Matlab can handle.

Added later: I've never used this option before, but here is how I would start. When bringing the equation to first-order form, one normally introduces a vector $(F_1,F_2)$ with $F_1(K) = F(K)$ and F_2(K) = F'(K) so that the equation becomes \begin{align} F_1' &= F_2, \\ F_2' &= \frac{3.45}{0.02K^2} F_2 + \frac{0.08}{0.02K^2} F_1 + \frac{3.45}{0.02K^2}. \end{align} As you noticed, Matlab requires the equation to be of the form y' = \frac1x Sy + f(x,y) ...

Added yet later: I initially thought that one could get rid of the $1/K^2$ terms by using $F_1(K) = F(K)$ and F_2(K) = KF'(K) but as Qiang Li noted (in more polite terms) I made a stupid mistake. In fact, in the original equation the boundary point $K=0$ is an irregular singular point, while in the equations that Matlab can handle the boundary point is a regular singular point. My uneducated guess would be that the algorithm implemented in Matlab won't be able to handle your equation. Sorry.

  • 0
    Oops, you're right, I'm stupid ... Thanks for your correction. In that case, I don't know how to do this :(2011-03-22