Examples - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


DifferentialAlgebra Examples

Examples

Study of a differential-algebraic system

• 

The following example is from [HW96]. It features a differential-algebraic system of differential index 2, describing a steering wheel. The dependent variables xt and yt are space coordinates. The dependent variable zt is a command and the system is given by

ⅆⅆtxt=7yt10+sin5zt2,ⅆⅆtyt=7xt5+cos5zt2,xt2+yt2=1

The RosenfeldGroebner function permits this system to be transformed into an equivalent system of differential index 0. In particular, it permits the following:

– 

To compute a complete set of relations, defining the algebraic variety, over which the integral curves of the system must remain. These relations are essential for choosing consistent initial values.

– 

To compute the missing ODE, which expresses the evolution of zt.

First, the above system is transformed into a polynomial differential form by introducing two new dependent variables st and ct which encode the sine and the cosine.

sys1diffxt,t=710yt+st,diffyt,t=1410xt+ct,xt2+yt2=1,diffst,t=2510diffzt,tct,diffct,t=2510diffzt,tst,st2+ct2=1

sys1ⅆⅆtxt=7yt10+st,ⅆⅆtyt=7xt5+ct,xt2+yt2=1,ⅆⅆtst=5ⅆⅆtztct2,ⅆⅆtct=5ⅆⅆtztst2,st2+ct2=1

(1)
• 

Then, a differential polynomial ring is defined, endowed with an orderly ranking, and the system is simplified.

withDifferentialAlgebra:

RDifferentialRingderivations=t,blocks=z,y,x,s,c

Rdifferential_ring

(2)

idealRosenfeldGroebnersys1,R

idealregular_differential_chain

(3)

Because the ranking is orderly, the order 0 differential polynomials of the returned regular differential chain provide the algebraic variety, over which, the integral curves of the system must remain. These differential polynomials form a non-differential squarefree regular chain (see RegularChains), that can be solved from bottom-up. They are important for determining consistent initial values. Indeed, once z0 is chosen, s0 and c0 are fixed, and, x0 cannot be chosen freely.

Equationsideal1,order=0,notation=jet,solved

y=100c2sx210csx2441sx3+210cs+341sx100c3100c,x4=2021x3c+341441x2+2021xc+100441c2,s2=c2+1

(4)

The missing ODE, which expresses the evolution of zt, is the element of the regular differential chain, whose leading derivative is a derivative of z.

Equationsideal1,leader=derivativezt,notation=jet,solved

zt=55566000c5x2+58344300c4x337044000c543306200c4x56831670c3x254519507c2x3+36335670c3+40951407c2x+13461000cx2+10892700x37987000c8422700x11025000c511025000c3+2500000c

(5)

Chemistry Example: The Henri-Michaelis-Menten Reduction

• 

This example features a model reduction for chemical reaction systems, based on a quasi-steady state approximation [BLLM07]. The process is illustrated over a famous case, but has more general applications.

The following system is derived from a basic enzymatic reaction system, by application of the mass-action law. Four chemical species are involved: an enzyme E, a substrate S, an intermediate complex C, and a product P. There are three chemical reactions. The dependent variables represent the concentrations of the four species.

 

k1

 

 

 

k−1

 

 

 

k2

 

E+S

--->

C,

 

C

---->

E+S,

 

C

--->

E+P.

sys2diffEt,t=k1EtSt+k1Ct+k2Ct,diffSt,t=k1EtSt+k1Ct,diffCt,t=k1EtStk1Ctk2Ct,diffPt,t=k2Ct

sys2ⅆⅆtEt=k1EtSt+k−1Ct+k2Ct,ⅆⅆtSt=k1EtSt+k−1Ct,ⅆⅆtCt=k1EtStk−1Ctk2Ct,ⅆⅆtPt=k2Ct

(6)

Under some assumptions, this system can be approximated by the so-called Henri-Michaelis-Menten formula. We are going to show how this formula can be automatically recovered. The main assumption is: the revertible reaction is fast, and, the last one is slow. In other words, k1,k−1 >> k2.

Taking into account this main assumption actually amounts to perform a quasi-steady state approximation of the above system. This can be done as follows.

– 

First, in the system, replace the contribution k1EtStk−1Ct of the fast reactions, which occurs in the first three ODEs, by a new dependent variable F1. This variable represents the unknown contribution, which cannot be assumed to be 0, of the fast reactions, after the transient step. Somehow, this variable simply encodes that fast reactions are reactions.

– 

Second, add the algebraic equation k1EtStk−1Ct=0 to the system. This equation forces the dynamics of the system to stays over the algebraic variety that it defines. Somehow, it encodes the speed.

– 

Third, eliminate the new dependent variable F1 from the differential-algebraic system. This elimination, performed using RosenfeldGroebner, computes the simplest ODE which describes the evolution of St, and which is a consequence of the DAE.

