Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| lehrkraefte:blc:math:maxima-cheatsheet [2021/05/05 07:43] – [Vector operations] Ivo Blöchliger | lehrkraefte:blc:math:maxima-cheatsheet [2024/05/03 07:06] (current) – [Using results of solve for further computations] Ivo Blöchliger | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Maxima Cheat Sheet ====== | ||
| + | |||
| + | ===== Solving exponential equations ===== | ||
| + | Maximas solve cannot handle exponential equations. However, it converts them into a form which can be used further by taking the logarithm of both sides. Make sure to set ' | ||
| + | <code text> | ||
| + | f(x): | ||
| + | g(x): | ||
| + | solve(f(x)=g(x), | ||
| + | x - 4 | ||
| + | x - 2 ----- | ||
| + | ----- 5 | ||
| + | 2 b 3 - 1 | ||
| + | (%o8) | ||
| + | a | ||
| + | |||
| + | logexpand: | ||
| + | solve(log(solve(f(x)=g(x), | ||
| + | x/5 - 4/5 | ||
| + | 2 log(b 3 - 1) - 2 log(a) + 2 log(2) | ||
| + | (%o11) | ||
| + | log(2) | ||
| + | |||
| + | </ | ||
| + | Und sonst halt mit '' | ||
| + | ===== Output stuff like Maxima Input ===== | ||
| + | <code txt> | ||
| + | (%i14) x^2/3; | ||
| + | 2 | ||
| + | x | ||
| + | (%o14) | ||
| + | 3 | ||
| + | (%i15) string(%); | ||
| + | (%o15) | ||
| + | </ | ||
| + | |||
| + | ===== Derivative as a new function (force evaluating the differentiation) ===== | ||
| + | <code txt> | ||
| + | f(x): | ||
| + | define(ff(x), | ||
| + | </ | ||
| + | |||
| + | ===== Using results of solve for further computations ===== | ||
| + | <code txt> | ||
| + | sol: | ||
| + | x^2-x, sol[2]; | ||
| + | expand(%); | ||
| + | val: | ||
| + | /* Usable inside an expresseion: | ||
| + | subst(sol[2], | ||
| + | </ | ||
| + | Or even better: | ||
| + | <code text> | ||
| + | rhs(sol[2]); | ||
| + | map(rhs, sol); | ||
| + | </ | ||
| + | ===== Nummerically solve equations ===== | ||
| + | [[https:// | ||
| + | <code txt> | ||
| + | find_root(sin(2*x)=x, | ||
| + | </ | ||
| + | |||
| + | ===== Vector operations ===== | ||
| + | <code maxima> | ||
| + | load(" | ||
| + | cross(u, | ||
| + | norm(a): | ||
| + | area(a, | ||
| + | vec2eq(eq): | ||
| + | </ | ||
| + | |||
| + | ===== Binomial Distribution ===== | ||
| + | <code maxima> | ||
| + | load(" | ||
| + | pdf_binomial (25, | ||
| + | cdf_binomial (25, | ||
| + | </ | ||