One-Layer Atmosphere Model - MathML
<?xml version="1.0" encoding="UTF-8"?>
<!--Xholon Workbook http://www.primordion.com/Xholon/wb/ (C) Ken Webb Thu May 10 2012 11:07:29 GMT-0400 (EDT)-->
<XholonWorkbook>
<Notes><![CDATA[
Xholon
------
Title: One-Layer Atmosphere Model - MathML
Description:
Url: http://www.w3.org/Math/
InternalName:
YoutubeId:
Keywords:
My Notes
--------
Mathematical Markup Language (MathML) is a standard neutral way to represent the structure of mathematical behavior. Using the MathML content syntax, it should be possible to generate code in any programming language, including Java and JavaScript which are my initial concern.
There are two basic types of MathML elements.
Content MathML ::
"to provide an explicit encoding of the underlying mathematical meaning of an expression"
This workbook mostly uses content MathML.
http://www.w3.org/TR/MathML3/chapter4.html
Presentation MathML ::
"to describe the layout structure of mathematical notation"
http://www.w3.org/TR/MathML3/chapter3.html
Wolfram Research provides a number of useful MathML tools, including a validation tool ::
http://www.mathmlcentral.com/Tools/ValidateMathML.jsp
and a tool that converts a MathML expression into various other formats (GIF, InputForm, JPEG, OutputForm, XHTML) ::
http://www.mathmlcentral.com/Tools/FromMathML.jsp
Try the Worlfram tools with the MathML in the TheSystem editor below.
The InputForm result looks like ::
solarConstantDivFour = solarConstant/4
and the OutputForm result ::
solarConstant
solarConstantDivFour = -------------
4
See also ::
http://en.wikipedia.org/wiki/MathML
http://www2.ph.ed.ac.uk/snuggletex/documentation/overview-and-features.html
]]></Notes>
<script implName="lang:python:inline:"><![CDATA[
print "MathML3 is a W3C Recommendation"
]]></script>
<script implName="lang:javascript:inline:"><![CDATA[
print("\nMathML is a low-level specification for describing mathematics");
]]></script>
<_-.XholonClass>
<!-- types of domain objects -->
<TheSystem/>
<TopOfAtmosphere/>
<!-- MathML elements -->
<MathMLEntity>
<!-- The root node of any MathML expression. -->
<math xmlns="http://www.w3.org/1998/Math/MathML"/>
<!-- MathML content syntax -->
<!-- MathML 2.0 Arithmetic -->
<arith xmlns="http://www.w3.org/1998/Math/MathML">
<abs/>
<conjugate/>
<factorial/>
<arg/>
<real/>
<imaginary/>
<floor/>
<ceiling/>
<quotient/>
<divide/>
<rem/>
<minus/>
<plus/>
<times/>
<power/>
<root/>
<max/>
<min/>
<gcd/>
<lcm/>
<sum/>
<product/>
</arith>
<!-- MathML 2.0 Constructs -->
<constructs xmlns="http://www.w3.org/1998/Math/MathML">
<apply/>
<interval/>
<inverse/>
<condition/>
<declare/>
<lambda/>
<piecewise/>
<bvar/>
<degree/>
</constructs>
<!-- MathML 2.0 Functions -->
<functions xmlns="http://www.w3.org/1998/Math/MathML">
<compose/>
<domain/>
<codomain/>
<image/>
<domainofapplication/>
<ident/>
</functions>
<!-- MathML 2.0 Relations -->
<relations xmlns="http://www.w3.org/1998/Math/MathML">
<eq/>
<neq/>
<leq/>
<lt/>
<geq/>
<gt/>
<equivalent/>
<approx/>
<factorof/>
</relations>
<!-- MathML 2.0 Tokens -->
<tokens xmlns="http://www.w3.org/1998/Math/MathML">
<cn/>
<ci/>
<csymbol/>
</tokens>
<!-- MathML 2.0 Semantics
Note: The root node has an extra 's' at the end to distinguish it from the child "semantics" element.
-->
<semanticss xmlns="http://www.w3.org/1998/Math/MathML">
<annotation/>
<annotation-xml/>
<semantics/>
</semanticss>
</MathMLEntity>
</_-.XholonClass>
<xholonClassDetails>
</xholonClassDetails>
<TheSystem>
<TopOfAtmosphere> <!-- act -->
<math xmlns="http://www.w3.org/1998/Math/MathML"><semantics>
<apply><compose/>
<ci type="function">act</ci>
<!-- solarConstantDivFour = solarConstant / 4.0 -->
<apply>
<eq/>
<ci>solarConstantDivFour</ci>
<apply>
<divide/>
<ci>solarConstant</ci>
<cn>4.0</cn>
</apply>
</apply>
</apply>
<annotation encoding="ASCIIMath">solarConstantDivFour = solarConstant / 4.0</annotation>
<annotation encoding="TeX">solarConstantDivFour = solarConstant \div 4.0</annotation>
<annotation encoding="SnuggleTeX">\[ \textrm{solarConstantDivFour} = \textrm{solarConstant} / 4.0 \]</annotation>
<annotation encoding="bsh">int solarConstant = 1368;solarConstantDivFour = solarConstant / 4.0;</annotation>
<annotation encoding="js">
javascript:(function(solarConstant){var solarConstantDivFour = solarConstant / 4.0; println(solarConstantDivFour);})(1368)
</annotation>
<annotation encoding="js">
javascript:(function(solarConstant){var solarConstantDivFour = solarConstant / 4.0; console.log(solarConstantDivFour);})(1368)
</annotation>
<annotation encoding="python">
solarConstantDivFour = solarConstant / 4.0
print str(solarConstantDivFour)
</annotation>
<annotation-xml encoding="MathML-Presentation"><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN"
"http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">
<math xmlns="http://www.w3.org/1998/Math/MathML">
<semantics>
<mrow>
<mn>solarConstantDivFour</mn>
<mo>=</mo>
<mi>solarConstant</mi>
<mo>÷</mo>
<mn>4.0</mn>
</mrow>
<annotation encoding="SnuggleTeX">\[ solarConstantDivFour = solarConstant \div 4.0 \]</annotation>
</semantics>
</math>
]]></annotation-xml>
</semantics></math>
</TopOfAtmosphere>
</TheSystem>
<Blockbehavior implName="lang:python:inline:"><![CDATA[
]]></Blockbehavior>
<Blockbehavior implName="lang:javascript:inline:"><![CDATA[
]]></Blockbehavior>
<Blockbehavior implName="lang:webEditionjs:inline:"><![CDATA[
]]></Blockbehavior>
<Blockbehavior implName="lang:bsh:inline:"><![CDATA[
]]></Blockbehavior>
<Blockbehavior implName="lang:jruby:inline:"><![CDATA[
]]></Blockbehavior>
<Blockbehavior implName="lang:groovy:inline:"><![CDATA[
]]></Blockbehavior>
<SvgClient><Attribute_String roleName="svgUri"><![CDATA[data:image/svg+xml,
<svg width="100" height="50" xmlns="http://www.w3.org/2000/svg">
<g>
<title>MathML</title>
<rect id="MathSystem/math" fill="#98FB98" height="50" width="50" x="25" y="0"/>
</g>
</svg>
]]></Attribute_String><Attribute_String roleName="setup">${MODELNAME_DEFAULT},${SVGURI_DEFAULT}</Attribute_String></SvgClient>
</XholonWorkbook>
All original content Copyright © 2012 Ken Webb