EASY5 Dynamic Simulation & Linear Control (.ez5, .ezm, .ezd, .eas)
The @modelscript/easy5 package (languages/easy5) provides native support for Boeing / MSC Software EASY5™ dynamic system simulation models, control block diagrams, and empirical table lookups. It delivers multi-syntax parsing, embedded Fortran user block (UG/UX) compilation via @modelscript/fortran, pre-flight static topological linting (M7001–M7012) including Tarjan algebraic cycle detection, direct continuous DAE arena lowering (IDaeBuilder), linear control system analysis (trim solver, numerical
Supported File Specifications
| Extension | Format | Key Structural Features |
|---|---|---|
.ez5 / .ezm | Modern Model Definition | Tagged MODEL, COMPONENTS, XP, S0, CONNECTIONS, TABLES blocks with graphical layout attributes |
.ezd / .eas | Classical Card Deck | Fixed-field component, parameter, and connection card images with continuation flags |
.tab | Empirical Lookup Tables | 1D and 2D tabular lookup arrays for nonlinear characteristics ( |
.f / .for | User General (UG/UX) | Embedded or referenced Fortran 77/90 routines computing custom nonlinear dynamics |
Architecture & Compilation Pipeline
1. Standard General Purpose (GP) Library Catalog
@modelscript/easy5 includes built-in operational descriptors for standard EASY5 General Purpose library blocks:
| Block ID | Name | Mathematical Transfer Function / Formulation | Key Parameters (XP) | States (S) | | :------- | :------------------- | :---------------------------------------------------------------------------------------------------- | :----------------------------------------- | :-------------------------------- | -------------------------- | ---- | | GA | Proportional Gain | K (Gain factor) | None | | SJ | Summing Junction | SGN1, SGN2, SGN3 (IN | Integrator | GAIN, S0 (Initial state), UL, LL | 1 continuous state | | TF | Transfer Function | NUM (array), DEN (array) | LA | First-Order Lead-Lag | GAIN, TAU1, TAU2 | 1 continuous state (LM | Hard Limiter | UL (Upper limit), LL (Lower limit) | None | | DZ | Deadband | DB (Deadband half-width) | None | | HY | Hysteresis Switch | Relay with toggle thresholds U_ON, U_OFF, Y_HIGH, Y_LOW | None (Discrete memory) | | TD | Transport Delay | TAU (Delay time in seconds) | Buffer ring | | SW | Controlled Switch | THRESH (Switch threshold) | None | | FN | Table Function | TABLE_NAME, ORDER (1=linear, 2=spline) | None | | UG | User General | Custom dynamics specified in Fortran 77/90 | User-defined parameters | User-defined (
2. Pre-Flight Diagnostic Rules (lintEasy5)
ModelScript evaluates 12 formal pre-flight diagnostic rules before simulation, linearization, or projection:
12 rules4 warning7 error1 info Run with msx lint
| Code | Rule | Severity | Message |
|---|---|---|---|
M7001 | unconnected-input-port | warning | Input port '<comp>.<port>' has no incoming connection. |
M7002 | csmf-algebraic-loop | error | Direct feedthrough algebraic loop detected with no continuous state or delay: <value>. |
M7003 | duplicate-component-id | error | Duplicate component identifier '<id>' in model. |
M7004 | uninitialized-state | info | Continuous state in component '<comp>' defaults to 0.0 with no explicit S0 specified. |
M7005 | improper-transfer-function | error | Transfer function in component '<comp>' is improper: numerator degree (<degNum>) exceeds denominator degree (<degDen>). |
M7006 | parameter-out-of-bounds | error | Parameter '<param>' in component '<comp>' is out of valid bounds: <reason>. |
M7007 | port-dimension-mismatch | error | Connection width mismatch from '<from>' (dim <dim1>) to '<to>' (dim <dim2>). |
M7008 | state-index-out-of-bounds | error | State index S(<idx>) in component '<comp>' exceeds allocated continuous states (<max>). |
M7009 | sample-rate-mismatch | warning | Sample rate mismatch between '<from>' (<rate1>s) and '<to>' (<rate2>s) without rate transition block. |
M7010 | user-fortran-syntax-error | error | User Fortran subroutine in '<comp>' has defect: <detail> |
M7011 | unstable-linear-pole | warning | Component '<comp>' has open-loop pole in right-half plane (Re = +<value>), indicating open-loop instability. |
M7012 | table-extrapolation-hazard | warning | Component '<comp>' references table '<tableName>' without bounded extrapolation protection. |
Generated from languages/easy5/src/lints/index.ts. All languages →
3. Direct Continuous DAE Arena Lowering (lowerEasy5ToDae)
ModelScript's data-oriented WebAssembly linear-memory DAE arena compiles EASY5 models directly into struct-of-arrays without intermediate TypeScript AST objects:
- Continuous states
become continuous variables with derivative bindings . - Initial states
become start attributes on continuous state variables. - Summing junctions, gains, limiters, and lookup functions become lowered arena expression IDs (
ExprId) and equality equations (EqId). - Embedded Fortran blocks evaluate expressions directly mapped into DAE equation nodes.
4. Linear Control Systems Engine (linear/)
The linear control package provides exact numerical state-space modeling for control design and frequency domain verification:
State-Space Extraction ( )
Linearizes the continuous non-linear system around an operating point
Where:
Computed via central finite differences:
Equilibrium Operating Point Trim Solver
Solves
Eigenvalue & Stability Analysis
Computes closed-loop poles
- Natural frequency:
- Damping ratio:
- Stability criterion:
for all
Bode Frequency Response Sweeps
Solves the complex resolvent system
- Magnitude (dB):
- Phase (degrees):
5. Cross-Language Projections
Projection to Modelica 3.x (easy5ToModelica)
Translates EASY5 continuous control blocks into canonical Modelica.Blocks continuous models:
// Modelica projection generated from EASY5 model: FlightController
model FlightController
// Component instances
Modelica.Blocks.Math.Gain GA01(k = 5.0);
Modelica.Blocks.Math.Add SJ01;
Modelica.Blocks.Continuous.Integrator IN01(k = 1.0, y_start = 0.0);
Modelica.Blocks.Continuous.TransferFunction LA01(b = {0.1, 1.0}, a = {0.02, 1.0});
Modelica.Blocks.Nonlinear.Limiter LM01(uMax = 10.0, uMin = -10.0);
equation
connect(GA01.y, SJ01.u1);
connect(SJ01.y, IN01.u);
connect(IN01.y, LA01.u);
connect(LA01.y, LM01.u);
end FlightController;Projection to FMI SystemStructure (easy5ToSsp)
Exports complete multi-component topologies as FMI 2.0/3.0 SystemStructure.ssd XML containers for co-simulation orchestration.
6. Command-Line Interface (msx easy5)
# Model inspection and topological summary
msx easy5 summary controller.ez5
# Pre-flight linter (including algebraic loop check)
msx easy5 lint controller.ez5
msx lint controller.ez5 --language=easy5
# Numerical linearization to A, B, C, D state-space matrices
msx easy5 linearize controller.ez5
# Bode plot logarithmic frequency response calculation
msx easy5 bode controller.ez5 --min-freq=0.01 --max-freq=1000 --num-points=60
# Translation to Modelica 3.x
msx easy5 to-modelica controller.ez5 --out=Controller.mo
# Export to FMI SystemStructure.ssd
msx easy5 to-ssp controller.ez5 --out=SystemStructure.ssd
# Export SVG schematic diagram
msx easy5 diagram controller.ez5 --out=schematic.svg
