Zurück zum Inhaltsverzeichnis
Kapitel 28
Verzeichnisse
> restart:
> currentdir();
> olddir:=currentdir("c:\\Programme\\Maple 6\\Versuche");
> 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);
Packages neuen Stils sind Module
> eval(LinearAlgebra);
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);
> f:=Int(1/(1+x^3), x): eval(subs(Int=int, f));
protect, unprotect
> seq:=3;
Error, attempting to assign to `seq` which is protected
> unprotect(seq);
> seq:=3;
> seq(i,i=1..5);
> restart:
Quellcode anzeigen
> restart:
> interface(verboseproc=1):
> print(read);
Error, reserved word `read` unexpected
> print(abs);
> print(cos);
> interface(verboseproc=2):
> print(abs);
> print(cos);
> print(int);
> print(`int/risch`);
> 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)
> print(`int/indef`);
> restart:
>
Analyse von Maple-Termen
op
> restart:
> sol:=int(1/(1+x^3), x);
> nops(sol);
> whattype(sol);
> type(sol, `+`);
> op3:=op(3,sol);
> whattype(op3);
> op(op3);
> op31:=op(1,op3):
> whattype(op31), op(op31);
> op32:=op(2,op3):
> whattype(op32), op(op32);
> op33:=op(3,op3):
> whattype(op33), op(op33);
> op(0,op33);
> op331:=op(1,op33):
> whattype(op331), op(op331);
> op(1,op(3,op(3,sol)));
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;
> 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);
>
> 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);
> simplify( sin(x)^2+cos(x)^2);
Remember-Tabellen von Maple-Funktionen
> op(4, eval(simplify));
>
> forget(simplify);
> op(4, eval(simplify));
> simplify( sin(x)^2+cos(x)^2);
> restart;
> int(1/x, x);
> op(4, eval(int));
> op(4, eval(`int/indef1`));
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);
>
test:=proc(x)
option remember;
test(x-1)+test(x-2):
end:
> test(0):=0:
> test(1):=1:
> test(7);
>
Zurück zum Inhaltsverzeichnis