Update README.md

Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
David Rotermund 2024-01-03 19:42:12 +01:00 committed by GitHub
parent 5d86903253
commit 13a13bbe48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -170,3 +170,18 @@ result = sympy.dsolve(diffeq, f(x))
print(result) # -> Eq(f(x), (C1 + C2*x)*exp(x) + cos(x)/2)
```
## [Numerical Evaluation](https://docs.sympy.org/latest/modules/evalf.html)
```python
import sympy
x, y = sympy.symbols("x y")
expr = sympy.cos(x) + 1
print(expr) # -> cos(x) + 1
expr = expr.subs(x, 0.333 * sympy.pi)
print(expr) # -> cos(0.333*pi) + 1
print(sympy.N(expr)) # -> 1.50090662536071
```