A Comparison of Maple and Mathematica: Solving Odes

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

A Comparison of Maple and ™

Mathematica : Solving ODEs ®

The famous text, Differentialgleichungen by Kamke, contains 1429 linear and non-linear ODEs. These equations
were used to test the symbolic ODE solving abilities of Maple™ and Mathematica®. The tests looked at their ability
to find solutions to the 1345 ODEs from the text known of have a solution, as well as how long it takes them to
recognize when they cannot solve the problem.

Maple Mathematica
Solves 97.5% of solvable ODEs Solves 80.3% of solvable ODEs
Completes test in 45 minutes Completes test in 7 hours 8 minutes

Maple Mathematica
Kamke Solvable Problems All Solvable Problems All
ODEs No No
response response
Returned Not % Total Returned Not % Total
within within
Solution Solved Solved Time Solution Solved Solved Time
time limit time limit
Spent Spent
(3 min) (3 min)

1st order: 576 541 6 99% 2 19 min 473 74 86% 65 250 min
solvable: 547

2nd order
nonlinear: 188 157 5 97% 2 13 min 114 48 70% 8 63 min
solvable: 162
2nd order
nonlinear 50 8 86% 0 3 min 0 58 0% 1 23 min
reducible 58
2nd order
linear 448 424 3 99% 1 5 min 387 40 91% 8 40 min
solvable: 427
3rd order
linear: 85 73 7 91% 1 3.5 min 58 22 72% 4 28 min
solvable: 80
4th order
linear: 45 40 3 93% 0 22 sec 33 10 77% 1 8 min
solvable: 43

5th order 11 1 92% 0 24 sec 9 3 75% 2 13 min


linear: 12

High order
nonlinear: 12 11 0 100% 0 21 sec 6 5 54% 1 2.5 min
solvable: 11
High order
nonlinear 5 0 100% 0 7 sec 0 5 0% 0 30 sec
reducible: 5

Totals for the


1429 equations
of which 1345 1312 33 97.5% 6 45 min 1080 265 80.3% 90 7.1 hours
are solvable
Details
This comparison was done using Maple 17.02 and Mathematica 9.0.1.

The 1429 Ordinary Differential Equations (ODE) of Kamke’s book were tackled with Mathematica’s DSolve
and Maple’s dsolve commands, with a time limit of 3 minutes per ODE (Maple function timelimit and
Mathematica function TimeConstrained), in a Macbook Pro (2013) 2.7 GHz Intel Core I7, 4 cores, 16 GB
of RAM. No optional arguments were allowed when calling DSolve and dsolve.

The test focused on: time consumed, number of equations solved versus unsolved, and also number of “no
response within time limit” equations, as a measure of the ability of the system to understand that a problem
is beyond its capabilities.

In this report we say that the ODE solver gave “no response within time limit” for an equation when the
solver did not terminate within a three minutes time limit. At that point, the computation was automatically
interrupted, with the system moving to tackling the next equation.

By “Not Solved” equations it is meant equations for which we know a solution exists (either because Kamke
shows it or because we were able to derive it and test it), and for which the ODE solver terminates before
3 minutes or returns without a solution. Problems for which the returned answer involved DESol in Maple
or the equivalent DifferentialRoot in Mathematica are considered unsolved, because the answer does not
provide more information than the original problem.

Regarding the unsolvable equations of Kamke’s book, naturally, neither Mathematica nor Maple are ex-
pected to solve them, but it is expected that these systems recognize their inability to solve these equations
within a reasonable period of time.

To compare the time spent in tackling only the portion of the 1429 ODEs for which the solver returns before
the time limit, multiply the number of “no response within time limit” equations by 3 minutes and then
subtract this number from the total time consumed.

First order ODEs


There are 576 first order ODEs in Kamke’s book: 29 are unsolvable and 547 are solvable. The Kamke’s
numbers for the unsolvable ODEs are 47, 48, 49, 50, 55, 56, 74, 79, 82, 87, 202, 203, 205, 206, 219, 234,
237, 250, 253, 265, 269, 331, 367, 370, 395, 461, 503, 572, 576.

Mathematica performance: 86.5 % in 4 hours and 10 minutes


