This is unfortunately a legacy of the parseFormula code; which was
originally written to parse between L1 infix formula and the ASTNode
class that was written to deal with MathML in L2. It was never intended
to provide full access to MathML using infix notation.
Since the csymbol 'time' only exists in L2 there was never any need to
deal with infix formula that contained the concept.
Also, in dealing with infix there is no clear way for software to know
that 'time' or 't' or anything else means the csymbol time and is not
the id of something else in the model. So in this case you would need
to explicitly tell the node that it is time.
Jordan Atlas wrote:
> Dear Forum,
>
> What is the proper way to enter a formula that references "time" (i.e. the model simulation time) into libSBML's "parseFormula" function?
>
> When I call libsbml.parseFormula('time') in python the resulting AST has type AST_NAME rather than AST_NAME_TIME. This is causing an error in the resulting SBML validation because the name 'time' is not recognized as a species/reaction/parameter/etc.
>
> I am using libSBML-4.0.0-xerces-vc90 from Python on Windows XP.
>
> There is a similar problem posted here, but I don't see any follow up.
>
> Thanks for your help.
>
> --Jordan Atlas
> ____________________________________________________________
> To manage your libsbml-development list subscription, visit
> https://utils.its.caltech.edu/mailman/listinfo/libsbml-development
>
> For a web interface to the libsbml-development mailing list, visit
> http://sbml.org/Forums/
>
> For questions or feedback about the libsbml-development list,
> contact sbml-team@caltech.edu
>
>