Update README.md
Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
parent
5d86903253
commit
13a13bbe48
1 changed files with 15 additions and 0 deletions
|
@ -170,3 +170,18 @@ result = sympy.dsolve(diffeq, f(x))
|
||||||
print(result) # -> Eq(f(x), (C1 + C2*x)*exp(x) + cos(x)/2)
|
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
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue