文档库 最新最全的文档下载
当前位置:文档库 › Mathematica 9 与 Maple 17 微分方程求解器对比资料

Mathematica 9 与 Maple 17 微分方程求解器对比资料

Mathematica 9 与 Maple 17 微分方程求解器对比资料
Mathematica 9 与 Maple 17 微分方程求解器对比资料

Comparing Mathematica 9 with Maple 17 in solving the 1390 ODEs of Kamke’s book

linear: 563M athemat

ematica 9 9Maple 1

aple 17

Kamke ODEs

nonlinear: 827Hangs Failed to

solve Solved Time Hangs Failed to

solve

Solved Time

1st order: 576

solvable: 547657486%250

min

2699%19 min

2nd order nonlinear:

188

solvable 162

84870%63 min2597%13 min

2nd order nonlinear

reducible 58

1580%23 min0886% 3 min

2nd order linear 448

solvable: 427

84091%40 min1399% 4 min

3rd order linear: 85

solvable: 8042272%28 min1791%2.5 min

4th order linear: 45

solvable: 43

11077%8 min0393%22 sec 5th order linear: 122375%13 min0192%24 sec

High order nonlinear: 12 solvable: 111554%

2.5

min

00100%36 sec

High order nonlinear

reducible: 5050%30 sec00100%10.5 sec

Totals for the 1390

equations from which 1345 are solvable 9025680%

7.1

hours

63397.5%43 min Perfo

Performance

ance in solvin

olving Kamke

amke’s ODEs

ODEs

Mathematica 9 solved 80% Maple 17 solved 97.5% Summary:

?Mathematica 9 took 7 hours and 8 minutes to tackle the 1390 ODEs, solved 80% of the solvable ODEs, failed with other 256 solvable ODEs and hanged with 90 ODEs.

?Maple 17 took 43 minutes to tackle the 1390 ODEs, solved 97.5% of the solvable ODEs, failed with other 31 solvable ODEs and hanged with 6 ODEs.

Details

The 1390 Ordinary Differential Equations (ODE) of Kamke’s book were tackled with Mathematica 9.0.1 DSolve and Maple 17.02 dsolve, with a timelimit 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 in: time consumed, number of equations solved versus unsolved, and also number of “hangs” 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 hanged with an equation when it did not terminate before the three minutes time limit and so the computation got automatically interrupted, with the system moving to tackling the next equation.

By “unsolved” 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, and fails in ?nding any solution, or it hanged. Equations for which the answer returned involved DESol in Maple and the equivalent DifferentialRoot in Mathematica are considered unsolved in that the answer returned does not involve more information than the equation passed to be solved.

Regarding the unsolvable equations of Kamke’s book, naturally, neither Mathematica nor Maple are expected to solve them, but both systems are expected not to hang with them.

To compare the time spent in tackling the 1390 ODEs discarding the hangs, multiply the number of hangs by 3 min and subtract that from the total time consumed.

First order ODEs

There are 576 ?rst 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 9 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 in returning 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. Independent of that, Mathematica hangs with 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, from which 60 equations are solvable.

Maple 17 performance: 99 %, in 19 minutes

Maple took 19 minutes in tackling the 576 ODEs, solved 541 of the 547 solvable ones and failed in returning a solution for 6 solvable equations: 121, 340, 460, 506, 510, 575. Independent of that, Maple hangs with 2 equations: 331, 340, from which 340 is solvable.

Second order nonlinear ODEs

There are 246 second order nonlinear ODEs in Kamke’s book, from 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 ?rst order’ type.

Mathematica 9 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 in returning 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. Independent of that, Mathematica hangs with 8 equations: 20, 50, 98, 121, 186, 221, 230, 243, from which 7 equations are fully solvable.

Maple 17 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 in returning a solution for 5 fully solvable equations: 108, 142, 145, 167, 171. Independent of that, Maple hangs with 2 equations: 217, 245, from which 1 equation is fully solvable.

Second order linear ODEs

There are 448 second order linear ODEs in Kamke’s book, from 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 9 performance: 91 %, in 40 minutes

Mathematica took 40 minutes in tackling the 448 ODEs, solved 387 of the 427 solvable ones and failed in returning 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. Independent of that, Mathematica hangs with 8 equations: 177, 232, 233, 263, 341, 406, 407, 427, all of which are solvable . Maple 17 performance: 99 %, in 4 minutes

Maple took 4 minutes in tackling the 448 ODEs, solved 424 of the 427 solvable ones and failed in returning a solution for 3 solvable equations: 81, 57, 441. Maple hangs with 1 equation: 441.

Third order linear ODEs

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

Mathematica 9 performance: 72.5 %, in 28 minutes

Mathematica took 28 minutes in tackling the 85 ODEs, solved 58 of the 80 solvable ones and failed in returning 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. Independent of that, Mathematica hangs with 4 equations: 2, 34, 68, 78, all of which are solvable.

Maple 17 performance: 91 %, in 2.5 minutes

Maple took 2.5 minutes in tackling the 85 ODEs, solved 73 of the 80 solvable ones and failed in returning a solution for 7 solvable equations: 13, 14, 25, 36, 41, 62, 83. Independent of that, Maple hangs with 1 equation: 67, which is solvable.

