Mathematics Previous page   Next Page

Solving Singular BVPs

The function bvp4c solves a class of singular BVPs of the form

    Equation 1: y prime = 1 / x times S times y + f(x,y).Equation 2: 0 = g(y(0),y(b)). (5-2)  

It can also accommodate unknown parameters for problems of the form

Singular problems must be posed on an interval [0, b] with 0 -->b >. Use bvpset to pass the constant matrix S to bvp4c as the value of the 'SingularTerm' integration property. Boundary conditions at x = 0 must be consistent with the necessary condition for a smooth solution, Sy(0) = 0. An initial guess should also satisfy this necessary condition.

When you solve a singular BVP using

bvp4c requires that your function odefun(x,y) return only the value of the f(x,y) term in Equation 5-2.

Example: Solving a BVP that Has a Singular Term

Emden's equation arises in modeling a spherical body of gas. The PDE of the model is reduced by symmetry to the ODE

on an interval [0, 1]. The coefficient 2 / x is singular at x = 0, but symmetry implies the boundary condition y prime (0) = 0. With this boundary condition, the term

is well-defined as x approaches 0. For the boundary condition y(1) = square root of 3 divided by 2, this BVP has the analytical solution

  1. Rewrite the problem as a first-order system and identify the singular term. Using a substitution y sub 1 = y and y sub 2 = y prime, write the differential equation as a system of two first-order equations
  1. The boundary conditions become

  1. Writing the ODE system in a vector-matrix form

  1. the terms of Equation 5-2 are identified as

  1. and

  1. Code the ODE and boundary condition functions. Code the differential equation and the boundary conditions as functions that bvp4c can use.
  2. Setup integration properties. Use the matrix as the value of the 'SingularTerm' integration property.
  3. Create an initial guess. This example starts with a mesh of five points and a constant guess for the solution.
  1. Use bvpinit to form the guess structure

  1. Solve the problem. Use the standard bvp4c syntax to solve the problem.
  2. View the results. This problem has an analytical solution
  1. The example evaluates the analytical solution at 100 equally-spaced points and plots it along with the numerical solution computed using bvp4c.

Previous page  Using Continuation to Make a Good Initial Guess Solving Multi-Point BVPs Next page

© 1994-2005 The MathWorks, Inc.