```python
from matplotlib import pyplot as plt
import numpy as np
from nodepy import runge_kutta_method as rk
from nodepy import stability_function
from sympy import symbols, expand
from scipy.special import laguerre
from ipywidgets import interact, FloatSlider
```


```python
def restricted_pade(k,gamma=0):
    coeffs = []
    for m in range(k+1):
        coeffs.append((-1)**k*laguerre(k).deriv(k-m)(1./gamma)*gamma**m)
    numer = np.poly1d(coeffs[::-1])
    z = symbols('z')
    denom = (1-gamma*z)**k
    coeffs = [expand(denom).coeff(z,n) for n in range(k+1)]
    denom = np.poly1d(coeffs[::-1])
    return numer, denom
```


```python
p, q = restricted_pade(3,gamma=1.06857902)
stability_function.plot_order_star(p,q);
```

Here we recreate and elaborate on Figure 6 of the paper "Order Stars and stability theorems" by Wanner, Hairer & Norsett.


```python
L4 = laguerre(4).deriv()
1./L4.r
```


```python
def hwnplot(k=3,gamma=1.):
    p, q = restricted_pade(k,gamma)
    stability_function.plot_order_star(p,q,bounds=[-4,4,-4,4]);
    plt.show()
    
interact(hwnplot, gamma=FloatSlider(min=0.12, max=1.07, 
                                    step=0.004, value=1.07));
```


```python

```

110a547315e7943f40c63ecd85cfed3988a432ad
ipynb
Jupyter Notebook
examples/Stability functions and order stars.ipynb
ranocha/nodepy
b6cff1ff635611de76beebacd6d821788befb36b
BSD-2-Clause
2015-02-23T17:59:50.000Z
2022-02-20T12:39:05.000Z
examples/Stability functions and order stars.ipynb
ranocha/nodepy
b6cff1ff635611de76beebacd6d821788befb36b
BSD-2-Clause
2015-02-20T18:03:39.000Z
2021-04-01T11:09:08.000Z
examples/Stability functions and order stars.ipynb
ranocha/nodepy
b6cff1ff635611de76beebacd6d821788befb36b
BSD-2-Clause
2015-02-23T12:32:47.000Z
2022-03-28T02:17:21.000Z
Qwen/Qwen-72B
1. YES
2. YES