LaTeX to CAS translator

Jump to navigation Jump to search

This mockup demonstrates the concept of TeX to Computer Algebra System (CAS) conversion.

The demo-application converts LaTeX functions which directly translate to CAS counterparts.

Functions without explicit CAS support are available for translation via a DRMF package (under development).

The following LaTeX input ...

{\displaystyle \frac{d^2y}{dt^2} + f(t) y = 0, }

... is translated to the CAS output ...

Semantic latex: \deriv [2]{y}{t} + f(t) y = 0

Confidence: 0

Mathematica

Translation: D[y, {t, 2}]+ f[t]* y == 0

Information

Sub Equations

  • D[y, {t, 2}]+ f[t]* y = 0

Free variables

  • t
  • y

Symbol info

  • Derivative; Example: \deriv[n]{f}{x}

Will be translated to: D[$1, {$2, $0}] Relevant links to definitions: DLMF: http://dlmf.nist.gov/1.4#E4 Mathematica: https://reference.wolfram.com/language/ref/D.html

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic

Test expression: (D[y, {t, 2}]+ f*(t)*y)-(0)

ERROR:

{
    "result": "ERROR",
    "testTitle": "Simple",
    "testExpression": null,
    "resultExpression": null,
    "wasAborted": false,
    "conditionallySuccessful": false
}
Numeric

SymPy

Translation: diff(y, t, 2)+ f(t)* y == 0

Information

Sub Equations

  • diff(y, t, 2)+ f(t)* y = 0

Free variables

  • t
  • y

Symbol info

  • Derivative; Example: \deriv[n]{f}{x}

Will be translated to: diff($1, $2, $0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/1.4#E4 SymPy: https://docs.sympy.org/latest/tutorial/calculus.html#derivatives

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic
Numeric

Maple

Translation: diff(y, [t$(2)])+ f(t)* y = 0

Information

Sub Equations

  • diff(y, [t$(2)])+ f(t)* y = 0

Free variables

  • t
  • y

Symbol info

  • Derivative; Example: \deriv[n]{f}{x}

Will be translated to: diff($1, [$2$($0)]) Relevant links to definitions: DLMF: http://dlmf.nist.gov/1.4#E4 Maple: https://www.maplesoft.com/support/help/Maple/view.aspx?path=diff

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • second-order linear ordinary differential equation
  • periodic function by minimal period
  • mathematics
  • Hill differential equation
  • Hill equation

Complete translation information:

{
  "id" : "FORMULA_6ef227c696b6ffa1b06a30923428b22f",
  "formula" : "\\frac{d^2y}{dt^2} + f(t) y = 0",
  "semanticFormula" : "\\deriv [2]{y}{t} + f(t) y = 0",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "D[y, {t, 2}]+ f[t]* y == 0",
      "translationInformation" : {
        "subEquations" : [ "D[y, {t, 2}]+ f[t]* y = 0" ],
        "freeVariables" : [ "t", "y" ],
        "tokenTranslations" : {
          "\\deriv1" : "Derivative; Example: \\deriv[n]{f}{x}\nWill be translated to: D[$1, {$2, $0}]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/1.4#E4\nMathematica:  https://reference.wolfram.com/language/ref/D.html",
          "f" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary)."
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "ERROR",
        "numberOfTests" : 1,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 1,
        "crashed" : false,
        "testCalculationsGroup" : [ {
          "lhs" : "D[y, {t, 2}]+ f*(t)*y",
          "rhs" : "0",
          "testExpression" : "(D[y, {t, 2}]+ f*(t)*y)-(0)",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        } ]
      }
    },
    "SymPy" : {
      "translation" : "diff(y, t, 2)+ f(t)* y == 0",
      "translationInformation" : {
        "subEquations" : [ "diff(y, t, 2)+ f(t)* y = 0" ],
        "freeVariables" : [ "t", "y" ],
        "tokenTranslations" : {
          "\\deriv1" : "Derivative; Example: \\deriv[n]{f}{x}\nWill be translated to: diff($1, $2, $0)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/1.4#E4\nSymPy: https://docs.sympy.org/latest/tutorial/calculus.html#derivatives",
          "f" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary)."
        }
      }
    },
    "Maple" : {
      "translation" : "diff(y, [t$(2)])+ f(t)* y = 0",
      "translationInformation" : {
        "subEquations" : [ "diff(y, [t$(2)])+ f(t)* y = 0" ],
        "freeVariables" : [ "t", "y" ],
        "tokenTranslations" : {
          "\\deriv1" : "Derivative; Example: \\deriv[n]{f}{x}\nWill be translated to: diff($1, [$2$($0)])\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/1.4#E4\nMaple: https://www.maplesoft.com/support/help/Maple/view.aspx?path=diff",
          "f" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary)."
        }
      }
    }
  },
  "positions" : [ {
    "section" : 0,
    "sentence" : 0,
    "word" : 21
  } ],
  "includes" : [ "f(t)", "t" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "second-order linear ordinary differential equation",
    "score" : 0.722
  }, {
    "definition" : "periodic function by minimal period",
    "score" : 0.7125985104912714
  }, {
    "definition" : "mathematics",
    "score" : 0.6859086196238077
  }, {
    "definition" : "Hill differential equation",
    "score" : 0.6460746792928004
  }, {
    "definition" : "Hill equation",
    "score" : 0.6460746792928004
  } ]
}

Specify your own input