Re: Calculation order
At 7:34 PM +0100 11/24/06, Giovanni A. Cignoni wrote: Hi there, thank for the new versions of the files. Now we are facing another problem regarding the order of definitions and uses of variables. The reference manual of DAVE-ML states that "variableDefs should appear in calculation order" (page 9 of v. 1.9b2). That "should" is a requirement or just a good practice suggestion? In the F16 dml there are two cases of variables used before they are defined (details by G. Mirri are in the following). I suppose that, at this point in the development of DAVE-ML, the true requirement is that definitions and uses may appear not in order, but an ordering must be possible: - writing them in order is just a good practice for the readability of the XML; - if an ordering is not possible (there is a cycle) the DAVE-ML is not valid. Is this right? Thanks in advance, Giovanni A. Cignoni. Dr. Cignoni, I have posted an updated F-16 subsonic aerodynamics example model on the DAVE-ML website <http://daveml.nasa.gov/examples.html> that has the variableDefs sorted correctly. I will be amplifying the paragraph on variableDefs in the next version of the reference manual <http://daveml.nasa.gov/DTDs.html> to read: The variableDefs should appear in calculation order; that is, a variableDef should not appear before the definitions of variables upon which it is dependent. This is good practice since doing so avoids a circular reference. If a variable depends upon the output (dependentVar) of a function it can be assumed that dependence has been met, since functions are defined later in the DAVEfunc element. Thanks for the excellent feedback, and I'm sorry to not have caught this obvious poor example. -- Bruce Jackson -- Bruce Jackson <[EMAIL PROTECTED]> Dynamic Systems & Control Branch 8 Langley Boulevard, MS 308 Research & Technology Directorate NASA Langley Research Center Hampton, Virginia 23681 More info about DAVE-ML: <http://daveml.nasa.gov> Simulation standards discussion listserv mailto:simstds@larc.nasa.gov
Re: Calculation order
At 7:34 PM +0100 11/24/06, Giovanni A. Cignoni wrote: Hi there, thank for the new versions of the files. Now we are facing another problem regarding the order of definitions and uses of variables. The reference manual of DAVE-ML states that "variableDefs should appear in calculation order" (page 9 of v. 1.9b2). That "should" is a requirement or just a good practice suggestion? In the F16 dml there are two cases of variables used before they are defined (details by G. Mirri are in the following). I suppose that, at this point in the development of DAVE-ML, the true requirement is that definitions and uses may appear not in order, but an ordering must be possible: - writing them in order is just a good practice for the readability of the XML; - if an ordering is not possible (there is a cycle) the DAVE-ML is not valid. Is this right? Thanks in advance, Giovanni A. Cignoni. --- F16_aero.dml Revision: 108 - line 372: definition of variable "cl1" refers to variable "clt" in the calculation block (at line 379), but variable "clt" is not yet defined (it will be defined later at line 488); - line 395: definition of variable "cn1" refers to variable "cnt" in the calculation block (at line 402), but variable "cnt" is not yet defined (it will be defined later at line 519). Giovanni, Thanks again for finding and report this mistake. It would appear, then, that variableDef order is NOT important, but I still think it is a good idea. As Dan Newman pointed out in his reply, problems may occur with some processors if functions are defined out-of-order. Your two suggestions are probably exactly right. It IS good practice (IMHO) to define the variables in the order they will be used; if this is not possible, we could end up with a circular reference which would (for a static model) indicate a problem. I will fix the F16 model and reword the reference guide. Thanks again for finding these bugs! -- Bruce Jackson -- Bruce Jackson <[EMAIL PROTECTED]> or http://public.xdi.org/=bjax Dynamic Systems & Control BranchResearch & Technology Directorate 8 Langley Boulevard, MS 308 NASA Langley Research Center Building 1232, Room 316 Hampton, VA 23681-0001 scud://N 37 05'31.7" W 76 22'55.1" http://dcb.larc.nasa.gov/DCBStaff/ebj/ebj.html "There is no try"
Re: Calculation order
It is good practice to order all the various definitions, for the benefit of human readers. However, the XML standard, to which parsers should conform, requires that data loaded to a DOM from and XML file preserves the parent-child-sibling relationships but not necessarily the order of data in the source XML file (although most parsers seem to preserve order, it should not be relied on). The ordering is not normally a problem for variableDefs, but it may be problematic for Functions, since they can be inter-dependent. Depending on how many passes through the dataset you are prepared to do while first loading the DOM, it may be necessary to require functions to be defined in an order of increasing inter-dependence. Regards, Dan Newman on 25/11/06 05:34 Giovanni A. Cignoni said the following: > Hi there, > > thank for the new versions of the files. > > Now we are facing another problem regarding the order of definitions > and uses of variables. The reference manual of DAVE-ML states that > "variableDefs should appear in calculation order" (page 9 of v. 1.9b2). > > That "should" is a requirement or just a good practice suggestion? > > In the F16 dml there are two cases of variables used before they are > defined (details by G. Mirri are in the following). > > I suppose that, at this point in the development of DAVE-ML, the true > requirement is that definitions and uses may appear not in order, but an > ordering must be possible: > - writing them in order is just a good practice for the readability of > the XML; > - if an ordering is not possible (there is a cycle) the DAVE-ML is not > valid. > > Is this right? > > Thanks in advance, > Giovanni A. Cignoni. > > > --- > > > F16_aero.dml Revision: 108 > > - line 372: definition of variable "cl1" refers to variable "clt" in >the calculation block (at line 379), but variable "clt" is not yet > defined >(it will be defined later at line 488); > > - line 395: definition of variable "cn1" refers to variable "cnt" in >the calculation block (at line 402), but variable "cnt" is not yet > defined >(it will be defined later at line 519). > >
Calculation order
Hi there, thank for the new versions of the files. Now we are facing another problem regarding the order of definitions and uses of variables. The reference manual of DAVE-ML states that "variableDefs should appear in calculation order" (page 9 of v. 1.9b2). That "should" is a requirement or just a good practice suggestion? In the F16 dml there are two cases of variables used before they are defined (details by G. Mirri are in the following). I suppose that, at this point in the development of DAVE-ML, the true requirement is that definitions and uses may appear not in order, but an ordering must be possible: - writing them in order is just a good practice for the readability of the XML; - if an ordering is not possible (there is a cycle) the DAVE-ML is not valid. Is this right? Thanks in advance, Giovanni A. Cignoni. --- F16_aero.dml Revision: 108 - line 372: definition of variable "cl1" refers to variable "clt" in the calculation block (at line 379), but variable "clt" is not yet defined (it will be defined later at line 488); - line 395: definition of variable "cn1" refers to variable "cnt" in the calculation block (at line 402), but variable "cnt" is not yet defined (it will be defined later at line 519).