where φ(x) is chosen by us. Written in terms of the mesh variable q, this equation is dx ψ = dq φ(x) () Notice that φ(x) should be chosen to be positive definite, so that the density of mesh points is everywhere positive. Otherwise () can have a zero in its denominator. To use automated mesh spacing, you add the three ODEs () and () to your set of equations | 784 Chapter 17. Two Point Boundary Value Problems where x is chosen by us. Written in terms of the mesh variable q this equation is dx ÿ dq x Notice that x should be chosen to be positive definite so that the density of mesh points is everywhere positive. Otherwise can have a zero in its denominator. To use automated mesh spacing you add the three ODEs and to your set of equations . to the array y j k . Now x becomes a dependent variable Q and also become new dependent variables. Normally evaluating requires little extra work since it will be composed from pieces of the g s that exist anyway. The automated procedure allows one to investigate quickly how the numerical results might be affected by various strategies for mesh spacing. A special case occurs if the desired mesh spacing function Q can be found analytically . dQ dx is directly integrable. Then you need to add only two equations those in and two new variables x . As an example of a typical strategy for implementing this scheme consider a system with one dependent variable y x . We could set d Q A 1 or . X 17-5-9 dx A yb where A and b are constants that we choose. The first term would give a uniform spacing in x if it alone were present. The second term forces more grid points to be used where y is changing rapidly. The constants act to make every logarithmic change in y of an amount b about as attractive to a grid point as a change in x of amount A. You adjust the constants according to taste. Other strategies are possible such as a logarithmic spacing in x replacing dx in the first term with d In x. CITED REFERENCES AND FURTHER READING Eggleton P. P 1971 Monthly Notices of the RoyalAstronomical Society vol. 151 pp. 351-364. Kippenhan R. Weigert A. and Hofmeister E. 1968 in Methods in Computational Physics vol. 7 New York Academic Press pp. 129ff. Handling Internal Boundary Conditions or Singular Points Singularities can occur in the interiors of two .