Maple Copyright 005 Shigeto R. Nishitani Department of Informatics, Kwansei Gakuin University, Sanda, Japan e-mail : nishitani@ksc.kwansei.ac.jp 7 5 3
i PowerBookG4 Maple 9 L A T E X Maple Maple 9 Waterloo Maple Inc. Macintosh, Power Macintosh Apple Computer, Inc. UNIX AT&T X Window System Microsoft Windoes Microsoft Corporation Maple Copyright c 005 v.0 ( http://www.opencontent.org/openpub/ ) ( ) Maple : Essentials and Applications on Numerical Recipe Copyright c 005 by Shigeto R. Nishitani. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/). Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder.
iii.................................. Maple.......................................................3........................... 3..4......................... 3.............................. 5...................... 5................................. 6..3...................... 7..4............................. 7..5........................... 9..6............................... 0..7............................... 0.3 Maple........................3...........................3...............................3.3.................... 4.3.4............................... 6.3.5 proc.............................. 9.4 Maple............................ 4.4...................... 4.4...................... 5.4.3..................... 6.4.4.............................. 7.5 Maple............................ 30.5........................... 30.5......................... 34.5.3.............................. 37
iv.6 Maple........................ 45.6.......................... 45.6. Maple.................... 49.6.3......................... 49.7............................. 5.7......................... 5.7..................... 5.7.3................. 5.7.4 linux............. 53
. Maple.. Maple PC user interface Java base OS linux xmaple GUI maple maple terminal character.. (">") [enter] enter return [shift+enter] shift enter > +;[ enter] > factor(x^-3*x+);[ shift+enter] > 3/+5/3;[ shift+enter] > 00!;[ enter] (x ) (x ) 9 6 933654439445686993885666700490759686438646859963895\ 759999399560894463976565886536979087375858\ 5096864000000000000000000000000 > plot(tanh(x),x=-5..5);[ enter]
0.5 4 4 x 0.5 > eq:=sin(x)*cos(y):[ shift+enter] > plot3d(eq,x=-pi..pi,y=-pi..pi);[ enter] 0.5 0 0.5 3 y 0 3 3 0 x 3 enter shift+enter enter shift+enter shift+enter ( ) enter enter [enter] [shift+enter]
.. 3 (">") [shift+enter]..3 enter π +π > plot(sin(x),x=-pi..pi); Error, (in plot) range values must be real constants ( (plot ) ) Maple pi Pi > plot(sin(x),x=-pi..pi); 0.5 3 0 3 x 0.5..4 Maple http://ist.ksc.kwansei.ac.jp/~nishitani/maple/jtoe.html
4 >?plot; plot index help Help Calling Sequence: Parameters: Description: Examples: See Also: Windows Examples Maple
.. 5... > mass:=0; mass := 0 > force:=-mass*accel; force := 0 accel % > exp:=%; exp := 0 accel > restart; > mass:= mass ; > force:=-mass*accel; mass := mass force := mass accel subs > subs(mass=0,accel=4,force); > force; 40 mass accel
6 > x:=;y:=3; > f:= x+y ;g:=x+y; x := y := 3 f := x + y g := 5 restart free.. (trigonometric functions) log ln > log[](5); ln(5) ln() evalf(evaluate float ) > evalf(%);.398094 Maple help index keywords? inifcns -? index[package] - (DETools), (linalg), (plots)? index[function] - Maple > with(plots): Warning, the name changecoords has been redefined
.. 7..3 i) ii) unapply > f:=x->-x*ln(exp(-/x)/(-exp(-/x))); f := x x ln e ( x ) unapply eq x f > eq:=(+exp(-/t))/(-exp(-/t)): > f:=unapply(eq,t); e( x ) f := T + e( T ) e ( T ) T 3 > f(3); > f3:=t->eq; > f3(3); + e ( /3) e ( /3) f3 := T eq + e ( T ) e ( T )..4 Maple plot
8 > plot(f(x),x=0..0); 0 x 4 6 8 0 5 0 5 0 > plot({f(x),f(x)},x=0..0); 0 0 0 x 4 6 8 0 0 0 plot3d > plot3d(sin(x)*exp(-y),x=-pi..pi,y=-pi..pi); 0 0 0 0 0 3 3 y 0 0 x 3 3
.. 9 plotting plot ) > with(plots): > with(plottools): plots package plottools package.6..5 solve > eqset:={x+y=,y=+x^}; > solve(eqset,{x,y}); > x;y; eqset := {x + y =, y = + x } {y =, x = 0}, {x =, y = } x,y x,y assign > solset:=solve(eqset,{x,y}); > solset[]; > assign(solset[]); > x;y; x y solset := {y =, x = 0}, {x =, y = } {y =, x = 0} fsolve > restart; > f:=x->-x*ln(exp(-/x)/(-exp(-/x))); > fsolve(f(x)=0,x); 0
0 f := x x ln.4469504 e( x ) e ( x )..6 diff > restart; > diff(x^,x); > diff(y^*x^,x,x); > c:=(x,t)->x(x)*t(t); > diff(c(x,t),x); > diff(c(x,t),x,t); x y c := (x, t) X(x) T(t) ( d X(x)) T(t) dx ( d dx X(x)) ( d dt T(t))..7 > int(ln(x),x); > int(sin(x),x=-pi..0); x ln(x) x int integrate > eq:=x^/sqrt(-x^); > int(eq,x); eq := x x
.. x x > eq:=exp(-x^); > int(eq,x=0..zz); + arcsin(x) eq := e ( x ) π erf(zz) Int. x, cos(x) x = 5..5. f(x) = x cos(x) x = 5..5 3. fsolve x cos(x) = 0 4. E(T ) = + exp( /T ) exp( /T ) (.) (T ) (C(T ) = de/dt )
.3 Maple Maple Maple Maple C.3. Maple C > i:=; > x:=3; > y:=.0; > z:=x+y; i := x := 3 y :=.0 z := 5.0 print printf C \t \n %d, %e, %f x,y,z %0.5f 0 5 Z > printf("%03d, %5.3e\t%0.5f\n",x,y,z); 003,.000e+00 5.00000 > printf("%0.5zf\n",z+y*i); 5.00000 +.00000I.3. +,-,*,/ > 3/4; > 3/4+/5; 3 4
.3. Maple 3 3 0 irem( ) iquo( ) > irem(0,3); > iquo(0,3); evalf > evalf(0/3); > evalf(pi,30); 3 3.333333333 3.45965358979338466433838 0 Digits > Digits:=0; > evalf(exp()); Digits := 0.78888459045354 trunc 0 round floor ceil floor trunc frac % C %%... > %; ^ >.^3.4;.78888459045354.858796997948670
4 round(x) x=-.6 round(x) x=.4 - - 0 ceil(x) floor(x) trunc(x) trunc(x) floor(x) ceil(x).: trunc, round, floor, ceil.3.3 if-else if-else if < > then < > elif < > then < > else < > end if ( ) > x:=-4; > if (x>0) then > y:=x; > else > y:=-x; > end if x := 4 y := 4 <, <=, >, >=, =, <> and, or, xor, implies, not evalb, type
.3. Maple 5 do-loop for-loop for < > from < > by < > < > end do; ( ) to < > do > total:=0; > for i from to 0 do > total:=total+i; > end: > total; total := 0 55 > for i from by - to -4 do > i; > end do; 0 4 loop loop end do; while-loop while < > do < > end do; next, break do-loop next do-loop break do-loop
6 > for i from to 5 do > if (i=3) then next; end if; > i; > end do; > for i from to 5 do > if (i=3) then break; end if; > i; > end do; 4 5.3.4 [ ] > restart; > list:=[,,3,4]; list := [,, 3, 4] > list[3]; > list[-]; > list[..4]; 3 4 [, 3, 4] -,- C 0 > list[0]; Error, invalid subscript selector
.3. Maple 7 op > op(list); > list:=[op(list),5];,, 3, 4 list := [,, 3, 4, 5] > list[4]:=x; > list; list 4 := x [,, 3, x, 5] > list:=subsop(4=null,list); > list; nops > nops(list); list := [,, 3, 5] [,, 3, 5] 4 ( Maple ) > aa:=[];# > for i from to 3 do > aa:=[op(aa),i];# > end do: > print(aa); aa := [] [,, 3] > n:=nops(aa); # > total:=0; > for i from to n do #for-loop > total:=total+aa[i]; > end do: > print(total);
8 n := 3 total := 0 [ ] (listlist) > aa:=[[,],[3,4]]; > aa[,]; 6 aa := [[, ], [3, 4]] array array listlist OK > A:=array(..3,..3,diagonal); > print(a); A := array(diagonal,..3,..3, []) A, 0 0 0 A, 0 0 0 A 3, 3 > B:=array(0..,-..,[[,,3,4],[5,6,7,8]]): > B[,-]; convert array listlist > A:=convert(aa,array); > print(a); [ ] A := 3 4 [ ] 3 4 i j array 5
.3. Maple 9 > n:=: > i:=op(,op(,eval(b))[n])-op(,op(,eval(b))[n])+; > n:=: > j:=op(,op(,eval(b))[n])-op(,op(,eval(b))[n])+; i := j := 4 set {} set set > {x,y,z},{y,z,x},{x,x,y,z,z,x}; {x, z, y}, {x, z, y}, {x, z, y} (union) (intersect) (minus) > {x,y,z} union {u,v,z}; > {x,y,z} intersect {u,v,z}; > {x,y,z} minus {z}; {v, x, z, y, u} {z} {x, y} [ ] Maple > {x,y,z}[]; x.3.5 proc proc < >:=proc(< >); local < >;
0 global < >; < > end proc; global,local C local, global global,local Maple :=proc() end proc; proc ( ) a > total:=proc(a) > local S,n,i; > n:=nops(a); > S:=0; > for i from to n do > S:=S+a[i]; > end do; > eval(s); > end proc:# > aa:=[3,5,7]; > total(aa); aa := [3, 5, 7] 5. Maple script C Maple script scanf irem #include <stdio.h> int main(void){ int i,n;
.3. Maple } scanf("%d",&n); for (i=n-;i>;i--){ if (n%i==0){ break; } } if (i==){ printf("%d is a prime number.\n",n); } else { printf("%d is not a prime number.\n",n); } return 0;. Google e 0 Maple evalf floor isprime true, false evalf 00 exp() floor 0 ( ) 0 isprime > EE:=.78; > i:=; > AA[i]:=floor(EE); > EE:=0*(EE-AA[i]); EE :=.78 i := AA := EE := 7.80
3. 00 0 00 0 ( ) 3 (3 ) 00.: ( ) 3 4 5 6 7 8 9 0 98 99 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [0] 0 0 0 0 0 3 0 0 [0] 0 0 4. p p + 0 000 5. 6 00 6. Newton-Raphson Newton-Raphson x cos(x) = 0 f (x) = + sin x Newton-Raphson x 0 x = x0 f(x0) f (x0) (.) y = f(x) x for-loop 3 x0, x, f(x) (eps=.0e-0 ) ( )
.3. Maple 3 x x x0.: Newton-Raphson 7. 0.0 0.0.0.0 4 x[0]=(0.0, 0.0) x[]=(.0,.0) x[]=(.0, 0.0) x[3]=(0.0,.0) [0,,,3,0]
4.4 Maple array list LinearAlgebra.4. > with(linearalgebra): matrix, vector Vector > v:=vector([x,y,z]); v := Vector ( ) (column vector) ( ) (row vector) ( row, column ) > v:=vector[row]([x,y,z]); x y z v := [x, y, z] [ ] < > > v:=<x,y,z>; > v:=<x y z>; v := x y z v := [x, y, z] Matrix 3 listlist > A0:=Matrix(,3,[[,,3],[4,5,6]]);
.4. Maple 5 [ ] 3 A0 := 4 5 6 < > > A:=<<,,3> <4,5,6> <7,8,9>>; A := 4 7 5 8 3 6 9 (shape=identity) > E:=Matrix(3,3,shape=identity); E := 0 0 0 0 0 0 listlist convert > A3:=[[,],[3,4]]; > A4:=convert(A3,Matrix); A3 := [[, ], [3, 4]] [ ] A4 := 3 4.4. Maple > A5:=Matrix(,,[[3,-],[,]]); > a*a4+b*a5; [ ] 3 A5 := [ ] a + 3 b a b 3 a + b 4 a + b "."( ) > A4.A4; [ ] 7 0 5 "."
6 > A.v; > v.v; x + 4 y + 7 z x + 5 y + 8 z 3 x + 6 y + 9 z x + y + z Error > v.a; Error, (in LinearAlgebra:-VectorMatrixMultiply) invalid input: LinearAlgebra:-VectorMatrixMultiply expects its st argument, v, to be of type Vector[row] but received Vector[column](3, [...], datatype = anything, storage = rectangular, order = Fortran_order, shape = []) (outer product) OuterProductMatrix > OuterProductMatrix(v,v); x x y x z x y y y z x z y z z.4.3 MatrixInverse > A3:=Matrix(3,3,[[,,],[4,5,6],[7,8,9]]): > MatrixInverse(A3); Determinant 5 3 3 7 6 3 > Determinant(A3); 6 A MatrixInverse > MatrixInverse(A); Error, (in LinearAlgebra:-LA_Main:-MatrixInverse) singular matrix
.4. Maple 7 0 > Determinant(A); Transpose > Transpose(A0); > Transpose(v); > Transpose(v).v; 0 4 5 3 6 [x, y, z] x + y + z.4.4 Eigenvectors > Eigenvectors(A); 5 + 3 4 ( 99 + 33 ) 4 ( 99 33 5 3 3 ( + 3 33 ) ( 3 + 3 33 ) 33 ) 3 ( 3 33 ) ( 3 3 33 ) 33, 65 + 33 65 0 ( + 3 33 33 ) ( 3 33 ) l(lambda) V > l,v:=evalf(eigenvectors(a)); 0. l, V := 6.684397,.6843970. 0.68640666.864066. 0.8430703308 0.5930703307... V Column A.V = λ V (.3)
8 > l[].column(v,); > A.Column(V,);.0584984479775 3.58763977398865 6.6843970000005.05849847999989 3.5876397700000 6.68439695999979 Row. x + 3y -z = -3 x + y -z = x + 3y +z = -6 (a) A (b) A (c) A A = E (d) b. H:=Matrix(,,[[,],[,3]]); Ax = b A Ax = A b Ex = A b (.4)
.4. Maple 9 Eigenvalues H:= H - x * Matrix(,,shape=identity); H solve
30.5 Maple exp Maple.5. solve( ), diff( ), int( ).: simplify: lhs, rhs: subs: expand: numer, denom: assume: factor: coeff: assuming: normal: nops, op assign: combine: about: collect: anames( user ): sort: restart,a:= a : convert: expand: expand(exp )
.5. Maple 3 factor: factor(exp ) normal: normal(exp ) combine: combine(exp ) collect: collect(exp,x) convert: convert(exp,opt ) > restart; > convert(sin(x),exp); I (e(x I) e > convert(sinh(x),exp); ex e x > convert(exp(i*x),trig); (x I) ) cos(x) + sin(x) I > convert(/(x-)/(x+3),parfrac); 4 (x + 3) + 4 (x ).3: convert opt polynom trig sincos exp parfrac rational tan sin, cos simplify: simplify(exp ), simplify(exp, ) > exp:=3*sin(x)^3-sin(x)*cos(x)^; exp := 3 sin(x) 3 sin(x) cos(x) > simplify(exp); (4 cos(x) 3) sin(x) > simplify(exp,{cos(x)^=-sin(x)^}); 4 sin(x) 3 sin(x)
3 sort: sort(exp ), sort(exp,[x,y]), sort(exp, [x],opts);opts=tdeg,plex,ascending,or descending (,, ) > exp:=x^3+4*x-3*x^+: > sort(exp); x 3 3 x + 4 x + > sort(exp,[x],ascending); + 4 x 3 x + x 3 > exp:=x^3-3*x*y+4*x^+y^: > sort(exp); > sort(exp,[x]); x 3 + 4 x 3 x y + y x 3 + 4 x 3 y x + y > sort(exp,[y],descending); y 3 x y + x 3 + 4 x lhs, rhs: lhs(exp =exp ) numer, denom: numer(exp /exp ) coeff: coeff(exp,x^) op,nops:, op(exp ), nops(exp ) subs: subs(,exp ) > exp:=x^-4*x+4; > subs(x=a+,exp); assume: assume( ) exp := x 4 x + 4 (a + ) 4 a 4 assuming: exp assuming > sqrt(exp); ( + x) ascending, descending Maple9.5
.5. Maple 33 > sqrt(exp) assuming x>; + x additionally: assume assign: solve about: assume restart,a= a : anames( user ): > anames( user ); exp, exp series: series(exp,x,4) > series(exp(x),x); + x + x + 6 x3 + 4 x4 + 0 x5 + O(x 6 ) > series(sin(x),x=pi/3,); 3 + (x π 3 ) + O((x π 3 ) ) > convert(%,polynom); 3 + x π 6 : > a ; > a b; seq: for-loop > seq(i,i=0..3); a ab 0,,, 3 map: > map(sin,[seq(a i,i=0..3)]);
34 add, mul: [sin(a0 ), sin(a ), sin(a ), sin(a3 )] sum, product: > add(x^i,i=..3); > add(x^i,i=..n); x + x + x 3 Error, unable to execute add > sum(x^i,i=..n); x (n+) x x x > mul(x^i,i=..3); > mul(x^i,i=..n); x 6 Error, unable to execute mul limit: > product(x^i,i=..n); n x i i= > limit(exp(-x),x=infinity); > limit(tan(x),x=pi/,left); 0 > limit(tan(x),x=pi/,complex); + I.5. Maple
.5. Maple 35 restart restart; plot Plotting error,empty plot xe ( β cx + β gx 3) dx (.5) Maple > f:=unapply(x*exp(-beta*c*x^)*(+beta*g*x^3),x); f := x x e ( β c x) ( + β g x 3 ) > int(f(x),x=-infinity..infinity); 3 g π 4 β c csgn(β c) = β c otherwise βc (csgn(βc)=) (otherwise) Maple restart > restart; > f:=unapply(x*exp(-beta*c*x^)*(+beta*g*x^3),x); f := x x e ( β c x) ( + β g x 3 ) plot
36 > plot(f(x),x=-0..0); Warning, unable to evaluate the function to numeric values in the region; see the plotting command s help page to ensure the calling sequence is correct Plotting error, empty plot > f(0); 0 e ( 00 β c) ( + 000 β g) beta,c,g > c:=; g:=0.0; beta:=0.; c := g := 0.0 β := 0. > plot(f(x),x=-0..0); 0.5 0 8 6 4 0 4 6 8 0 x 0.5.. > c:= c ; g:= g ; beta:= beta ; c := c g := g β := β
.5. Maple 37 > int(f(x),x); e (β c x ) β c + β g x 3 e ( β c x ) β c + 3 x e ( β c x ) β c + π erf( β c x) 4 β c β c β c x=-alpha..alpha > int(f(x),x=-alpha..alpha); g (4 α 3 e ( β c α) β c β c + 6 α e ( β c α ) β c 3 π erf( β c α)) 4 β c β c alpha > limit(int(f(x),x=-alpha..alpha),alpha=infinity); lim g (4 α 3 e ( β c α) β c β c + 6 α e ( β c α ) β c 3 π erf( β c α)) α 4 β c β c beta*c>0 (assume) > assume(beta*c>0); > limit(int(f(x),x=-alpha..alpha),alpha=infinity); 3 π g 4 β c β c.5.3 ( ) ( )
38 Maple () () > ex:=(x-3)^4; ex := (x 3) 4 > ex:=x^4-*x^3+54*x^-08*x+8; > expand(ex-ex); ex := x 4 x 3 + 54 x 08 x + 8 0 expand 0 0 978 (thermal expansion) 3 x U(x) = cx gx 3 (.6) x 3 x x = x exp ( βu(x)) dx exp ( βu(x)) dx (.7)
.5. Maple 39 β /(k B T ) x = 3g 4βc (.8) Taylor 3 Maple > restart; > U:=c*x^-g*x^3; > eu:=expand(exp(-beta*u)); U := c x g x 3 eu := e(β g x3 ) e (β c x ) > ex:=convert(series(numer(eu),x,4),polynom); > f:=ex/denom(eu); ex := + β g x 3 f := + β g x3 e (β c x ) > den:=int(f,x=-infinity..infinity); π den := csgn(β c) = β c otherwise > num:=int(x*f,x=-infinity..infinity); 3 g π num := 4 β c csgn(β c) = β c otherwise beta c >0 beta c >0 (assume) > assume(beta*c>0):
40 > num/den; 3 g 4 β c 古典論 量子論 3 V (x) = 0 h d ϕ(x) = εϕ(x) (.9) m dx x 0 ϕ(x) = A exp(ikx) + B exp( ikx) (.0) x a ϕ(x) = C exp(ikx). k = mε/ h ε V 0 ε V 0 κ = m(ε V 0 )/ h 0 x a ϕ(x) = F exp(iκx) + G exp( iκx) (.) 3 970 5A 969
.5. Maple 4 x = 0 x = a x = 0 ϕ(x) A + B = F + G (.) x = 0 ϕ (x) k(a B) = κ(f G) x = a x = a ϕ(x) F exp(iκa) + G exp( iκa) = C exp(ika) ϕ (x) κf exp(iκa) κg exp( iκa) = kc exp(ika) 5 4 F, G B/A C/A B A C A = = [ 4k κ ] [ + (k κ ) sin = + 4ε(ε V ] 0) κa V0 sin (.3) κa [ + (k κ ) sin ] [ κa = + V 0 sin ] κa 4k κ 4ε(ε V 0 ) 0 < ε < V 0 α = m(v 0 ε)/ h 0 x a ϕ(x) = F exp(αx) + G exp( αx) (.4) [ C = + V 0 sinh ] αa (.5) A 4ε(ε V 0 ) mv 0 a / h = 8 E/V 0 < C/A C/A > restart; > psi:=x->a*exp(i*k*x)+b*exp(-i*k*x); ψ := x A e (k x I) ( I k x) + B e > psi:=x->e*exp(i*kappa*x)+f*exp(-i*kappa*x); ψ := x E e (κ x I) ( I κ x) + F e
4 mv 0 a /h =8 0.8 C / A 0.6 0.4 0. 0 0 4 6 8 0 E/V 0 A = 4 > psi3:=x->c*exp(i*k*x); (k x I) ψ3 := x C e x = 0, x = a 0 > eq:=psi(0)=psi(0); eq := A + B = E + F > eq:=simplify(subs(x=0,diff(psi(x),x))=subs(x=0,diff(psi(x),x))); > eq3:=psi(a)=psi3(a); eq := A k I B k I = E κ I F κ I eq3 := E e (κ a I) + F e ( I κ a) (k a I) = C e > eq4:=simplify(subs(x=a,diff(psi(x),x))=subs(x=a,diff(psi3(x),x))); eq4 := κ (E e (κ a I) F e ( I κ a) ) I = C k e (k a I) I 4 A,B,C,E,F > solve({eq,eq,eq3,eq4},{a,b,c,e,f}); e (k a I) ( k e ( I κ a) + k e (κ a I) κ e ( I κ a) + κ e (κ a I) k κ e ( I κ a) k κ e (κ a I) ) C k κ e (κ a I) e ( I κ a), C = C, B = (k κ) e (k a I) (k + κ) ( e ( I κ a) + e (κ a I) ) C, F = 4 k κ e (κ a I) e ( I κ a) E = e (k a I) (k + κ) C κ e (κ a I) > assign(%); e (k a I) (k κ) C κ e ( I κ a), assign A/C (conjugate)
.5. Maple 43 kappa, k,a Maple > assume(kappa,real);assume(k,real),assume(a,real); conjugate (trig) convert > CC:=convert(A/C,trig): > CC:=combine(conjugate(CC)*CC); CC := κ k cos( κ a) + 6 κ k k 4 cos( κ a) κ 4 cos( κ a) + k 4 + κ 4 8 κ k > C_num:=simplify(expand(numer(CC)), > {cos(kappa*a)^=-sin(kappa*a)^, > cos(k*a)^=-sin(k*a)^}); C num := 8 κ k + ( 4 κ k + k 4 + κ 4 ) sin(κ a) > C_den:=denom(CC); > saa:=sin(kappa*a); C den := 8 κ k saa := sin(κ a) > CC:=collect(C_num/C_den,saa); CC := + ( 4 κ k + k 4 + κ 4 ) sin(κ a) 8 κ k k,kappa,a > NN:=8; > a:= a ; > a:=solve(m*v0*a/h=nn,a); > kappa:=*m*(epsilon-v0)/h; > k:=*m*epsilon/h; NN := 8 a := a a := 8 h m V0 κ := m (ε V0 ) h k := m ε h > CC3:=simplify( > subs({k=sqrt(k),kappa=sqrt(kappa)},coeff(cc,saa^)));
44 V0 CC3 := 4 (ε V0 ) ε > CC4:=simplify(subs(epsilon=x*V0,CC3)); CC4 := 4 (x ) x > aa:=simplify(subs(epsilon=x*v0,sqrt(kappa*a))); > CC5:=+CC4*sin(aa)^; aa := 4 x CC5 := + sin(4 x ) 4 (x ) x > f:=unapply(cc5,x); f := x + 4 > plot(/f(x),x=0..0); sin(4 x ) (x ) x. ( ) (i) (ii). 0 < ε < V 0 sinh sin cosh (α a) = + sinh (α a) (.6)
.6. Maple 45.6 Maple.6. plot > plot(sin(x),x); 0.5 0 8 6 4 0 4 6 8 0 x 0.5 ({}) ([]) plot > plot({sin(x),cos(x),tan(x)},x=-pi..pi,y=-..); y 3 0 3 x?plot[options]; plots[interactive]();
46 plots display > with(plots): > p:=plot(arctan(x),x,color=black): > p:=plot(diff(arctan(x),x),x,color=blue): > display(p,p);.5 0.5 0 8 6 4 4 6 8 0 x 0.5.5 p p display listplot listplot > with(plots): > T:=[seq(exp(-i),i=0..5)]; > listplot(t); T := [, e ( ), e ( ), e ( 3), e ( 4), e ( 5) ] 0.8 0.6 0.4 0. 0 3 4 5 6 listplot list y i x i
.6. Maple 47 > listplot(t,style=point); 0.8 0.6 0.4 0. 0 3 4 5 6 point x i,, 3, > T:=[seq([i/,exp(-i/)],i=0..0)]: > pointplot(t); 0.8 0.6 0.4 0. 0 3 4 5 listlist [x i, y i ] pointplot listplot > pointplot(t,connect=true); plot3d 3 plot3d > plot3d(sin(x)*cos(y),x=-pi..pi,y=-pi..pi);
48 0.5 0 0.5 3 3 y 0 0 x 3 3 > contourplot(sin(x)*cos(y),x=-pi..pi,y=-pi..pi); 3 y 3 3 x 3 plots with(plots); parameteric plot > plot([sin(t),cos(t),t=0..*pi]); 0.5 - -0.5 0 0 0.5-0.5 -
.6. Maple 49.6. Maple Maple plot[structure] PLOT,PLOT3D CURVES, POINTS, POLYGONS, TEXT plots pointplot point animate, listplot, logplot, polarplot,contourplot plottools PLOT arc, arrow, circle, curve, line, point, sphere PLOT plots[display].6.3 ( ) plots animate [] t > with(plottools):with(plots): > animate(plot, [sin(x-t),x=0..5*pi], t=0..0): display insequence=true ([]) > tmp:=[]; > n:=0; > for i from 0 to n do > t:=i; > tmp:=[op(tmp), plot(sin(x-t),x=0..5*pi)]; > end do: > display(tmp,insequence=true); tmp := [] n := 0
50 0.8 0.6 0.4 0. 0 0. 4 6 8 0 4 x 0.4 0.6 0.8
.7. 5.7 animation gif.7. Java Maplet GetFile > with(maplets[examples]): > file:=getfile(); Warning, the protected name LinearAlgebra has been redefined and unprotected Initializing Java runtime environment. file := /Users/bob/Desktop/data.txt GetFile file Windows > with(stringtools): > file:=substituteall(file,"\\","/"); \ / Substitute > with(stringtools): > file:=substitute(file,"data","data"); Warning, the assigned name Group now has a global binding file := /Users/bob/Desktop/data.txt.7. writedata,readdata > f:=t->subs({a=0,b=40000,c=380,d=8},a+b/(c+(t-d)^) ): > T:=[seq(f(i)*(0.6+0.8*evalf(rand()/0^)),i=..56)]: > writedata(file,t);
5 T file > T:=readdata(file,): > with(plots): > listplot(t); Warning, the name changecoords has been redefined 40 0 00 80 60 40 0 0 50 00 50 00 50.7.3 writeto > interface(quiet=true); > writeto(file); > for i from to 0 do > s:=data i; > printf("%0.5f %s\n",evalf(f(i)),s); > end do: > writeto(terminal): > interface(quiet=false); false true C fopen, readline, sscanf, fclose > fd:=fopen(file,read); > for i from to do > l:=readline(fd); > d:=sscanf(l,"%f %s"); > end do; > fclose(fd): fd :=
.7. 53 l :=.49 data d := [.49, data ] l :=.46063 data d := [.46063, data ] fd (file descripter) readline sscanf format l l > d[]; > whattype(d[]); > d[]; > whattype(d[]);.46063 float data string animation gif plot > plotsetup(gif,plotoutput=file): > display(tmp,insequence=true); > plotsetup(default): quicktime Maple 3 vrml (?vrml; ).7.4 linux linux maple filter [bob@asura0 ~/test]$ cat test.txt T:=readdata("./data0"); interface(quiet=true); writeto("./result"); print(t[]); writeto(terminal); interface(quiet=false);
54 data0 result interface(quiet=true) maple [bob@asura0 ~/test]$ /usr/local/maple9.5/bin/maple < test.txt \^/ Maple 9.5 (IBM INTEL LINUX)._ \ / _. Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 004 \ MAPLE / All rights reserved. Maple is a trademark of < > Waterloo Maple Inc. Type? for help. > T:=readdata("./data0"); T := [.3,.35] > interface(quiet=true); false true > quit bytes used=000, alloc=6096, time=0.00 [bob@asura0 ~/test]$ cat result.3