<?xml version="1.0" encoding="UTF-8"?>
<!-- =================================================================

                   Dynamic Aerospace Vehicle Exchange DTD            
                        Function Data Representation                   
                                                                
                              Version: 1.7b1                             
                             $Revision: 47 $                           
                                                                
    This DTD module is identified by these PUBLIC and SYSTEM       
    identifiers:                                                   
                                                                
    PUBLIC "-//NASA//DTD for Flight Dynamic Models - Functions//EN" 
    SYSTEM "http://dcb.larc.nasa.gov/utils/fltsim/DAVE/DAVEfunc.dtd"
                                                                
    Developed by:

      American Institute of Aeronautics and Astronautics (AIAA)
      Modeling & Simulation Technical Committee
      Simulation Modeling Standards Subcommittee

    Contact information:

      E. Bruce Jackson <mailto:e.b.jackson@nasa.gov>
      Bruce L. Hildreth <mailto:bruce.hildreth@saic.com>                         
      <http://dcb.larc.nasa.gov/utils/fltsim/DAVE/index.html>

    Purpose: 

      Proposed standard for exchanging dynamic models of aerospace
      vehicles, including aero, engine, gear, inertia, and control
      models.
                                                                
      This preliminary version defines static models typically
      associated with aerodynamic subsystem models, but can be used to
      describe any non-linear multi-dimensional function.
                                                                
    Status:                                                         
      In development. Direct comments to above contacts.

  
     ================================================================= -->

<!-- =================================================================


    Acknowledgements:                                                

      Assistance and encouragement by Jon S. Berndt
      <jsb@hal-pc.org> whose JSBsim aero & control law XML
      format was original work.  Extensive testing, collaboration, and
      encouragement from both Bill Cleveland
      <wcleveland@mail.arc.nasa.gov> and Brent York
      <brent.york@navy.mil> who were the real beta testers.

  
     ================================================================= -->


<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!--                         Level 0 Elements                         -->
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<!-- =================================================================

      Root element is DAVEfunc, composed of a file header element
      followed by 1 or more variable definitions and 0 or more break
      point definitions, gridded or ungridded table definitions, and
      function elements.
    
     ================================================================= -->

<!ELEMENT DAVEfunc 
     (fileHeader, variableDef+, breakpointDef*, griddedTableDef*, ungriddedTableDef*, function*, checkData*)
>



<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!--                         Level 1 Elements                         -->
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<!-- =================================================================

      The header element requires an author, a creation date and a
      version indicator; optional content are description, references
      and mod records.
    
     ================================================================= -->

<!ELEMENT fileHeader 
     (author, fileCreationDate, fileVersion?, description?, reference*, modificationRecord*, provenance*)
>
<!ATTLIST fileHeader
     name	CDATA	#IMPLIED
>

<!-- =================================================================

      variableDef elements provide wiring information - that is, they
      identify the input and output signals used by these function
      blocks. They also provide MathML content markup to indicate any
      calculation required to arrive at the value of the variable,
      using other variables as inputs.  The variable definition can
      include statistical information regarding the uncertainty of the
      values which it might take on, when measured after any
      calculation is performed.
    
     ================================================================= -->

<!ELEMENT variableDef 
     (description?, calculation?, isOutput?, uncertainty?)
>
<!ATTLIST variableDef
     name	CDATA	#REQUIRED
     varID	ID	#REQUIRED
     units	CDATA	#REQUIRED
     axisSystem	CDATA	#IMPLIED
     sign	CDATA	#IMPLIED
     alias	CDATA	#IMPLIED
     symbol	CDATA	#IMPLIED
     initialValue	CDATA	#IMPLIED
>

<!ELEMENT variableRef EMPTY>
<!ATTLIST variableRef
     varID	IDREF	#REQUIRED
>

<!-- =================================================================

      A breakpointDef is where gridded table breakpoints are given.
      Since these are separate from function data, may be reused.
    
     ================================================================= -->

<!ELEMENT breakpointDef 
     (description?, bpVals)
>
<!ATTLIST breakpointDef
     name	CDATA	#IMPLIED
     bpID	ID	#REQUIRED
     units	CDATA	#IMPLIED
>

