Modeling Middle Ear Ossicle Amplification in Matter.js

This article provides a technical overview of how to simulate the acoustic lever action of the human middle ear ossicles using the Matter.js 2D physics engine. By mapping the malleus and incus into constrained rigid bodies with asymmetrical lever arms around a fixed fulcrum, you can quantitatively model how mechanical advantage transforms low-pressure, high-displacement tympanic membrane vibrations into higher-force, lower-displacement inputs at the stapes footplate.


The Biomechanics of the Ossicular Lever

The middle ear overcomes the acoustic impedance mismatch between air and fluid-filled cochlear environments. Part of this impedance matching is achieved through the anatomical lever system formed by the malleus (connected to the tympanic membrane) and the incus (connected to the stapes).

In humans, the manubrium of the malleus acts as the input lever arm (\(L_1\)), while the long process of the incus acts as the output lever arm (\(L_2\)). This produces an anatomical lever ratio of approximately \(1.3:1\). Under static equilibrium of torque (\(\tau = F_1 L_1 = F_2 L_2\)), the force transmitted to the stapes is amplified inversely proportional to the ratio of lever lengths:

\[F_2 = F_1 \cdot \left(\frac{L_1}{L_2}\right)\]

1. Defining the Anatomical Geometry in Matter.js

To capture this mechanism in Matter.js, you can represent the malleus-incus complex either as a single compound rigid body or as two rigidly linked bodies rotating around a single revolute joint (fulcrum).

const { Engine, Render, Runner, Bodies, Body, Constraint, Composite } = Matter;

const engine = Engine.create();
const world = engine.world;

// Disable default gravity to isolate acoustic drive forces
engine.gravity.y = 0;

// Dimensions based on a 1.3:1 ratio (scaled for canvas representation)
const malleusLength = 130; // Input arm (L1)
const incusLength = 100;   // Output arm (L2)
const armThickness = 12;

// Create the unified ossicular lever body
const malleusArm = Bodies.rectangle(200, 300 - malleusLength / 2, armThickness, malleusLength, {
    label: "Malleus"
});
const incusArm = Bodies.rectangle(200 + incusLength / 2, 300, incusLength, armThickness, {
    label: "Incus"
});

const ossicleComplex = Body.create({
    parts: [malleusArm, incusArm],
    label: "OssicleComplex"
});

Composite.add(world, ossicleComplex);

2. Implementing the Fulcrum Constraint

The ossicular chain rotates around an axis running through the anterior ligament of the malleus and the short process of the incus. In Matter.js, this is best modeled using a Constraint anchored to a static world coordinate with zero length and high stiffness:

// Anchor point corresponding to the joint axis of rotation
const fulcrumPoint = { x: 200, y: 300 };

const fulcrum = Constraint.create({
    pointA: fulcrumPoint,
    bodyB: ossicleComplex,
    pointB: { x: 0, y: 0 }, // Center of rotation relative to the complex
    length: 0,
    stiffness: 1
});

Composite.add(world, fulcrum);

To incorporate the damping and restoring elastic forces provided by the middle ear ligaments and muscles (such as the tensor tympani), attach an auxiliary spring constraint between the malleus arm and a static position:

const ligamentSpring = Constraint.create({
    pointA: { x: 200 - 30, y: 300 - malleusLength },
    bodyB: ossicleComplex,
    pointB: { x: 0, y: -malleusLength / 2 },
    length: 30,
    stiffness: 0.05,
    damping: 0.02
});

Composite.add(world, ligamentSpring);

3. Driving the System (Tympanic Input)

Acoustic vibrations from the eardrum translate into a periodic normal force applied at the distal end of the malleus arm. You can drive this within the engine's update cycle using sinusoidal force injection:

const inputFrequency = 0.05; // Represents the acoustic frequency
const inputAmplitude = 0.005; // Magnitude of the acoustic pressure force
let step = 0;

Matter.Events.on(engine, 'beforeUpdate', () => {
    step++;
    const forceMagnitude = Math.sin(step * inputFrequency) * inputAmplitude;
    
    // Apply horizontal acoustic force to the tip of the malleus
    Body.applyForce(
        ossicleComplex,
        { x: ossicleComplex.position.x, y: ossicleComplex.position.y - (malleusLength / 2) },
        { x: forceMagnitude, y: 0 }
    );
});

4. Simulating the Cochlear Load and Measuring Force Amplification

To measure amplification, place a constrained rigid body representing the stapes footplate against a resistive barrier that models the high impedance of the fluid-filled cochlea:

// Stapes footplate resting against a viscous cochlear boundary
const stapes = Bodies.rectangle(200 + incusLength, 300, 20, 30, {
    label: "Stapes",
    frictionAir: 0.2 // High viscous damping of the cochlear fluid
});

// Link the tip of the incus to the stapes
const incudoStapedialJoint = Constraint.create({
    bodyA: ossicleComplex,
    pointA: { x: incusLength / 2, y: 0 },
    bodyB: stapes,
    pointB: { x: -10, y: 0 },
    stiffness: 0.9,
    length: 0
});

Composite.add(world, [stapes, incudoStapedialJoint]);

Validating Mechanical Advantage

To confirm that amplification matches the theoretical lever advantage:

  1. Torque and Kinematics: Verify that the tip velocity and linear displacement of the malleus are larger than those of the stapes by a factor roughly equal to \(L_1 / L_2\).
  2. Force Measurement: Query the tension and normal force inside incudoStapedialJoint using Constraint.currentContractForce or by calculating collision reaction forces at the stapes boundary. The effective output force will equal the input force scaled up by the designed length ratio, minus internal resistance and inertial losses.