.. status: ok 9.60 OrderlyDifferentialPolynomial ---------------------------------- Many systems of differential equations may be transformed to equivalent systems of ordinary differential equations where the equations are expressed polynomially in terms of the unknown functions. In FriCAS, the domain constructors OrderlyDifferentialPolynomial (abbreviated ODPOL) and SequentialDifferentialPolynomial (abbreviation SDPOL) implement two domains of ordinary differential polynomials over any differential ring. In the simplest case, this differential ring is usually either the ring of integers, or the field of rational numbers. However, FriCAS can handle ordinary differential polynomials over a field of rational functions in a single indeterminate. The two domains ODPOL and SDPOL are almost identical, the only difference being the choice of a different ranking, which is an ordering of the derivatives of the indeterminates. The first domain uses an orderly ranking, that is, derivatives of higher order are ranked higher, and derivatives of the same order are ranked alphabetically. The second domain uses a sequential ranking, where derivatives are ordered first alphabetically by the differential indeterminates, and then by order. A more general domain constructor, DifferentialSparseMultivariatePolynomial (abbreviation DSMP) allows both a user-provided list of differential indeterminates as well as a user-defined ranking. We shall illustrate ODPOL(FRAC INT), which constructs a domain of ordinary differential polynomials in an arbitrary number of differential indeterminates with rational numbers as coefficients. .. spadInput :: dpol:= ODPOL(FRAC INT) .. spadMathAnswer .. spadMathOutput .. math:: +------------------------------------------------+ | OrderlyDifferentialPolynomialFractionInteger | +------------------------------------------------+ .. spadType :sub:`Type: Domain` A differential indeterminate w may be viewed as an infinite sequence of algebraic indeterminates, which are the derivatives of w. To facilitate referencing these, FriCAS provides the operation makeVariablemakeVariableOrderlyDifferentialPolynomial to convert an element of type Symbol to a map from the natural numbers to the differential polynomial ring. .. spadInput :: w := makeVariable('w)$dpol .. spadMathAnswer .. spadMathOutput .. math:: +---------------+ | theMap(...) | +---------------+ .. spadType :sub:`Type: (NonNegativeInteger -> OrderlyDifferentialPolynomial Fraction` Integer) .. spadInput :: z := makeVariable('z)$dpol .. spadMathAnswer .. spadMathOutput .. math:: +---------------+ | theMap(...) | +---------------+ .. spadType :sub:`Type: (NonNegativeInteger -> OrderlyDifferentialPolynomial Fraction` Integer) The fifth derivative of w can be obtained by applying the map w to the number 5. Note that the order of differentiation is given as a subscript (except when the order is 0). .. spadInput :: w.5 .. spadMathAnswer .. spadMathOutput .. math:: +------+ | w5 | +------+ .. spadType :sub:`Type: OrderlyDifferentialPolynomial Fraction Integer` .. spadInput :: w 0 .. spadMathAnswer .. spadMathOutput .. math:: +-----+ | w | +-----+ .. spadType :sub:`Type: OrderlyDifferentialPolynomial Fraction Integer` The first five derivatives of z can be generated by a list. .. spadInput :: [z.i for i in 1..5] .. spadMathAnswer .. spadMathOutput .. math:: +--------------------+ | [z1,z2,z3,z4,z5] | +--------------------+ .. spadType :sub:`Type: List OrderlyDifferentialPolynomial Fraction Integer` The usual arithmetic can be used to form a differential polynomial from the derivatives. .. spadInput :: f:= w.4 - w.1 * w.1 * z.3 .. spadMathAnswer .. spadMathOutput .. math:: +------------+ | w4-w12z3 | +------------+ .. spadType :sub:`Type: OrderlyDifferentialPolynomial Fraction Integer` .. spadInput :: g:=(z.1)^3 * (z.2)^2 - w.2 .. spadMathAnswer .. spadMathOutput .. math:: +-------------+ | z13z22-w2 | +-------------+ .. spadType :sub:`Type: OrderlyDifferentialPolynomial Fraction Integer` The operation DDOrderlyDifferentialPolynomial computes the derivative of any differential polynomial. .. spadInput :: D(f) .. spadMathAnswer .. spadMathOutput .. math:: +--------------------+ | w5-w12z4-2w1w2z3 | +--------------------+ .. spadType :sub:`Type: OrderlyDifferentialPolynomial Fraction Integer` The same operation can compute higher derivatives, like the fourth derivative. .. spadInput :: D(f,4) .. spadMathAnswer .. spadMathOutput .. math:: +-------------------------------------------------------------------------------+ | w8-w12z7-8w1w2z6+(-12w1w3-12w22)z5-2w1z3w5+(-8w1w4-24w2w3)z4-8w2z3w4-6w32z3 | +-------------------------------------------------------------------------------+ .. spadType :sub:`Type: OrderlyDifferentialPolynomial Fraction Integer` The operation makeVariablemakeVariableOrderlyDifferentialPolynomial creates a map to facilitate referencing the derivatives of f, similar to the map w. .. spadInput :: df:=makeVariable(f)$dpol .. spadMathAnswer .. spadMathOutput .. math:: +---------------+ | theMap(...) | +---------------+ .. spadType :sub:`Type: (NonNegativeInteger -> OrderlyDifferentialPolynomial Fraction` Integer) The fourth derivative of f may be referenced easily. .. spadInput :: df.4 .. spadMathAnswer .. spadMathOutput .. math:: +-------------------------------------------------------------------------------+ | w8-w12z7-8w1w2z6+(-12w1w3-12w22)z5-2w1z3w5+(-8w1w4-24w2w3)z4-8w2z3w4-6w32z3 | +-------------------------------------------------------------------------------+ .. spadType :sub:`Type: OrderlyDifferentialPolynomial Fraction Integer` The operation orderorderOrderlyDifferentialPolynomial returns the order of a differential polynomial, or the order in a specified differential indeterminate. .. spadInput :: order(g) .. spadMathAnswer .. spadMathOutput .. math:: +-----+ | 2 | +-----+ .. spadType :sub:`Type: PositiveInteger` .. spadInput :: order(g, 'w) .. spadMathAnswer .. spadMathOutput .. math:: +-----+ | 2 | +-----+ .. spadType :sub:`Type: PositiveInteger` The operation differentialVariablesdifferentialVariablesOrderlyDifferentialPolynomial returns a list of differential indeterminates occurring in a differential polynomial. .. spadInput :: differentialVariables(g) .. spadMathAnswer .. spadMathOutput .. math:: +---------+ | [z,w] | +---------+ .. spadType :sub:`Type: List Symbol` The operation degreedegreeOrderlyDifferentialPolynomial returns the degree, or the degree in the differential indeterminate specified. .. spadInput :: degree(g) .. spadMathAnswer .. spadMathOutput .. math:: +----------+ | z22z13 | +----------+ .. spadType :sub:`Type: IndexedExponents OrderlyDifferentialVariable Symbol` .. spadInput :: degree(g, 'w) .. spadMathAnswer .. spadMathOutput .. math:: +-----+ | 1 | +-----+ .. spadType :sub:`Type: PositiveInteger` The operation weightsweightsOrderlyDifferentialPolynomial returns a list of weights of differential monomials appearing in differential polynomial, or a list of weights in a specified differential indeterminate. .. spadInput :: weights(g) .. spadMathAnswer .. spadMathOutput .. math:: +---------+ | [7,2] | +---------+ .. spadType :sub:`Type: List NonNegativeInteger` .. spadInput :: weights(g,'w) .. spadMathAnswer .. spadMathOutput .. math:: +-------+ | [2] | +-------+ .. spadType :sub:`Type: List NonNegativeInteger` The operation weightweightOrderlyDifferentialPolynomial returns the maximum weight of all differential monomials appearing in the differential polynomial. .. spadInput :: weight(g) .. spadMathAnswer .. spadMathOutput .. math:: +-----+ | 7 | +-----+ .. spadType :sub:`Type: PositiveInteger` A differential polynomial is isobaric if the weights of all differential monomials appearing in it are equal. .. spadInput :: isobaric?(g) .. spadMathAnswer .. spadMathOutput .. math:: +---------+ | false | +---------+ .. spadType :sub:`Type: Boolean` To substitute differentially, use evalevalOrderlyDifferentialPolynomial. Note that we must coerce 'w to Symbol, since in ODPOL, differential indeterminates belong to the domain Symbol. Compare this result to the next, which substitutes algebraically (no substitution is done since w.0 does not appear in g). .. spadInput :: eval(g,['w::Symbol],[f]) .. spadMathAnswer .. spadMathOutput .. math:: +-------------------------------------------+ | -w6+w12z5+4w1w2z4+(2w1w3+2w22)z3+z13z22 | +-------------------------------------------+ .. spadType :sub:`Type: OrderlyDifferentialPolynomial Fraction Integer` .. spadInput :: eval(g,variables(w.0),[f]) .. spadMathAnswer .. spadMathOutput .. math:: +-------------+ | z13z22-w2 | +-------------+ .. spadType :sub:`Type: OrderlyDifferentialPolynomial Fraction Integer` Since OrderlyDifferentialPolynomial belongs to PolynomialCategory, all the operations defined in the latter category, or in packages for the latter category, are available. .. spadInput :: monomials(g) .. spadMathAnswer .. spadMathOutput .. math:: +----------------+ | [z13z22,-w2] | +----------------+ .. spadType :sub:`Type: List OrderlyDifferentialPolynomial Fraction Integer` .. spadInput :: variables(g) .. spadMathAnswer .. spadMathOutput .. math:: +--------------+ | [z2,w2,z1] | +--------------+ .. spadType :sub:`Type: List OrderlyDifferentialVariable Symbol` .. spadInput :: gcd(f,g) .. spadMathAnswer .. spadMathOutput .. math:: +-----+ | 1 | +-----+ .. spadType :sub:`Type: OrderlyDifferentialPolynomial Fraction Integer` .. spadInput :: groebner([f,g]) .. spadMathAnswer .. spadMathOutput .. math:: +------------------------+ | [w4-w12z3,z13z22-w2] | +------------------------+ .. spadType :sub:`Type: List OrderlyDifferentialPolynomial Fraction Integer` The next three operations are essential for elimination procedures in differential polynomial rings. The operation leaderleaderOrderlyDifferentialPolynomial returns the leader of a differential polynomial, which is the highest ranked derivative of the differential indeterminates that occurs. .. spadInput :: lg:=leader(g) .. spadMathAnswer .. spadMathOutput .. math:: +------+ | z2 | +------+ .. spadType :sub:`Type: OrderlyDifferentialVariable Symbol` The operation separantseparantOrderlyDifferentialPolynomial returns the separant of a differential polynomial, which is the partial derivative with respect to the leader. .. spadInput :: sg:=separant(g) .. spadMathAnswer .. spadMathOutput .. math:: +----------+ | 2z13z2 | +----------+ .. spadType :sub:`Type: OrderlyDifferentialPolynomial Fraction Integer` The operation initialinitialOrderlyDifferentialPolynomial returns the initial, which is the leading coefficient when the given differential polynomial is expressed as a polynomial in the leader. .. spadInput :: ig:=initial(g) .. spadMathAnswer .. spadMathOutput .. math:: +-------+ | z13 | +-------+ .. spadType :sub:`Type: OrderlyDifferentialPolynomial Fraction Integer` Using these three operations, it is possible to reduce f modulo the differential ideal generated by g. The general scheme is to first reduce the order, then reduce the degree in the leader. First, eliminate z.3 using the derivative of g. .. spadInput :: g1 := D g .. spadMathAnswer .. spadMathOutput .. math:: +-----------------------+ | 2z13z2z3-w3+3z12z23 | +-----------------------+ .. spadType :sub:`Type: OrderlyDifferentialPolynomial Fraction Integer` Find its leader. .. spadInput :: lg1:= leader g1 .. spadMathAnswer .. spadMathOutput .. math:: +------+ | z3 | +------+ .. spadType :sub:`Type: OrderlyDifferentialVariable Symbol` Differentiate f partially with respect to this leader. .. spadInput :: pdf:=D(f, lg1) .. spadMathAnswer .. spadMathOutput .. math:: +--------+ | -w12 | +--------+ .. spadType :sub:`Type: OrderlyDifferentialPolynomial Fraction Integer` Compute the partial remainder of f with respect to g. .. spadInput :: prf:=sg * f- pdf * g1 .. spadMathAnswer .. spadMathOutput .. math:: +-----------------------------+ | 2z13z2w4-w12w3+3w12z12z23 | +-----------------------------+ .. spadType :sub:`Type: OrderlyDifferentialPolynomial Fraction Integer` Note that high powers of lg still appear in prf. Compute the leading coefficient of prf as a polynomial in the leader of g. .. spadInput :: lcf:=leadingCoefficient univariate(prf, lg) .. spadMathAnswer .. spadMathOutput .. math:: +-----------+ | 3w12z12 | +-----------+ .. spadType :sub:`Type: OrderlyDifferentialPolynomial Fraction Integer` Finally, continue eliminating the high powers of lg appearing in prf to obtain the (pseudo) remainder of f modulo g and its derivatives. .. spadInput :: ig * prf - lcf * g * lg .. spadMathAnswer .. spadMathOutput .. math:: +---------------------------------+ | 2z16z2w4-w12z13w3+3w12z12w2z2 | +---------------------------------+ .. spadType :sub:`Type: OrderlyDifferentialPolynomial Fraction Integer`