Fourth order linear ODEs

There are 45 fourth order linear ODEs in Kamke’s book, from which 2 are unsolvable and 43 are solvable. The Kamke’s numbers for the unsolvable ODEs are 7, 8.

Mathematica 9 performance: 76.7 %. in 8 minutes

Mathematica took 8 minutes in tackling the 45 ODEs, solved 33 of the 43 solvable ones and failed in returning a solution for 10 solvable equations: 9, 10, 11, 14, 40, 41, 42, 43, 39, 19. Independent of that, Mathematica hangs with 1 equation: 19, which is solvable.

Maple 17 performance: 93 %, in 22 seconds

Maple took 22 seconds in tackling the 45 ODEs, solved 40 of the 43 solvable ones and failed in returning a solution for 3 solvable equations: 9, 10, 11. Independent of that, Maple did not hang with any equation.

Fifth order linear ODEs

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

Mathematica 9 performance: 75 %, in 13 minutes

Mathematica took 13 minutes in tackling the 12 ODEs, solved 9 of the 12 solvable equations and failed in returning a solution for 3 solvable equations: 8, 5, 12. Independent of that, Mathematica hangs with 2 equation: 5, 12, which are both solvable.

Maple 17 performance: 92 %, in 24 seconds

Maple took 24 seconds in tackling the 12 ODEs, solved 11 of the 12 solvable equations and failed in returning a solution for 1 solvable equation: 4. Independent of that, Maple did not hang with any equation.

Higher order nonlinear ODEs

There are 17 higher order nonlinear ODEs in Kamke’s book, from 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 9 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 in returning a solution for 5 fully solvable equations: 1, 8, 9, 17, 12. Independent of that, Mathematica hangs with 1 equation: 12, which is fully solvable.

Maple 17 performance with solvable ODEs: 100%; with reducible ODEs: 100%, in 24 seconds

Maple took 24 seconds in tackling the 17 ODEs, solved 11 of the 11 solvable ones, 5 of the 5 reducible ones, so all of them. Independent of that, Maple did not hang with any equation.

第5章 微分方程(Maple)

