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

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

<!--

              Dynamic Aerospace Vehicle Exchange DTD            
                 Function Data Representation                   
                                                                
                      Version: 1.5b2                             
                     $Revision: 29 $                           
                                                                
 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"
                                                                
Authors:                                                        
 E. Bruce Jackson <[email protected]>                        
 Bruce L. Hildreth <[email protected]>                         
                                                                
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 <[email protected]>
  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, a creation date and a
      version indicator; optional content are description, references
      and mod records.
    -->
<!-- ================================================================ -->

<!ELEMENT fileHeader 
     ((author), (fileCreationDate), (fileVersion?), (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
>

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

<!ELEMENT griddedTableDef 
     ((description?), (provenance?), (breakpointRefs), (confidenceBound?), (dataTable))
>
<!ATTLIST griddedTableDef
     name	CDATA	#IMPLIED
     gtID	ID	#REQUIRED
     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?), (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 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.-->
<!-- ================================================================ -->

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


<!ENTITY % mathml PUBLIC "-//W3C//DTD MathML 2.0//EN"
        "http://www.w3.org/TR/MathML2/dtd/mathml2.dtd">
%mathml;

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

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


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