<?xml version ="1.0" encoding="UTF-8"?>
<!-- ================================================================ -->
<!--                                                                  -->
<!--               Dynamic Aerospace Vehicle Exchange DTD             -->
<!--                  Function Data Representation                    -->
<!--                                                                  -->
<!--                       Version: 1.5b                              -->
<!--                      $Revision: 29 $                            -->
<!--                                                                  -->
<!--  This DTD module is identified by the PUBLIC and SYSTEM          -->
<!--  identifiers:                                                    -->
<!--                                                                  -->
<!-- PUBLIC "-//NASA//DTD for Flight Dynamic Models - Functions//EN"  -->
<!-- SYSTEM "http://dcb.larc.nasa.gov/utils/fltsim/DAVE/DAVEfunc.dtd" -->
<!--                                                                  -->
<!-- Authors:                                                         -->
<!--  E. Bruce Jackson <e.b.jackson@nasa.gov>                         -->
<!--  Bruce L. Hildreth <bruce@pax.saic.com>                          -->
<!--                                                                  -->
<!-- Purpose:                                                         -->
<!--  Proposed standard for exchanging dynamic models of aerospace    -->
<!--  vehicles, including aero, engine, gear, inertia, and control    -->
<!--  models.                                                         -->
<!--                                                                  -->
<!--  This preliminary version defines just function table formats    -->
<!--  typically associated with aerodynamic function data, but can    -->
<!--  be used to describe any non-linear multi-dimensional function.  -->
<!--                                                                  -->
<!-- Status:                                                          -->
<!--  In development. Direct comments to above authors.               -->
<!--                                                                  -->
<!-- ================================================================ -->

<!-- ================================================================ -->
<!--                                                                  -->
<!-- Acknowledgement:                                                 -->
<!--   Assistance and encouragement by Jon S. Berndt <jsb@hal-pc.org> -->
<!--   whose JSBsim aero & control law XML format was original work   -->
<!--                                                                  -->
<!-- ================================================================ -->

<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!--                         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*)>

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

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

<!ELEMENT fileHeader (author, fileCreationDate, description?,
                       reference*, modificationRecord*)>
<!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. Note the breakpoint values are -->
<!--  specified separately since one input signal may be normalized   -->
<!--  to more than one breakpoint set (for gridded function data).    -->
<!-- ================================================================ -->

<!ELEMENT variableDef (description?, calculation?, isOutput?)>
<!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
>

<!-- ================================================================ -->
<!-- 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
>

<!ELEMENT bpVals (#PCDATA)>

<!-- ================================================================ -->
<!-- A griddedTableDef is where gridded table data points are given.  -->
<!--  This optional element is separate from actual function decla-   -->
<!--  rations and thus may be reused.                                 -->
<!-- ================================================================ -->

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

<!-- ================================================================ -->
<!-- An ungriddedTableDef is where ungridded table data is given.     -->
<!--  This optional element is separate from actual function decla-   -->
<!--  rations and thus may be reused.                                 -->
<!-- ================================================================ -->

<!ELEMENT ungriddedTableDef ( description?, provenance?, confidenceBound?, 
        dataPoint+ )>
<!ATTLIST ungriddedTableDef
        name            CDATA #IMPLIED
        utID            ID    #REQUIRED 
        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?, 
      (
        (independentVarPts+, dependentVarPts) | 
        (independentVarRef+, dependentVarRef, functionDefn)
      )
  )
>
<!ATTLIST function
        name     CDATA #REQUIRED
>

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

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

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

<!-- ================================================================ -->
<!-- fileCreationDate is simply a string with a date in it.           -->
<!-- ================================================================ -->

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

<!-- ================================================================ -->
<!-- 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.-->
<!-- ================================================================ -->

<!ELEMENT isOutput EMPTY>

<!-- ================================================================ -->
<!-- optional calculation element is MathML 2 content markup          -->
<!-- describing how something is calculated.                          -->
<!-- ================================================================ -->
<!ENTITY  % mathml PUBLIC "-//W3C//DTD MathML 2.0//EN"
           "http://www.w3.org/TR/MathML2/dtd/mathml2.dtd">
%mathml; 
<!ELEMENT calculation (math)>


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

<!ELEMENT reference EMPTY>
<!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 modification event with an ID -->
<!-- ================================================================ -->

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

<!-- ================================================================ -->
<!-- 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*)>

<!-- ================================================================ -->
<!-- An independentVarPts element is a simple list of breakpoints   -->
<!--  and contains name, units, and sign convention attributes.       -->
<!--  An optional extrapolate attribute describes how to extrapolate  -->
<!--  the output value when the input value exceeds specified values. -->
<!-- ================================================================ -->

<!ELEMENT independentVarPts (#PCDATA)>
<!ATTLIST independentVarPts 
        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 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.    -->
<!-- ================================================================ -->

<!ELEMENT dependentVarPts (#PCDATA)>
<!ATTLIST dependentVarPts 
        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 function_defn 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 | griddedTable | ungriddedTableRef | 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>

<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!--                         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. -->
<!-- ================================================================ -->

<!ELEMENT confidenceBound EMPTY>
<!ATTLIST confidenceBound value CDATA #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.       -->
<!-- ================================================================ -->

<!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
>

<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!--                         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>

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