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

Online Help

All Products    Maple    MapleSim

Home : Support : Online Help : MaplePortal/DAE

Differential-Algebraic Equations in Maple

Go to Maple Portal     Maple Portal for Engineers


Overview of Maple's Differential Equations Solvers

DAEs in Maple

See Also

Overview of Maple's Differential Equations Solvers


Maple's differential equation solvers employ advanced techniques to solve:



Ordinary differential equations (ODEs): dsolve solves linear and nonlinear ODEs, initial value problems (IVPs), and boundary value problems (BVPs) symbolically or numerically.  The ODE Analyzer Assistant provides an interactive way to solve an ODE and plot the solution.  See dsolve, dsolve/numeric, and ODE Analyzer for more information.



Partial differential equations (PDEs): pdsolve finds exact solutions to PDEs.  Use Maple's PDE tools to perform structural analysis and order reduction for PDE systems.  pdsolve/numeric handles systems of time-dependent PDEs in one spatial dimension with boundary conditions.  Includes 11 standard methods for numerically solving PDEs, particularly useful in education.  See pdsolve and pdsolve/numeric for more information.



Differential-Algebraic Equations (DAEs):   dsolve/numeric's hybrid symbolic-numeric solvers, using symbolic pre-processing and order reduction, enable Maple to solve many high-index DAE problems.  Maple has four solvers for handling DAEs: 1) Modified Runge-Kutta Fehlberg method, 2) Cash-Karp Pair Runge-Kutta method, 3) Rosenbrock method, and 4) Modified Extended Backward-Differentiation Implicit method.

DAEs in Maple


More highlights:



In most cases dsolve is able to detect if a given problem is a DAE system, as opposed to an ODE system, by identifying whether a pure algebraic equation in the dependent variables is present. If the input is a DAE system containing no purely algebraic equations, the method must be included to specify that the system is a DAE system.



dsolve has four methods for finding numeric solutions to DAEs.  The default DAE IVP method is a modified Runge-Kutta Fehlberg method (rkf45_dae).  The other methods, ck45_dae (an extension of the ck45 method, a Runge-Kutta method with the Cash-Karp coefficients), rosenbrock_dae (an extension of the rosenbrock method, an Implicit Rosenbrock third-fourth order Runge-Kutta method with degree three interpolant), and mebdfi (Modified Extended Backward-Differentiation Formula Implicit method) can be specified using the method option.  If you specify that the problem is stiff with the option stiff=true without selecting a method, then the method rosenbrock_dae will be used.



Maple's core numeric ODE and DAE IVP solvers (rkf45, ck45, rosenbrock, and the DAE versions of these) can handle user-defined events.


For more information on solving DAEs, see dsolve/numeric and dsolve/numeric/DAE.


In this document, we solve two DAE problems, one by simply calling dsolve/numeric and using the default DAE solver and the second by specifying in the call to dsolve/numeric that the stiff solver should be used.

Higher-Index DAEs in Maple: Simple Pendulum in Cartesian Coordinates


In this example, we model a simple pendulum in Cartesian coordinates.  The equations result in an index-3 DAE, which we solve using dsolve with the numeric option.  Then, we plot the solution using plots[odeplot].  We begin by loading the plots package.




Equations of motion:

eq1ⅆⅆ t vxt=Ftxt



eq2ⅆⅆ t vyt=Ftytg



eq3ⅆⅆ t xt=vxt



eq4ⅆⅆ t yt=vyt






xt and yt are the position of the pendulum, and Ft is the compressive force in the rigid link.  (Note that Ft is also the Lagrange multiplier of the problem.)


The index of the system can be determined by repeated differentiation of the constraint equation (eq5):

subseq3,eq4,ⅆⅆ t lhseq5



subseq1,eq2,eq3,eq4,ⅆⅆ t



collectsubseq1,eq2,eq3,eq4,ⅆⅆ t,ⅆⅆ t Ft



Since the coefficient of ⅆⅆ t Ft in the last equation is 0 (see eq5), this equation is an ODE and the index of the system of equations is 3. (It takes three differentiations of the constraint equation in order to get an ODE.)


Now, solve this system and plot the solutions:

soldsolvesubsg=9.81, eq1,eq2,eq3,eq4,eq5,x0=1,y0=0,vx0=0,vy0=0,numeric,xt,yt,vxt,vyt,Ft

procx_rkf45_dae...end proc





Solving a Stiff DAE Problem: Example from Physical Chemistry


Here is a three variable problem from physical chemistry that is not solved by Maple's default numeric ODE solver, but can be solved by specifying a stiff solver.  When the option stiff=true is specified to dsolve along with the numeric option, Maple uses the method rosenbrock_dae.


To begin, we use PDEtools[declare] to display derivatives with the prime ' symbol.





derivatives with respect totof functions of one variable will now be displayed with '



In this example, the solution is constrained to lie on the plane at+bt+ct=1.





The default numeric solver fails on the desired range.


Warning, cannot evaluate the solution further right of 6.4957591, maxfun limit exceeded (see ?dsolve,maxfun for details)


The problem here is that using the default numerical solver the computation becomes too expensive beyond t=6.4957591, exceeding the maxfun limit of 30000 evaluations. If it takes too long to solve the IVP using the default rkf45 solver, then the system might be stiff.  In this case, we can solve the problem using the modified Rosenbrock method by specifying stiff=true.


  DAESolution:=dsolvesys,numeric,range=0..40000, stiff=true

procx_rosenbrock_dae...end proc


  odeplotDAESolution,t, at


For more information on solving stiff IVPs in Maple, see dsolve/Stiffness.

See Also

dsolve, dsolve/numeric, dsolve/numeric/DAE, dsolve/Stiffness, ODE Analyzer, pdsolve, plots[odeplot]


Go to Maple Portal     Maple Portal for Engineers