<!-- =================================================================

      bpVals is a set of breakpoints; that is, a set of independent
      variable values associated with one dimension of a gridded table
      of data. An example would be the Mach or angle-of-attack values
      that define the coordinates of each data point in a
      two-dimensional coefficient value table.
    
     ================================================================= -->

<!ELEMENT bpVals (#PCDATA)>


<!-- =================================================================

      A griddedTableDef contains points arranged in an orthogonal (but
      multi-dimensional) array, where the independent variables are
      defined by separate breakpoint vectors.  This table definition
      is specified separately from the actual function declaration and
      requires an XML identifier attribute so that it may be used by
      multiple functions.  The table data point values are specified
      as comma-separated values in floating-point notation
      (0.93638E-06) in a single long sequence as if the table had been
      unraveled with the last-specified dimension changing most
      rapidly.  Line breaks are to be ignored. Comments may be
      embedded in the table to promote [human] readability.
    
     ================================================================= -->

<!ELEMENT griddedTableDef 
     (description?, 
     (provenance? | provenanceRef?)
, breakpointRefs, uncertainty?, dataTable)
>
<!ATTLIST griddedTableDef
     name	CDATA	#IMPLIED
     gtID	ID	#IMPLIED
     units	CDATA	#IMPLIED
>

<!-- =================================================================

      An ungriddedTableDef contains points that are not in an
      orthogonal grid pattern; thus, the independent variable
      coordinates are specified for each dependent variable value.
      This table definition is specified separately from the actual
      function declaration and requires an XML identifier attribute so
      that it may be used by multiple functions.
    
     ================================================================= -->

<!ELEMENT ungriddedTableDef 
     (description?, 
     (provenance? | provenanceRef?)
, uncertainty?, dataPoint+)
>
<!ATTLIST ungriddedTableDef
     name	CDATA	#IMPLIED
     utID	ID	#IMPLIED
     units	CDATA	#IMPLIED
>

<!-- =================================================================

      Each function has optional description, optional provenance, and
      either a simple input/output values or references to more
      complete (possible multiple) input, output, and function data
      elements.
    
     ================================================================= -->

<!ELEMENT function 
     (description?, 
     (provenance? | provenanceRef?)
, 
     (
     (independentVarPts+, dependentVarPts)
 | 
     (independentVarRef+, dependentVarRef, functionDefn)
)
)
>
<!ATTLIST function
     name	CDATA	#REQUIRED
>

<!-- =================================================================

      This top-level element is the placeholder for verification data of various forms. It will
      include static check cases, trim shots, and dynamic check case information.
    
     ================================================================= -->

<!ELEMENT checkData 
     (staticShot*)
>



<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!--                         Level 2 Elements                         -->
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<!-- =================================================================

      author includes alternate means of identifying author using    
      XNS or normal e-mail/address                                    
    
     ================================================================= -->

<!ELEMENT author (address?)>
<!ATTLIST author
     name	CDATA	#REQUIRED
     org	CDATA	#REQUIRED
     xns	CDATA	#IMPLIED
     email	CDATA	#IMPLIED
>

<!-- =================================================================

      fileCreationDate is simply a string with a date in it.  We
      follow ISO 8601 and use dates like "2004-01-02" to refer to
      January 2, 2004.
    
     ================================================================= -->

<!ELEMENT fileCreationDate EMPTY>
<!ATTLIST fileCreationDate
     date	CDATA	#REQUIRED
>

<!-- =================================================================

      This is a string describing, in some arbitrary text, the version
      identifier for this function description.
    
     ================================================================= -->

<!ELEMENT fileVersion (#PCDATA)>


<!-- =================================================================

      optional description is free-form text describing something.
    
     ================================================================= -->

<!ELEMENT description (#PCDATA)>


<!-- =================================================================

      Optional isOutput element signals a variable that should be
      forced to be an output, even if it is used as an input
      elsewhere. Otherwise, using program should assume a signal
      defined with no calculation is an input; a signal defined with a
      calculation but not used elsewhere is an output; and a signal
      defined as a calculation and used subsequently in the model is
      an internal signal.
    
     ================================================================= -->

<!ELEMENT isOutput EMPTY>


<!-- =================================================================

      Optional calculation element is MathML 2 content markup
      describing how the signal is calculated.
    
     ================================================================= -->

<!ELEMENT calculation (mathml2:math)>
<!ATTLIST calculation
     xmlns:mathml2	CDATA	#FIXED	'http://www.w3.org/TR/MathML2'
>

<!-- =================================================================

      A reference element associates an external document with an ID
      making use of XLink semantics.
    
     ================================================================= -->

<!ELEMENT reference (description?)>
<!ATTLIST reference
     xmlns:xlink	CDATA	#FIXED	'http://www.w3.org/1999/xlink'
     xlink:type	(simple)	#FIXED	'simple'
     refID	ID	#REQUIRED
     author	CDATA	#REQUIRED
     title	CDATA	#REQUIRED
     accession	CDATA	#IMPLIED
     date	CDATA	#REQUIRED
     xlink:href	CDATA	#IMPLIED
>

<!-- =================================================================

      A modificationRecord associates a single letter (such as
      modification "A") with a modification author, address, and any
      optional external reference documents, in keeping with the AIAA
      draft standard.
    
     ================================================================= -->

<!ELEMENT modificationRecord 
     (author, description?, extraDocRef*)
>
<!ATTLIST modificationRecord
     modID	ID	#REQUIRED
     refID	IDREF	#IMPLIED
>

<!-- =================================================================

      A single modification event may have more than one documented
      reference. This element can be used in place of the refID
      attribute in a modificationRecord to record more than one
      refIDs, pointing to the referenced document.
    
     ================================================================= -->

<!ELEMENT extraDocRef EMPTY>
<!ATTLIST extraDocRef
     refID	IDREF	#REQUIRED
>

<!-- =================================================================

      optional provenance describes history or source of data and
      includes author, date, and zero or more references to documents
      and modification records.
    
     ================================================================= -->

<!ELEMENT provenance 
     (author, functionCreationDate, documentRef*, modificationRef*)
>
<!ATTLIST provenance
     provID	ID	#IMPLIED
>

<!-- =================================================================
 
      When the provenance of a set of several data is identical, the
      first provenance element may be given a provID and referenced by
      later data elements as a space-saving measure.
    
     ================================================================= -->

<!ELEMENT provenanceRef EMPTY>
<!ATTLIST provenanceRef
     provID	IDREF	#REQUIRED
>

<!-- =================================================================

      An independentVarPts element is a simple list of breakpoints and
      contains a mandatory varID identifier as well as optional name,
      units, and sign convention attributes.  An optional extrapolate
      attribute describes how to extrapolate the output value when the
      input value exceeds specified values. This element is used for
      simple functions that don't share breakpoint or table values
      with other functions.
    
     ================================================================= -->

<!ELEMENT independentVarPts (#PCDATA)>
<!ATTLIST independentVarPts
     varID	IDREF	#REQUIRED
     name	CDATA	#IMPLIED
     units	CDATA	#IMPLIED
     sign	CDATA	#IMPLIED
     extrapolate	(neither | min | max | both) #IMPLIED
>

<!-- =================================================================

      A dependentVarPts element is a simple of function values and
      contains a mandatory varID as well as optional name, units, and
      sign convention attributes.  Data points are arranged as single
      vector with last-specified breakpoint values changing most
      frequently. Note that the number of dependent values must equal
      the product of the number of independent values for this simple,
      gridded, realization.  This element is used for simple functions
      that don't share breakpoint or table values with other
      functions.
    
     ================================================================= -->

<!ELEMENT dependentVarPts (#PCDATA)>
<!ATTLIST dependentVarPts
     varID	IDREF	#REQUIRED
     name	CDATA	#IMPLIED
     units	CDATA	#IMPLIED
     sign	CDATA	#IMPLIED
>

<!-- =================================================================

      An independentVarRef more fully describes the input mapping of
      the function by pointing to a separate breakpoint definition
      element. This allows common breakpoint values for many tables.
    
     ================================================================= -->

<!ELEMENT independentVarRef EMPTY>
<!ATTLIST independentVarRef
     varID	IDREF	#REQUIRED
     min	CDATA	#IMPLIED
     max	CDATA	#IMPLIED
     extrapolate	(neither | min | max | both) #IMPLIED
>

<!-- =================================================================

      A dependentVarRef ties the output of a function to a signal name
      defined previously in a variable definition.
    
     ================================================================= -->

<!ELEMENT dependentVarRef EMPTY>
<!ATTLIST dependentVarRef
     varID	IDREF	#REQUIRED
>

<!-- =================================================================

      A functionDefn defines how function is represented in one of two
      possible ways: gridded (implies breakpoints), or ungridded (with
      explicit independent values for each point).
    
     ================================================================= -->

<!ELEMENT functionDefn 
     (griddedTableRef | griddedTableDef | griddedTable | ungriddedTableRef | ungriddedTableDef | ungriddedTable)
>
<!ATTLIST functionDefn
     name	CDATA	#IMPLIED
>


<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!--                         Level 3 Elements                         -->
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<!ELEMENT address (#PCDATA)>


<!ELEMENT functionCreationDate EMPTY>
<!ATTLIST functionCreationDate
     date	CDATA	#REQUIRED
>

<!ELEMENT documentRef EMPTY>
<!ATTLIST documentRef
     docID	IDREF	#REQUIRED
>

<!ELEMENT modificationRef EMPTY>
<!ATTLIST modificationRef
     modID	IDREF	#REQUIRED
>

<!ELEMENT griddedTableRef EMPTY>
<!ATTLIST griddedTableRef
     gtID	IDREF	#REQUIRED
>

<!ELEMENT griddedTable 
     (breakpointRefs, confidenceBound?, dataTable)
>
<!ATTLIST griddedTable
     name	CDATA	#IMPLIED
>

<!ELEMENT ungriddedTableRef EMPTY>
<!ATTLIST ungriddedTableRef
     gtID	IDREF	#REQUIRED
>

<!ELEMENT ungriddedTable 
     (confidenceBound?, dataPoint+)
>
<!ATTLIST ungriddedTable
     name	CDATA	#IMPLIED
>

<!-- =================================================================

      Contains a description of the inputs and outputs, and possibly internal values, of a DAVE-ML
      model in a particular instant of time.
    
     ================================================================= -->

<!ELEMENT staticShot 
     (checkInputs, internalValues?, checkOutputs)
>
<!ATTLIST staticShot
     name	CDATA	#REQUIRED
     refID	IDREF	#IMPLIED
>


<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!--                         Level 4 Elements                         -->
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<!-- =================================================================

      The breakpointRefs elements tie the independent variable names
      for the function to specific breakpoint values defined earlier.
    
     ================================================================= -->

<!ELEMENT breakpointRefs (bpRef+)>


<!-- =================================================================

      The confidenceBound element is used to declare the confidence
      interval associated with the data table. This is a placeholder
      and will be removed in a future version of DAVE-ML.
    
     ================================================================= -->

<!ELEMENT confidenceBound EMPTY>
<!ATTLIST confidenceBound
     value	CDATA	#REQUIRED
>

<!-- =================================================================

      This optional element is used in function and parameter
      definitions to describe statistical variance in the possible
      value of that function or parameter value. Only Gaussian
      (normal) or uniform distributions of continuous random variable
      distribution functions are supported.
    
     ================================================================= -->

<!ELEMENT uncertainty 
     (normalPDF | uniformPDF)
>
<!ATTLIST uncertainty
     effect	(additive | multiplicative | percentage | absolute) #REQUIRED
>

<!-- =================================================================

      The dataTable element is used by gridded tables where the indep.
      variable values are implied by breakpoint sets. Thus, the data
      embedded between the dataTable element tags is expected to be
      sorted ASCII values of the gridded table, wherein the last
      independent variable listed in the function header varies most
      rapidly. Values are comma or whitespace separated values.

      A dataTable element can also be used in an uncertainty element
      to provide duplicate uncertainty bound values.
    
     ================================================================= -->

<!ELEMENT dataTable (#PCDATA)>


<!-- =================================================================

      The dataPoint element is used by ungridded tables to list the
      values of independent variables that are associated with each
      value of dependent variable. For example:
                                                                 
 <dataPoint>                                                     
   0.1, -4.0, 0.2      <!- Mach, alpha, CL ->                    
 </dataPoint>                                                    
 <dataPoint>                                                     
   0.1,  0.0, 0.6      <!- Mach, alpha  CL ->                    
 </dataPoint>                                                    
                                                                 
      Each data point may have associated with it a modification tag
      to document the genesis of that particular point.  No
      requirement on ordering of independent variables is implied.
      Since this is a ungridded table, the intepreting application is
      required to handle what may be unsorted data.
    
     ================================================================= -->

<!ELEMENT dataPoint (#PCDATA)>
<!ATTLIST dataPoint
     modID	IDREF	#IMPLIED
>

<!-- =================================================================
Specifies the contents of the input vector for the given check case.
     ================================================================= -->

<!ELEMENT checkInputs (signal+)>


<!-- =================================================================

      Provides a set of all internal variable values to assist in debugging recalcitrant
      implementations of DAVE-ML import tools.
    
     ================================================================= -->

<!ELEMENT internalValues (signal+)>


<!-- =================================================================
Specifies the contents of the output vector for the given check case.
     ================================================================= -->

<!ELEMENT checkOutputs (signal+)>



<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!--                         Level 5 Elements                         -->
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<!-- =================================================================

      The bpRef element provides references to breakpoint lists so
      breakpoints can be defined separately from, and reused by,
      several data tables.
    
     ================================================================= -->

<!ELEMENT bpRef EMPTY>
<!ATTLIST bpRef
     bpID	IDREF	#REQUIRED
>

<!-- =================================================================

      In a normally distributed random variable, a symmetrical
      distribution of given standard deviation is assumed about the
      nominal value (which is given elsewhere in the parent element).
    
     ================================================================= -->

<!ELEMENT normalPDF (bounds)>
<!ATTLIST normalPDF
     numSigmas	CDATA	#REQUIRED
>

<!-- =================================================================

      In a uniformly distributed random variable, the value of the
      parameter has equal likelihood of assuming any value within the
      (possibly asymmetric) bounds, which must bracket the nominal
      value (which is given elsewhere in the parent element).
    
     ================================================================= -->

<!ELEMENT uniformPDF (bounds+)>
<!ATTLIST uniformPDF
     symmetric	(yes | no) #REQUIRED
>

<!-- =================================================================

      This element contains some description of the statistical limits
      to the values the citing parameter element might take on. This
      can be in the form of a scalar value, a[n] [un]griddedTableRef
      reference to an existing table definition, or a private
      [un]griddedTableDef, or a private table. In the case of formal
      table references or definitions, these tables define their own
      dependency, independent of the underlying random variable (whose
      nominal value is probably specified in a parent table
      definition). In the more common instance, this element will
      either be a scalar constant value or a simple table, whose
      dimensions must match the parent nominal function table and
      whose independent variables are identical to the nominal
      table. It is also possible that this limit be determined by an
      independent variable.
    
     ================================================================= -->

<!ELEMENT bounds 
     (#PCDATA | griddedTableRef | ungriddedTableRef | griddedTableDef | ungriddedTableDef | dataTable | variableDef | variableRef)*
>


<!-- =================================================================

      This element is used to document the name, ID, value, tolerance, and units of measure for
      checkcases. When used with checkInputs or checkOutputs, the signalName subelement must be
      present (since check cases are viewed from "outside" the model); when used in an
      internalValues element, the signalID subelement should be used to identify the signal by ID
      (which is the model-unique internal reference for each signal). When used in a checkOutputs
      vector, the tol element must be present.
    
     ================================================================= -->

<!ELEMENT signal 
     (
     (
     (signalName, signalUnits?)
 | 
     (signalID)
)
, signalValue, tol?)
>



<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!--                         Level 6 Elements                         -->
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<!-- =================================================================

      Used inside a checkCase element to specify the input or output variable name
    
     ================================================================= -->

<!ELEMENT signalName (#PCDATA)>


<!-- =================================================================

      Used inside a checkCase element to specify the input or output varID
    
     ================================================================= -->

<!ELEMENT signalID (#PCDATA)>


<!-- =================================================================

      Used inside a checkCase element to specify the units-of-measure for an input or output
      variable, for verification of proper implementation of a model.
    
     ================================================================= -->

<!ELEMENT signalUnits (#PCDATA)>


<!-- =================================================================

      Used inside a checkCase element to give the current value of an internal signal or
      input/output variable, for verification of proper implementation of a model.
    
     ================================================================= -->

<!ELEMENT signalValue (#PCDATA)>


<!-- =================================================================

      This element specifies the allowable tolerance of error in an output value such that the model
      can be considered verified. It is assumed all uncertainty is removed in performing the model
      calculations.
    
     ================================================================= -->

<!ELEMENT tol (#PCDATA)>


