## Re: [pydstool-users] Matrix in system of equation

 Re: [pydstool-users] Matrix in system of equation From: Rob Clewley - 2011-01-24 20:27:51 ```Hi Achim, > > How can I deal with matrices in the system of equations? I need to work with > such systems often in future as this is the form I get after applying the > Galerking decomposition to continuum-mechanical dynamic systesm. > > Thanks for your help! > Achim I'm afraid the software is somewhat limited in this respect. Matrix equations have to unwrapped into a set of 1D equations in scalar variables only, i.e. you must pre-multiply out the RHS vector expressions and extract each component of the result to the RHS of a 1D scalar variable. As well as the usual Maple or Sage, the excellent SymPy package should be able to help you perform the symbolic matrix multiplications, from which you could copy and paste strings into your PyDSTool specs. In addition, provided you have the Radau integrator working, you may integrate systems that have a LHS "mass matrix," which can have time and state dependence. I.e. this will let you solve more general ODEs and DAEs M(x,t) dx/dt = F(x,t) that cannot be written in a normal form dx / dt = f(x, t), where x is a vector, because of the potential non-invertability of M. For an example, see the demonstration in tests/freefinger_noforce_radau.py, which implements a "finger" model as an inverted, damped triple pendulum. Currently, the syntax for this is clunky, and if anyone would like to contribute the code to provide better syntactic sugar for this feature I would include it! Best, Rob -- Robert Clewley, Ph.D. Assistant Professor Neuroscience Institute and Department of Mathematics and Statistics Georgia State University PO Box 5030 Atlanta, GA 30302, USA tel: 404-413-6420 fax: 404-413-5446 http://www2.gsu.edu/~matrhc http://neuroscience.gsu.edu/rclewley.html ```

 Re: [pydstool-users] Matrix in system of equation From: Rob Clewley - 2011-01-24 20:27:51 ```Hi Achim, > > How can I deal with matrices in the system of equations? I need to work with > such systems often in future as this is the form I get after applying the > Galerking decomposition to continuum-mechanical dynamic systesm. > > Thanks for your help! > Achim I'm afraid the software is somewhat limited in this respect. Matrix equations have to unwrapped into a set of 1D equations in scalar variables only, i.e. you must pre-multiply out the RHS vector expressions and extract each component of the result to the RHS of a 1D scalar variable. As well as the usual Maple or Sage, the excellent SymPy package should be able to help you perform the symbolic matrix multiplications, from which you could copy and paste strings into your PyDSTool specs. In addition, provided you have the Radau integrator working, you may integrate systems that have a LHS "mass matrix," which can have time and state dependence. I.e. this will let you solve more general ODEs and DAEs M(x,t) dx/dt = F(x,t) that cannot be written in a normal form dx / dt = f(x, t), where x is a vector, because of the potential non-invertability of M. For an example, see the demonstration in tests/freefinger_noforce_radau.py, which implements a "finger" model as an inverted, damped triple pendulum. Currently, the syntax for this is clunky, and if anyone would like to contribute the code to provide better syntactic sugar for this feature I would include it! Best, Rob -- Robert Clewley, Ph.D. Assistant Professor Neuroscience Institute and Department of Mathematics and Statistics Georgia State University PO Box 5030 Atlanta, GA 30302, USA tel: 404-413-6420 fax: 404-413-5446 http://www2.gsu.edu/~matrhc http://neuroscience.gsu.edu/rclewley.html ```