第5章 微分方程 5.1 常微分方程 5.1.1 常微分方程的求解和作图命令 z 求解微分方程命令dsolve 在微分方程中,我们称只有一个自变量的微分方程为常微分方程,具有两个或两个以上自变量的微分方程为偏微分方程。例如:描述物体冷却过程的数学模型 )(0u u k dt du ??= 含有自变量t 、未知函数u 以及一阶导数du dt ,是一个常微分方程。Maple 中求解常微分方程的命令为dsolve 函数,其用法有 dsolve (常微方程) dsolve (常微方程,待解函数,选项) dsolve ({常微方程,初值},待解函数,选项) dsolve ({常微方程组,初值},{待解函数},选项) z 方程数值解作图命令odeplot 要做出常微分方程数值解的图象,请使用odeplot 函数。odeplot 在程序包plots 中,可通过with(plots)或plots[odeplot]调出。 odeplot (数值解,被绘函数,参数范围,选项) 5.1.2 一阶常微分方程 z 可分离变量方程 若一阶微分方程有形式 )()(y g x f dx dy =,则称为可分离变量方程。一般可以通过对方程dx x f y g dy )() (=两边分别积分,得到方程的隐式解。

例:求解微分方程sin() '()sin() x y x y = 。 > eq:=diff(y(x),x)=sin(x)/sin(y(x)); 显然,这是可分离变量的常微分方程。用Detools 程序包中的odeadvisor 函数检测方程的类型,输出结果_separable 说明方程类型是可分离变量的。 > DEtools[odeadvisor](eq); [_separable] 用dsolve 函数求解方程,得到方程的通解。 > dsolve(eq); 设定选项implicit ,得到方程的隐式解。 > dsolve(eq,implicit); 附加初始值y(0)=1,得到方程的准确解。 > dsolve({eq,y(0)=1}); odeplot 命令作出方程解的图形。 > dsolve({eq,y(0)=1},numeric,range=-2..2); > plots[odeplot](%); z 齐次方程 若常微分方程具有形式 ??? ???=x y f dx dy ,则称为齐次方程。通常用变量代换x y u =将齐次方程转换为可分离变量方程 x u u f dx du ?=)(。

第4章-方程求解(Maple 中文教程)

第四章 方程求解 1 代数方程(组)求解 1.1 常用求解工具—solve 求解代数方程或代数方程组, 使用Maple 中的solve 函数. 求解关于x 的方程eqn=0的命令格式为: solve(eqn, x); 求解关于变量组vars 的方程组eqns 的命令为: solve(eqns, vars); > eqn:=(x^2+x+2)*(x-1); := eqn () + + x 2x 2() ? x 1 > solve(eqn,x); ,,1? + 1212I 7? ? 1212 I 7 当然, solve 也可以求解含有未知参数的方程: > eqn:=2*x^2-5*a*x=1; := eqn = ? 2x 25a x 1 > solve(eqn,x); , + 54a 14 + 25a 28 ? 54a 14 + 25a 28 solve 函数的第一个参数是有待求解的方程或方程的集合, 当然也可以是单个表达式或者表达式的集合, 如下例: > solve(a+ln(x-3)-ln(x),x); 3e a ? + 1e a 对于第二个参数, Maple 的标准形式是未知变量或者变量集合, 当其被省略时, 函数indets 自动获取未知变量. 但当方程中含有参数时, 则会出现一些意想不到的情况: > solve(a+ln(x-3)-ln(x));

{}, = x x = a ? + ()ln ? x 3()ln x 很多情况下, 我们知道一类方程或方程组有解, 但却没有解决这类方程的一般解法, 或者说没有解析解. 比如, 一般的五次或五次以上的多项式, 其解不能写成解析表达式. Maple 具备用所有一般算法尝试所遇到的问题, 在找不到解的时候, Maple 会用RootOf 给出形式解. > x^7-2*x^6-4*x^5-x^3+x^2+6*x+4; ? ? ? + + + x 72x 64x 5x 3x 26x 4 > solve(%); + 15 ? 15()RootOf , ? ? _Z 5_Z 1 = index 1()RootOf , ? ? _Z 5_Z 1 = index 2(RootOf ,) ? ? _Z 5_Z 1 = index 3,,,,()RootOf , ? ? _Z 5_Z 1 = index 4()RootOf , ? ? _Z 5_Z 1 = index 5,, > solve(cos(x)=x,x); ()RootOf ? _Z ()cos _Z 对于方程组解的个数可用nops 命令获得, 如: > eqns:={seq(x[i]^2=x[i],i=1..7)}; := eqns {,,,,,, = x 12x 1 = x 22x 2 = x 32x 3 = x 42x 4 = x 52x 5 = x 62x 6 = x 72 x 7} > nops({solve(eqns)});128 但是, 有时候, Maple 甚至对一些“显而易见”的结果置之不理, 如: > solve(sin(x)=3*x/Pi,x); ()RootOf ? 3_Z ()sin _Z π 此方程的解为0 ,6π ±, 但Maple 却对这个超越方程无能为力, 即便使用allvalues 求解也只有下述结果: > allvalues(%); ()RootOf , ? 3_Z ()sin _Z π0. 另外一个问题是, Maple 在求解方程之前,会对所有的方程或表达式进行化简, 而不管表达式的类型, 由此而产生一些低级的错误: > (x-1)^2/(x^2-1); () ? x 12 ? x 21 > solve(%); 1

如何利用Maple求解偏微分方程

如何利用Maple求解偏微分方程 微分方程分有常微分和偏微分方程两种,利用Maple对微分方程求解是Maple的一个核心优势,下面介绍利用Maple求偏微分方程的命令。 求偏微分方程或偏微分方程系统的命令是“Pdsolve”。 调用格式是: pdsolve(PDE, f, HINT = hint, INTEGRATE, build) pdsolve(PDE_system, funcs, HINT, other_options) pdsolve(PDE_or_PDE_system, conds, type=numeric, other_options) 其中: PDE:偏微分方程。 f:不定函数或名称;当有很多导函数时需要指定此项。 hint:(可选项)HINT = hint中的右边,其中hint 为“+,“*”之一,关键词strip 或TWS之一,结构TWS(math_function_name),或关于不定函数的任意代数表达式。 INTEGRATE:(可选项)当使用变量分离法求解PDE时发现ODE集合,此选项表明进行自动积分。 Build:(可选项)尝试建立不定函数的显式表达式,不管所得解的一般性。 PDE_system:偏微分方程系统;可包含不等式。 Funcs:(可选项)由不定函数或名称构成的集合或列表。 other_options:当精确求解PDE系统时,casesplit命令接受的所有选项也被pdsolve 接受。 PDE_or_PDE_system:偏微分方程或偏微分方程系统;可包含不等式。 Conds:初始或边界条件。

type=numeric:等式;表明寻找数值解;可使用关键词numeric替代整个等式。 示例:求解热传导方程的数值解、解析解和图形解。 初始条件: 为了得到数值解,我们需要定义a和h的值,以及提供第二个边界条件: 这个命令创建了一个模块(module,使用方法类似于Maple的函数包),可以看到模块的输出函数是plot,plot3d,animate和value。 解的表面图:

Maple常用计算命令..

常用计算命令 《Maple 指令》7.0版本 第1章章数 1.1 复数 Re,Im - 返回复数型表达式的实部/虚部 abs - 绝对值函数 argument - 复数的幅角函数 conjugate - 返回共轭复数 csgn - 实数和复数表达式的符号函数 signum - 实数和复数表达式的sign 函数5 1.2 MAPLE 常数 已知的变量名称 指数常数(以自然对数为底) I - x^2 = -1 的根 infinity 无穷大 1.3 整数函数 ! - 阶乘函数 irem, iquo - 整数的余数/商 isprime - 素数测试 isqrfree - 无整数平方的因数分解 max, min - 数的最大值/最小值 mod, modp, mods - 计算对 m 的整数模 rand - 随机数生成器 randomize - 重置随机数生成器 1.4 素数 Randpoly, Randprime - 有限域的随机多项式/首一素数多项式ithprime - 确定第 i 个素数 nextprime, prevprime - 确定下一个最大/最小素数 1.5 数的进制转换 convert/base - 基数之间的转换 convert/binary - 转换为二进制形式 convert/decimal - 转换为 10 进制 convert/double - 将双精度浮点数由一种形式转换为另一种形式convert/float - 转换为浮点数 convert/hex - 转换为十六进制形式 convert/metric - 转换为公制单位

convert/octal - 转换为八进制形式 1.6 数的类型检查 type - 数的类型检查函数 第2章初等数学 2.1 初等函数 product - 确定乘积求和不确定乘积 exp - 指数函数 sum - 确定求和不确定求和 sqrt - 计算平方根 算术运算符+, -, *, /, ^ add, mul - 值序列的加法/乘法 2.2 三角函数 arcsin, arcsinh, . - 反三角函数/反双曲函数 sin, sinh, . - 三角函数/双曲函数 2.3 LOGARITHMS 函数 dilog - Dilogarithm 函数 ln, log, log10 - 自然对数/一般对数,常用对数 2.4 类型转换 convert/`+`,convert/`*` - 转换为求和/乘积 convert/hypergeom - 将求和转换为超越函数 convert/degrees - 将弧度转换为度 convert/expsincos - 将trig 函数转换为exp, sin, cos convert/Ei - 转换为指数积分 convert/exp - 将trig 函数转换为指数函数 convert/ln - 将arctrig 转换为对数函数 polar - 转换为极坐标形式 convert/radians - 将度转换为弧度 convert/sincos - 将trig 函数转换为sin, cos, sinh, cosh convert/tan - 将trig 函数转换为tan convert/trig - 将指数函数转换为三角函数和双曲函数 第3章求值 3.1 假设功能 3.2 求值 Eval - 对一个表达式求值 eval - 求值

Maple-ch-常微分方程

1 / 20 第四章 微分方程 §4.1 常微分方程 4.1.1 常微分方程的解析解 1. 函数dsolve 在微分方程中的应用 在Maple 中,这是一个用途最广的函数——称为通用函数吧,几乎可以求解所有的微 分方程和方程组,既能求解解析解,也能求解数值解,本节只介绍其求微分方程的解析解中的作用: dsolve (ODE); dsolve (ODE,y(x),extra_args); 其中,ODE(Ordinary Differential Equation)是一个常微分方程; y(x)为未函数,求解时这个参数可以省略;第三个参数extra_args 是一个可选的参数,主要用来设置最后解析解的形式或求解过程中一些积分的设置,它的选值很广,这里仅举几个参数。 (1) explicit: 求出显式解; (2) implicit: 解可以是隐式; (3) useInt: 运算中用“Int ”函数代替“int ”函数,可加快运算速度; (4) parametric: 将最后的解析解表达成另外一个自变量的形式。 这些参数的位置很灵活,可以放在除第一个参数位置外的任何位置,并且它们的组合 也很灵活,可以单独作用,也可几何参数合用,只要在中间用逗号隔开,而且参数并不一定需要写在一起,也可以分开。 > eq:='eq': eq:=diff(y(x),x)*(1+y(x)^2)+cos(x)=0; 可以两端都不是零 := eq = + ?? ?? ???()y x () + 1()y x 2()cos x 0 > sol1:=dsolve(eq,explicit); 给出显式解 sol1()y x = := 12 - ()- - + 12()sin x 12_C12 - + + 3418()cos 2x 72()sin x _C136_C12() /234 () - - + 12()sin x 12_C12 - + + 3418()cos 2x 72()sin x _C136_C12()/13, 其中“_C 1”表示第一个任意常数。方程的解是很恐怖的解,这里仅给出了一个解,另

Maple提高教程B3- Maple中的偏微分方程求解

B3: Maple中的偏微分方程求解 西希安工程模拟软件(上海)有限公司,2008 11.0 Maple中的微分方程求解器介绍 Maple中微分方程求解器使用领先的算法求解以下问题: 常微分方程 (ODEs): dsolve 命令用于求解线性和非线性ODEs, 初始值问题 (IVP), 以及边界值问题 (BVP),可以通过参数项选择求符号解 (解析解) 或数值解。ODE Analyzer Assistant 微分方程分析器助手提供一个交互式用户界面方便用户求解 ODE 以及显示结果的图形。了解更多信息,参考帮助系统中的 dsolve, dsolve/numeric, 和 ODE Analyzer. 偏微分方程 (PDEs): pdsolve 命令用于求 PDEs 和含边界值问题的 PDEs 的符号解或数值解。使用Maple的PDE工具可以完成对PDE系统的结构分析和指数降阶处理。了解更多信息,参考帮助系统中的 pdsolve and pdsolve/numeric. 微分-代数方程 (DAEs): dsolve/numeric 命令是符号-数值混合求解器,使用符号预处理和降阶技术,让Maple能够求解高指数的DAE问题。Maple内置三个求解器用于处理DAEs:1)修正的 Runge-Kutta Fehlberg 方法,2)Rosenbrock 方法,以及 3)修正的拓展后向差分隐式方法。 11.1 求解偏微分方程PDE问题(BVP和IVP) Maple 求解经典力学难题的能力是非常著名的,它的数值和符号偏微分方程求解器是其中的重要工具。 例子:在不同的边界条件下,求波动方程的数值解、解析解、和图形解。 11.1.1 初始化 下面的Maple代码定义了一个名为P X的程序,生成函数的周期展开。 PX := proc(h::{algebraic,procedure},g::{range,name=range}) local L, D, var; if type(g,'range') then L := lhs(g); D := rhs(g) - L;

