From: Rainer M. <ra...@tb...> - 2006-06-16 11:23:01
|
hi Andrew, The use of piecewise in the semantic test suite seems to differ from official definitions: E.g. in discontinuityTimeAndDelay-geq-l2.xml it's: <piecewise> <piece> <apply> <geq/> <ci> s2 </ci> <cn> 4 </cn> </apply> <cn>1.5</cn> </piece> <otherwise> <cn>0.05</cn> </otherwise> </piecewise> which is piecewise(geq(s2, 4), 1.5, 0.05) in libSBML infix and interpreted as 1.5 if s2 >= 4 and 0.05 otherwise by SOSlib. SOSlib produces the results required by the testsuite. However, at http://www.w3.org/TR/MathML2/chapter4.html#contm.piecewise the definition is slightly different: <piecewise> <piece> <cn> 0 </cn> <apply><lt/><ci> x </ci> <cn> 0 </cn></apply> </piece> <otherwise> <ci> x </ci> </otherwise> </piecewise> in libSBML infix piecewise(0, lt(x, 0), x) interpreted as 0 if x < 0 and x otherwise. Note, that the if condition of the piece element is BEFORE the associated result, while it is AFTER the result in the test suite example. The same ordering is found in the piecewise example for more pieces - see below. The result associated with a piece is always BEFORE the condition. Am i missing something or is the test suite example (and SOSlib) wrong? Rainer The general example with more pieces: <piecewise> <piece> <apply><minus/><ci> x </ci></apply> <apply><lt/><ci> x </ci> <cn> 0 </cn></apply> </piece> <piece> <cn> 0 </cn> <apply><eq/><ci> x </ci> <cn> 0 </cn></apply> </piece> <piece> <ci> x </ci> <apply><gt/><ci> x </ci> <cn> 0 </cn></apply> </piece> </piecewise> |