Home » railML newsgroups » railml.rollingstock » TrainResistance definition in MathML
Re: TrainResistance definition in MathML [message #1214 is a reply to message #1213] Thu, 29 August 2013 14:05 Go to previous messageGo to previous message
Susanne Wunsch railML is currently offline  Susanne Wunsch railML
Messages: 0
Registered: January 2020
Hello Thomas,

Thomas Albrecht <ThomasKAlbrecht(at)tu-dresdende> writes:
> or 2)mathml.
> ValueTable should be straightforward, but in practice, it seems that
> rather formulas of the kind
> fW = A + C * (V + X) (A, C parameters, V speed of train, X wind speed)
> or similar are given, which is probably better formulated using MathML.
>
> A) Has anyone worked with MathML?

No experiences from my side.

> B) Should we use standard symbols and units in order to make it
> understandable?

Of course! ;-)

I checked the current MathML standard (version 3.0) and tried to make a
proposal for usage in the railML context.

MathML is now widely understood in different tools, but there seems to be
great differences between the MathML versions and the degree of
implementation completeness.

* Apache OpenOffice4 displays the "Presentation-Mode" if it's separated
into a file.
* Firefox23 displays the "Presentation-Mode" if it's separated into a
file without the "Content-Mode".
* LibreOffice4.1 doesn't understand this MathML-version.

I would be interested in further reports about usability of the
following MathML code: Mathematica?, MATLAB?, M$ Office?, IE?, Chrome?,
Opera? ...

Copy the following lines into a file. Maybe you should snip the MathML
part out for testing in MathML-aware tools.

