c17-6 (779606)
Текст из файла
784Chapter 17.Two Point Boundary Value Problemswhere φ(x) is chosen by us. Written in terms of the mesh variable q, this equation isdxψ=dqφ(x)(17.5.7)dx|d ln y|+∆δ dy/dx dQ1φ(x) ==+ dx∆yδ dQ =or(17.5.8)(17.5.9)where ∆ and δ are constants that we choose.
The first term would give a uniform spacingin x if it alone were present. The second term forces more grid points to be used where y ischanging rapidly. The constants act to make every logarithmic change in y of an amount δabout as “attractive” to a grid point as a change in x of amount ∆. You adjust the constantsaccording to taste. Other strategies are possible, such as a logarithmic spacing in x, replacingdx in the first term with d ln x.CITED REFERENCES AND FURTHER READING:Eggleton, P. P. 1971, Monthly Notices of the Royal Astronomical 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.17.6 Handling Internal Boundary Conditionsor Singular PointsSingularities can occur in the interiors of two point boundary value problems. Typically,there is a point xs at which a derivative must be evaluated by an expression of the formS(xs ) =N (xs , y)D(xs , y)(17.6.1)where the denominator D(xs , y) = 0. In physical problems with finite answers, singularpoints usually come with their own cure: Where D → 0, there the physical solution y mustbe such as to make N → 0 simultaneously, in such a way that the ratio takes on a meaningfulvalue.
This constraint on the solution y is often called a regularity condition. The conditionthat D(xs , y) satisfy some special constraint at xs is entirely analogous to an extra boundarycondition, an algebraic relation among the dependent variables that must hold at a point.We discussed a related situation earlier, in §17.2, when we described the “fitting pointmethod” to handle the task of integrating equations with singular behavior at the boundaries.In those problems you are unable to integrate from one side of the domain to the other.Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use.
Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).Notice that φ(x) should be chosen to be positive definite, so that the density of mesh points iseverywhere positive. Otherwise (17.5.7) can have a zero in its denominator.To use automated mesh spacing, you add the three ODEs (17.5.5) and (17.5.7) to yourset of equations, i.e., 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 sinceit will be composed from pieces of the g’s that exist anyway. The automated procedure allowsone to investigate quickly how the numerical results might be affected by various strategiesfor mesh spacing. (A special case occurs if the desired mesh spacing function Q can be foundanalytically, i.e., dQ/dx is directly integrable.
Then, you need to add only two equations,those in 17.5.5, and two new variables x, ψ.)As an example of a typical strategy for implementing this scheme, consider a systemwith one dependent variable y(x). We could set78517.6 Handling Internal Boundary Conditions or Singular PointsXXX1X1 X1XXXXXX1XXXXXXXXXXXXXXXXX1XXXXXXXXXXVVVVVVVVVVVVVBBBBBBBBBBBBBlockXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXckXXXXXXXXXXXecialbXXXXXXXXXXXBBBBBBBBBBBBBloX X X1 X X X111XXXXXXXXXXXVVVVVVVVVVVVVspXXXXXXXlb1XXXXXXXia(b)XXXXXXXXX1X1X1 XFigure 17.6.1.FDE matrix structure with an internal boundary condition.
The internal conditionintroduces a special block. (a) Original form, compare with Figure 17.3.1; (b) final form, comparewith Figure 17.3.2.However, the ODEs do have well-behaved derivatives and solutions in the neighborhood ofthe singularity, so it is readily possible to integrate away from the point. Both the relaxationmethod and the method of “shooting” to a fitting point handle such problems easily.
Also,in those problems the presence of singular behavior served to isolate some special boundaryvalues that had to be satisfied to solve the equations.The difference here is that we are concerned with singularities arising at intermediatepoints, where the location of the singular point depends on the solution, so is not known apriori. Consequently, we face a circular task: The singularity prevents us from finding anumerical solution, but we need a numerical solution to find its location. Such singularitiesare also associated with selecting a special value for some variable which allows the solutionto satisfy the regularity condition at the singular point. Thus, internal singularities take onaspects of being internal boundary conditions.One way of handling internal singularities is to treat the problem as a free boundaryproblem, as discussed at the end of §17.0.
Suppose, as a simple example, we considerthe equationdyN (x, y)=dxD(x, y)(17.6.2)where N and D are required to pass through zero at some unknown point xs . We addthe equationz ≡ xs − x1dz=0dx(17.6.3)Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use.
Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).XXXXX1XXXXXec1sp(a)786Chapter 17.Two Point Boundary Value Problemswhere xs is the unknown location of the singularity, and change the independent variableto t by settingx − x1 = tz,0≤t≤1(17.6.4)D(x, y) = 0(17.6.5)The boundary conditions at t = 1 becomeN (x, y) = 0,dQ=ψdqdψ=0dq(17.6.6)(17.6.7)with a simple mesh spacing function that maps x uniformly into q, where q runs from 1 toM , the number of mesh points:dQ=1(17.6.8)dxHaving added three first-order differential equations, we must also add their correspondingboundary conditions.
If there were no singularity, these could simply beQ(x) = x − x1 ,atatq=1:q=M :x = x1 ,x = x2Q=0(17.6.9)(17.6.10)and a total of N values yi specified at q = 1. In this case the problem is essentially aninitial value problem with all boundary conditions specified at x1 and the mesh spacingfunction is superfluous.However, in the actual case at hand we impose the conditionsat q = 1 :at q = M :x = x1 , Q = 0N (x, y) = 0, D(x, y) = 0(17.6.11)(17.6.12)and N − 1 values yi at q = 1. The “missing” yi is to be adjusted, in other words, so asto make the solution go through the singular point in a regular (zero-over-zero) rather thanirregular (finite-over-zero) manner. Notice also that these boundary conditions do not directlyimpose a value for x2 , which becomes an adjustable parameter that the code varies in anattempt to match the regularity condition.In this example the singularity occurred at a boundary, and the complication arosebecause the location of the boundary was unknown.
In other problems we might wish tocontinue the integration beyond the internal singularity. For the example given above, wecould simply integrate the ODEs to the singular point, then as a separate problem recommencethe integration from the singular point on as far we care to go. However, in other cases thesingularity occurs internally, but does not completely determine the problem: There are stillsome more boundary conditions to be satisfied further along in the mesh.
Such cases presentno difficulty in principle, but do require some adaptation of the relaxation code given in §17.3.In effect all you need to do is to add a “special” block of equations at the mesh point wherethe internal boundary conditions occur, and do the proper bookkeeping.Figure 17.6.1 illustrates a concrete example where the overall problem contains 5equations with 2 boundary conditions at the first point, one “internal” boundary condition, andtwo final boundary conditions.
The figure shows the structure of the overall matrix equationsalong the diagonal in the vicinity of the special block. In the middle of the domain, blockstypically involve 5 equations (rows) in 10 unknowns (columns). For each block prior to thespecial block, the initial boundary conditions provided enough information to zero the firsttwo columns of the blocks. The five FDEs eliminate five more columns, and the final threecolumns need to be stored for the backsubstitution step (as described in §17.3).
To handle theextra condition we break the normal cycle and add a special block with only one equation:Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited.
Характеристики
Тип файла PDF
PDF-формат наиболее широко используется для просмотра любого типа файлов на любом устройстве. В него можно сохранить документ, таблицы, презентацию, текст, чертежи, вычисления, графики и всё остальное, что можно показать на экране любого устройства. Именно его лучше всего использовать для печати.
Например, если Вам нужно распечатать чертёж из автокада, Вы сохраните чертёж на флешку, но будет ли автокад в пункте печати? А если будет, то нужная версия с нужными библиотеками? Именно для этого и нужен формат PDF - в нём точно будет показано верно вне зависимости от того, в какой программе создали PDF-файл и есть ли нужная программа для его просмотра.















