Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Continuous system simulation in Python

Reply
Thread Tools

Continuous system simulation in Python

 
 
Nicolas Pernetty
Guest
Posts: n/a
 
      10-06-2005
Hello,

I'm looking for any work/paper/ressource about continuous system
simulation using Python or any similar object oriented languages (or
even UML theory !).

I'm aware of SimPy for discrete event simulation, but I haven't found
any work about continuous system.
I would like to develop a generic continous system simulator, and so
would be eager to join any open source effort on the subject.

For instance, it would be useful for modelling an airplane with all the
dynamics (flight simulator).

Python is my language of choice because of the keyword 'generic'. Being
an object oriented dynamic language, it's perfect for such a task.
Unfortunately I'm a novice when it comes to object oriented
design and development, so I would prefer to start from something
already existent instead of starting from scratch.

If you had any idea on the subject, I would be really glad to discuss it
with you.

Thanks in advance,

P.S. : for email, replace nowhere by yahoo
 
Reply With Quote
 
 
 
 
hrh1818
Guest
Posts: n/a
 
      10-07-2005
A good starting point is the book "Python Scripting for Computational
Science" by Hans Petter Langtangen. The book covers topics that go
from simulating second order mechanical systems to solving partial
differentail equations.

Howard

Nicolas Pernetty wrote:
> Hello,
>
> I'm looking for any work/paper/ressource about continuous system
> simulation using Python or any similar object oriented languages (or
> even UML theory !).
>
> I'm aware of SimPy for discrete event simulation, but I haven't found
> any work about continuous system.
> I would like to develop a generic continous system simulator, and so
> would be eager to join any open source effort on the subject.
>
> For instance, it would be useful for modelling an airplane with all the
> dynamics (flight simulator).
>
> Python is my language of choice because of the keyword 'generic'. Being
> an object oriented dynamic language, it's perfect for such a task.
> Unfortunately I'm a novice when it comes to object oriented
> design and development, so I would prefer to start from something
> already existent instead of starting from scratch.
>
> If you had any idea on the subject, I would be really glad to discuss it
> with you.
>
> Thanks in advance,
>
> P.S. : for email, replace nowhere by yahoo


 
Reply With Quote
 
 
 
 
Dennis Lee Bieber
Guest
Posts: n/a
 
      10-07-2005
On Fri, 7 Oct 2005 01:12:22 +0200, Nicolas Pernetty
<(E-Mail Removed)> declaimed the following in comp.lang.python:

>
> I'm aware of SimPy for discrete event simulation, but I haven't found
> any work about continuous system.
> I would like to develop a generic continous system simulator, and so
> would be eager to join any open source effort on the subject.
>
> For instance, it would be useful for modelling an airplane with all the
> dynamics (flight simulator).
>

Unless that flight simulator is running on some big ugly ANALOG
computer (the ones that used rheostats, transformers, and amplifiers),
they all are really using discrete time intervals and computing values
at those time points. Such computation may require integration of
continuous functions from previous time step to current time step.
--
> ================================================== ============ <
> http://www.velocityreviews.com/forums/(E-Mail Removed) | Wulfraed Dennis Lee Bieber KD6MOG <
> (E-Mail Removed) | Bestiaria Support Staff <
> ================================================== ============ <
> Home Page: <http://www.dm.net/~wulfraed/> <
> Overflow Page: <http://wlfraed.home.netcom.com/> <

 
Reply With Quote
 
Robert Kern
Guest
Posts: n/a
 
      10-07-2005
Dennis Lee Bieber wrote:
> On Fri, 7 Oct 2005 01:12:22 +0200, Nicolas Pernetty
> <(E-Mail Removed)> declaimed the following in comp.lang.python:
>
>>I'm aware of SimPy for discrete event simulation, but I haven't found
>>any work about continuous system.
>>I would like to develop a generic continous system simulator, and so
>>would be eager to join any open source effort on the subject.
>>
>>For instance, it would be useful for modelling an airplane with all the
>>dynamics (flight simulator).