Maple 常用计算命令

Maple 常用计算命令 《Maple 指令》7.0版本 第1章章数 1.1 复数 Re,Im - 返回复数型表达式的实部/虚部 abs - 绝对值函数 argument - 复数的幅角函数 conjugate - 返回共轭复数 csgn - 实数和复数表达式的符号函数 signum - 实数和复数表达式的sign 函数5 1.2 MAPLE 常数 已知的变量名称 指数常数(以自然对数为底) I - x^2 = -1 的根 infinity 无穷大 1.3 整数函数 ! - 阶乘函数 irem, iquo - 整数的余数/商 isprime - 素数测试 isqrfree - 无整数平方的因数分解 max, min - 数的最大值/最小值 mod, modp, mods - 计算对 m 的整数模 rand - 随机数生成器 randomize - 重置随机数生成器 1.4 素数 Randpoly, Randprime - 有限域的随机多项式/首一素数多项式ithprime - 确定第i个素数 nextprime, prevprime - 确定下一个最大/最小素数 1.5 数的进制转换 convert/base - 基数之间的转换 convert/binary - 转换为二进制形式 convert/decimal - 转换为 10 进制 convert/double - 将双精度浮点数由一种形式转换为另一种形式convert/float - 转换为浮点数 convert/hex - 转换为十六进制形式 convert/metric - 转换为公制单位 convert/octal - 转换为八进制形式 1.6 数的类型检查 type - 数的类型检查函数 第2章初等数学 2.1 初等函数 product - 确定乘积求和不确定乘积 exp - 指数函数

