1. Uvod mathematical computational engine / software
OBSAH PREDMETU: zakladni principy/uvod - Maple 18 ABSOLVOVANI PREDMETU: klasifikovany zapocet 1) test na cviceni (90 min, 14. tyden, povoleny vsechny materialy) 2) vypracovani projektu (zadani v prubehu semestru - 11. tyden)
2. Maple - verze - Maple 18: Standard Worksheet (.mw) - !! my budeme pouzivat !! - Classic Worksheet Maple 18 (.mws) - starsi pocitace, mene pameti - Command-line Maple 18 - komplexni vypocty - a jine (kalkulacka, vlastni aplikace - maplets)
3. Maple - prostredi Ikonky novy subor (Create a new file ulozeni (Save the active file T (Insert plain text after the current execution group radek) [> (Insert Maple Input after the current execution group (vytvori novy radek, executable) Math mode - text je cerny + radek nemusi byt ukoncen ; nebo : Text mode - text je cerveny + radek musi byt ukoncen ; nebo : novy blok (Enclose the current selection in a document mode, or create a new one) odstavce (Enclose the selection in a subsection Z Remove any section enclosing the selection) restart (Restart Maple server) Poznamka: - "tlacitko" restart - vyhodnoceni az pri prvnim spusteni ve worksheetu - "napsany" restart - vyhodnoceni hned po [Enter]: !!! (Execute the entire worksheet) ! (Execute all selected groups) preruseni operace (Interrupt the current operation) Priklad: > Warning,
computation interrupted
help (Open the help system (help), F2 (napoveda pro dany prikaz)
Palety - viz leva cast pracovniho okna - umoznuji rychlejsi zadavani matematickeho vstupu, specialnich symbolu, ...
4. Reseni problemu Cisla (symbol v Open Face palete) - cele cisla > 123456789; 123456789
(4.1.1)
1 2
(4.1.2)
0.6666666667
(4.1.3)
0.5000000000
(4.1.4)
= Z/; - racionalni cisla > 2/4;
> evalf(2/3);
- realne cisla > 2/4.;
- komplexne cisla > (1+2*I)*(1-2*I); # I imaginární jednotka 5 > 5+0*I; 5
(4.1.5) (4.1.6)
Zakladni operace: + , - , * , /
Konstanty - cislo > (4.2.1) > evalf(pi); (4.2.2)
- hodnota (cislo) > Pi; (4.2.3) > evalf(Pi); 3.141592654
(4.2.4)
0.5772156649
(4.2.5)
e
(4.2.6)
e
(4.2.7)
2.718281828
(4.2.8)
7.389056099
(4.2.9)
e
(4.2.10)
> evalf(gamma);
exponenciala > exp(1); > exp(1); > evalf(exp(1)); > evalf(exp(2)); > evalf(e);
Promenne nazvy - kombinace: male/velke pismena + cislice + "_" mezery v nazvech promennych nepouzivat - Maple chape mezery jako nasobeni (az na 1-D mode) Priklady: > promenna1; promenna1
(4.3.1)
> promenna1 := 2; (4.3.2) > promenna1; 2
(4.3.3)
> x := a[123]*b; (4.3.4) > a[123] := 3; (4.3.5) > x; (4.3.6) > x := 'x'; (4.3.7) > x+1; (4.3.8)
Document Mode vs. Worksheet Mode
Maple offers two primary modes of problem entry and content creation: Document mode and Worksheet mode. Both modes have respective advantages and you can easily switch from one mode to the other for maximum flexibility. See worksheet for more information on the worksheet interface. Document Mode Quick problem-solving and free-form, rich content composition
Worksheet Mode Traditional Maple problem-solving environment
No prompt (>) displayed
Enter problems at a prompt (>)
Math is entered and displayed in 2-D
Math entered and displayed in 2-D or 1-D
Solve math problems with right-click menu on input and output
Solve math problems with right-click menu on output
Document mode lets you create rich content. For example, the following solves for x without any commands:
The command to perform the same operation in Worksheet mode is in 2-D (Math) Input: >
solutions for x
(4.4.1) or in 1-D (Maple) Input: > solve((x-2)/alpha=1,x); (4.4.2)
Toggle Math/Text entry mode
[F5]
Toggle 2-D/1-D Math entry mode
[F5] 2-D black font, 1 -D red font
on toolbar Evaluate math expression and display result inline
[Ctrl][=]
Evaluate math [Enter] expression and display result on new line
Evaluate math expression and display result on new line
[Enter]
Continue on next line without executing
[Shift][Enter]
Switch to Document mode
Format Create Document Block
Hide commands. Show only results.
Highlight commands to be hidden. Format Create Document Block
Switch to Worksheet mode (insert prompt) Show hidden commands
on toolbar View Expand Document Block
Zapis matematickych vyrazu 1-D Math vs. 2-D Math Math Input Z 2-D Math Input)
> (4.5.1) > int(exp(-x^2), x = 0 .. infinity); (4.5.2) > (4.5.3) !!! Pozor na mezery !!! : =
ale
=
Vyhodnoceni vyrazu Document mode:
3
(4.6.1)
3
(4.6.2)
=3
Worksheet mode (s [>): a) Math (cerny text) > (+ Enter) > 10 (+Shift+Enter (nevyhodnoti radek, radky musi matematicky "navazovat")) b) Text (cerveny text) > 1+2+ 3+4;
; 10
Hlaseni chyb > Error, unable to match delimiters
> sin(x
(4.6.3)
(4.6.4)
> ... zadna chybova hlaska, ale taky zadny vystup v Maple 16 jeste byla chybova hlaska: Warning, premature end of input, use <Shift> + <Enter> to avoid this message. > sin(x; Error, `;` unexpected
Error, unable to match delimiters
Operace s vyrazy (classic mod) - zjednodusi vyraz > v1 := ((3-2*sqrt(2))/(3*sqrt(2)-4))^2; (4.8.1.1)
> simplify(v1); 1 2 > v2 := (sqrt(a)*a^(1/3)/(a*sqrt(a))^(1/3))^(-1);
(4.8.1.2)
(4.8.1.3) > simplify(v2); (4.8.1.4) > simplify(v2, symbolic); # nebere v potaz podmínky 1
(4.8.1.5)
> v3 := (a^2+1)^(1/2)/(a*(1+1/a^2)^(1/2)); #výsledek |a|/a (4.8.1.6)
> simplify(v3); (4.8.1.7)
> simplify(v3, symbolic); # tento vysledek neni spravne 1 (4.8.1.8) > simplify(v3, assume = negative); (4.8.1.9)
(4.8.1.9)
> simplify(v3, assume = positive); (4.8.1.10)
> - roznasobi soucin > v1 := (2*x+1)*(x-3); simplify(v1); (4.8.2.1) > expand(v1); (4.8.2.2) > v2 := (x+1)^3; v3 := expand(v2); (4.8.2.3) - rozlozi na soucin cinitelu > v3; (4.8.3.1) > simplify(v3); (4.8.3.2) > factor(v3); (4.8.3.3) > combine - slouci vyrazy stejneho typu > v := sqrt(2)*sqrt(3); (4.8.4.1) > simplify(v); (4.8.4.2) > combine(v); (4.8.4.3) > convert - ukazeme si jenom prevod na parcialni zlomky > v := 1/(x^2-1); > convert(v, parfrac); (4.8.5.1) > w := a/(x^2-1); >
> convert(w, parfrac, x); (4.8.5.2) >
> z := [a+b-2*b]/(a-b); (4.8.6.1) > simplify(z); (4.8.6.2)
Deleni polynomu - zjisti, zda jsou polynomy delitelne beze zbytku > delenec := x^3-1; (4.8.7.1) > delitel:=x-1; (4.8.7.2) > divide(delenec, delitel); true > divide(delenec, delitel, 'podil'); true > podil;
(4.8.7.3) (4.8.7.4) (4.8.7.5)
> p := x^2+x+1; (4.8.7.6) > divide(p, delitel, 'q'); false > q; q
(4.8.7.7) (4.8.7.8)
- vydeli dva polynomy a zbytek ulozi do promenne
je jako nahore v casti pro divide, i.e. > q := x-1; (4.8.8.1) > quo(p, q, x); (4.8.8.2) > quo(p, q, x, 'zbytek'); (4.8.8.3)
(4.8.8.3) > zbytek; 3 > p/q = quo(p, q, x, 'zbytek')+zbytek/q;
(4.8.8.4) (4.8.8.5)
- zbytek po deleni dvou polynomu > rem(p, q, x); 3 > p/q = quo(p, q, x)+rem(p, q, x)/q;
(4.8.9.1) (4.8.9.2)
>