The two first steps yield the following differential-algebraic system. The rate constants are considered to be arbitrary parameters of the problem.

DAEdiffEt,t=F1t+k2Ct,diffSt,t=F1t,diffCt,t=F1tk2Ct,diffPt,t=k2Ct,k1EtStk1Ct=0

DAEⅆⅆtEt=F1t+k2Ct,ⅆⅆtSt=F1t,ⅆⅆtCt=F1tk2Ct,ⅆⅆtPt=k2Ct,k1EtStk−1Ct=0

(7)

speciesC,E,P,S

speciesC,E,P,S

(8)

rate_constantsk1,k1,k2

rate_constantsk1,k−1,k2

(9)

RDifferentialRingblocks=F1,species,derivations=t,arbitrary=rate_constants

Rdifferential_ring

(10)
• 

The third step can now be performed. An inequation,  Ct0, is added to the DAE system passed to RosenfeldGroebner to avoid a spurious discussion on the case Ct=0.

idealRosenfeldGroebneropDAE,Ct0,R

idealregular_differential_chain

(11)
• 

The returned regular differential chain involves a differential polynomial expressing the evolution of St; however, this relation is not yet the Henri-Michaelis-Menten formula. Indeed, the minor hypotheses have not yet been taken into account. This formula is just the simplest formula that can be deduced from the DAE, by using the main assumption only.

Equationsideal1,leader=diffSt,t,solved

ⅆⅆtSt=EtSt2k12k2+EtStk1k−1k2Etk1k−1+Stk1k−1+k−12

(12)
• 

A few more parameters, C0,E0,P0 and S0, are introduced and the linear conservation laws of the system involving them:

conservation_lawsEt+Ct=E0+C0,St+Ct+Pt=S0+C0+P0

conservation_lawsEt+Ct=E0+C0,St+Ct+Pt=S0+C0+P0

(13)
• 

A minor assumption is: P0 = C0 = 0.

hypothesessubsP0=0,C0=0,conservation_laws

hypothesesEt+Ct=E0,St+Ct+Pt=S0

(14)

At this point, we could either add E0,C0,S0 and P0 to the constants declared as arbitrary when defining the differential ring, or we can call RosenfeldGroebner directly because by default all non declared objects will be taken as arbitrary anyway

• 

One could actually proceed from the formula established above, but, it is simpler to perform the whole simplification anew.

idealRosenfeldGroebneropDAE,ophypotheses,R

idealregular_differential_chain

(15)

formulaEquationsideal1,leader=diffSt,t,solved

formulaⅆⅆtSt=St2k12k2E0+Stk1k−1k2E0St2k12+2Stk1k−1+k1k−1E0+k−12

(16)
• 

Not yet: one still needs to perform some renaming on parameters, and to neglect the term KE0, assuming S0 >> E0.

formulaevalformula,k1=Kk1:

formulanormalformula:

formulaalgsubsk2E0=Vmax,formula:

• 

Here is the Henri-Michaelis-Menten formula.

formulanormalevalformula,KE0=0

formulaⅆⅆtSt=VmaxStK+St

(17)

The pendulum

• 

Consider the set of differential polynomials describing the motion of a pendulum, that is, a point mass m suspended from a massless rod of length l under the influence of gravity g, in Cartesian coordinates x,y. The Lagrangian formulation leads to two second order differential equations with an algebraic constraint. T is the Lagrangian multiplier.

paramsm,l,g:

Pmdiffyt,t,t+Ttyt+g,mdiffxt,t,t+Ttxt,xt2+yt2l2

Pmⅆ2ⅆt2yt+Ttyt+g,mⅆ2ⅆt2xt+Ttxt,xt2+yt2l2

(18)
• 

To find the lowest order differential polynomials vanishing on the zeros of the system modeling the pendulum and in particular all the algebraic constraints (that is, the differential polynomials of order 0), use an orderly ranking. The second component in the output of RosenfeldGroebner corresponds to the equilibria of the pendulum. From the first component of the output, it can be seen that the actual motion is described by two first order differential equations with a constraint: the solution depends on only two arbitrary constants.

RDifferentialRingderivations=t,blocks=T,x,y,arbitrary=params

Rdifferential_ring

(19)

idealRosenfeldGroebnerP,R

idealregular_differential_chain,regular_differential_chain

(20)

Equationsideal1,notation=jet,solved

Tt=3ytgl2,yt2=Tl4+Tl2y2gl2y+gy3ml2,x2=l2y2

(21)

Equationsideal2,notation=jet,solved

T=ygl2,x=0,y2=l2

(22)
• 

To obtain the differential system satisfied by x and y alone, eliminate T. Note here that the motion is given by a second order differential equation in y. Then the Lagrange multiplier is given explicitly in terms of y and its first derivative.

