I actually think that the Piecewise approach is important and is
something that we should do somehow but for it to work it needs to be
done (or doable) *everywhere* including solvers for linear systems and
polynomials:
https://github.com/sympy/sympy/issues/16861
We could have that in dsolve but it should inherit work done in
matrices/poly etc rather than implementing all the cases in the ode
module.
For ODE systems right now only the 2-equation constant coefficient
solver uses Piecewise and it has lots of bug reports. Basic things
explode because it isn't implemented very well. I won't show the
output but try this in isympy:
dsolve([f(x).diff(x)-y*f(x), g(x).diff(x)-g(x)])
Given that it doesn't work properly and is inconsistent with the rest
of solvers the Piecewise behaviour there should go and we should
return results for the generic cases.
The matrix exponential is continuous (and analytic). Whether or not
non-diagonalisability occurs at isolated points is more complicated
though as it depends which class of matrices we consider in the first
place which depends on user input in sympy's case.
Given a matrix [[a, b], [c, d]] where a, b, c, d are real we have a 4D
space of matrices. The submanifold of non-diagonalisable matrices is
3D so it is a non-generic subset of the 4D space. However if we think
of the submanifold of matrices that have repeated eigenvalues then
within *that* space non-diagonalisability is generic and
diagonalisability occurs in a 2D subspace (the symmetric case [[a, b],
[b, a]]). On the other hand if we restrict ourselves to symmetric
matrices then we get a 3D subspace [[a, b], [b, c]] within which
diagonalisability is universal.
Oscar
> To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/CAKgW%3D6K2p1P4swGCtu619TCxqys%3DfRWx4pbuFwa2o_x255obcw%40mail.gmail.com.