Maple微分方程的求解

题目:微分方程的求解 ——基于Maple工具 姓名: 学号: 专业: 学科: 老师:

目录 一、简介 (3) 概况: (3) Maple 主要技术特征: (3) 1. 强大的求解器:数学和分析软件的领导者 (3) 2. 技术文件环境:重新定义数学的使用性 (4) 3. 知识捕捉:不仅是工具,更是知识 (4) 4. 外部程序连接:无缝集成到您现有的工具链中 (4) 二、Maple在微分方程中的应用 (5) 1、常用函数 (5) 1)求解常微分方程的命令dsolve. (5) 2)求解一阶线性常微分方程的命令linearsol. (5) 3)偏微分方程求解命令pdsolve. (6) 2、方法 (6) 1)一阶常微分方程的解法 (6) 2)二阶线性常微分方程的解法 (7) 3、作图 (8) 1)常微分方程数值解作图命令odeplot (8) 2)偏微分方程作图命令PDEplot (8) 三、各种方程的求解 (8) 第一部分:一阶常微分方程 (8) 1、可分离变量方程 (8) 2、齐次方程 (9) 3、线性方程 (10) 4、Bernoulli方程 (10) 第二部分:二阶线性常微分方程 (11) 1、二阶常系数线性齐次方程 (11) 2、二阶常系数线性非齐次方程 (12) 3、Euler方程(变系数) (12) 第三部分:偏微分方程 (13) 1、波动方程 (13) 2、热传导方程 (14) 3、作图 (14) 四、总结 (15)

一、简介 概况: Maple是目前世界上最为通用的数学和工程计算软件之一,在数学和科学领域享有盛誉,有“数学家的软件”之称。Maple 在全球拥有数百万用户,被广泛地应用于科学、工程和教育等领域,用户渗透超过96%的世界主要高校和研究所,超过81%的世界财富五百强企业。 Maple系统内置高级技术解决建模和仿真中的数学问题,包括世界上最强大的的符号计算、无限精度数值计算、创新的互联网连接、强大的4GL语言等,内置超过5000个计算命令,数学和分析功能覆盖几乎所有的数学分支,如微积分、微分方程、特殊函数、线性代数、图像声音处理、统计、动力系统等。 Maple不仅仅提供编程工具,更重要的是提供数学知识。Maple是教授、研究员、科学家、工程师、学生们必备的科学计算工具,从简单的数字计算到高度复杂的非线性问题,Maple都可以帮助您快速、高效地解决问题。用户通过Maple产品可以在单一的环境中完成多领域物理系统建模和仿真、符号计算、数值计算、程序设计、技术文件、报告演示、算法开发、外部程序连接等功能,满足各个层次用户的需要,从高中学生到高级研究人员。 Maple 主要技术特征: 1. 强大的求解器:数学和分析软件的领导者 ★内置超过5000个符号和数值计算命令,覆盖几乎所有的数学领域,如微积分,线性代数,方程求解,积分和离散变换,概率论和数理统计,物理,图论,张量分析,微分和解析几何,金融数学,矩阵计算,线性规划,组合数学,矢量分析,抽象代数,泛函分析,数论,复分析和实分析,抽象代数,级数和积分变换,特殊函数,编码和密码理论,优化等。 ★各种工程计算:优化,统计过程控制,灵敏度分析,动力系统设计,小波分析,信号处理,控制器设计,集总参数分析和建模,各种工程图形等。 ★提供世界上最强大的符号计算和高性能数值计算引擎,包括世界上最强大的微分方程求解器(ODEs,PDEs,高指数DAEs)。 ★智能自动算法选择。 ★强大、灵活、容易使用的编程语言,让您能够开发更复杂的模型或算法。

