Model a Helmholtz Resonator in Simscape Acoustics
R2026bThis example shows how to create a simple Helmholtz resonator using Simscape™ Acoustics.
A Helmholtz resonator can be modeled using the equation
,
where is the acoustic impedance at the neck, is acoustic resistance, is acoustic inertance, and is acoustic compliance [1]. In this model, resistance represents viscous and thermal losses in the neck and cavity, inertance corresponds to the air in the neck, and compliance corresponds to the springiness of air inside the cavity.
The acoustic impedance is also defined as
,
where is pressure in Pascals, is volume velocity in , and is frequency in radians. The damped resonant frequency of the resonator in radians is given by
.
drawHelmholtzResonator

Mapping Physical Attributes of a Resonator to Acoustic Properties
The physical elements of a resonator can be mapped to acoustic resistance, inertance, and compliance. Consider a small bottle described by the following properties:
V = 1e-3; % Cavity volume (m^3) r = 10e-3; % Neck radius (m) L = 20e-3; % Neck length (m) A = pi*r^2; % Neck area (m^2) Le = L + 1.2*r; % Effective neck length (end correction)
The acoustic properties are computed using the physical properties of air.
rho = 1.21; % Air density (kg/m^3) c = 343; % Sound speed (m/s) mu = 1.8e-5; % Dynamic viscosity (Pa*s) C = V/(rho*c^2); % Acoustic compliance M = rho*Le/A; % Acoustic inertance R = 8*mu*Le/(pi*r^4); % Acoustic resistance
Using the previous equation, the expected resonant frequency of the bottle in Hz is:
F = sqrt(1/(M*C) - R^2/(2*M^2))/(2*pi)
F = 171.0465
Simscape Model of a Helmholtz Resonator
The helmholtz model uses an Acoustic Resistance, Acoustic Inertance, and Acoustic Compliance block to model a Helmholtz Resonator. The parameter values for each block are set using R, M, and C, respectively.
A Controlled Pressure Source applies a step function to the system, simulating as a burst of pressure across the bottle neck. The volume velocity of the system is converted to a physical signal using a Volume Velocity Sensor.
open_system("helmholtz")
Like all Simscape models, a Solver Configuration block and a reference block for each domain in the model is required. Simscape Acoustics includes the Acoustic Reference block for the acoustic domain.
Check Theoretical Resonant Frequency Against Simulated Resonant Frequency
Analyze the system's resonant frequency response by viewing the Spectrum Analyzer Block.
out = sim("helmholtz"); open_system("helmholtz/Spectrum Analyzer");

The Spectrum Analyzer block shows a resonant peak at approximately 171 Hz, so the Simscape model is a good match to the theoretical model.
References
[1] Kinsler, Lawrence, Austin Frey, Alan Coppens, and James Sanders. Fundamentals of Acoustics. 4th ed. John Wiley and Sons, 2000.