Zurück zum Inhaltsverzeichnis

Kapitel 28

Verzeichnisse

> restart:

> currentdir();

> olddir:=currentdir("c:\\Programme\\Maple 6\\Versuche");

olddir :=

> currentdir();

> currentdir(olddir);

> currentdir();

>

Online-Hilfe

> ?keywords

> ?index

> ?index,procedure

> ?index,statement

> ?index,function

> ?ininame

> ?inifcn

> ?index,packages

> ?envvar

> ?index,misc

> ?worksheet,expressions

> ?operator

> ?share

>

> ?updates

Packages alten Stils (vor Maple 6) sind als Tabellen gespeichert

> op(linalg);

TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...
TABLE([htranspose = readlib('`linalg/htrans`'), sin...

Packages neuen Stils sind Module

> eval(LinearAlgebra);

module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...
module LinearAlgebra () local IEP_Map, IEP_Map2, `B...

Träge Funktionen

> restart:

> Int(1/(1+x^3), x),
Diff(x,y),
Sum(n^2/n!, n=1..infinity),
Product( (1+1/n^5), n=a..b);

Int(1/(1+x^3),x), Diff(x,y), Sum(n^2/n!,n = 1 .. in...

> f:=Int(1/(1+x^3), x): eval(subs(Int=int, f));

1/3*ln(x+1)-1/6*ln(x^2-x+1)+1/3*sqrt(3)*arctan(1/3*...

protect, unprotect

> seq:=3;

Error, attempting to assign to `seq` which is protected

> unprotect(seq);

> seq:=3;

seq := 3

> seq(i,i=1..5);

3

> restart:

Quellcode anzeigen

> restart:

> interface(verboseproc=1):

> print(read);

Error, reserved word `read` unexpected

> print(abs);

proc () option builtin; 121 end proc

> print(cos);

proc (x::algebraic) local n, t; option `Copyright (...

> interface(verboseproc=2):

> print(abs);

proc () option builtin; 121 end proc

> print(cos);

proc (x::algebraic) local n, t; option `Copyright (...

> print(int);

proc () local answer; option `Copyright (c) 1997 Wa...

> print(`int/risch`);

proc (f, x) local r, g, h, theta, n, inds, restart,...

> infolevel[all]:=5;

infolevel[all] := 5

> int(1/(1+x^3),x);

int/indef1: first-stage indefinite integration

int/ratpoly: rational function integration

parfrac/parfrac: partial fraction decomposition

factor/polynom: polynomial factorization: number of terms 2

parfrac/parfrac: splitting 1/(_X+1)/(_X^2-_X+1)

radnormal: entering radnormal at time 1.173

solve/linear: # equations 2

solve/linear/integer/sparse: # equations 2

solve/linear/integer/sparse: c[1], -2+3*c[1], 3

solve/linear/integer/sparse: # equations 1

solve/linear/integer/sparse: c[2], 1+3*c[2], 3

solve/linear/integer/sparse: backsubstitution at: 2

solve/linear/integer/sparse: backsubstitution at: 1

parfrac/parfrac: exit partial fraction decomposition

parfrac/parfrac: split is 1/3/(_X+1)-1/3*(-2+_X)/(_X^2-_X+1)

1/3*ln(x+1)-1/6*ln(x^2-x+1)+1/3*sqrt(3)*arctan(1/3*...

> print(`int/indef`);

`int/indef`

> restart:

>

Analyse von Maple-Termen

op

> restart:

> sol:=int(1/(1+x^3), x);

sol := 1/3*ln(x+1)-1/6*ln(x^2-x+1)+1/3*sqrt(3)*arct...

> nops(sol);

3

> whattype(sol);

`+`

> type(sol, `+`);

true

> op3:=op(3,sol);

op3 := 1/3*sqrt(3)*arctan(1/3*(2*x-1)*sqrt(3))

> whattype(op3);

`*`

> op(op3);

1/3, sqrt(3), arctan(1/3*(2*x-1)*sqrt(3))

> op31:=op(1,op3):

> whattype(op31), op(op31);

fraction, 1, 3

> op32:=op(2,op3):

> whattype(op32), op(op32);

`^`, 3, 1/2

> op33:=op(3,op3):

> whattype(op33), op(op33);

function, 1/3*(2*x-1)*sqrt(3)

> op(0,op33);

arctan

> op331:=op(1,op33):

> whattype(op331), op(op331);

`*`, 1/3, 2*x-1, sqrt(3)

> op(1,op(3,op(3,sol)));

1/3*(2*x-1)*sqrt(3)

nestprint

> nestprint:=proc(x)
local i,n;
if nargs=2 then n:=args[2]; else n:=0; end if:
for i from 0 to n do printf(` `); end do:
if type(x,function) then
lprint(op(0,x));
for i from 1 to nops(x) do: nestprint(op(i,x),n+1): end do:
elif nops(x)>1 then
lprint(whattype(x));
for i from 1 to nops(x) do: nestprint(op(i,x),n+1): end do:
else
lprint(op(x));
end if;
end proc:

> nestprint(-x);

`*`

-1

x

> nestprint(2/3);

fraction

2

3

> nestprint(2/x);

`*`

2

`^`

x

-1

> nestprint( evalf(1/3) );

float

3333333333

-10

> sol:=int(1/(1+x^3), x): op3:=op(3,sol):

> op3;

1/3*sqrt(3)*arctan(1/3*(2*x-1)*sqrt(3))

> nestprint(op3);

`*`

fraction

1

3

`^`

3

fraction

1

2

arctan

`*`

fraction

1

3

`+`

`*`

2

x

-1

`^`

3

fraction

1

2

> save nestprint, `nestprt`;

> read(`nestprt`):

adrprint

> adrprint:=proc(x)
local i,j,n;
if nargs=2 then n:=args[2]; else n:=0; fi:
for i from 0 to n do printf(` `); od:
if type(x,function) then
lprint(op(0,x), x, addressof(x));
for i from 1 to nops(x) do: adrprint(op(i,x),n+1): od:
elif nops(x)>1 then
lprint(whattype(x), x, addressof(x));
for i from 1 to nops(x) do: adrprint(op(i,x),n+1): od:
else
lprint(op(x), addressof(op(x)));
fi;
end:

> adrprint( (1+x)^2 + (1+x)^3 );

`+`, (x+1)^2+(x+1)^3, 1232640

`^`, (x+1)^2, 1269640

`+`, x+1, 1513788

x, 46689768

1, 3

2, 5

`^`, (x+1)^3, 1269656

`+`, x+1, 1513788

x, 46689768

1, 3

3, 7

dismantle

> sol:=int(1/(1+x^3), x): op3:=op(3,sol);

op3 := 1/3*sqrt(3)*arctan(1/3*(2*x-1)*sqrt(3))

>

> dismantle(op3);

SUM(3)

PROD(5)

INTPOS(2): 3

RATIONAL(3): 1/2

INTPOS(2): 1

INTPOS(2): 2

FUNCTION(3)

NAME(5): arctan #[protected]

EXPSEQ(2)

SUM(3)

PROD(5)

SUM(5)

NAME(4): x

INTPOS(2): 2

INTNEG(2): -1

INTPOS(2): 1

INTPOS(2): 1

INTPOS(2): 3

RATIONAL(3): 1/2

INTPOS(2): 1

INTPOS(2): 2

RATIONAL(3): 1/3

INTPOS(2): 1

INTPOS(2): 3

INTPOS(2): 1

RATIONAL(3): 1/3

INTPOS(2): 1

INTPOS(2): 3

>

Prozeduren

> restart:

> seq( [op(i,eval(simplify))], i=1..6);

[s], [f, i, inds, r, rnormal, symb_mode, new_inds, ...
[s], [f, i, inds, r, rnormal, symb_mode, new_inds, ...
[s], [f, i, inds, r, rnormal, symb_mode, new_inds, ...

> simplify( sin(x)^2+cos(x)^2);

1

Remember-Tabellen von Maple-Funktionen

> op(4, eval(simplify));

TABLE([cos = cos, 1 = 1, sin(x)^2+cos(x)^2 = 1, x =...

>

> forget(simplify);

> op(4, eval(simplify));

> simplify( sin(x)^2+cos(x)^2);

1

> restart;

> int(1/x, x);

ln(x)

> op(4, eval(int));

> op(4, eval(`int/indef1`));

TABLE([1/_X = ln(_X)])

Die remember-Option für Funktionen

> restart:

> f:=proc(x::nonnegint)
option remember;
if x=0 then 0
elif x=1 then 1
else f(x-1)+f(x-2) fi
end:

> f(2000);

Error, (in f) too many levels of recursion

> f(1000); f(2000);

434665576869374564356885276750406258025646605173717...
434665576869374564356885276750406258025646605173717...
434665576869374564356885276750406258025646605173717...

422469633339230487870672560234148278257985284025068...
422469633339230487870672560234148278257985284025068...
422469633339230487870672560234148278257985284025068...
422469633339230487870672560234148278257985284025068...
422469633339230487870672560234148278257985284025068...
422469633339230487870672560234148278257985284025068...

> test:=proc(x)
option remember;
test(x-1)+test(x-2):
end:

> test(0):=0:

> test(1):=1:

> test(7);

13

>

Zurück zum Inhaltsverzeichnis