Maple中的微分代数方程求解

Part10:Maple中的微分代数方程求解 西希安工程模拟软件(上海)有限公司,2008 10.0 Maple中的微分方程求解器介绍 Maple中微分方程求解器使用领先的算法求解以下问题: 常微分方程 (ODEs): dsolve 命令用于求解线性和非线性ODEs, 初始值问题 (IVP), 以及边界值问题 (BVP),可以通过参数项选择求符号解 (解析解) 或数值解。ODE Analyzer Assistant 微分方程分析器助手提供一个交互式用户界面方便用户求解 ODE 以及显示结果的图形。了解更多信息,参考帮助系统中的 dsolve, dsolve/numeric, 和 ODE Analyzer. 偏微分方程 (PDEs): pdsolve 命令用于求 PDEs 和含边界值问题的 PDEs 的符号解或数值解。使用Maple的PDE工具可以完成对PDE系统的结构分析和指数降阶处理。了解更多信息,参考帮助系统中的 pdsolve and pdsolve/numeric. 微分-代数方程 (DAEs): dsolve/numeric 命令是符号-数值混合求解器,使用符号预处理和降阶技术,让Maple能够求解高指数的DAE问题。Maple内置三个求解器用于处理DAEs:1)修正的 Runge-Kutta Fehlberg 方法,2)Rosenbrock 方法,以及 3)修正的拓展后向差分隐式方法。 10.1 Maple中的微分代数方程(DAEs) 更多亮点: 大部分情况下,通过识别是否存在因变量的纯代数方程,dsolve命令可以判断给定的问题是否是微分代数方程,而不是常微分方程。如果输入是一个不含有纯代数方程的微分代数方程,使用solve求解时需要用method参数指定对象是一个微分代数方程。 dsolve 有三种数值方法求解DAEs。默认的 DAE IVP 方法是 modified Runge-Kutta Fehlberg method (rkf45_dae),另两个方法是 rosenbrock_dae 和 Modified Extended Backward-Differentiation Implicit method (mebdfi),可以通过 method 参数项指定。 Maple 的ODE数值求解器和DAE IVP(初值问题)求解器可以处理用户自定义事件。 关于求解DAEs的更多信息,请参考帮助 dsolve/numeric 和 dsolve/numeric/DAE.

微分方程的maple求解

1、常用函数 1)求解常微分方程的命令dsolve. dsolve(常微分方程) dsolve(常微分方程,待解函数,选项) dsolve({常微分方程,初值},待解函数,选项) dsolve({常微分方程组,初值},{待解函数},选项) 其中选项设置解得求解方法和解的表示方式。求解方法有type=formal_series(形式幂级数解)、type=formal_solution(形式解)、type=numeric(数值解)、type=series(级数解)、method=fourier(通过Fourier变换求解)、method=laplace(通过Laplace变换求解)等。解的表示方式有explicit(显式)、implicit(隐式)、parametric(参数式)。当方程比较复杂时,要想得到显式解通常十分困难,结果也会相当复杂。这时,方程的隐式解更为有用,一般也要简单得多。dsolve为标准库函数。 2)求解一阶线性常微分方程的命令linearsol. 在Maple中求解一阶线性方程既可以用dsolve函数求解,也可以用Detools函数包中的linearsol函数求解。linearsol是专门求解线性微分方程的命令,使用格式为: linearsol(线性方程,待解函数) linearsol的返回值为集合形式的解。 3)偏微分方程求解命令pdsolve. pdsolve(偏微分方程,待解变量,选项) pdsolve(偏微分方程,初值或边界条件,选项) pdsolve为标准库函数,可直接使用。 如果求解成功,将得到几种可能结果: 方程的通解; 拟通解(包含有任意函数,但不足以构造通解); 一些常微分方程的集合;

Maple解方程组有哪些算法

Maple解方程组有哪些算法 勿庸质疑Maple符号计算功能是非常强大的,因此Maple能够进行大量的复杂运算。这些复杂运算中会用到不同的算法,那么Maple是怎么解方程组的呢? 更多Maple常见命令和基本操作介绍请访问Maple中文版网站。 Maple可以解决很多方程和方程组的问题,在这个过程中Maple会使用很多不同的技术: 1.在封闭解时使用符号方法 2.在近似解时使用数值方法 3.混合符号和数值算法共同运用事业解决那些单独使用其中一种无法解决的问题。 Maple启动界面示例 在需要精确的、封闭解的情况下使用符号运算 Maple的符号求解器使用状态算法来解决代数方程问题,包括运用F4算法来计算Gr?bner 和三角集合来分解算法。 在Maple中你可以: 解方程和方程组; 解不等式和不等式组; 对多种类型的参数方程和不等式找到约束解。 使用普通变量或者函数作为未知量。当未知量是一个函数时,Maple返回出一个可以解方程的函数。 求解恒等式、参数方程、非线性系统和级数。 控制解的形式。 近似解时使用数值方法: 在寻找方程的近似解时,Maple的数值求解器使用工业标准技术,包括集成数值算法组(NAG)中的求解器。 使用Maple你可以: 解方程和方程组; 设置在运算过程上使用数值的位数;

指定初始值; 指定一个解的区间; 指定你正在寻找的真正的根或者复杂的根; 对有一个变量的多项式方程返回出来有限个数的解。 混合方法: 除了单独使用标准的数值技术之外,Maple还可以通过使用混合符号-数值的方法来拓展数值求解器的能力和速度。 如果一个问题在某种形式下无法使用标准数值或符号方法来求解,Maple就会象征性地尝试将问题转换成一个可以用数值方法求解的等价形式。 混合技术也可以用来对数值求解器中选择近似初始值,这样可以使它们更快得出答案。 这种混合运算的方法已经被完全集成到数值求解器的算法中了,在需要时会自动应用。 其他求解器 除了对代数方程的常规求解方法外,对于微分方程、代数微分方程、整数方程、整数取余方程、递推方程、级数解和q差分方程等,Maple还有很多包括常规解法在内的专业门的求解方法。 以上内容是对Maple解方程时所用到的算法的介绍,Maple在计算时使用的符号计算系统能够解决很多复杂的数学计算精确且迅速。欢迎访问Maple中文版网站获取最新版Maple 2015下载地址。

微分方程求解

微分方程的求解 ----基于Maple工具一、Maple工具简介 Maple是加拿大滑铁卢大学(Waterloo University)研制的一种计算机代数系统。经过近20年的不断发展,数学软件Maple已成为当今世界上最优秀的几个数学软件之一,它以良好的使用环境、强有力的符号计算能力、高精度的数字计算、灵活的图形显示和高效的可编程功能,为越来越多的教师、学生和科研人员所喜爱,并成为他们进行数学处理的工具。可以容易的运用Maple软件解决微积分、解析几何、线性代数、微分方程、计算方法、概率统计等数学分支中的常见的计算问题。1980 年9月,加拿大Waterloo大学的符号计算研究小组成立,开始了符号计算在计算机上实现的研究项目。数学软件Maple是这个项目的产品。目前,这仍是一个正在研究的项目。Maple的第一个商业版本Maple3.3是1985年出版的。随着几经更新,Maple被广泛的使用,得到越来越多的用户。 Maple 软件主要由三部分组成:用户界面(Iris),代数运算器(kernel),外部函数库(External library)。用户界面和代数运算器是用C语言写的,只占整个软件的一小部分,当系统启动时,即被装入。Iris负责输入命令和算式的初步处理、显示结果、函数图像的显示等。Kernel负责输入的编译、基本的代数运算,如有理数运算、初等代数运算,还负责内存管理。Maple的大部分数学函数

和过程是用Maple自身的语言写成的,存于外部函数库中。当一个函数调用时,在多数情况下,Maple会自动将该函数的过程调入内存,一些不常用的函数才需要用户自己将它们调入。另外有一些特别的函数包也需要用户自己调入,如线性代数包、统计包,这使得Maple 在资源的利用上具有很大的优势,只有最有用的东西才留住内存,这是Maple可以在较小内存的计算机上正常运行的原因。 Maple不仅仅提供编程工具,更重要的是提供数学知识。用户在直观的文档计算环境中完成各种数学问题,无限精度的计算消除了计算误差。Maple是教授、研究员、科学家、工程师、学生们必备的科学计算工具,从简单的数字计算到高度复杂的非线性问题,Maple 都可以帮助您快速、高效地解决问题。用户可在单一的环境中完成多领域建模和模拟,符号计算、数值计算、程序设计、技术文件、报告演示、算法开发、与外部程序连接等功能,满足各个层次用户的需要,从高中学生到高级研究人员。 Maple 有三大关键特征:数学引擎、操作简单、外部连接性。 数学引擎:Mathematics=Maplesoft !解决数学问题时,世界上没有任何其他软件比Maple更完整、更好。 操作简单:Maple人性化的界面让用户只需要按几个键就可以解决大量复杂的计算问题,Maple的文件模式界面可以创建多样化的、专业级的技术文件,并可以自由转换为其他格式的文件,如Latex/html/word等。 外部连接性:Maple 的程序可以自动转换为其他语言代码,如

Maple6-ch41-常微分方程共23页

第四章微分方程 §4.1 常微分方程 4.1.1 常微分方程的解析解 1. 函数dsolve在微分方程中的应用 在Maple中,这是一个用途最广的函数——称为通用函数吧,几乎可以求解所有的微 分方程和方程组,既能求解解析解,也能求解数值解,本节只介绍其求微分方程的解析解中的作用: dsolve(ODE); dsolve(ODE,y(x),extra_args); 其中,ODE(Ordinary Differential Equation)是一个常微分方程; y(x)为未函数,求解时这个参数可以省略;第三个参数extra_args是一个可选的参数,主要用来设置最后解析解的形式或求解过程中一些积分的设置,它的选值很广,这里仅举几个参数。 (1) explicit: 求出显式解; (2) implicit: 解可以是隐式; (3) useInt: 运算中用“Int”函数代替“int”函数,可加快运算速 度; 第 1 页

