Skip to content
Beta.ez5@modelscript/easy5 12 diagnostic rules
Parser WASM GLR
Diagnostics 12 rules
DAE Arena Lowering
Simulation Co-sim / Export
Projections Modelica, SSP
Live ExampleElectroHydraulicFlightActuator.ez5

EASY5 Electro-Hydraulic Flight Control Servo Loop

Multi-rate block schematic coupling a command summing junction, servo valve transfer function, hydraulic cylinder integrator, and LVDT feedback.

Playground
Source (16 lines)
1TITLE = Primary Flight Control Electro-Hydraulic Servo Actuator
2COMPONENT SUM1 TYPE = SJ
3  PARAMETER G1 = 1.0, G2 = -1.0
4COMPONENT GAIN1 TYPE = GN
5  PARAMETER K = 18.5
6COMPONENT VALVE1 TYPE = TF
7  PARAMETER K = 1.25, TAU = 0.008
8COMPONENT CYL1 TYPE = IN
9  PARAMETER IC = 0.0, GAIN = 1.0
10COMPONENT LVDT1 TYPE = LA
11  PARAMETER K = 1.0, TAU = 0.002
12CONNECT SUM1.S_OUT TO GAIN1.S_IN
13CONNECT GAIN1.S_OUT TO VALVE1.S_IN
14CONNECT VALVE1.S_OUT TO CYL1.S_IN
15CONNECT CYL1.S_OUT TO LVDT1.S_IN
16CONNECT LVDT1.S_OUT TO SUM1.S_IN2
EASY5 Control Block Schematic
Easy5Model - EASY5 Schematic
Drag to pan · Click % to reset

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 (A,B,C,D) Jacobian extraction, QR eigenvalue/pole analysis, Bode frequency sweeps), multi-domain projections to Modelica 3.x and FMI SSP, and interactive AntV X6 / SVG schematic diagram generation.


Supported File Specifications ​

ExtensionFormatKey Structural Features
.ez5 / .ezmModern Model DefinitionTagged MODEL, COMPONENTS, XP, S0, CONNECTIONS, TABLES blocks with graphical layout attributes
.ezd / .easClassical Card DeckFixed-field component, parameter, and connection card images with continuation flags
.tabEmpirical Lookup Tables1D and 2D tabular lookup arrays for nonlinear characteristics (f(x) or f(x,y))
.f / .forUser General (UG/UX)Embedded or referenced Fortran 77/90 routines computing custom nonlinear dynamics

Architecture & Compilation Pipeline ​

Rendering diagram...

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 | y(t)=K⋅u(t) | K (Gain factor) | None | | SJ | Summing Junction | y(t)=∑i=1mSGNi⋅ui(t) | SGN1, SGN2, SGN3 (±1.0) | None | | IN | Integrator | x˙(t)=K⋅u(t),y(t)=x(t) | GAIN, S0 (Initial state), UL, LL | 1 continuous state | | TF | Transfer Function | Y(s)=bmsm+⋯+b0ansn+⋯+a0U(s) | NUM (array), DEN (array) | n continuous states | | LA | First-Order Lead-Lag | Y(s)=Kτ1s+1τ2s+1U(s) | GAIN, TAU1, TAU2 | 1 continuous state (τ2>0) | | LM | Hard Limiter | y(t)=max(umin,min(umax,u(t))) | UL (Upper limit), LL (Lower limit) | None | | DZ | Deadband | y(t)={u−δu>δu+δu<−δ0|u|≤δ | DB (Deadband half-width) | None | | HY | Hysteresis Switch | Relay with toggle thresholds uon,uoff | U_ON, U_OFF, Y_HIGH, Y_LOW | None (Discrete memory) | | TD | Transport Delay | y(t)=u(t−τ) | TAU (Delay time in seconds) | Buffer ring | | SW | Controlled Switch | y(t)={u1(t)uctrl≥uthreshu2(t)uctrl<uthresh | THRESH (Switch threshold) | None | | FN | Table Function | y(t)=interp(u(t),X,Y) | TABLE_NAME, ORDER (1=linear, 2=spline) | None | | UG | User General | Custom dynamics specified in Fortran 77/90 | User-defined parameters | User-defined (S(i),SD(i)) |


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

CodeRuleSeverityMessage
M7001unconnected-input-portwarningInput port '<comp>.<port>' has no incoming connection.
M7002csmf-algebraic-looperrorDirect feedthrough algebraic loop detected with no continuous state or delay: <value>.
M7003duplicate-component-iderrorDuplicate component identifier '<id>' in model.
M7004uninitialized-stateinfoContinuous state in component '<comp>' defaults to 0.0 with no explicit S0 specified.
M7005improper-transfer-functionerrorTransfer function in component '<comp>' is improper: numerator degree (<degNum>) exceeds denominator degree (<degDen>).
M7006parameter-out-of-boundserrorParameter '<param>' in component '<comp>' is out of valid bounds: <reason>.
M7007port-dimension-mismatcherrorConnection width mismatch from '<from>' (dim <dim1>) to '<to>' (dim <dim2>).
M7008state-index-out-of-boundserrorState index S(<idx>) in component '<comp>' exceeds allocated continuous states (<max>).
M7009sample-rate-mismatchwarningSample rate mismatch between '<from>' (<rate1>s) and '<to>' (<rate2>s) without rate transition block.
M7010user-fortran-syntax-errorerrorUser Fortran subroutine in '<comp>' has defect: <detail>
M7011unstable-linear-polewarningComponent '<comp>' has open-loop pole in right-half plane (Re = +<value>), indicating open-loop instability.
M7012table-extrapolation-hazardwarningComponent '<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 S(i) become continuous variables with derivative bindings der(xi)=fi(x,u).
  • Initial states S0 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 (A,B,C,D) ​

Linearizes the continuous non-linear system around an operating point (x0,u0):

x˙=Ax+Bu,y=Cx+Du

Where:

Aij=∂x˙i∂xj,Bik=∂x˙i∂uk,Cpj=∂yp∂xj,Dpk=∂yp∂uk

Computed via central finite differences:

∂fi∂xj≈fi(x0+εej,u0)−fi(x0−εej,u0)2ε

Equilibrium Operating Point Trim Solver ​

Solves x˙(x,u)=0 using Levenberg-Marquardt damped least-squares:

(JTJ+λI)Δx=−JTx˙(x,u)

Eigenvalue & Stability Analysis ​

Computes closed-loop poles si=σi±jωi using the QR algorithm with Wilkinson shifts:

  • Natural frequency: ωn,i=σi2+ωi2
  • Damping ratio: ζi=−σiωn,i
  • Stability criterion: σi≤0 for all i

Bode Frequency Response Sweeps ​

Solves the complex resolvent system (jωI−A)X(jω)=B at logarithmically spaced frequencies:

G(jω)=CX(jω)+D
  • Magnitude (dB): 20log10⁡|G(jω)|
  • Phase (degrees): atan2(ImG(jω),ReG(jω))⋅180π

5. Cross-Language Projections ​

Projection to Modelica 3.x (easy5ToModelica) ​

Translates EASY5 continuous control blocks into canonical Modelica.Blocks continuous models:

modelica
// 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) ​

bash
# 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

Open-Core under the GNU AGPL v3 License; Enterprise Edition (ee/) under the ModelScript Enterprise License. • Trademark Policy