>
> Unless that flight simulator is running on some big ugly ANALOG
> computer (the ones that used rheostats, transformers, and amplifiers),
> they all are really using discrete time intervals and computing values
> at those time points. Such computation may require integration of
> continuous functions from previous time step to current time step.


I think Nicolas means "(discrete event) simulation" as opposed to
"discrete (event simulation)" and "(continuous system) simulation" as
opposed to "continuous (system simulation)". The methods used in SimPy
to model (discrete events) don't apply terribly well to simulating many
(continuous systems) like airplane dynamics. For example, an ODE
integrator would probably want to adaptively select its timesteps as
opposed to laying out a uniform discretization upfront.

--
Robert Kern
(E-Mail Removed)

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter

 
Reply With Quote
 
=?iso-8859-1?Q?Fran=E7ois?= Pinard
Guest
Posts: n/a
 
      10-07-2005
[Robert Kern]

> [...] an ODE integrator would probably want to adaptively select its
> timesteps as opposed to laying out a uniform discretization upfront.


Eons ago, I gave myself such a little beast (but really found in an
Appendix of a book on simulation), which I use since then whenever I
need it, not so often in these days. If you are curious, see:

http://fp-etc.progiciels-bpi.ca/rke.html

yet I'm sure there is just plenty of such things, all around.

The above is in C, not in Python. I vaguely remember having once
rewritten the thing in Python, then discarded the result as not fast
enough for the need I then had. If I really needed to use it nowadays,
I'll probably try to quickly link it through Pyrex. Or just look around
a bit for some already made, and maybe better solution.

It is easy and convenient, when writing a mixed discrete and continuous
simulation system, to tie the advancement control of the various active
ODE solvers within the main loop of the discrete event scheduler.

--
François Pinard http://pinard.progiciels-bpi.ca
 
Reply With Quote
 
Robert Kern
Guest
Posts: n/a
 
      10-07-2005
François Pinard wrote:
> [Robert Kern]
>
>>[...] an ODE integrator would probably want to adaptively select its
>>timesteps as opposed to laying out a uniform discretization upfront.

>
> Eons ago, I gave myself such a little beast (but really found in an
> Appendix of a book on simulation), which I use since then whenever I
> need it, not so often in these days. If you are curious, see:
>
> http://fp-etc.progiciels-bpi.ca/rke.html
>
> yet I'm sure there is just plenty of such things, all around.
>
> The above is in C, not in Python. I vaguely remember having once
> rewritten the thing in Python, then discarded the result as not fast
> enough for the need I then had. If I really needed to use it nowadays,
> I'll probably try to quickly link it through Pyrex. Or just look around
> a bit for some already made, and maybe better solution.


scipy has wrapped LSODA and VODE from ODEPACK. There are a few more
integrators in ODEPACK which could easily be wrapped with f2py should
someone feel the urge. We'd probably wrap yours, too, if it weren't
GPLed.

--
Robert Kern
(E-Mail Removed)

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter

 
Reply With Quote
 
phil_nospam_schmidt@yahoo.com
Guest
Posts: n/a
 
      10-07-2005
Nicholas,

Have you looked at Octave? It is not Python, but I believe it can talk
to Python.
Octave is comparable to Matlab for many things, including having ODE
solvers. I have successfully used it to model and simulate simple
systems. Complex system would be easy to model as well, provided that
you model your dynamic elements with (systems of) differential
equations.

 
Reply With Quote
 
Nicolas Pernetty
Guest
Posts: n/a
 
      10-07-2005
Hello Phil,

Yes I have considered Octave. In fact I'm already using Matlab and
decided to 'reject' it for Python + Numeric/numarray + SciPy because I
think you could do more in Python and in more simple ways.

Problem is that neither Octave, Matlab and Python offer today a
framework to build continuous system simulator (in fact Matlab with
Simulink and SimMechanics, do propose, but I was not convinced at all).

Regards,

*********** REPLY SEPARATOR ***********

On 7 Oct 2005 11:00:54 -0700, (E-Mail Removed) wrote :

> Nicholas,
>
> Have you looked at Octave? It is not Python, but I believe it can talk
> to Python.
> Octave is comparable to Matlab for many things, including having ODE
> solvers. I have successfully used it to model and simulate simple
> systems. Complex system would be easy to model as well, provided that
> you model your dynamic elements with (systems of) differential
> equations.
>

 
Reply With Quote
 
Nicolas Pernetty
Guest
Posts: n/a
 
      10-07-2005
On Thu, 06 Oct 2005 22:30:00 -0700, Robert Kern <(E-Mail Removed)>
wrote :

> Dennis Lee Bieber wrote:
> > On Fri, 7 Oct 2005 01:12:22 +0200, Nicolas Pernetty
> > <(E-Mail Removed)> declaimed the following in
> > comp.lang.python:
> >
> > > I'm aware of SimPy for discrete event simulation, but I haven't
> > > found any work about continuous system.
> > > I would like to develop a generic continous system simulator, and
> > > so would be eager to join any open source effort on the subject.
> > >
> > >For instance, it would be useful for modelling an airplane with all
> > > the dynamics (flight simulator).

> >
> > Unless that flight simulator is running on some big ugly ANALOG
> > computer (the ones that used rheostats, transformers, and
> > amplifiers), they all are really using discrete time intervals and
> > computing values at those time points. Such computation may require
> > integration of continuous functions from previous time step to
> > current time step.

>
> I think Nicolas means "(discrete event) simulation" as opposed to
> "discrete (event simulation)" and "(continuous system) simulation" as
> opposed to "continuous (system simulation)". The methods used in SimPy
> to model (discrete events) don't apply terribly well to simulating
> many (continuous systems) like airplane dynamics. For example, an ODE
> integrator would probably want to adaptively select its timesteps as
> opposed to laying out a uniform discretization upfront.
>


Yes you are absolutely right. That's what I wanted to mean.
Thanks
 
Reply With Quote
 
Nicolas Pernetty
Guest
Posts: n/a
 
      10-07-2005
Thanks, but what is really difficult is not to understand how to design
the program which solve a specific problem but to design a generic
framework for solving all these kinds of problem. And in a simple enough
way for basic programmers (but good scientists !) to handle it.

*********** REPLY SEPARATOR ***********

On 6 Oct 2005 17:04:01 -0700, "hrh1818" <(E-Mail Removed)> wrote
:

> A good starting point is the book "Python Scripting for Computational
> Science" by Hans Petter Langtangen. The book covers topics that go
> from simulating second order mechanical systems to solving partial
> differentail equations.
>
> Howard
>
> Nicolas Pernetty wrote:
> > Hello,
> >
> > I'm looking for any work/paper/ressource about continuous system
> > simulation using Python or any similar object oriented languages (or
> > even UML theory !).
> >
> > I'm aware of SimPy for discrete event simulation, but I haven't
> > found any work about continuous system.
> > I would like to develop a generic continous system simulator, and so
> > would be eager to join any open source effort on the subject.
> >
> > For instance, it would be useful for modelling an airplane with all
> > the dynamics (flight simulator).
> >
> > Python is my language of choice because of the keyword 'generic'.
> > Being an object oriented dynamic language, it's perfect for such a
> > task. Unfortunately I'm a novice when it comes to object oriented
> > design and development, so I would prefer to start from something
> > already existent instead of starting from scratch.
> >
> > If you had any idea on the subject, I would be really glad to
> > discuss it with you.
> >
> > Thanks in advance,
> >
> > P.S. : for email, replace nowhere by yahoo

>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Continuous Ink System for Color Printers Gary Edstrom Digital Photography 1 03-06-2009 06:00 AM
Problem with post-route simulation / timing simulation jasperng VHDL 0 11-27-2008 06:23 AM
Best thing since sliced bread. - The Continuous Ink System- this will change your life!! rudijock@gmail.com Digital Photography 0 08-16-2007 02:34 AM
epson desktop: continuous ink system for desktop printer lois8386 Hardware 0 11-24-2006 09:12 AM
Python Projects Continuous Integration Harry George Python 8 08-08-2006 07:31 PM



Advertisments