7

I need to store a lot of equation and mathematical formula into database for my simulation experimentations, and i think it's better to use some mathML or latex string... but ...

I make some googling request, and i'm very surprised because i don't find any eval library in java or scala to transform string latex or string mathML expression into equation in java / scala. I don't want to eval() very complex equation with solver, my objective is "really" to store and transform simple equation (polynomial, linear) into scala/java language.

Do you have some advice to help me understand if there are other solution to store and parse easily equation or mathematic formula after string evaluation in java or scala language ?

Update 1 :

Finally i find some java library which read et eval() string formula ... If you find anything, i can complete this list with your proposal.

Without parsing of MathML/Latex :

With experimental Parsing of MathML

Thanks

Community
  • 1
  • 1
reyman64
  • 523
  • 4
  • 34
  • 73
  • 4
    Wait. You want to _evaluate_ a `LaTeX` string? To a _number_? – Louis Wasserman Mar 26 '12 at 21:43
  • Latex or other normalized language to store/describe complex formula ... why not, it's a stream pratice when you have to describe some complex dynamics in a model. My question is, how can i do that with actual tool because i think it's interesting to store equation to inject later in a model. Why ? Because we have choice between multiple complex equation to describe only one real mecanism, like city growing for example ? – reyman64 Mar 27 '12 at 08:24
  • 1
    You should be aware that you are asking **a lot**. It would help to limit your formulas to a special class like polynomials. – ziggystar Mar 27 '12 at 08:59
  • Yes @ziggystar, i don't want to solve equation, if i can store simple function it's great. I update my question. – reyman64 Mar 27 '12 at 09:39
  • Polynomials can be easily represented by the vector of their coefficients. Multi-dimensional linear functions can be represented by matrices. Can you be more specific about your requirements? not just "simple". – ziggystar Mar 27 '12 at 11:16
  • @ziggystar I'm not the final user, so i don't know exactly which real use case user wants, but i think i can make a first proposal with polynomial function. I find some example of library which make eval() but anything with latex, or mathml equivalent. – reyman64 Mar 27 '12 at 12:20
  • Did you find what you needed? – Abid Nov 12 '18 at 05:19

1 Answers1

2

If you want something as sophisticated as I think you are asking for, the only thing that comes to mind that's Java-ecosystem compatible is Clojuratica, and even then you'd have to store the formulae in Mathematica format. (And have a copy of Mathematica.)

Rex Kerr
  • 166,841
  • 26
  • 322
  • 407
  • It's a great trail, but it's even better if you have and idea of same functionnality/library with open source software ... – reyman64 Mar 27 '12 at 08:18