Mathematica took 4 hours and 10 minutes in tackling the 576 ODEs, solved 473 of the 547 solvable ones
and failed to return a solution for 74 solvable equations: 16, 22, 63, 66, 69, 70, 80, 81, 83, 86, 121, 127,
266, 292, 340, 365, 366, 368, 383, 385, 394, 400, 402, 404, 413, 414, 416, 428, 429, 451, 452, 460, 465,
467, 468, 479, 482, 485, 487, 489, 494, 504, 506, 508, 509, 510, 513, 515, 520, 523, 524, 527, 528, 530,
532, 533, 534, 535, 537, 538, 541, 542, 543, 544, 546, 550, 555, 561, 562, 566, 567, 570, 575.
Mathematica does not respond within the time limit for 65 equations: 22, 63, 66, 69, 70, 86, 127, 219, 250,
265, 266, 269, 292, 340, 365, 366, 368, 383, 385, 400, 402, 404, 413, 414, 416, 428, 429, 451, 452, 465,
467, 468, 479, 482, 485, 487, 489, 494, 503, 504, 509, 513, 515, 520, 523, 524, 527, 528, 530, 532, 533,
534, 535, 537, 538, 541, 542, 543, 544, 546, 550, 555, 561, 562, of which 60 equations are solvable.

Maple performance: 99 % in 19 minutes


Maple took 19 minutes in tackling the 576 ODEs, solved 541 of the 547 solvable ones and failed to return a
solution for 6 solvable equations: 121, 340, 460, 506, 510, 575. Maple does not respond within the time limit
for 2 equations: 331, 340, of which 340 is solvable.

Second order nonlinear ODEs


There are 246 second order nonlinear ODEs in Kamke’s book, of which 26 are unsolvable and 220 are
solvable, divided into fully solvable (162 of them) and reducible (58 of them).

The Kamke’s numbers of the 26 unsolvable ODEs are: 3, 5, 6, 8, 9, 13, 16, 18, 19, 27, 29, 52, 55, 59, 85, 95,
112, 114, 139, 147, 149, 161, 207, 211, 212, 217.
The Kamke numbers of the 58 second order nonlinear ODEs that are only reducible are: 11, 15, 21, 22, 25,
26, 28, 34, 36, 37, 44, 46, 47, 49, 53, 54, 58, 68, 69, 70, 72, 73, 74, 75, 76, 77, 82, 83, 87, 90, 92, 94, 96,
100, 102, 103, 105, 106, 115, 116, 118, 123, 129, 131, 144, 148, 152, 172, 187, 198, 199, 225, 226, 230,
231, 235, 242, 246.

Maple conveys solutions for the reducible equations using ‘ODESolStruc’, showing the solution for the
original problem in terms of the solution of the reduced ODE, as well as the reduced ODE and
transformation used to reduce the problem. Mathematica does not convey reductions of order, thus failing
with all the 58 equations of ‘only reducible to first order’ type.

Mathematica performance: solvable: 70.4 %, reducible 0 %, in 1 hour and 16 minutes


Mathematica took 1 hour and 16 minutes in tackling the 246 ODEs, solved 114 of the 162 solvable ones,
0 of the 58 reducible ones, and failed to return a solution for 48 fully solvable equations: 23, 24, 30, 31, 32,
33, 35, 38, 39, 41, 43, 45, 48, 62, 66, 88, 91, 101, 108, 119, 120, 130, 142, 145, 156, 165, 167, 171, 189,
190, 208, 216, 219, 223, 227, 228, 229, 233, 237, 241, 244, 20, 50, 98, 121, 186, 221, 243. Mathematica
does not respond within the time limit for 8 equations: 20, 50, 98, 121, 186, 221, 230, 243, of which 7
equations are fully solvable.

Maple performance: solvable: 97 %, reducible: 86 %, in 16 minutes


Maple took 16 minutes in tackling the 246 ODEs, solved 157 of the 162 solvable ones, 50 of the 58
reducible ones, and failed to return a solution for 5 fully solvable equations: 108, 142, 145, 167, 171.
Maple does not respond within the time limit for 2 equations: 217, 245, of which 1 equation is fully solvable.

Second order linear ODEs


There are 448 second order linear ODEs in Kamke’s book, of which 21 are unsolvable and 427 are
solvable. The Kamke’s numbers for the unsolvable ODEs are 15, 19, 26, 28, 30, 31, 38, 72, 73, 75, 76, 77,
205, 212, 216, 236, 278, 408, 439, 440, 443.

Mathematica performance: 91 %, in 40 minutes


