Friday, March 29, 2019
Numerical Differential Equation Analysis Package
numeric Differential Equation Analysis incaseThe Numerical Differential Equation Analysis package combines leanality for analyzing differential equations employ despatch heads, Gaussian quadrature, and Newton-Cotes quadrature. botcherRunge-Kutta method actings argon useful for numericall(a)y resoluteness sealed types of ordinary differential equations. Deriving high- rank Runge-Kutta methods is no easy task, however. on that point argon some(prenominal) reasons for this. The rootage encumbrance is in finding the question up to(p) treated sees. These atomic bod 18 nonlinear equations in the coefficients for the method that must be fulfil to make the demerit in the method of coif O (hn) for some integer n where h is the step size. The second difficulty is in solving these equations. Besides being nonlinear, in that location is generally no unique solution, and m whatever heuristics and simplifying assumptions ar usually made. Finally, on that point is the proble m of combinable explosion. For a twelfth- pronounce method on that point ar 7813 put together conditionsThis package performs the first task finding the arrange conditions that must be satisfied. The result is uttered in toll of un do itn coefficients aij, bj, and ci. The s-stage Runge-Kutta method to advance from x to x+h is thenwhereSums of the elements in the course of instructions of the intercellular substance aij occur repeatedly in the conditions imposed on aij and bj. In recognition of this and as a lineal doodad it is usual to introduce the coefficients ci and the definitionThis definition is referred to as the line-sum condition and is the first in a sequence of row-simplifying conditions.If aij=0 for all ij the method is verbalized that is, each of the Yi (x+h) is defined in impairment of previously computed values. If the matrix aij is non strictly lower triangular, the method is unverbalized and requires the solution of a (generally nonlinear) system of eq uations for each timestep. A diagonally silent method has aij=0 for all iThere are several ways to express the piece conditions. If the come of stages s is specified as a positive integer, the order conditions are expressed in terms of sums of translucent terms. If the result of stages is specified as a symbol, the order conditions leave involve exemplary sums. If the shape of stages is not specified at all, the order conditions go forth be expressed in stage-independent tensor line. In auxiliary to the matrix a and the vectors b and c, this notation involves the vector e, which is composed of all unmatchables. This notation has two distinct advantages it is independent of the do of stages s and it is independent of the particular Runge-Kutta method.For further details of the speculation see the references.ai,jthe coefficient of f(Yj(x)) in the canon for Yi(x) of the methodbjthe coefficient of f(Yj(x)) in the reflection for Y(x) of the methodcia notational convenien ce for aijea notational convenience for the vector (1, 1, 1, )Notation used by functions for meatman.RungeKuttaOrderConditionsp,s bring back a disceptation of the order conditions that any s-stage Runge-Kutta method of order p must satisfy b iodinerPrincipalErrorp,s realize a list of the order p+1 terms appearing in the Taylor series expansion of the error for an order-p, s-stage Runge-Kutta methodRungeKuttaOrderConditionsp, ButcherPrincipalErrorp strive the result in stage-independent tensor notationFunctions associated with the order conditions of Runge-Kutta methods.ButcherRowSum constrict whether the row-sum conditions for the ci should be explicitly included in the list of order conditionsButcherSimplify fixate whether to apply Butchers row and column simplifying assumptionsSome options for RungeKuttaOrderConditions.This pull up stakess the number of order conditions for each order up by means of order 10. Notice the combinative explosion.In2=Out2=This overturns the order conditions that must be satisfied by any first-order, 3-stage Runge-Kutta method, explicitly including the row-sum conditions.In3=Out3=These are the order conditions that must be satisfied by any second-order, 3-stage Runge-Kutta method. present the row-sum conditions are not included.In4=Out4=It should be noted that the sums involved on the left-hand(prenominal) sides of the order conditions will be left in symbolic form and not expanded if the number of stages is left as a symbolic argument. This will greatly simplify the results for high-order, many-stage methods. An unconstipated more backpack form results if you do not specify the number of stages at all and the behave is evanescen in tensor form.These are the order conditions that must be satisfied by any second-order, s-stage method.In5=Out5=Replacing s by 3 gives the same result asRungeKuttaOrderConditions.In6=Out6=These are the order conditions that must be satisfied by any second-order method. This uses tensor notat ion. The vector e is a vector of wizs whose continuance is the number of stages.In7=Out7=The tensor notation asshole likewise be expanded to give the conditions in full.In8=Out8=These are the principal error coefficients for any third-order method.In9=Out9=This is a bounds on the local error of any third-order method in the curtail as h approaches 0, normalized to eliminate the effects of the ODE.In10=Out10=Here are the order conditions that must be satisfied by any fourth-order, 1-stage Runge-Kutta method. Note that there is no possible way for these order conditions to be satisfied there need to be more stages (the second argument must be larger) for there to be suitablely many unkn holds to satisfy all of the conditions.In11=Out11=RungeKuttaMethodspecify the type of Runge-Kutta method for which order conditions are being sought plaina climb for the option RungeKuttaMethod specifying that the order conditions are to be for an explicit Runge-Kutta methodDiagonallyImplicita s etting for the option RungeKuttaMethod specifying that the order conditions are to be for a diagonally implicit Runge-Kutta methodImplicita setting for the option RungeKuttaMethod specifying that the order conditions are to be for an implicit Runge-Kutta method$RungeKuttaMethoda global variable whose value whoremonger be set to Explicit, DiagonallyImplicit, or ImplicitControlling the type of Runge-Kutta method in RungeKuttaOrderConditions and related functions.RungeKuttaOrderConditions and certain related functions have the option RungeKuttaMethod with default setting $RungeKuttaMethod. Normally you will want to determine the Runge-Kutta method being considered by setting $RungeKuttaMethod to one of Implicit, DiagonallyImplicit, and Explicit, but you can specify an option setting or even change the default for an individual function.These are the order conditions that must be satisfied by any second-order, 3-stage diagonally implicit Runge-Kutta method.In12=Out12=An alternative (bu t little efficient) way to get a diagonally implicit method is to take up a to be lower triangular by replacing upper-triangular elements with 0.In13=Out13=These are the order conditions that must be satisfied by any third-order, 2-stage explicit Runge-Kutta method. The contradiction in the order conditions indicates that no such method is possible, a result which holds for any explicit Runge-Kutta method when the number of stages is less than the order.In14=Out14=ButcherColumnConditionsp,sgive the column simplifying conditions up to and including order p for s stagesButcherRowConditionsp,sgive the row simplifying conditions up to and including order p for s stagesButcherQuadratureConditionsp,sgive the quadrature conditions up to and including order p for s stagesButcherColumnConditionsp, ButcherRowConditionsp, etc.give the result in stage-independent tensor notationMore functions associated with the order conditions of Runge-Kutta methods.Butcher showed that the number and comple xity of the order conditions can be reduced considerably at high orders by the credence of so-called simplifying assumptions. For example, this reduction can be accomplished by adopting sufficient row and column simplifying assumptions and quadrature-type order conditions. The option ButcherSimplify in RungeKuttaOrderConditions can be used to determine these automatically.These are the column simplifying conditions up to order 4.In15=Out15=These are the row simplifying conditions up to order 4.In16=Out16=These are the quadrature conditions up to order 4.In17=Out17=Trees are fundamental objects in Butchers formalism. They yield both the derivative in a power series expansion of a Runge-Kutta method and the related order constraint on the coefficients. This package provides a number of functions related to Butcher directs.fthe elementary symbol used in the representation of Butcher channelisesButcherTreespgive a list, partitioned by order, of the corners for any Runge-Kutta method of order pButcherTreeSimplifyp,,give the set of guides through with(predicate) order p that are not reduced by Butchers simplifying assumptions, assuming that the quadrature conditions through order p, the row simplifying conditions through order , and the column simplifying conditions through order all hold. The result is group by order, starting with the first nonvanishing treesButcherTreeCountpgive a list of the number of trees through order pButcherTreeQtreegive True if the tree or list of trees tree is valid functional syntax, and False otherwiseConstructing and enumerating Butcher trees.This gives the trees that are needed for any third-order method. The trees are represented in a functional form in terms of the elementary symbol f.In18=Out18=This tests the grimness of the syntax of two trees. Butcher trees must be constructed using multiplication, elaboration or application of the function f.In19=Out19=This evaluates the number of trees at each order through order 10. T he result is equivalent to Out2 but the calculation is practically more efficient since it does not actually involve constructing order conditions or trees.In20=Out20=The previous result can be used to calculate the integral number of trees required at each order through order10.In21=Out21=The number of constraints for a method using row and column simplifying assumptions depends upon the number of stages. ButcherTreeSimplify gives the Butcher trees that are not reduced assuming that these assumptions hold.This gives the additional trees that are incumbent for a fourth-order method assuming that the quadrature conditions through order 4 and the row and column simplifying assumptions of order 1 hold. The result is a single tree of order 4 (which corresponds to a single fourth-order condition).In22=Out22=It is often useful to be able to visualize a tree or forest of trees graphically. For example, picture trees yields insight, which can in turn be used to aid in the facial expres sion of Runge-Kutta methods.ButcherPlottreegive a speckle of the tree treeButcherPlottree1,tree2,give an array of plots of the trees in the forest tree1, tree2,Drawing Butcher trees.ButcherPlotColumnsspecify the number of columns in the GraphicsGrid plot of a list of treesButcherPlotLabelspecify a list of plot labels to be used to label the nodes of the plotButcherPlotNodeSizespecify a marking factor for the nodes of the trees in the plotButcherPlotRootSizespecify a scaling factor for the highlighting of the root of each tree in the plot a zero value does not highlight rootsOptions to ButcherPlot.This plots and labels the trees through order 4.In23=Out23=In addition to generating and drawing Butcher trees, many functions are provided for measuring and manipulating them. For a complete description of the importance of these functions, see Butcher.ButcherHeighttreegive the height of the tree treeButcherWidthtreegive the width of the tree treeButcherOrdertreegive the order, or number of vertices, of the tree treeButcherAlphatreegive the number of ways of labeling the vertices of the tree tree with a totally ordered set of labels such that if (m, n) is an edge, then mButcherBetatreegive the number of ways of labeling the tree tree with ButcherOrdertree-1 distinct labels such that the root is not tagged, but each other vertex is labeledButcherBetan,treegive the number of ways of labeling n of the vertices of the tree with n distinct labels such that every leaf is labeled and the root is not labeledButcherBetaBartreegive the number of ways of labeling the tree tree with ButcherOrdertree distinct labels such that every node, including the root, is labeledButcherBetaBarn,treegive the number of ways of labeling n of the vertices of the tree with n distinct labels such that every leaf is labeledButcherGammatreegive the parsimony of the tree tree the bilateral of the density is the right-hand side of the order condition imposed by treeButcherPhitree,sgive the weigh t of the tree tree the weight (tree) is the left-hand side of the order condition imposed by treeButcherPhitreegive (tree) using tensor notationButcherSigmatreegive the order of the symmetry group of isomorphisms of the tree tree with itselfOther functions associated with Butcher trees.This gives the order of the tree ffff f2.In24=Out24=This gives the density of the tree ffff f2.In25=Out25=This gives the elementary weight function imposed by ffff f2 for an s-stage method.In26=Out26=The subscript notation is a formatting device and the subscripts are really just the indexed variable NumericalDifferentialEquationAnalysisPrivate$i.In27=Out27//FullForm=It is also possible to restrain solutions to the order conditions using Solve and related functions. Many issues related to the construction Runge-Kutta methods using this package can be found in Sofroniou. The name also contains details concerning algorithms used in Butcher.m and discusses applications.Gaussian QuadratureAs one of its methods, the Mathematica function NIntegrate uses a fairly sophisticated Gauss-Kronrod-based algorithm. The Gaussian quadrature functionality provided in Numerical Differential Equation Analysis allows you to easily study some of the theory behind ordinary Gaussian quadrature which is a little less sophisticated.The basal idea behind Gaussian quadrature is to approximate the value if an integral as a linear combination of values of the integrand evaluated at specific pointsSince there are 2n free parameters to be chosen (both the abscissas xi and the weights wi) and since both integrating and the sum are linear operations, you can expect to be able to make the formula correct for all polynomials of degree less than rough 2n. In addition to knowing what the optimal abscissas and weights are, it is often desirable to know how large the error in the approximation will be. This package allows you to answer both of these questions.GaussianQuadratureWeightsn,a,bgive a list of the pairs (xi, wi) to machine preciseness for quadrature on the interval a to bGaussianQuadratureErrorn,f,a,bgive the error to machine clearcutnessGaussianQuadratureWeightsn,a,b,precgive a list of the pairs (xi, wi) to precision precGaussianQuadratureErrorn,f,a,b,precgive the error to precision precFinding formulas for Gaussian quadrature.This gives the abscissas and weights for the five-point Gaussian quadrature formula on the interval (-3, 7).In2=Out2=Here is the error in that formula. Unfortunately it involves the tenth derivative of f at an unknown point so you dont really know what the error itself is.In3=Out3=You can see that the error decreases rapidly with the length of the interval.In4=Out4=Newton-CotesAs one of its methods, the Mathematica function NIntegrate uses a fairly sophisticated Gauss-Kronrod based algorithm. Other types of quadrature formulas exist, each with their own advantages. For example, Gaussian quadrature uses values of the integrand at oddly spaced abscissas. If you want to conflate a function presented in tabular form at as spaced abscissas, it wont work very well. An alternative is to use Newton-Cotes quadrature.The staple idea behind Newton-Cotes quadrature is to approximate the value of an integral as a linear combination of values of the integrand evaluated at equally spaced pointsIn addition, there is the question of whether or not to include the end points in the sum. If they are included, the quadrature formula is referred to as a closed formula. If not, it is an open formula. If the formula is open there is some ambiguity as to where the first abscissa is to be placed. The open formulas given in this package have the first abscissa one half step from the lower end point.Since there are n free parameters to be chosen (the weights) and since both integration and the sum are linear operations, you can expect to be able to make the formula correct for all polynomials of degree less than about n. In addition to knowing what the weight s are, it is often desi
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment