Maple

MAPLE是一個符號運算和數值計算軟體平臺總覽.核心功能.使用者能夠直接使用傳統數學符號進行輸入，也可以定製個性化的介面。對於數值計算有額外的支援，能夠擴充套件到任意精度，同時亦支援符號演算及視覺化。符號演算的例子文。Maple內建有一種動態的命令列風格的程式語言，該語言支援具有作用域的變數。同時亦有其他語言的介面。還具有與Excel進行互動的介面。架構.Maple由一個很小的由C語言編寫的核心提供Maple語言。許多功能由各種函式庫提供。許多數值計算由NAG數值計算庫, ATLAS庫, GNU多精度庫提供。大部分庫由Maple語言編寫，並且可檢視原始碼。Maple中不同的功能需要不同格式的數值資料。符號表達式在記憶體中以有向無環圖的形式儲存。標準介面和計算介面由Java語言編寫。經典介面由C語言編寫。Maple程式碼示例.簡單指令式程式的構造：myfac := proc(n::nonnegint)local out, i;out := 1;for i from 2 to n doout := out * iend do;outend proc;一些簡單的函式也可以使用直觀的箭頭表示法表示myfac := n -&gt; product( i, i=1..n );開方.evalf[100](2^1/12)1.059463094359295264561825294946341700779204317494185628559208431458761646063255722383768376863945569求根.f:=x^2-63*x+99=0;solve(f,x);formula_1, formula_2f := x^7+3*x = 7;solve(f,x);RootOf(formula_3, index = 1),RootOf(formula_3, index = 2),RootOf(formula_3, index = 3),RootOf(formula_3, index = 4),RootOf(formula_3, index = 5),RootOf(formula_3, index = 5),RootOf(formula_3, index =7),evalf(%);f := sin(x)^3+5*cosh(x) = 0;formula_10&gt; solve(f, x);RootOf(formula_11&gt; evalf(%);0.2873691672 - 1.111497506 I求解方程和不等式.根據formula_12，尋找formula_13的所有整數解。solve({x-y &gt; 6, (x+y)^5 = 9}, [x, y])[];答案：formula_14&gt; p1 := x*y*z-x*y^2-z-x-y; p2 := x*z-x^2-z-y+x; p3 := z^2-x^2-y^2;&gt; sys := {p1, p2, p3};&gt; var := {x, y, z};&gt; solve(sys, var);{x = 0, y = y, z = -y}, {x = 3, y = 4, z = 5}, {x = 1, y = 0, z = -1}&gt; f1 := cos(x)+sin(3*y)+tan(5*z) = 0;&gt; f2 := cos(3*z)+tan(3*y^2)-sin(2*z^3) = 33;&gt; f3 := tan(4*x+y)-sin(5*y-4*z) = 2*x;&gt; sys1 := {f1, f2, f3};&gt; var1 := {x, y, z};{x, y, z}&gt; fsolve(sys1, var1);{x = -10.77771790, y = -2.397849343, z = -7.382158103}矩陣與行列式.計算矩陣的行列式。M:= Matrix(1,2,3, [a,b,c], x,y,z); # 矩陣樣例formula_15with(LinearAlgebra)m:=Determinant(M);答案：formula_16with(VectorCalculus);w:=Wronskian([1,x,x^3+x-1],x)Matrix(3, 3, {(1, 1) = 1, (1, 2) = x, (1, 3) = x^3+x-1, (2, 1) = 0, (2, 2) = 1, (2, 3) = 3*x^2+1, (3, 1) = 0, (3, 2) = 0, (3, 3) = 6*x})d:=Determinant(w);6xJ := Jacobian([r*sin(t)), r^2*cosh(t)], [r, t]);m:=Matrix(2, 2, {(1, 1) = cos(t), (1, 2) = -r*sin(t), (2, 1) = sinh(t), (2, 2) = r*cosh(t)})d:=Determinant(m);sin(t)*r^2*sinh(t)-2r^2cos(t)cosh(t)f := x^3+y*cos(x)+t*tan(y))with(VectorCalculus);h:=hessian(f,[x,y,t]);formula_17積分.求formula_18.int(cos(x/a), x);答案：formula_19求formula_20.int(sin(x/a), x);答案：formula_21注意：Maple在積分時不提供常數項C，必須自行補上。&gt; int(cos(x/a), x = 1 .. 5);16 a sin（1/a)* cos^4(1/a) - 12 a sin^2(1/a)求解線性微分方程.計算以下線性常微分方程的一個精確解formula_22初始條件為formula_23dsolve( {diff(y(x),x,x) - 3*y(x) = x, y(0)=0, D(y)(0)=2}, y(x) );答案：formula_24非線性常微分方程.dsolve(diff(y(x), x, x) = x^2*y(x))解：formula_25BesselI(formula_26,formula_27formula_28)+formula_29BesselK(formula_26,formula_27formula_28)級數展開.series(tanh(x),x=0,15)formula_33formula_34f:=int(exp^cosh(x),x)series(f,x=0,15);formula_35formula_36拉普拉斯變換.with(inttrans);&gt; f := (1+A*t+B*t^2)*exp(c*t);formula_37&gt; laplace(f, t, s);formula_38invlaplace(1/(s-a),s,x)formula_39z := y(t);y(t)f := diff(z, t, t)+a*(diff(z, t)) = b*z;formula_40with(inttrans);g := laplace(f, t, s);s^2*laplace(y(t), t, s) - D(y)(0) - s y(0)+ a s^2 laplace(y(t), t, s) - a y(0) = b laplace(y(t), t, s)invlaplace(g, s, t);formula_40傅立葉變換.with(inttrans);fourier(sin(x),x,w)formula_42*(Dirac(w-1)+Dirac(w+1))繪製單變數函式圖形.繪製函式formula_43，formula_44plot(x*sin(x),x=-10..10);繪製雙變數函式.繪製函式formula_45，formula_46和formula_47的範圍為 -1到1plot3d(x^2+y^2,x=-1..1,y=-1..1);繪製函式動畫.formula_48with(plots);animate(subs(k = .5, f), x = -30 .. 30, t = -10 .. 10, numpoints = 200, frames = 50, color = red, thickness = 3);with(plots)animate3d(cos(t*x)*sin(3*t*y), x = -Pi .. Pi, y = -Pi .. Pi, t = 1 .. 2)求解偏微分方程組.求解偏微分方程組formula_49formula_50formula_51條件為formula_52.eqn1:= diff(v(x, t), x) = -u(x,t)*v(x,t):eqn2:= diff(v(x, t), t) = -v(x,t)*(diff(u(x,t), x))+v(x,t)*u(x,t)^2:eqn3:= diff(u(x,t), t)+2*u(x,t)*(diff(u(x,t), x))-(diff(diff(u(x,t), x), x)) = 0:pdsolve({eqn1,eqn2,eqn3,v(x,t)0},[u,v]): op(%);答案： formula_53積分方程.尋找函式formula_54滿足積分方程formula_55.eqn:= f(x)-3*Integrate((x*y+x^2*y^2)*f(y), y=-1..1) = h(x):intsolve(eqn,f(x));答案：formula_56