pyarie-users Mailing List for Pyarie - Modular Systems Modeling
Status: Pre-Alpha
Brought to you by:
kuthu
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
(1) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Vinicius L. <vin...@pa...> - 2007-05-24 10:28:11
|
Hello John! I've taken a quick look at the Pyarie home page. We have developed an application for process industry, which may have some help of the work you have done. Maybe there are some cooperation opportunities. My first question regards the license applied to the code you developed. Simpy uses LGPL, which would enable liking to some of our code that we intend to keep closed. There is however a large part of our work that we could release as open source provided we can keep some parts close. Best regards, Vinicius --=20 --------------------------------- Vinicius Lobosco, PhD www.paperplat.com Sv=E4rdl=E5ngsv=E4gen 39 SE-120 60 Stockholm +46 73 925 8476 |
From: John P. M. <pen...@en...> - 2005-11-05 18:52:27
|
No worries. It might be good for you to wait a bit. I'm working on updating the data structure to something that directly addresses your problem. How's this sound. A Variable class that is a subclass of Python Decimal (abitrary and exact precision in floating point). This class can be manipulated as a number and can have an arbitrary number of instances. Then, (still working on this on) the System class will have addition and subtraction methods. Thus, something like # Set variables and initial conditions stateA = pamVariable(3.4) stateB = pamVariable(0) stateC = pamVariable(INF) #infinity # Create system system = pamSystem() # Add variables to system system += stateA + stateB + stateC # optionally add/remove variables if "something important": stateD = pamVariable() # Default initializers can be set system -= stateC + stateD This system will allow what you described, but more powerful. I'm researching now about the best way to build the relationships (i.e. defining equations) for each variable and add those to System, and then automatically perform checks (probably at the __add__() stage) to ensure variables are calculated in the proper order. # This is possible if I can't think of any other way system.setDep(stateA, (stateB, stateC)) # A depends on B and C How's this sound? -j Nicolas Pernetty wrote: > Hello John, > > Just to let you know that I haven't forgotten Pyarie ! > I'm currently having a lot of work, so this project is a little > delayed, but I will get back at is as soon as possible. > > Regards, > > *********** REPLY SEPARATOR *********** > > On Wed, 12 Oct 2005 18:56:52 -0700, John Pennington Metta > <pen...@en...> wrote : > > >>Hello Nicolas, >> >>My apologies, it's not your fault at all. I was reading it with >>something else in mind. >> >>Yes, the system is developed in that fashion. This was only because I >>developed it based on the way I work through my equations (i.e. >>stepping through successivly dependent equations). >> >>I can see the utility of what you are saying. I am not aware of this >>functionality in SimPy, but neither am I very familiar with SimPy. If >>it is within that system, it might be easy to implement in Pyarie. >> >>I'll have to think a while on how best to implement this. I'd want to >>do it in such a way that overall programming for each user is not >>significantly increased. One suggestion is making an pamEquation base >>class, but that might make things more complicated all around. >> >>I'll think about this. >> >>-j >> >>Nicolas Pernetty wrote: >> >>>Hello John, >>> >>>I seems that I haven't made myself clear( I told you that my english >>>was not so good ;-) ). >>>My concern was that I was looking for a convenient way for our >>>future users to design the system. >>> >>>In a procedural world, users have to take care and be careful of how >>>they place their function calls : C depends of A and B, so I have to >>>call C _after_ calling A and B, and so on... It leads to many >>>hassles... >>> >>>In the system you sent, on line 44 ("# MUST BE IN PROPER ORDER"), it >>>appears that you also have to design it while having in mind who >>>has to be called first. >>> >>>In theory, I think that you can deduce the correct tree call if you >>>know on which systems each system has influence. >>>If I give you A,B and C and told you that : >>>1) A had effect on C >>>2) B had effect on C >>> >>>You'll deduce that you have to call A and B, before C (I implicitly >>>assume that every system has access to every state variables from >>>previous step). >>>So if they have a complex model, users only have to concentrate on >>>local actions, and let the program compute if they made an error >>>and got an algebraical loop : >>>1) A had effet on C >>>2) B had effet on C >>>3) C had effect on A >>> >>>It seems that SimPy has somehow this kind of algorithm to deduce a >>>tree call from such informations, or am I mistaken ? >>> >>>For instance, we can have a cannon ball simulation with only at >>>first the earth system (gravity) and the ball. >>>Then come another user, who want to add atmosphere friction to this >>>model without having to modify too much the model. All he had to do >>>is to declare that its Atmosphere system has effect on the ball. >>> >>>Hope that you will understand what I'm trying to say... >>> >>>Regards, >>> >>>*********** REPLY SEPARATOR *********** >>> >>>On Wed, 12 Oct 2005 10:01:53 -0700, John Pennington Metta >>><pen...@en...> wrote : >>> >>> >>> >>>>Nicolas, >>>> >>>>This is already functional, it's just not "hooked up" in the model >>>>you have. >>>> >>>>I'll try to explain and you tell me if this is not what you are >>>>seeking. Note: I've renamed the methods, so instead of >>>>nitrogenBacteria() and nitrogenCycling() in testmodel.py, think of >>>>them as System() (as in the system of equations) and Model() (as in >>>>what might hold multiple systems). >>>> >>>>The simple case is that at a given timestep, the SimPy iterate() >>>>(within the model class) function calls the step() method of the >>>>chosen integrator (runge-kutta, adaptive, etc). The step method >>>>requires 4 arguments: an array of the governing system (the >>>>equations), array of the current state variable values, the time >>>>(SimPy.now()) and the timestep. >>>> >>>>The step() method then calls each function in a FOR loop and >>>>calculates a new state variable value at t given the array of state >>>>variables that has been calculated at time t-1 (which was passed to >>>>it as stated above). Since the governing equations can be anything, >>>>and have access to the entire array of state variables, any >>>>equation has full access to the values calculated at the previous >>>>timestep. This means, using your example that stateC could be >>>>calculated for time t with values for stateA and stateB that were >>>>calculated at time t-1. >>>> >>>>Now, as I understand it, you wish to calculate stateC at time t >>>>with values from stateA and stateB that were calculated at time t. >>>>This, or >>>> >>>>you wish to mix, using some values from the previous timestep and >>>>some >>>> >>> >>>>from the current calculations. Is this correct? >>> >>>>I've attached a new testmodel.py file to illustrate this. It's a >>>>real simple concept in theory. Basically, you create a list within >>>>System (cur_state) which holds the values at time t. You can access >>>>these values from within each function as you see fit (see example >>>>state functions). The list is empty in Model because it is >>>>populated in System by copying in the initial conditions. It's >>>>important to use Python's copy module, so you copy the VALUES and >>>>not the REFERENCES into the cur_state list. >>>> >>>>I don't know if this model will run as is, but it should be a good >>>>enough example to illustrate how to do what you need, assuming I >>>>understand correctly. >>>> >>>>Your English is perfectly fine. I didn't realize you were a >>>>francophone until you said that and I looked at your email. >>>> >>>>Cheers, >>>>-J >>>> >>>>Nicolas Pernetty wrote: >>>> >>>> >>>>>For instance, let's say we have a closed system : A and B have >>>>>effects on C and C has effects on B. >>>>>In a procedural language, I'll do the loop like this : >>>>> >>>>>10: >>>>>computeA(stateA, outA) >>>>>computeB(stateB, outC, outB) >>>>>computeC(stateC, outA, outB, outC) >>>>>goto 10 >>>>> >>>>>In reality we can have a much more complex tree, so do we have to >>>>>somehow design a solver which deduce the tree call from the >>>>>informations or do we have to input the tree as well ? I think >>>>>that somehow it is already solved in SimPy... >>>> >>> >>> >>>------------------------------------------------------- >>>This SF.Net email is sponsored by: >>>Power Architecture Resource Center: Free content, downloads, >>>discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl >>>_______________________________________________ >>>Pyarie-users mailing list >>>Pya...@li... >>>https://lists.sourceforge.net/lists/listinfo/pyarie-users >> -- John Metta (yes, my name has indeed changed...) http://oregonstate.edu/~penningj/ "A computer without windows is like a dog without bricks tied to its head." |
From: John P. M. <pen...@en...> - 2005-10-13 02:52:09
|
Greetings, A new version (alpha level) has been published on the Pyarie website. This version has some significant abstraction advances over the pre-alpha version, making it trivial to create a model by modifying only simulation.py. Much of the dirty work has been moved to the base classes. There is also a new directory structure with an example directory (the examples are just illustrations. I've not yet made good, complex *working* examples). The release is on sourceforge at: http://sourceforge.net/project/showfiles.php?group_id=129965&package_id=142415&release_id=363084 or is accessible from the main Pyarie page at pyarie.wikisophia.org. Cheers, -j -- John Metta (yes, my name has indeed changed...) http://oregonstate.edu/~penningj/ "A computer without windows is like a dog without bricks tied to its head." |
From: John P. M. <pen...@en...> - 2005-10-13 01:56:56
|
Hello Nicolas, My apologies, it's not your fault at all. I was reading it with something else in mind. Yes, the system is developed in that fashion. This was only because I developed it based on the way I work through my equations (i.e. stepping through successivly dependent equations). I can see the utility of what you are saying. I am not aware of this functionality in SimPy, but neither am I very familiar with SimPy. If it is within that system, it might be easy to implement in Pyarie. I'll have to think a while on how best to implement this. I'd want to do it in such a way that overall programming for each user is not significantly increased. One suggestion is making an pamEquation base class, but that might make things more complicated all around. I'll think about this. -j Nicolas Pernetty wrote: > Hello John, > > I seems that I haven't made myself clear( I told you that my english > was not so good ;-) ). > My concern was that I was looking for a convenient way for our future > users to design the system. > > In a procedural world, users have to take care and be careful of how > they place their function calls : C depends of A and B, so I have to > call C _after_ calling A and B, and so on... It leads to many hassles... > > In the system you sent, on line 44 ("# MUST BE IN PROPER ORDER"), it > appears that you also have to design it while having in mind who has to > be called first. > > In theory, I think that you can deduce the correct tree call if you know > on which systems each system has influence. > If I give you A,B and C and told you that : > 1) A had effect on C > 2) B had effect on C > > You'll deduce that you have to call A and B, before C (I implicitly > assume that every system has access to every state variables from > previous step). > So if they have a complex model, users only have to concentrate on local > actions, and let the program compute if they made an error and got an > algebraical loop : > 1) A had effet on C > 2) B had effet on C > 3) C had effect on A > > It seems that SimPy has somehow this kind of algorithm to deduce a tree > call from such informations, or am I mistaken ? > > For instance, we can have a cannon ball simulation with only at first > the earth system (gravity) and the ball. > Then come another user, who want to add atmosphere friction to this > model without having to modify too much the model. All he had to do is > to declare that its Atmosphere system has effect on the ball. > > Hope that you will understand what I'm trying to say... > > Regards, > > *********** REPLY SEPARATOR *********** > > On Wed, 12 Oct 2005 10:01:53 -0700, John Pennington Metta > <pen...@en...> wrote : > > >>Nicolas, >> >>This is already functional, it's just not "hooked up" in the model you >>have. >> >>I'll try to explain and you tell me if this is not what you are >>seeking. Note: I've renamed the methods, so instead of >>nitrogenBacteria() and nitrogenCycling() in testmodel.py, think of >>them as System() (as in the system of equations) and Model() (as in >>what might hold multiple systems). >> >>The simple case is that at a given timestep, the SimPy iterate() >>(within the model class) function calls the step() method of the >>chosen integrator (runge-kutta, adaptive, etc). The step method >>requires 4 arguments: an array of the governing system (the >>equations), array of the current state variable values, the time >>(SimPy.now()) and the timestep. >> >>The step() method then calls each function in a FOR loop and >>calculates a new state variable value at t given the array of state >>variables that has been calculated at time t-1 (which was passed to >>it as stated above). Since the governing equations can be anything, >>and have access to the entire array of state variables, any equation >>has full access to the values calculated at the previous timestep. >>This means, using your example that stateC could be calculated for >>time t with values for stateA and stateB that were calculated at time >>t-1. >> >>Now, as I understand it, you wish to calculate stateC at time t with >>values from stateA and stateB that were calculated at time t. This, or >> >>you wish to mix, using some values from the previous timestep and some >> >>from the current calculations. Is this correct? >> >>I've attached a new testmodel.py file to illustrate this. It's a real >>simple concept in theory. Basically, you create a list within System >>(cur_state) which holds the values at time t. You can access these >>values from within each function as you see fit (see example state >>functions). The list is empty in Model because it is populated in >>System by copying in the initial conditions. It's important to use >>Python's copy module, so you copy the VALUES and not the REFERENCES >>into the cur_state list. >> >>I don't know if this model will run as is, but it should be a good >>enough example to illustrate how to do what you need, assuming I >>understand correctly. >> >>Your English is perfectly fine. I didn't realize you were a >>francophone until you said that and I looked at your email. >> >>Cheers, >>-J >> >>Nicolas Pernetty wrote: >> >> > For instance, let's say we have a closed system : A and B have >> > effects on C and C has effects on B. >> > In a procedural language, I'll do the loop like this : >> > >> > 10: >> > computeA(stateA, outA) >> > computeB(stateB, outC, outB) >> > computeC(stateC, outA, outB, outC) >> > goto 10 >> > >> > In reality we can have a much more complex tree, so do we have to >> > somehow design a solver which deduce the tree call from the >> > informations or do we have to input the tree as well ? I think that >> > somehow it is already solved in SimPy... >> > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, downloads, discussions, > and more. http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > Pyarie-users mailing list > Pya...@li... > https://lists.sourceforge.net/lists/listinfo/pyarie-users -- John Metta (yes, my name has indeed changed...) http://oregonstate.edu/~penningj/ "A computer without windows is like a dog without bricks tied to its head." |
From: Nicolas P. <nic...@ya...> - 2005-10-13 00:46:55
|
Hello John, I seems that I haven't made myself clear( I told you that my english was not so good ;-) ). My concern was that I was looking for a convenient way for our future users to design the system. In a procedural world, users have to take care and be careful of how they place their function calls : C depends of A and B, so I have to call C _after_ calling A and B, and so on... It leads to many hassles... In the system you sent, on line 44 ("# MUST BE IN PROPER ORDER"), it appears that you also have to design it while having in mind who has to be called first. In theory, I think that you can deduce the correct tree call if you know on which systems each system has influence. If I give you A,B and C and told you that : 1) A had effect on C 2) B had effect on C You'll deduce that you have to call A and B, before C (I implicitly assume that every system has access to every state variables from previous step). So if they have a complex model, users only have to concentrate on local actions, and let the program compute if they made an error and got an algebraical loop : 1) A had effet on C 2) B had effet on C 3) C had effect on A It seems that SimPy has somehow this kind of algorithm to deduce a tree call from such informations, or am I mistaken ? For instance, we can have a cannon ball simulation with only at first the earth system (gravity) and the ball. Then come another user, who want to add atmosphere friction to this model without having to modify too much the model. All he had to do is to declare that its Atmosphere system has effect on the ball. Hope that you will understand what I'm trying to say... Regards, *********** REPLY SEPARATOR *********** On Wed, 12 Oct 2005 10:01:53 -0700, John Pennington Metta <pen...@en...> wrote : > Nicolas, > > This is already functional, it's just not "hooked up" in the model you > have. > > I'll try to explain and you tell me if this is not what you are > seeking. Note: I've renamed the methods, so instead of > nitrogenBacteria() and nitrogenCycling() in testmodel.py, think of > them as System() (as in the system of equations) and Model() (as in > what might hold multiple systems). > > The simple case is that at a given timestep, the SimPy iterate() > (within the model class) function calls the step() method of the > chosen integrator (runge-kutta, adaptive, etc). The step method > requires 4 arguments: an array of the governing system (the > equations), array of the current state variable values, the time > (SimPy.now()) and the timestep. > > The step() method then calls each function in a FOR loop and > calculates a new state variable value at t given the array of state > variables that has been calculated at time t-1 (which was passed to > it as stated above). Since the governing equations can be anything, > and have access to the entire array of state variables, any equation > has full access to the values calculated at the previous timestep. > This means, using your example that stateC could be calculated for > time t with values for stateA and stateB that were calculated at time > t-1. > > Now, as I understand it, you wish to calculate stateC at time t with > values from stateA and stateB that were calculated at time t. This, or > > you wish to mix, using some values from the previous timestep and some > > from the current calculations. Is this correct? > > I've attached a new testmodel.py file to illustrate this. It's a real > simple concept in theory. Basically, you create a list within System > (cur_state) which holds the values at time t. You can access these > values from within each function as you see fit (see example state > functions). The list is empty in Model because it is populated in > System by copying in the initial conditions. It's important to use > Python's copy module, so you copy the VALUES and not the REFERENCES > into the cur_state list. > > I don't know if this model will run as is, but it should be a good > enough example to illustrate how to do what you need, assuming I > understand correctly. > > Your English is perfectly fine. I didn't realize you were a > francophone until you said that and I looked at your email. > > Cheers, > -J > > Nicolas Pernetty wrote: > > > For instance, let's say we have a closed system : A and B have > > effects on C and C has effects on B. > > In a procedural language, I'll do the loop like this : > > > > 10: > > computeA(stateA, outA) > > computeB(stateB, outC, outB) > > computeC(stateC, outA, outB, outC) > > goto 10 > > > > In reality we can have a much more complex tree, so do we have to > > somehow design a solver which deduce the tree call from the > > informations or do we have to input the tree as well ? I think that > > somehow it is already solved in SimPy... > |
From: John P. M. <pen...@on...> - 2005-10-12 17:28:48
|
Two issues: 1: Possible merge with SimPy. Klaus is on vacation for a month, but he's interested in possibly merging some of the Pyarie functionality in SimPy, or creating a module that is usable with SimPy. For this reason, I'm splitting the tree. There will be a base system, that can be used by programmers and used with SimPy, and there will be the "bells and whistles" version that I am working on for the long term. This way, the base system should be available within a few weeks, after cleaning it up and re-organizing a bit (such as naming conventions). I'll create some simple documentation and sample models. Nicolas, if you want to include a somewhat simple version of your complex case model, we could make that part of an examples directory. 2: Current state list I've made a list in the base class called System.state. This way users can access all current calculations (time t instead of t-1) without first defining this. There is also System.update_state() method which will update the System.state list. There'll be some documentation needed for this. The quick and dirty is that you can ignore it if it's not needed. If you need it (see testmodel.py or the examples directory when it's built), use the Python copy module to copy Model.vars to system.state. Then before returning each state variables value, make a call to self.update_state(index, result). Then each equation has access to the current timestep's value (time t) through self.state[index]. Accessing x[index] then gives the value at timestep t-1. I'll try to get a beta version for the base system up soon, and put it on this and pyarie-announce. Cheers, -j -- John Metta (yes, my name has indeed changed...) http://oregonstate.edu/~penningj/ "A computer without windows is like a dog without bricks tied to its head." |
From: John P. M. <pen...@en...> - 2005-10-12 17:01:55
|
Nicolas, This is already functional, it's just not "hooked up" in the model you have. I'll try to explain and you tell me if this is not what you are seeking. Note: I've renamed the methods, so instead of nitrogenBacteria() and nitrogenCycling() in testmodel.py, think of them as System() (as in the system of equations) and Model() (as in what might hold multiple systems). The simple case is that at a given timestep, the SimPy iterate() (within the model class) function calls the step() method of the chosen integrator (runge-kutta, adaptive, etc). The step method requires 4 arguments: an array of the governing system (the equations), array of the current state variable values, the time (SimPy.now()) and the timestep. The step() method then calls each function in a FOR loop and calculates a new state variable value at t given the array of state variables that has been calculated at time t-1 (which was passed to it as stated above). Since the governing equations can be anything, and have access to the entire array of state variables, any equation has full access to the values calculated at the previous timestep. This means, using your example that stateC could be calculated for time t with values for stateA and stateB that were calculated at time t-1. Now, as I understand it, you wish to calculate stateC at time t with values from stateA and stateB that were calculated at time t. This, or you wish to mix, using some values from the previous timestep and some from the current calculations. Is this correct? I've attached a new testmodel.py file to illustrate this. It's a real simple concept in theory. Basically, you create a list within System (cur_state) which holds the values at time t. You can access these values from within each function as you see fit (see example state functions). The list is empty in Model because it is populated in System by copying in the initial conditions. It's important to use Python's copy module, so you copy the VALUES and not the REFERENCES into the cur_state list. I don't know if this model will run as is, but it should be a good enough example to illustrate how to do what you need, assuming I understand correctly. Your English is perfectly fine. I didn't realize you were a francophone until you said that and I looked at your email. Cheers, -J Nicolas Pernetty wrote: > For instance, let's say we have a closed system : A and B have effects > on C and C has effects on B. > In a procedural language, I'll do the loop like this : > > 10: > computeA(stateA, outA) > computeB(stateB, outC, outB) > computeC(stateC, outA, outB, outC) > goto 10 > > In reality we can have a much more complex tree, so do we have to > somehow design a solver which deduce the tree call from the informations > or do we have to input the tree as well ? I think that somehow it is > already solved in SimPy... -- John Metta (yes, my name has indeed changed...) http://oregonstate.edu/~penningj/ "A computer without windows is like a dog without bricks tied to its head." |
From: John P. M. <pen...@en...> - 2005-10-12 16:55:27
|
Forwarded from the SimPy users list. -------- Original Message -------- Subject: Re: [Simpy-users] Continuous system simulation in Python Date: Wed, 12 Oct 2005 03:16:59 +0200 From: Nicolas Pernetty <nic...@ya...> To: sim...@li... References: <200...@sm...>=20 <434...@en...>=20 <200...@li...>=20 <434...@en...> Hi John, I've had a long loog at Pyarie and SimPy. Good news is that I've understood almost everything (thanks to the Python clear syntax and to the comments !) and that I had no problem running your example (even managed to create new ones). I think that I can build upon your work without too much difficulties. I need some more time to digest everything and to clear my head before giving you a full review, but something that I haven't quite grasped is how can we manage multiple models/process ? For instance, let's say we have a closed system : A and B have effects on C and C has effects on B. In a procedural language, I'll do the loop like this : 10: computeA(stateA, outA) computeB(stateB, outC, outB) computeC(stateC, outA, outB, outC) goto 10 In reality we can have a much more complex tree, so do we have to somehow design a solver which deduce the tree call from the informations or do we have to input the tree as well ? I think that somehow it is already solved in SimPy... As for my line of work, I'm involved in multiple mechanical bodies simulation. For instance I can model an airplane, with the engine, the wings, gravity and atmosphere as well as an autopilot. Ok, give me at least 1-2 weeks to play and tweak with Pyarie/SimPy before fully understand what I can do with it. Thanks again for your help, P.S. : sorry for my poor english, but it's really late and I'm really tired... ;-) *********** REPLY SEPARATOR *********** On Mon, 10 Oct 2005 16:25:49 -0700, John Pennington Metta <pen...@en...> wrote : > Nicolas, >=20 > Multiple solution routines should be trivial in Pyarie. It's based on=20 > the simultaneous (with respect to timestep) solution of a system of=20 > equations. Each system (e.g. a nitrogen cycling model) is built as a=20 > class, with member functions for each equation (i.e. organic nitrogen) >=20 > or sub-routine within an equation. >=20 > The system doesn't care how the equation is solved. In other words, it >=20 > matters not whether you use mathematics or define a routine to look up >=20 > values in a table. You could even define the function in such a way > that it looks up a value and if the value can't be found in the > table, then calculates it and adds the calculated value to a table > for later use. >=20 > This all, of course, assumes that you are using the system in such a > way that each state variable is defined by a function. I'd be > interested in learning more about what you're doing and what you > need. As the documentation states, I designed this for my use in > river ecosystem modeling, but I'd like it to be as generally usable > as possible. >=20 > Cheers, > -J >=20 >=20 > Nicolas Pernetty wrote: > > Hi John, > >=20 > > Thank you for your answer. I've just downloaded the package and will > > have a look on it next week. > >=20 > > About continuous system modeling, I'm personnaly involved in > > mechanics system simulator (2-3 body linked together) and found it > > extremely difficult to design the basic sets of equation without > > approximations. Results are often hugely complex and slow. > >=20 > > We have tried to use readily available generic simulator (like > > SimMechanics) but without success. > >=20 > > We decided to assume approximation, and thus managed to dramatically > > simplify the set of equations, which we implemented 'by hand' in C. > > Problem is that such approach has to be unique and repeated each > > time someone has to design a simulator (because approximations are > > different). > >=20 > > Another constraint I have is that some parts of the simulator has to > > be run by data files. Indeed some parts are so difficult that it is > > useless to try to represent it by equations. So some other people > > use different method (like finite elements computation) and give me > > the result in the form of data files. For instance for an airplane, > > I can have time vs mass vs flow in the data file. > >=20 > > So my simulator is composed of equations, data files and some > > solver. How can I design a generic program capable of handling every > > situations is my current problem ! ;-) > >=20 > > I would be happy to build on your project (if possible) and made it > > available to the Python community... > >=20 > > I'll keep you informed of my progress, > >=20 > > Thank you again, > >=20 > > *********** REPLY SEPARATOR *********** > >=20 > > On Fri, 07 Oct 2005 08:07:34 -0700, John Pennington Metta > > <pen...@en...> wrote : > >=20 > >=20 > >>Nicolas, > >>I'm working on Pyarie (pyarie.wikisophia.org), a system designed=20 > >>(theoretically) to take an arbitrary set of equations and solve > >them, >tracking system or state variables, using a variety of > >solution >methods (Runge-Kutta, etc). > >> > >>It's functional right now, but needs a great deal of cleaning up and > >>has a lot of gaps (probability distributions, etc.). I was > >originally > > >>writing it for some modeling I'm doing for my thesis, but we took a=20 > >>different path, so it's on a bit of a hold. > >> > >>There is one version that would probably be fine for you and which=20 > >>works. It just requires the user to build his/her equations and=20 > >>variables (along with timestep, output timestep, initial conditions, > > > >>etc) into two modules. After which the model will run, and spit all > >>the state variables at each output timestep to a text file which > >you >could graph (I linked it successfully with gnuplot at one > >point, and >it ran and output graphs transparently). > >> > >>The link with SimPy is that continuous modeling is essentially > >>discrete, in that we have to solve most equations at each timestep. > >>So SimPy is the backend to the software, controlling the solution > >to >the equation as a discrete processes at the given timestep. > >> > >>For a non-programmer, the current pre-alpha version is > >non-functional, > > >>but for you it would work fine (the programming you have to do is=20 > >>essentially just entering your equations correctly). Please feel > >free >to email me if there are any questions (which there will be), > >but I >think there's still a sample model included (testmodel.py > >holds the >equations, testsimulation sets up the initial variables, > >solver, >timestep, etc.) > >> > >>Also, let me know what you'd like to, or do, change. I'm always=20 > >>interested in making this better for others. Eventually I'll clean > >it >up and publish it. > >> > >>Cheers, > >>-J > >> > >>p.s. I just noticed that some fiends completely erased every page of > >>the wiki-based home, so I'll have to modify that so no-one can edit > >>it, and replace all the information. > >> > >> > >>Klaus Muller wrote: > >> > >>>Hi Nicolas! > >>>There has been some work on continuous system simulation in Python: > >>> > >>>1) traffic simulation (using SimPy, too): > >>>http://bitsko.slc.ut.us/blog/prt-lrt-sim.html > >>>2) a paper presented at EuroPython 2005: > >>>http://www.python-in-business.org/ep2005/talk.chtml?talk=3D2273&trac > >k=3D646 >>3) an excellent book: "Python Scripting for Computational > >Science" >>by H. P. Langtangen (Springer) > >>> > >>>If you find out moe, please, let us all know. We may yet be able to > >>>make SimPy a hybrid simulation package. > >>> > >>>Klaus M=FCller > >>> > >>> > >>> > >>> > >>>>-----Original Message----- > >>>>From: sim...@li...=20 > >>>>[mailto:sim...@li...] On Behalf Of=20 > >>>>Nicolas Pernetty > >>>>Sent: Friday, October 07, 2005 1:16 AM > >>>>To: sim...@li... > >>>>Subject: [Simpy-users] Continuous system simulation in Python > >>>> > >>>>Hello, > >>>> > >>>>I'm looking for any work/paper/ressource about continuous=20 > >>>>system simulation using Python or any similar object oriented=20 > >>>>languages (or even UML theory !). > >>>> > >>>>I'm aware that SimPy is for discrete event simulation, but=20 > >>>>maybe you would have heard of any similr work on continuous=20 > >>>>system. I would like to develop a generic continous system=20 > >>>>simulator, and so would be eager to join any open source=20 > >>>>effort on the subject. > >>>> > >>>>For instance, it would be useful for modelling an airplane=20 > >>>>with all the dynamics (flight simulator). > >>>> > >>>>Python is my language of choice because of the keyword=20 > >>>>'generic'. Being an object oriented dynamic language, it's=20 > >>>>perfect for such a task. > >>>>Unfortunately I'm a novice when it comes to object oriented=20 > >>>>design and development, so I would prefer to start from=20 > >>>>something already existent instead of starting from scratch. > >>>> > >>>>If you had any idea on the subject, I would be really glad to=20 > >>>>discuss it with you. > >>>> > >>>>Thanks in advance, > >>>> > >>>> > >>>>------------------------------------------------------- > >>>>This SF.Net email is sponsored by: > >>>>Power Architecture Resource Center: Free content, downloads,=20 > >>>>discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl > >>>>_______________________________________________ > >>>>Simpy-users mailing list > >>>>Sim...@li... > >>>>https://lists.sourceforge.net/lists/listinfo/simpy-users > >>>> > >> >=20 ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ Simpy-users mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpy-users --=20 John Metta (yes, my name has indeed changed...) http://oregonstate.edu/~penningj/ "A computer without windows is like a dog without bricks tied to its head." |
From: Jonathan P. <pen...@en...> - 2005-03-01 05:21:43
|
The Pyarie users mailing list is now live. -JW -- JW Pennington | My Mind Map:http://oregonstate.edu/~penningj/ Masters Student: Bioresource Engineering & Geosciences Oregon State Univ., Wilkinson 017, Corvallis Or. 97331 "A computer without windows is like a dog without bricks tied to its head." |