热门问题
时间线
聊天
视角

Maple

来自维基百科,自由的百科全书

Maple
Remove ads

MAPLE是一個符號計算數值計算軟體平臺。

快速預覽 開發者, 首次發布 ...

總覽

核心功能

使用者能夠直接使用傳統數學符號進行輸入,也可以客製化個性化的介面。對於數值計算有額外的支援,能夠擴充到任意精度,同時亦支援符號演算及視覺化。符號演算的例子參見下文。Maple內建有一種動態的命令列風格的程式語言,該語言支援具有作用域的變數。同時亦有其他語言的介面(C、FORTRAN、Java、Matlab和Visual Basic)。還具有與Excel進行互動的介面。

架構

Maple由一個很小的由C語言編寫的核心提供Maple語言。許多功能由各種來源的函式庫提供。許多數值計算由NAG數值計算庫, ATLAS庫, GNU多精度庫提供。大部分庫由Maple語言編寫,並且可檢視原始碼。

Maple中不同的功能需要不同格式的數值資料。符號表達式在主記憶體中以有向無環圖的形式儲存。標準介面和計算介面由Java語言編寫。經典介面由C語言編寫。


版本

更多資訊 版本, 年份 ...
Remove ads

Maple代碼範例

簡單指令式程式的構造:

myfac := proc(n::nonnegint)
   local out, i;
   out := 1;
   for i from 2 to n do
       out := out * i
   end do;
   out
end proc;

一些簡單的函式也可以使用直觀的箭頭表示法表示

myfac := n -> product( i, i=1..n );

開方

evalf[100](2^1/12)

1.059463094359295264561825294946341700779204317494185628559208431458761646063255722383768376863945569

Thumb

求根

f:=x^2-63*x+99=0;

solve(f,x);

,

f := x^7+3*x = 7;

solve(f,x);

RootOf(, index = 1),
RootOf(, index = 2),
RootOf(, index = 3),
RootOf(, index = 4),
RootOf(, index = 5),
RootOf(, index = 5),
RootOf(, index =7),

evalf(%);

  • (1.1922047171828134),
  • (0.8658388666792263) + (0.9230818802764879) I,
  • (0.2099602786426775) + (1.3442579297631496) I,
  • (1.2519809466279554) + (0.6424819505558892) I,
  • (1.2519809466279554) - (0.6424819505558892) I,
  • (0.2099602786426775) - (1.3442579297631496) I,
  • (0.8658388666792263) - (0.9230818802764879) I


f := sin(x)^3+5*cosh(x) = 0;


> solve(f, x);


RootOf(

> evalf(%);

0.2873691672 - 1.111497506 I
Remove ads

求解方程式和不等式

根據,尋找的所有實數解。

solve({x-y > 6, (x+y)^5 = 9}, [x, y])[];

答案:

Remove ads

方程組

代數方程組
> 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;
> sys := {p1, p2, p3};
> var := {x, y, z};
> solve(sys, var);
{x = 0, y = y, z = -y}, {x = 3, y = 4, z = 5}, {x = 1, y = 0, z = -1}
三角方程組
> f1 := cos(x)+sin(3*y)+tan(5*z) = 0;
> f2 := cos(3*z)+tan(3*y^2)-sin(2*z^3) = 33;
> f3 := tan(4*x+y)-sin(5*y-4*z) = 2*x;
> sys1 := {f1, f2, f3};
> var1 := {x, y, z};
{x, y, z}
> fsolve(sys1, var1);
{x = -10.77771790, y = -2.397849343, z = -7.382158103}

超幾何函式

矩陣與行列式

計算矩陣行列式

M:= Matrix([[1,2,3]], [a,b,c], [[x,y,z]]);  # 矩阵样例
with(LinearAlgebra)
m:=Determinant(M);

答案:

朗斯基行列式

with(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);

6x
雅可比矩陣

J := 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]);

Remove ads

積分

.

int(cos(x/a), x);

答案:

.

int(sin(x/a), x);

答案:

注意:Maple在積分時不提供常數項C,必須自行補上。

定積分

> int(cos(x/a), x = 1 .. 5);


16 a sin(1/a)* cos^4(1/a) - 12 a sin^2(1/a)

求解線性微分方程式

計算以下線性常微分方程式的一個精確解初始條件為

dsolve( {diff(y(x),x,x) - 3*y(x) = x, y(0)=0, D(y)(0)=2}, y(x) );

答案:

非線性常微分方程式

dsolve(diff(y(x), x, x) = x^2*y(x))

解:

BesselI(,)

+BesselK(,)

級數展開

series(tanh(x),x=0,15)
f:=int(exp^cosh(x),x)
series(f,x=0,15);

拉普拉斯轉換

with(inttrans);

拉普拉斯轉換

> f := (1+A*t+B*t^2)*exp(c*t);

> laplace(f, t, s);

反拉普拉斯轉換

invlaplace(1/(s-a),s,x)

z := y(t);

y(t)
f := diff(z, t, t)+a*(diff(z, t)) = b*z;

with(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);

傅立葉轉換

with(inttrans);

fourier(sin(x),x,w)

*(Dirac(w-1)+Dirac(w+1))

繪製單變數函式圖形

繪製函式

plot(x*sin(x),x=-10..10);

Thumb

繪製雙變數函式

繪製函式的範圍為 -1到1

plot3d(x^2+y^2,x=-1..1,y=-1..1);

Thumb

繪製函式動畫

二維動畫

with(plots);

animate(subs(k = .5, f), x = -30 .. 30, t = -10 .. 10, numpoints = 200, frames = 50, color = red, thickness = 3);

Thumb
鐘形孤立子
Thumb
三維函式動畫
三維動畫

with(plots)

animate3d(cos(t*x)*sin(3*t*y), x = -Pi .. Pi, y = -Pi .. Pi, t = 1 .. 2)

求解偏微分方程組

求解偏微分方程式

條件為.

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(%);

答案: 

積分方程式

尋找函式滿足積分方程式 .

eqn:= f(x)-3*Integrate((x*y+x^2*y^2)*f(y), y=-1..1) = h(x):
intsolve(eqn,f(x));

答案:

注釋

  • 現在,MATLAB已改用MuPAD替代了matlab的Maple符號計算核心。

參考文獻

外部連結

參見

Loading related searches...

Wikiwand - on

Seamless Wikipedia browsing. On steroids.

Remove ads