140 likes | 262 Views
符號數學運算軟體. 何謂符號數學運算軟體. 允許使用者作數學符號之運算 可做無誤差的任意位數或者精確至任意位數的算術和數學計算 可做曲線區面等函數之二度 , 三度空間繪圖及展示 符號數學運算包含了 微分 , 積分 , 分解因式 , 多項式求解 , 泰勒級數 , 微分方程求解 , 拉普拉斯轉換 , 矩陣及線性代數運算 , 向量和向量微積分等. 範例 1: 基本代數及運算. # <A> Basic algebra and arithmatics
E N D
符號數學運算軟體 銘傳大學應用統計資訊學系 蔡桂宏 製作
何謂符號數學運算軟體 • 允許使用者作數學符號之運算 • 可做無誤差的任意位數或者精確至任意位數的算術和數學計算 • 可做曲線區面等函數之二度,三度空間繪圖及展示 • 符號數學運算包含了 • 微分,積分,分解因式,多項式求解,泰勒級數,微分方程求解,拉普拉斯轉換,矩陣及線性代數運算,向量和向量微積分等 銘傳大學應用統計資訊學系 蔡桂宏 製作
範例1:基本代數及運算 # <A> Basic algebra and arithmatics > 5*(9-3)/2; simplify( (2/27)**(2/3)); (1+ 2*I)*(4+ I); #基本計算 >igcd(123, 456 , 789); ilcm(123, 456 , 789); lcm( x^2 +2*x+1, x^2-1, x^3 +1); #最大公因數 最小公因數 式 • gcd(gcd( x^2 +2*x+1, x^2-1), x^3 +1); # 因式分解 • convert(x/(x+2)^2-3*x+2,parfrac,x); convert(exp(x),confrac,x); #部分分式 連續分式 銘傳大學應用統計資訊學系 蔡桂宏 製作
範例2:基本代數及運算 > isprime(37); isprime(2^35-1); ifactor(2^35 -1); #質數判斷 > solve({(3-x)^2+(5-y)^2=r^2,(2-x)^2+(4-y)^2=r^2,(6-x)^2+(1-y)^2=r^2},{x,y,r}); #方程式求解 > solve (1/(1+x) + 1/(2+x) = 4 , x); solve(sqrt(x+1)-sqrt(x-1)=a,x); solve({sqrt(x)+sqrt(y)-2,x-y+1},{x,y}); > isolve(3*x-4*y=7); #求整數解 銘傳大學應用統計資訊學系 蔡桂宏 製作
範例3:微積分的應用 > limit(( (x+h)^3 - x^3)/h, h = 0); limit(sin(x)/x, x=0); limit(x^(1/x), x=infinity); limit(abs(x)/x, x=0); limit(abs(x)/x, x=0 , right); # 極限 含有無限大 > limit((sin(x)+tan(x))/(exp(x)+exp(-x)-2),x=0, left ); # L'Hopital's rule > sum(1/n^2,n=1..infinity); sum(n*x^n/(n+1),n=1..infinity); # 級數求和 > diff(exp(-x^2) + log(x^2-1), x); diff(x^2+y^3+2*x^2* y^2, x,y); # 微分 > int(x^3*cos(x), x); int(x^3 * sqrt(x^2-a^2), x=a..2*a); int(1/(1+x^2),x=0..infinity); int(1/(x+exp(x)), x=0..1); evalf(%); #不定積分 及含有無限大的定積分 銘傳大學應用統計資訊學系 蔡桂宏 製作
範例4:微積分的應用 > limit(( (x+h)^3 - x^3)/h, h = 0); limit(sin(x)/x, x=0); limit(x^(1/x), x=infinity); limit(abs(x)/x, x=0); limit(abs(x)/x, x=0 , right); # 極限 含有無限大 > limit((sin(x)+tan(x))/(exp(x)+exp(-x)-2),x=0, left ); # L'Hopital's rule > sum(1/n^2,n=1..infinity); sum(n*x^n/(n+1),n=1..infinity); # 級數求和 > diff(exp(-x^2) + log(x^2-1), x); diff(x^2+y^3+2*x^2* y^2, x,y); # 微分 > int(x^3*cos(x), x); int(x^3 * sqrt(x^2-a^2), x=a..2*a); int(1/(1+x^2),x=0..infinity); int(1/(x+exp(x)), x=0..1); evalf(%); #不定積分 及含有無限大的定積分 銘傳大學應用統計資訊學系 蔡桂宏 製作
範例5:線性代數 # Linear Algebra #examples; # 1. Hilbert Matrix........... > with (linalg): # read library file > mat_a:= hilbert(10); >det(mat_a); #行列式 > ainv:=inverse(mat_a); # 反矩陣 及利用來求解 > vec_b:= [1,2,3,4,5,6,7,8,9,10]; > evalm(ainv &* vec_b); 銘傳大學應用統計資訊學系 蔡桂宏 製作
範例6: Inner product problem內積空間 # Define the inner product space <f, g> by the integration of f(t)*g(t) from 0 to 2 Pi. Show that {1, sin(t), cos(t), sin(2t), cos(2t), ......} orthogonal to each other. >int( sin(m*t) * cos(n*t), t=0..2*Pi); simplify(subs({m=3,n=100}, %)); >int(sin(m*t) * sin(n*t), t=0..2*Pi); simplify(subs({m=3,n=100}, %)); > int( cos(m*t) * cos(n*t), t=0..2*Pi); simplify(subs({m=3,n=100}, %)); # Hence we have shown that {1=cos(0t), sin(t), cos(t),.....} are orthogonal to each # other. Next we will find the corresponding norms for these vectors; 銘傳大學應用統計資訊學系 蔡桂宏 製作
範例6: Inner product problem內積空間 > int(sin(n*t) * sin(n*t), t=0..2*Pi); simplify(subs(n=97, %)); >int( cos(n*t) * cos(n*t), t=0..2*Pi); simplify(subs(n=100, %)); > int(1,t=0..2*Pi); # Hence {1/sqrt(2Pi), sin(t)/c,cos(t)/c,sin(2t)/c,cos(2t)/c,.....} are orthonormal basis where c=sqrt(Pi); 銘傳大學應用統計資訊學系 蔡桂宏 製作
範例7:函數的近似與繪圖比較 # Find the Continue Fraction , Taylor and Pade approximations for f(x):=exp(-x^2) by using 2-D Plot. > f:= exp(-x**2); cf:=convert(f, confrac,x); > taylor(f,x=0,7); tf:=convert(%, polynom); > with(numapprox); pf:= pade(f,x,[5,5]); > plot({f,cf, tf, pf}, x=-2..2); 銘傳大學應用統計資訊學系 蔡桂宏 製作
當前主要的符號數學運算軟體 • Maple • Mathematica • Derive • Macsyma 銘傳大學應用統計資訊學系 蔡桂宏 製作
符號數學運算軟體之優越性-1 • 所有數值運算軟體可得到之數值計算,在符號數學運算軟體均可獲得 • 能以符號,等式(不等式),等表達正確的數學關係 • 可做不定積分,微分方程求解等得到數學公式而非僅得到數值解答 • 可做含有無限大為上下限之定積分和及數求和等數學運算 銘傳大學應用統計資訊學系 蔡桂宏 製作
符號數學運算軟體之優越性-2 • 可以完全克服數值計算之捨去誤差因而可得到合宜之解答 • 可做任意位數精確度的數學運算,使得所得之數值結果,誤差控制在適當的範圍內 銘傳大學應用統計資訊學系 蔡桂宏 製作
Maple軟體的優越性 • 數學函數庫最大範圍最廣 • 所得到的結果最具信賴 • Fourier轉換函數最完整適合工程師使用 • Help系統結合了網際網路使用方便,範例充足使用方便 • 可結合文書編輯製作圖文並茂,文章與數學結果並存的優異文書並能與視窗充分配合 • 自行定義函數及程序方便, 擁有討論社群,交流方便 銘傳大學應用統計資訊學系 蔡桂宏 製作