Docs / AI Agent Reference

AI Agent Reference

This page provides a structured, machine-readable summary of the Modellus system for AI agents that generate, interpret, or modify Modellus models.

Schema Files

Canonical references for model structure and expression syntax:

SchemaPurpose
Model SchemaFull model JSON structure: shapes array, properties, visualization settings
Expression SchemaExpression language grammar: statements, operators, functions, AST nodes

Shape Types

Type IDClassPurposeParent Required
expressionExpressionShapeDefine equations, parameters, ODEs, recurrencesNo
tableTableShapeDisplay/enter data, perform regressionNo
chartChartShapePlot data series and regression curvesNo
bodyBodyShapeAnimated sprite controlled by termsReferential
pointPointShapePositioned dot driven by X/Y termsReferential
lineLineShapeSegment between two coordinate pairsReferential
arcArcShapeCurved segment / angle indicatorReferential
vectorVectorShapeArrow with direction and magnitudeReferential
sliderSliderShapeInteractive parameter controlNo
gaugeGaugeShapeCircular meter displayNo
valueValueShapeNumeric readout of a termNo
mediaMediaShapeImage / backgroundNo
textTextShapeRich text annotationNo
rulerRulerShapeDistance measurement toolNo
protractorProtractorShapeAngle measurement toolNo
referentialReferentialShapeCoordinate system containerNo
questionQuestionShapeAssessment questionNo

Expression Language Summary

Statement Types

KindPatternTerm Type
functionname = exprPARAMETER (no dependencies) or FUNCTION
differential\frac{dx}{dt} = exprDIFFERENTIAL
functionSubscriptx_{n} = exprRECURRENCE
functionSubscriptDigitx_0 = exprPARAMETER
functionIndependentf(t) = exprFUNCTION
conditionalname = \begin{cases}...\end{cases}FUNCTION
displayexpr (no assignment)None (visual only)

Built-in Functions

Trig:      \sin, \cos, \tan, \cot, \sec, \csc
Inv Trig:  \arcsin, \arccos, \arctan
Hyperbolic: \sinh, \cosh, \tanh
Log:       \ln, \log
Two-arg:   \max(a,b), \min(a,b), \mod(a,b)
Utility:   sign(x), rnd(x), irnd(x), int(x), round(x)
Other:     \det(x), \sqrt{x}

Operators

Arithmetic: +  -  \cdot  /  \frac{}{}  ^{}  \sqrt{}
Comparison: =  >  <  \ge  \le  \neq
Logical:    \lor (OR)  \land (AND)
Special:    \Delta (finite difference)

Constants

\pi = 3.14159...
e (or \E) = 2.71828...

Model JSON Structure

{
  "properties": {
    "independent": { "name": "t", "start": 0, "end": 10, "step": 0.1 },
    "initialValuesByCase": { "1": { "x": 0, "v": 5 } }
  },
  "shapes": [
    {
      "type": "expression",
      "id": "uuid",
      "expression": "\\displaylines{g=9.8\\\\\\frac{dx}{dt}=v}",
      "position": { "x": 100, "y": 100 }
    },
    {
      "type": "referential",
      "id": "uuid",
      "children": [
        { "type": "point", "id": "uuid", "xTerm": "x", "yTerm": "y" }
      ]
    }
  ]
}

Key Rules for Agents

For the complete formal grammar specification, see the Expression Schema page.