Fix sympy deprecation warning (#1600)
Fix sympy deprecation warning (#1600)

```
sympy/matrices/dense.py:41: SymPyDeprecationWarning:

  The private _mat attribute of Matrix has been deprecated since SymPy
  1.9. Use the .flat() method instead. See
  https://github.com/sympy/sympy/issues/21715 for more info.

    SymPyDeprecationWarning(
```

Closes #1562
FFroehlich/AMICI,FFroehlich/AMICI,FFroehlich/AMICI,FFroehlich/AMICI