## pydstool-users — General discussion about using PyDSTool

You can subscribe to this list here.

 2007 2008 2009 2011 2012 2013 2014 2015 Jan Feb (2) Mar Apr May Jun Jul (1) Aug Sep Oct Nov Dec Jan Feb Mar Apr May (2) Jun Jul Aug Sep Oct Nov Dec Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec (1) Jan (3) Feb Mar Apr (2) May Jun Jul Aug Sep Oct Nov Dec Jan Feb Mar Apr May (10) Jun Jul Aug Sep Oct Nov Dec Jan Feb (2) Mar (3) Apr May Jun Jul Aug Sep Oct Nov Dec Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec (1) Jan Feb (1) Mar Apr May Jun Jul (1) Aug Sep Oct Nov Dec
S M T W T F S

1

2

3

4

5

6

7

8

9

10

11

12
(1)
13

14

15

16

17

18

19

20

21

22

23

24
(2)
25

26

27

28

29

30

31

Showing 3 results of 3

 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
 [pydstool-users] Did anyone happen to download the old PyDSTool wiki files? From: Rob Clewley - 2011-01-24 20:05:58 Hi list members, As you may have noticed, last year the PyDSTool wiki server crashed at my former place of employment, Cornell University. For various administrative and technical reasons that I do not properly understand, all the data was irretrievably lost. I have only a less recent backup of the entire Wiki, which is probably a year or more old. Although that covers almost all of the pages, there were many minor but important edits in many pages that I have no record or memory of. It occurred to me to ask the users list in case anyone made a copy of the wiki for their own use offline in the past 12 months. If you have and wouldn't mind zipping up the files to send to me, I would be most grateful. They can even be in html or PDF format, if that's all you have. Also, I hope to put out another bug fix release in the near future. My research and teaching duties make my support for this software less rigorous and occasionally less careful than I would prefer. (I am the only active maintainer.) This has become harder since the entire SVN repository records were also lost in the Cornell server crash, and I have not yet had the time to commit to a new version control system and implement it. Thank you for bearing with me while I fix some of the silly mistakes that have crept in while trying to fix other inter-related features! I do appreciate when you offer suggestions for fixing issues that arise, as that helps me respond to them more rapidly. Regards, 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
 [pydstool-users] Matrix in system of equation From: Achim Ammon - 2011-01-12 06:29:19 Attachments: Message as HTML Hi Happy new year every one! I'm new to continuation and trying to get my head around things at the moment. I've got the following system of equation: $$\left( \begin{array}{c} \dot{s}\\ \dot{v} \end{array} \right) = \left( \begin{array}{c} v\\ -\mathbf{B}^{-1} \mathbf{A} s + V_{DC} \mathbf{B}^{-1} \mathbf{C} s \end{array} \right)$$ where A B and C are square matrices of dimension (nxn), s and v are vectors of length n and V_DC is a scalar. I tried to enter this system of equations and solve it with pyDSTool but got; 'TypeError: only length-1 arrays can be converted to Python scalars'. Here's the code: > #!/usr/bin/python > # encoding=utf8 > > import PyDSTool as DS > import numpy as np > > AA = np.matrix([[127.717469865, 2.05025780562], > [0.0521863096197, 2605.29996274]]) > BB = np.matrix([[1.65676839951e-10, 6.76971107431e-14], > [6.76971107431e-14, 8.60513163289e-11]]) > CC = np.matrix([[-5.91089367427436, 58.2428565496970], > [-9.30459729674465, 47.6048481884652]]) > > > DSargs = DS.args(name='Hopf') > > # parameters > DSargs.pars = { > 'A': AA, > 'B': BB, > 'B_I': BB.I, > 'C': CC, > 'V_DC': 0 > } > > # auxiliary helper function(s) > DSargs.fnspecs = { > 'ss': (['s'], 'sum(s)'), > 'vv': (['v'], 'sum(v)') > } > > # rhs of the differential equation > DSargs.varspecs = { > 's': 'v', > 'v': '-B_I*A*s + V_DC*B_I*C*s' > } > > # initial conditions > DSargs.ics = { > 's': np.matrix([0,0]), > 'v': np.matrix([0,0]) > } > > DSargs.info() > > ode = DS.Generator.Vode_ODEsystem(DSargs) > > # Set up continuation class > PyCont = DS.ContClass(ode) > > PCargs = DS.args(name='EQ1', type='EP-C') > PCargs.freepars = ['V_DC'] > PCargs.MaxNumPoints = 400 > PCargs.StepSize = 0.1 > PCargs.LocBifPoints = ['all'] > PCargs.SaveEigen = True > 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 ps: Thanks for another awesome open-source tool!

Showing 3 results of 3