hfern / odeapprox

Numerical ODE approximation, because I'm bored of doing them by hand

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ODE Approximations

Supports euler and improved euler methods.

Install dependencies with pip install click terminaltables.

Example:

$> python nsolve.py euler
dy/dx: y + 1
X0: 0
Y0: 1
Ending X: 1.2
Step: .1
+-----+----------+----------+------+----------+
| Xn  | Yn       | k        | Xn+1 | Yn+1     |
+-----+----------+----------+------+----------+
| 0.0 | 1.0      | 2.0      | 0.1  | 1.2      |
| 0.1 | 1.2      | 2.2      | 0.2  | 1.42     |
| 0.2 | 1.42     | 2.42     | 0.3  | 1.662    |
| 0.3 | 1.662    | 2.662    | 0.4  | 1.9282   |
| 0.4 | 1.9282   | 2.9282   | 0.5  | 2.22102  |
| 0.5 | 2.22102  | 3.22102  | 0.6  | 2.543122 |
| 0.6 | 2.543122 | 3.543122 | 0.7  | 2.897434 |
| 0.7 | 2.897434 | 3.897434 | 0.8  | 3.287178 |
| 0.8 | 3.287178 | 4.287178 | 0.9  | 3.715895 |
| 0.9 | 3.715895 | 4.715895 | 1.0  | 4.187485 |
| 1.0 | 4.187485 | 5.187485 | 1.1  | 4.706233 |
| 1.1 | 4.706233 | 5.706233 | 1.2  | 5.276857 |
| 1.2 | 5.276857 |          |      |          |
+-----+----------+----------+------+----------+

About

Numerical ODE approximation, because I'm bored of doing them by hand


Languages

Language:Python 100.0%