Arquimedes Canedo
Wed, 16 Dec 2009 17:41:13 -0800
Peter, and all readers,
Thank you for getting me started with these concepts. It is really interesting. Maybe it is my limited understanding of acausality, but I am still trying to make the connection between the acausal system and causal systems. You partially agreed that the compiler is automatically transforming the acausal into a causal form, with the exception of simultaneous systems of equations that remain acausal. A fundamental question would be this. Is acausality a concept that facilitates the high-level abstraction of continuous system descriptions ? It seems that this is what enables Modelica to have its elegant semantics. The compiler is doing all necessary arrangements to transform the mathematical (at the highest level of abstraction) description of systems into a causal implementation needed by execution in a computer. I've been reading about the topic and I found this interesting comparison: http://www.claytex.com/Products/Dymola/ModellingMethod/tabid/193/Default.aspx Although they show how the Modelica has a cleaner representation, in the end, its compiler derives the context and decides between one of the possible variations in the block-diagram. If my guess is right, the generated code is most of the time, in causal form. However, the way we describe the systems is acausal, and this paradigm gives us much flexibility and power. Best Regards, Arquimedes On Thu, Dec 17, 2009 at 2:23 AM, Peter Fritzson <pe...@ida.liu.se> wrote: > Dear Arquimedes, > see below. > > -----Original Message----- > From: owner-openmodelicainter...@ida.liu.se > [mailto:owner-openmodelicainter...@ida.liu.se] On Behalf Of Arquimedes > Canedo > Sent: den 16 december 2009 05:25 > To: OpenModelicaInterest@ida.liu.se > Subject: Acausal systems modelling and compilation > > Hello, > > > I am new to Modelica and the acausal paradigm of system design. I am > familiar with the causal block-diagram notation but it seems that Modelica > is just a different world. I am also learning about the underlying > mathematics of Modelica. > > I have several questions about the compilation of acausal systems into > simulation code and I hope this is the right place to ask them. > > I have read the Open Modelica Compiler Phases document and it gives a very > good high-level perspective on how the omc works. I have also read some of > the related papers on the omc compiler and this is where things start > getting fuzzy. > > While I can see the benefit of ordering the dependency matrix in BLT form > for reducing the reaching definitions of variables for parallelization, I > don't fully understand why this step is necessary for generating > uniprocessor code. Is it to reduce the complexity of the matrix manipulation > algorithms ? How does the BLT form affect the quality of the generated code, > in the case of uniprocessor ?. > > - This is to generate more efficient code, e.g. many simple blocks in the > BLT form > can be transformed into assignment statements. > > Concerning the numerical solver selection, I have seen the ongoing > discussion about DAEs with index > 1. It seems that DAEs are passed to the > index reduction and if the resulting system has an index == 1 then we can > easily solve with fixed-step ODE solvers, Runge-Kutta methods for example. > However, if the index > 1, are we forced to use DASSL ?. > > - You are mixing the issues of index reduction and solver. > The index is automatically reduced to 1. > DASSL can handle DAEs, but not high index. > > > What criteria does openmodelica apply for the selection of DASSL or Euler ? > > - OpenMOdelica always uses DASSL. (Some experimental versions used Euler) > > I know this is highly dependent on the problem itself, but how often do you > get systems with index >= 2 ? How do you handle them ?, is it possible to > apply index reduction again and again until we reach our target ? > > - Most mechanical system models (e.g. from MultiBody) are index 3. > > > Finally, I would like to ask about the meaning of 'acausality' inside a > Modelica compiler, openmodelica in this case. After deciding the ordering of > equations based on their data dependencies and scheduling them, aren't we > transforming the 'acausal' system into a 'causal' one ? > > - Yes, the compiler is automatically transforming a acausal system into > a partly causal implementation (but subsystems in the BLT having 2 or more > variables, > are still acausal simultaneous systems of equations) > > > Thank you, > > Arquimedes > > Best regards, > > Peter Fritzson > > >