?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE math [
<!ENTITY middot "&#x000B7;"> <!--MIDDLE DOT -->
<!ENTITY InvisibleTimes "&#x02062;" ><!--INVISIBLE TIMES -->
]>
<!-- First proposal for definition of formulas inside railML elements
Following references were used:
* Mathematical Markup Language (MathML) Version 3.0, Chapter 5 Mixing Markup Languages for Mathematical Expressions,
W3C Recommendation 21 October 2010: http://www.w3.org/TR/MathML3/chapter5.html#mixing.parallel
* Units in MathML,
W3C Working Group Note 10 November 2003: http://www.w3.org/TR/mathml-units/
* Definition identifier URNs in OGC namespace, Version 1.3, OGC document number 07-092r3
Open Geospatial Consortium Inc.: http://portal.opengeospatial.org/files/?artifact_id=30575
* The Unified Code for Units of Measure (UCUM), XML releases of the formal part of the specification,
UCUM: http://unitsofmeasure.org/ucum-essence.xml
* XML Entity Definitions for Characters, The expanded set of HTML and MathML entity definitions,
W3C Recommendation 01 April 2010: http://www.w3.org/2003/entities/2007/htmlmathml-f.ent
-->
<railml xmlns="http://www.railml.org/schemas/2013"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:mml="http://www.w3.org/1998/Math/MathML">
<rollingstock id="r1">
<metadata>
<dc:title>railML rollingstock sample</dc:title>
<dc:description>Proposal for train resistance definition with a formula</dc:description>
<dc:creator>Susanne Wunsch</dc:creator>
</metadata>
<vehicles>
<vehicle id="v1"/>
<vehicle id="v2"/>
</vehicles>
<formations>
<formation id="f1">
<trainOrder>
<vehicleRef orderNumber="1" vehicleRef="v1"/>
<vehicleRef orderNumber="2" vehicleRef="v2" vehicleCount="9"/>
</trainOrder>
<trainResistance>
<mml:math>
<mml:semantics>
<!-- Content mathematical expression: 17,456 N + 5,677 Ns/m * v + 1,234 Ns^2/m^2 * v^2 -->
<!-- TODO: Currently missing: definition of uom for variable 'v'-->
<mml:apply>
<mml:plus/>
<mml:apply>
<mml:times/>
<mml:cn type="constant">17,456</mml:cn>
<mml:csymbol definitionURL="urn:ogc:def:uom:UCUM::N">N</mml:csymbol>
</mml:apply>
<mml:apply>
<mml:times/>
<mml:cn href="">5,677</mml:cn>
<mml:apply>
<mml:times/>
<mml:csymbol definitionURL="urn:ogc:def:uom:UCUM::N">N</mml:csymbol>
<mml:apply>
<mml:divide/>
<mml:csymbol definitionURL="urn:ogc:def:uom:UCUM::s">s</mml:csymbol>
<mml:csymbol definitionURL="urn:ogc:def:uom:UCUM::m">m</mml:csymbol>
</mml:apply>
</mml:apply>
<mml:ci>v</mml:ci>
</mml:apply>
<mml:apply>
<mml:times/>
<mml:cn type="constant">1,234</mml:cn>
<mml:apply>
<mml:times/>
<mml:csymbol definitionURL="urn:ogc:def:uom:UCUM::N">N</mml:csymbol>
<mml:apply>
<mml:power/>
<mml:apply>
<mml:divide/>
<mml:csymbol definitionURL="urn:ogc:def:uom:UCUM::s">s</mml:csymbol>
<mml:csymbol definitionURL="urn:ogc:def:uom:UCUM::m">m</mml:csymbol>
</mml:apply>
<mml:cn>2</mml:cn>
</mml:apply>
</mml:apply>
<mml:apply>
<mml:power/>
<mml:ci>v</mml:ci>
<mml:cn>2</mml:cn>
</mml:apply>
</mml:apply>
</mml:apply>
<mml:annotation-xml style="MathML-Presentation">
<!-- Presentation mathematical expression: 17,456 N + 5,677 Ns/m * v + 1,234 Ns^2/m^2 * v^2 -->
<mml:mrow>
<mml:mn>17,456</mml:mn>
<mml:mo rspace='thickmathspace'>&InvisibleTimes;</mml:mo>
<mml:mi mathvariant='normal' class='MathML-Unit'>N</mml:mi>
<mml:mo>+</mml:mo>
<mml:mrow>
<mml:mn>5,677</mml:mn>
<mml:mo rspace='thickmathspace'>&InvisibleTimes;</mml:mo>
<mml:mrow>
<mml:mi mathvariant='normal' class='MathML-Unit'>N</mml:mi>
<mml:mo>&middot;</mml:mo>
<mml:mfrac>
<mml:mi mathvariant='normal' class='MathML-Unit'>s</mml:mi>
<mml:mi mathvariant='normal' class='MathML-Unit'>m</mml:mi>
</mml:mfrac>
</mml:mrow>
<mml:mo>&InvisibleTimes;</mml:mo>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mo>+</mml:mo>
<mml:mrow>
<mml:mn>1,234</mml:mn>
<mml:mo rspace='thickmathspace'>&InvisibleTimes;</mml:mo>
<mml:mrow>
<mml:mi mathvariant='normal' class='MathML-Unit'>N</mml:mi>
<mml:mo>&middot;</mml:mo>
<mml:mfrac>
<mml:msup>
<mml:mi mathvariant='normal' class='MathML-Unit'>s</mml:mi>
<mml:mn>2</mml:mn>
</mml:msup>
<mml:msup>
<mml:mi mathvariant='normal' class='MathML-Unit'>m</mml:mi>
<mml:mn>2</mml:mn>
</mml:msup>
</mml:mfrac>
</mml:mrow>
<mml:mo>&InvisibleTimes;</mml:mo>
<mml:msup>
<mml:mi>v</mml:mi>
<mml:mn>2</mml:mn>
</mml:msup>
</mml:mrow>
</mml:mrow>
</mml:annotation-xml>
</mml:semantics>
</mml:math>
</trainResistance>
</formation>
</formations>
</rollingstock>
</railml>

Kind regards...
Susanne

--
Susanne Wunsch
Schema Coordinator: railML.common
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: roles
Next Topic: Distinguish vehicles by vehicle category
Goto Forum:
  


Current Time: Wed May 01 22:13:05 CEST 2024