Given the degrees in numerator and denominator I would like to represent a Padé polynomial à la
```
P(x) = (a[0] + a[1]*x + a[2]*x**2 + ...) / (1 + b[1]*x + b[2]*x**2 + ...)
```
in sympy and let it do the heavy lifting, e.g., computation of derivatives.
Operations that I'll need to do:
* Replace a[] and b[] with actual numerical values (in both P and P')
* Evaluate those P_{a,b} and P'_{a, b} for many x.
The first idea was to go
```
import numpy
import sympy
a = sympy.MatrixSymbol('a', 2, 1)
b = sympy.MatrixSymbol('b', 3, 1)
x = sympy.Symbol('x')
P = (a[0] + a[1]*x) / (1 + b[0]*x + b[1]*x**2 + b[2]*x**3)
val_a = numpy.random.rand(2)
P_a = P.evalf(subs={a: val_a})
```
The last line however doesn't seem to do anything at all. Second attempt:
```
Pa = sympy.lambdify(a, P)(val_a)
```
This gives
```
IndexError: too many indices for array
```
Hm. Any hints of how to proceed here? Perhaps `MatrixSymbol` isn't what I'm looking for.