Mathematica took 40 minutes in tackling the 448 ODEs, solved 387 of the 427 solvable ones and failed to
return a solution for 40 solvable equations: 27, 29, 32, 80, 81, 82, 83, 84, 85, 128, 156, 413, 418, 442, 445,
157, 248, 261, 268, 303, 306, 329, 330, 343, 348, 362, 367, 372, 373, 398, 402, 403, 177, 232, 233, 263,
341, 406, 407, 427. Mathematica does not respond within the time limit for 8 equations: 177, 232, 233, 263,
341, 406, 407, 427, all of which are solvable.

Maple performance: 99 %, in 5 minutes


Maple took 5 minutes in tackling the 448 ODEs, solved 424 of the 427 solvable ones and failed to return
a solution for 3 solvable equations: 81, 57, 441. Maple does not respond within the time limit for 1
equation: 441.

Third order linear ODEs


There are 85 third order linear ODEs in Kamke’s book, of which 5 are unsolvable and 80 are solvable.
The Kamke’s numbers for the unsolvable ODEs are 9, 10, 11, 12, 28.

Mathematica performance: 72.5 %, in 28 minutes


Mathematica took 28 minutes in tackling the 85 ODEs, solved 58 of the 80 solvable ones and failed to
return a solution for 22 solvable equations: 13, 14, 15, 23, 24, 25, 26, 59, 62, 67, 81, 82, 83, 36, 41, 57, 72,
79, 2, 34, 68, 78. Mathematica does not respond within the time limit for 4 equations: 2, 34, 68, 78, all of
which are solvable.

Maple performance: 91 %, in 3.5 minutes


Maple took 3.5 minutes in tackling the 85 ODEs, solved 73 of the 80 solvable ones and failed to return a
solution for 7 solvable equations: 13, 14, 25, 36, 41, 62, 83. Maple does not respond within the time limit
for 1 equation: 67, which is solvable.
Fourth order linear ODEs
There are 45 fourth order linear ODEs in Kamke’s book, of which 2 are unsolvable and 43 are solvable.
The Kamke’s numbers for the unsolvable ODEs are 7, 8.

Mathematica performance: 76.7 %. in 8 minutes


Mathematica took 8 minutes in tackling the 45 ODEs, solved 33 of the 43 solvable ones and failed to return
a solution for 10 solvable equations: 9, 10, 11, 14, 40, 41, 42, 43, 39, 19. Mathematica does not respond
within the time limit for 1 equation: 19, which is solvable.

Maple performance: 93 %, in 22 seconds


Maple took 22 seconds in tackling the 45 ODEs, solved 40 of the 43 solvable ones and failed to return a
solution for 3 solvable equations: 9, 10, 11. Maple responds within the time limit for all equations

Fifth order linear ODEs


There are 12 fifth order linear ODEs in Kamke’s book, all of them solvable.

Mathematica performance: 75 %, in 13 minutes


Mathematica took 13 minutes in tackling the 12 ODEs, solved 9 of the 12 solvable equations and failed to
return a solution for 3 solvable equations: 8, 5, 12. Mathematica does not respond within the time limit for
2 equations: 5, 12, which are both solvable.

Maple performance: 92 %, in 24 seconds


Maple took 24 seconds in tackling the 12 ODEs, solved 11 of the 12 solvable equations and failed to return
a solution for 1 solvable equation: 4. Maple responds within the time limit for all equations.

Higher order nonlinear ODEs


There are 17 higher order nonlinear ODEs in Kamke’s book, of which 1 is unsolvable and 16 are solvable,
in turn divided into fully solvable (11 of them) and fully reducible (5 of them). The Kamke’s number for the
unsolvable ODE is 15.

The Kamke numbers of the 5 higher order ODEs that are only reducible are: 2, 3, 4, 5, 14.

Mathematica performance with solvable ODEs: 54.6 %; with reducible ODEs: 0 %, in 3 minutes
Mathematica took 3 minutes in tackling the 17 ODEs, solved 6 of the 11 solvable ones, 0 of the 5 reducible
ones, and failed to return a solution for 5 fully solvable equations: 1, 8, 9, 17, 12. Mathematica does not
respond within the time limit for 1 equation: 12, which is fully solvable.

Maple performance with solvable ODEs: 100%; with reducible ODEs: 100%, in 28 seconds
Maple took 24 seconds in tackling the 17 ODEs. Maple responds within the time limit for all equations,
and solves both the solvable and reducible sets of equations completely.

www.maplesoft.com | [email protected]
© Maplesoft, a division of Waterloo Maple Inc., 2014. Maple is a trademark of Waterloo Maple Inc.
Mathematica is a registered trademark of Wolfram Research, Inc.
A Cybernet Group Com pany

You might also like