Run an example 'Interpolation: Neville'.
()
| 302 | |
| 303 | @print_docstring |
| 304 | def example_interpolation_neville(): |
| 305 | """Run an example 'Interpolation: Neville'.""" |
| 306 | x = np.array([1.0, 1.3, 1.6, 1.9, 2.2]) |
| 307 | y = np.array([0.7651977, 0.6200860, 0.4554022, 0.2818186, 0.1103623]) |
| 308 | x_int = 1.5 |
| 309 | |
| 310 | print("Inputs:") |
| 311 | print(f"x = {x}") |
| 312 | print(f"y = {y}") |
| 313 | print(f"x_int = {x_int}") |
| 314 | |
| 315 | y_int, q = interpolation.neville(x, y, x_int) |
| 316 | |
| 317 | print("Output:") |
| 318 | print(f"y_int = {y_int:.5f}") |
| 319 | print(f"q =\n{q}") |
| 320 | |
| 321 | |
| 322 | @print_docstring |