(4) parametric: 将最后的解析解表达成另外一个自变量的形式。 这些参数的位置很灵活,可以放在除第一个参数位置外的任何位置,并且它们的组合 也很灵活,可以单独作用,也可几何参数合用,只要在中间用逗号隔开,而且参数并不一定需要写在一起,也可以分开。 > eq:='eq': eq:=diff(y(x),x)*(1+y(x)^2)+cos(x)=0; 可以两端都不是零 > sol1:=dsolve(eq,explicit);给出显式解 其中“_C1”表示第一个任意常数。方程的解是很恐怖的解,这里仅给出了一个解,另外还有两个更长的解,读者可以在Maple下执行上面求解过程观察到另外两个解的全貌。这是由于将解转换成显函数造成的,假如我们将参数进行改善: > sol2:=dsolve(eq,implicit,y(x)); 给出隐式解,式中的y(x)可省略 再加上一个参数“useInt”,可以明显感到运算速度非常快,因此,它在求解过程中积分比较复杂时很有用,同时还能使解过程、解结果给出较多的信息: > sol3:=dsolve(eq,implicit,y(x),useInt); 第 2 页

matlab-maple画常微分向量场上课讲义

m a t l a b-m a p l e画常微分向量场

作业 一、常微分方程向量场相关概念 1、常微分方程向量场定义 答: 设一阶微分方程()y x f dx ,dy = 满足解的存在唯一性定理的条件。过D 中任一点 ()y x 0 ,,有且仅有一个解(),x y ?=满足(),y 0 x =?()()()x x f x ??,' =。称 域D 为方程所定义的向量场。 2、常微分方程向量场性质 答: 性质1:解()x ?=y 就是通过点 ()y 0 x ,的一条曲线(称为积分曲线),且 ()()x x ?,f 就是该曲线上的点()()x ?,x 处的切线斜率,特别在 ()y 0 x ,切线斜率就 是()y x 0 ,f 。 性质2:向量场可以用映射22:F R R Ω?→r 来表示,其中(,)(,)F X x y i Y x y j =+r r r ,Ω为一个平面区域,22R R →表示由平面一点映射到一个二维向量。 性质3:若函数(,)f x y 为Ω上的连续函数,那么向量场也是连续的。 性质4:向量场的原函数不唯一,但是任意两个原函数之间只差一个常数。 3、利用向量场求常微分方程(组)近似解 答: 从几何上看,方程 ()y x f dx ,dy =的一个解()x y ?=就是位于它所确定的向量场中的一条曲线,该曲线所经过的每一点都与向量场在这一点的方向相切。形象的说,解()x ?就是始终沿着向量场中的方向行进的曲线,因此,求方程

()y x f dx ,dy =满足初始值()y x 0 y =的解,就是求通过点 ()y 0 x ,的这样的一条曲 线。 4、利用向量场研究常微分方程定性理论 答: 向量场对于求解微分方程的近似解和研究微分方程的几何性质极为重要,因为,可根据向量场的走向来近似求积分曲线,同时也可根据向量场本身的性质来研究解的性质。 (1). 李雅普诺夫稳定性 考虑方程 262dy y y dx =-和242dy y y dx =-+,现用向量场判断方程的李 雅普诺夫稳定性。分别绘制其向量场如下图: 从该图中的向量场方向可以看出,其所有解都渐进稳定于直线3y =。

用MATLAB解常微分方程

实验四求微分方程的解 一、问题背景与实验目的 实际应用问题通过数学建模所归纳而得到的方程,绝大多数都是微分方程, 真正能得到代数方程的机会很少.另一方面,能够求解的微分方程也是十分有限 的,特别是高阶方程和偏微分方程(组).这就要求我们必须研究微分方程(组) 的解法,既要研究微分方程(组)的解析解法(精确解),更要研究微分方程(组) 的数值解法(近似解). 对微分方程(组)的解析解法(精确解),Matlab 有专门的函数可以用,本实 验将作一定的介绍. 本实验将主要研究微分方程(组)的数值解法(近似解),重点介绍Euler 折线 法. 二、相关函数(命令)及简介 1. dsolve ('equ1','equ2';…):Matlab 求微分方程的解析解.equ1、equ2、… 为方 程(或条件).写方程(或条件)时用 Dy 表示y 关于自变量的一阶导数, 用用D2y 表示y 关于自变量的二阶导数,依此类推. 2. simplify (s ):对表达式s 使用maple 的化简规则进行化简. 例如: syms x sim pl ify (si n (x )A2 + cos (x )^2) an s=1 3. [r,how]=simple (s ):由于 Matlab 提供了多种化简规则,simpie 命令就是 对表达 式s 用各种规则进行化简,然后用r 返回最简形式,how 返回形成这种 形式所用的规则. 例如: syms x [r,how]=sim ple (cos (x )A2-si n (x )A2) r = cos (2*x ) how = comb ine 4. [T,Y] = solver ( odefun,tspan,y ))求微分方程的数值解. 说明: (1)其中的 solver 为命令 ode45、ode23、ode113 ode15s ode23s 、ode23t 、 ode23tb 之一. ⑶ 在积分区间tspan=[t 0,t f ]上,从t o 到t f ,用初始条件y 求解. ⑵odefu n 是显式常微分方程: 詈 f(t ,y) y(t 0) y o

相关文档
相关文档 最新文档