RDifferentialRingderivations=t,blocks=T,x,y,arbitrary=params

Rdifferential_ring

(23)

idealRosenfeldGroebnerP,R

idealregular_differential_chain,regular_differential_chain

(24)

Equationsideal&comma;notation=jet&comma;leader<Tt&comma;solved

yt,t=l2myyt2gl4+2gl2y2gy4l4m+l2my2&comma;x2=l2y2&comma;x=0&comma;y2=l2

(25)

General and singular solutions of a single differential equation

• 

In general, when RosenfeldGroebner is applied on a single differential polynomial F, it returns at least one component involving F, and, possibly, some other components. The first component describes the general solution of F. The other ones describe the singular solutions.

RDifferentialRingderivations=t&comma;blocks=y

Rdifferential_ring

(26)

Fdiffyt&comma;t34tytdiffyt&comma;t+8yt2

F&DifferentialD;&DifferentialD;tyt34tyt&DifferentialD;&DifferentialD;tyt+8yt2

(27)
• 

Over this example, RosenfeldGroebner returns the general component plus two singular ones. As we shall see, one of the singular components is essential, while the other one is not [K73,H99].

idealRosenfeldGroebnerF&comma;R

idealregular_differential_chain&comma;regular_differential_chain&comma;regular_differential_chain

(28)

Equationsideal

&DifferentialD;&DifferentialD;tyt34tyt&DifferentialD;&DifferentialD;tyt+8yt2&comma;27yt4t3&comma;yt

(29)
• 

The three components can be solved explicitly. The solutions of the general component writes yt=ctc2, where c denotes an arbitrary constant. The solution of the first singular component writes yt=4t327. It is not a particular case of the general solution. This first singular component is said to be essential. The solution of the second singular component writes yt=0. It is a particular case of the general solution, since it is obtained for c=0. This second singular component is said to be non-essential.

• 

The function RosenfeldGroebner  with the option singsol = essential only returns the essential components of F:

idealRosenfeldGroebnerF&comma;R&comma;singsol=essential

idealregular_differential_chain&comma;regular_differential_chain

(30)

Equationsideal

&DifferentialD;&DifferentialD;tyt34tyt&DifferentialD;&DifferentialD;tyt+8yt2&comma;27yt4t3

(31)

Power Series Solutions

• 

The regular differential chains returned by RosenfeldGroebner, permit to compute integral formal power series solutions of the input system. By integral, it is meant that the exponents are integers. By formal, it is meant that convergence issues are not addressed. The following system provides a good example of what a general PDE polynomial system may look like, Its power series solutions turn out to be polynomials.

RDifferentialRingderivations=x&comma;y&comma;blocks=v&comma;u

Rdifferential_ring

(32)

sys3ux24u&comma;ux,yvyu+1&comma;vx,xux

sys3ux24u&comma;ux,yvyu+1&comma;vx,xux

(33)

idealRosenfeldGroebnersys3&comma;R

idealregular_differential_chain

(34)

Equationsideal1&comma;solved

vx,x=ux&comma;vy=uuxuy+uxuy4u&comma;ux2=4u&comma;uy2=2u

(35)
• 

Looking at the leading derivatives of the returned regular differential chain, one sees that the system solutions depend on three constants, or initial values, which can be chosen almost arbitrary (see [DL84] for related undecidability results). Indeed, they must be solutions of the polynomial system of equations, returned by PowerSeriesSolution with the option conditions:

PowerSeriesSolutionconditions&comma;ideal1

D1u0&comma;024u0&comma;0=0&comma;D2u0&comma;022u0&comma;0=0&comma;u0&comma;00&comma;D1u0&comma;00&comma;D2u0&comma;00

(36)
• 

Let us choose the following initial values, and, check that they do satisfy the above polynomial system.

ivu=c02&comma;uy=sqrt2c0&comma;ux=2c0&comma;v=c1&comma;vx=c2

ivu=c02&comma;uy=2c0&comma;ux=2c0&comma;v=c1&comma;vx=c2

(37)

PowerSeriesSolutionconditions&comma;ideal1&comma;iv

0=0&comma;0=0&comma;c00

(38)
• 

The PowerSeriesSolution function can now compute the integral formal power series solutions of sys3, for these initial values.

solsPowerSeriesSolutionideal1&comma;3&comma;iv

solsvx&comma;y=c1+c022222y+c2x+c0y22+2c0xy+c0x2+2y312+xy22+2x2y2+x33&comma;ux&comma;y=c02+2c0y+2c0x+y22+2xy+x2

(39)

equationsEquationssys3&comma;R&comma;notation=diff

equations2x2vx&comma;yxux&comma;y&comma;2xyux&comma;yyvx&comma;yux&comma;y+1&comma;xux&comma;y24ux&comma;y

(40)

expandevalequations&comma;sols

0&comma;0&comma;0

(41)