From 8ff18384fea7e1e31453f1c8cc70c7f307057f49 Mon Sep 17 00:00:00 2001 From: David Rotermund <54365609+davrot@users.noreply.github.com> Date: Wed, 3 Jan 2024 19:11:53 +0100 Subject: [PATCH] Create README.md Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com> --- sympy/intro/README.md | 91 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sympy/intro/README.md diff --git a/sympy/intro/README.md b/sympy/intro/README.md new file mode 100644 index 0000000..a43e4fc --- /dev/null +++ b/sympy/intro/README.md @@ -0,0 +1,91 @@ +# Symbolic Computation +{:.no_toc} + + + +## Top + +Questions to [David Rotermund](mailto:davrot@uni-bremen.de) + +```shell +pip install sympy +``` + +|| +|---| +|[Simplification](https://docs.sympy.org/latest/tutorials/intro-tutorial/simplification.html)| +|[Calculus](https://docs.sympy.org/latest/tutorials/intro-tutorial/calculus.html) | +|[Solvers](https://docs.sympy.org/latest/tutorials/intro-tutorial/solvers.html)| + + + + +## [Some examples](https://docs.sympy.org/latest/tutorials/intro-tutorial/intro.html#a-more-interesting-example) + + +### [Derivatives](https://docs.sympy.org/latest/tutorials/intro-tutorial/calculus.html#derivatives) + +```python +import sympy + +x, y = sympy.symbols("x y") + +y = sympy.diff(sympy.sin(x) * sympy.exp(x), x) +print(y) # -> exp(x)*sin(x) + exp(x)*cos(x) +``` + +### [Integrals](https://docs.sympy.org/latest/tutorials/intro-tutorial/calculus.html#integrals) + +```python +import sympy + +x, y = sympy.symbols("x y") + +y = sympy.integrate(sympy.cos(x), x) +print(y) # -> sin(x) +``` + + +### [(Taylor) Series Expansion](https://docs.sympy.org/latest/tutorials/intro-tutorial/calculus.html#series-expansion) + +```python +import sympy + +x, y, z = sympy.symbols("x y z") +y = sympy.cos(x) +z = y.series(x, 0, 8) # around x = 0 , up order 7 + +print(z) # -> 1 - x**2/2 + x**4/24 - x**6/720 + O(x**8) +``` + +## [simplify](https://docs.sympy.org/latest/tutorials/intro-tutorial/simplification.html#simplify) + +```python +import sympy + +x, y, z = sympy.symbols("x y z") +y = sympy.simplify(sympy.sin(x) ** 2 + sympy.cos(x) ** 2) + +print(y) # -> 1 +``` + +## [Solving Equations Algebraically](https://docs.sympy.org/latest/tutorials/intro-tutorial/solvers.html) + +> Recall from the [gotchas section](https://docs.sympy.org/latest/tutorials/intro-tutorial/gotchas.html#tutorial-gotchas-equals) of this tutorial that symbolic equations in SymPy are not represented by = or ==, but by Eq. + +```python +import sympy + +x, y, z = sympy.symbols("x y z") + +z = sympy.Eq(x, y) +``` + +Output: + +$$x=y$$ + +