RunMat
  • Pricing
RunMat
GitHub
GitHub
Sign inTry in browser
DesktopRuntimePhysicsCADAdministrationAgent

Get RunMat updates

New releases, guides and examples.

Product+
  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download
Math+
  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting
Physics+
  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA
Industries+
  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance
Learn+
  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students
Compare+
  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons
Company+
  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms

Product

  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download

Math

  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting

Physics

  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA

Industries

  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance

Learn

  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students

Compare

  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons

Company

  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms
GitHubXLinkedIn

© Dystr, Inc. · RunMat v0.7.1, Nov 17, 2026

RunMat® is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

/
    • Linear static analysis
    • Steady heat transfer
    • Modal analysis
    • Mesh refinement
    • Thermal stress
    • First static study
    • Reusable parameterized model
    • Transient study with generated inputs
    • Modal response-spectrum study
    • Run and plot a sweep
    • Scale from local to cluster
    • Publish and read large results
Docs/FEA/Guides

Finite-element analysis

Modal analysis

Extract a tuning fork’s natural frequencies and compare its original mode shapes in RunMat.

A modal analysis finds the natural frequencies of a supported structure and the shape it vibrates in at each one. It is the first step in keeping resonances away from the frequencies a machine, a road or a motor will drive, and it supplies the modes that forced-response studies build on. This page works one example in full: the vibration theory of a cantilever, the finite-element eigenproblem that generalizes it, and the solution in RunMat.

Example 1: Natural frequencies of a clamped tuning fork

A steel tuning fork is clamped at the bottom of its stem and mounted on equipment that vibrates anywhere from 0 to 250 Hz. To avoid resonance, its lowest natural frequency must lie at least 20 % above the top of that band.

Given

A 100 millimeter steel tuning fork has two free tines joined by a bridge and a fixed 8 by 6 millimeter stem end; there is no applied vibration force.
Modal model · clamp the bottom of the stem; leave the tines free. No forcing or damping is applied.
QuantityValue
Overall height100 mm; the fork is a 6 mm thick plate throughout
Stem8 mm wide, 25 mm long
Bridge36 mm wide, 10 mm tall
Tinestwo, each 8 mm wide and 65 mm long above the bridge, 20 mm apart
Materialsteel, E = 200 GPa, ν = 0.3, ρ = 7,850 kg/m³
Supportthe bottom face of the stem is fixed in all directions
Excitation band0 to 250 Hz
Required lowest frequency250 Hz × 1.2 = 300 Hz

Find

  1. The first two natural frequencies and the motion of each mode.
  2. Whether the lowest natural frequency clears 300 Hz.

Free vibration of a cantilever

Single degree of freedom

A mass mmm on a spring of stiffness kkk, displaced and released, oscillates at its natural frequency

mx¨+kx=0⇒ω=k/m,f=ω2π.m\ddot x + kx = 0 \quad\Rightarrow\quad \omega = \sqrt{k/m}, \qquad f = \frac{\omega}{2\pi}.mx¨+kx=0⇒ω=k/m​,f=2πω​.

Stiffer means higher, heavier means lower. A continuous structure behaves like many springs and masses coupled together, and it has one natural frequency for each independent pattern of motion.

Bending vibration of a beam

For a slender Euler–Bernoulli beam with bending stiffness EIEIEI and mass per length ρA\rho AρA, the transverse deflection v(x,t)v(x,t)v(x,t) satisfies

EI ∂4v∂x4+ρA ∂2v∂t2=0.EI\,\frac{\partial^4 v}{\partial x^4} + \rho A\,\frac{\partial^2 v}{\partial t^2} = 0 .EI∂x4∂4v​+ρA∂t2∂2v​=0.

A free vibration has the form v=ϕ(x)sin⁡ωtv = \phi(x)\sin\omega tv=ϕ(x)sinωt, which separates into the eigenvalue problem EI ϕ′′′′=ω2ρA ϕEI\,\phi'''' = \omega^2 \rho A\,\phiEIϕ′′′′=ω2ρAϕ. A cantilever has ϕ=ϕ′=0\phi = \phi' = 0ϕ=ϕ′=0 at the clamp and no moment or shear at the free end (ϕ′′=ϕ′′′=0\phi'' = \phi''' = 0ϕ′′=ϕ′′′=0). Those four conditions admit a nonzero ϕ\phiϕ only when

cos⁡βLcosh⁡βL=−1,β4=ω2ρAEI,\cos\beta L \cosh\beta L = -1, \qquad \beta^4 = \frac{\omega^2 \rho A}{EI},cosβLcoshβL=−1,β4=EIω2ρA​,

whose first root is β1L=1.875\beta_1 L = 1.875β1​L=1.875. The first natural frequency is therefore

f1=1.87522πEIρAL4.f_1 = \frac{1.875^2}{2\pi}\sqrt{\frac{EI}{\rho A L^4}} .f1​=2π1.8752​ρAL4EI​​.

For a rectangular section bending across its thickness hhh, I/A=h2/12I/A = h^2/12I/A=h2/12, so f1f_1f1​ grows in proportion to h/L2h/L^2h/L2 and to E/ρ\sqrt{E/\rho}E/ρ​. These are the design levers: a shorter or thicker member is stiffer and vibrates faster.

Treating one tine as a cantilever clamped at the bridge, with L = 65 mm, gives about 1,160 Hz for bending across the 6 mm thickness and 1,540 Hz for bending across the 8 mm width. A tine alone would clear the band easily. The fork is more than its tines, though: the tines sit on a bridge and a slender stem, and the beam formula cannot say how those parts combine.

Finite-element formulation

Weak form. For the elastic solid with displacement u\mathbf uu, density ρ\rhoρ and no applied load, the principle of virtual work with inertia reads

∫Ωρ w⋅u¨ dΩ+∫Ωε(w):C:ε(u) dΩ=0\int_\Omega \rho\, \mathbf w \cdot \ddot{\mathbf u}\, d\Omega + \int_\Omega \boldsymbol\varepsilon(\mathbf w) : \mathsf C : \boldsymbol\varepsilon(\mathbf u)\, d\Omega = 0∫Ω​ρw⋅u¨dΩ+∫Ω​ε(w):C:ε(u)dΩ=0

for every virtual displacement w\mathbf ww that vanishes on the clamped face.

Discretization. The fork is meshed with ten-node tetrahedra (Tet10), and the displacement in each element is interpolated from its nodes with quadratic shape functions, uh=∑aNaua\mathbf u^h = \sum_a N_a \mathbf u_auh=∑a​Na​ua​, as in the linear static example. The two integrals produce the element stiffness and mass matrices:

Ke=∫ΩeBeTD Be dΩ,Me=∫Ωeρ NTN dΩ.\mathbf K_e = \int_{\Omega_e} \mathbf B_e^{\mathsf T}\mathbf D\,\mathbf B_e\, d\Omega, \qquad \mathbf M_e = \int_{\Omega_e} \rho\, \mathbf N^{\mathsf T}\mathbf N\, d\Omega .Ke​=∫Ωe​​BeT​DBe​dΩ,Me​=∫Ωe​​ρNTNdΩ.

Me\mathbf M_eMe​ is the consistent mass matrix: it uses the same shape functions as the stiffness, so the kinetic energy is computed with the same displacement field.

Eigenproblem. Assembling the elements, removing the clamped degrees of freedom as in a static analysis, and substituting u=ϕsin⁡ωt\mathbf u = \boldsymbol\phi \sin\omega tu=ϕsinωt gives the generalized eigenvalue problem

K ϕi=ωi2 M ϕi,fi=ωi2π.\mathbf K\,\boldsymbol\phi_i = \omega_i^2\, \mathbf M\,\boldsymbol\phi_i, \qquad f_i = \frac{\omega_i}{2\pi} .Kϕi​=ωi2​Mϕi​,fi​=2πωi​​.

This is the spring–mass equation with matrices in place of numbers. Both matrices are symmetric, and M\mathbf MM is positive definite, so the ωi2\omega_i^2ωi2​ are real and the mode shapes are orthogonal with respect to the mass, ϕiTMϕj=0\boldsymbol\phi_i^{\mathsf T}\mathbf M\boldsymbol\phi_j = 0ϕiT​Mϕj​=0 for i≠ji \ne ji=j. A part with no supports has six zero frequencies, its rigid-body motions, before the first elastic mode.

Solution method. A model has as many modes as unknowns, but design needs only the lowest few. RunMat finds them with a shift-invert block Lanczos method: it factors K−σM\mathbf K - \sigma\mathbf MK−σM once for a shift σ\sigmaσ and iterates on a small block of vectors, which converges first to the frequencies nearest the shift. The structural physics reference lists what each computed mode records.

Solution

Each block below is an excerpt of tuning-fork-modal.fea.

Geometry

The fork is imported from a STEP file, and the clamped face is selected by its CAD name.

geometry fork {
    file = "./geometry/tuning-fork.step"
    units = mm
    region body : solid { select name "Tuning fork"; expect exactly_one }
    region fixed_end : face { select name "Stem end"; expect exactly_one }
}
Solver mesh
Solver mesh from the saved analysis study
Saved result · interaction loads as you scroll

Solver mesh · m. Drag to rotate; scroll to zoom.

Material

Frequencies depend on the ratio of stiffness to mass, so the density enters M\mathbf MM and matters as much as Young's modulus.

material steel {
    mass_density = 7850 kg/m^3
    elastic {
        youngs_modulus = 200 GPa
        poisson_ratio = 0.3
    }
}

Support, and no load

Free vibration has no applied load, so the model has only the support. The support is part of the answer: it removes degrees of freedom from K\mathbf KK and M\mathbf MM, and a stiffer support gives higher frequencies. structural.fixed clamps the stem's bottom face rigidly.

model supported_fork {
    assign material.steel to geometry.fork.region.body
    constraint fixed_end {
        structural.fixed { target = geometry.fork.region.fixed_end }
    }
}

Mesh

Mode shapes are bending shapes, so the mesh uses quadratic tetrahedra; linear tetrahedra are too stiff in bending and would push the frequencies up. The 30 mm target size is larger than the fork's features, so the 6 mm thickness and the 0.1 mm surface deviation set the actual element size. The mesh has 11,144 nodes.

mesh fork on geometry.fork {
    tetrahedra {
        order = quadratic
        target_size = 30 mm
        maximum_deviation = 0.1 mm
    }
}

Study

The analysis requests the two lowest modes and retains the modal basis, so later response steps can reuse it. The output publishes the mode shapes.

study fork_modes {
    geometry = geometry.fork
    mesh = mesh.fork
    model = model.supported_fork
    analysis modes { structural modal { modes = 2 } retain basis }
    output shapes = analysis.modes.field.node.displacement
}

Run

The complete project opens in RunMat Desktop with the STEP geometry, the study and the saved modes:

Import the fork and choose quadratic elements

geometry fork {
    file = "./geometry/tuning-fork.step"
    units = mm
    region body : solid { select name "Tuning fork"; expect exactly_one }
    region fixed_end : face { select name "Stem end"; expect exactly_one }
}

mesh fork on geometry.fork {
    tetrahedra {
        order = quadratic
        target_size = 30 mm
        maximum_deviation = 0.1 mm
    }
}

Choose stiffness and mass

material steel {
    mass_density = 7850 kg/m^3
    elastic {
        youngs_modulus = 200 GPa
        poisson_ratio = 0.3
    }
}

Fix the stem end

model supported_fork {
    assign material.steel to geometry.fork.region.body
    constraint fixed_end {
        structural.fixed { target = geometry.fork.region.fixed_end }
    }
}

Extract two modes and retain the basis

study fork_modes {
    geometry = geometry.fork
    mesh = mesh.fork
    model = model.supported_fork
    analysis modes { structural modal { modes = 2 } retain basis }
    output shapes = analysis.modes.field.node.displacement
}
Edit in RunMat Desktop ↗Download complete project

Includes the study, STEP geometry, and saved results. Run new analyses in RunMat Desktop or the CLI.

View the complete study
// Engineering physics belongs in the importing study.

geometry fork {
    file = "./geometry/tuning-fork.step"
    units = mm
    region body : solid { select name "Tuning fork"; expect exactly_one }
    region fixed_end : face { select name "Stem end"; expect exactly_one }
}

mesh fork on geometry.fork {
    tetrahedra {
        order = quadratic
        target_size = 30 mm
        maximum_deviation = 0.1 mm
    }
}

material steel {
    mass_density = 7850 kg/m^3
    elastic {
        youngs_modulus = 200 GPa
        poisson_ratio = 0.3
    }
}

model supported_fork {
    assign material.steel to geometry.fork.region.body
    constraint fixed_end {
        structural.fixed { target = geometry.fork.region.fixed_end }
    }
}
study fork_modes {
    geometry = geometry.fork
    mesh = mesh.fork
    model = model.supported_fork
    analysis modes { structural modal { modes = 2 } retain basis }
    output shapes = analysis.modes.field.node.displacement
}

From the command line:

runmat check tuning-fork-modal.fea
runmat run tuning-fork-modal.fea

run meshes the fork, assembles K\mathbf KK and M\mathbf MM, extracts the requested modes and publishes the frequencies and shapes. In .m code, fea.results(runId, "ModeIndices", [1 2]) reads them; see get started.

Mode 1

Mode 1 relative amplitude · 364.81 Hz
Mode 1 relative amplitude · 364.81 Hz from the saved analysis study
Saved result · interaction loads as you scroll

Mode 1 relative amplitude · 364.81 Hz · relative · 0.00 to 1.00. Drag to rotate; scroll to zoom.

The first natural frequency is 364.85 Hz. Color shows the relative amplitude of the mode shape, scaled so that its largest displacement is 1; the deformed shape is exaggerated. A mode shape has no physical amplitude, and its sign is arbitrary: the same mode can appear with every displacement reversed. How far the fork actually moves depends on the forcing and the damping, which a harmonic or transient response adds.

Mode 2

Mode 2 relative amplitude · 475.46 Hz
Mode 2 relative amplitude · 475.46 Hz from the saved analysis study
Saved result · interaction loads as you scroll

Mode 2 relative amplitude · 475.46 Hz · relative · 0.00 to 1.00. Drag to rotate; scroll to zoom.

The second natural frequency is 475.17 Hz. Comparing the stem, the bridge and the tine tips with mode 1 shows which direction each mode moves in and which member flexes most.

Answers

  1. The first two natural frequencies are 364.85 Hz and 475.17 Hz. Both lie far below the 1.2–1.5 kHz estimates for a tine alone, so the tines are not the most flexible part: the slender 8 mm × 6 mm stem bends in these modes too. The stem's second moment of area is 256 mm⁴ for bending across its width and 144 mm⁴ across its thickness, a ratio whose square root, 1.33, is close to the ratio of the two frequencies, 1.30. That points to the whole fork swaying on its stem, across the plate's thickness in mode 1 and in its own plane in mode 2; the shape views show the direction of each.
  2. The lowest frequency, 364.85 Hz, is above the required 300 Hz, and 46 % above the top of the band. The fork meets the criterion.

Discussion

Design meaning. The margin is comfortable. If the band reached 330 Hz, the margin would fall to 11 %, and the design response would be to stiffen what moves in mode 1: a wider or shorter stem raises both frequencies far more than any change to the tines, because the stem is the flexible member.

Model limits. The fixed face is a perfectly rigid clamp. A real fixture is somewhat flexible and lowers every frequency, so the computed values are an upper estimate for the mounted fork. When the margin is small, model the fixture or measure its stiffness. The analysis is also linear and undamped: it gives frequencies and shapes, not amplitudes.

Refinement. A displacement-based finite-element model is slightly too stiff, so its frequencies approach the exact values from above and fall a little as the mesh is refined. Before relying on a margin, rerun with a smaller target_size and confirm that the first frequency changes by much less than the margin. A 46 % margin tolerates a lot; an 11 % margin deserves a refinement run. The mesh refinement guide works through a refinement sequence.

Try a change

Problem 1.1. Change the material to aluminum (E = 68.9 GPa, ρ = 2,700 kg/m³). Predict the effect before running.

Answer. When only the material changes, every frequency scales with E/ρ\sqrt{E/\rho}E/ρ​. For aluminum that ratio is within 1 % of steel's, so the frequencies barely move: aluminum is lighter and less stiff in almost the same proportion.

Problem 1.2. Request ten modes (modes = 10) and look for the mode in which the tines move against each other in the plane of the fork, the motion that sounds a tuning fork's note. Compare its frequency with the 1,540 Hz tine estimate, and explain the difference from how the bridge holds each tine. If it is not among the first ten, request more.

Problem 1.3. Shorten the stem in the CAD and re-export it with the same face names. Which of the first two frequencies rises more, and why?

Problem 1.4. Publish the frequencies as an output, so the criterion can be stated as an assessment in the study (Not yet releasedStatus):

output frequencies = analysis.modes.field.mode.modal_frequency

A retained modal basis also feeds the modal-superposition procedures: harmonic response, transient response, response spectrum and random vibration (see studies, analyses and state).

Next

  • Linear static analysis: deflection, stress and reactions under load.
  • Structural physics reference: every structural procedure and its equations.
  • Structural validation: how frequencies and mode bases are checked.

Continue learning

  • Validation: structural
  • Linear static analysis
On this page
  • Overview
  • Example 1: Natural frequencies of a clamped tuning fork
  • Free vibration of a cantilever
  • Solution
  • Discussion
  • Try a change
  • Next
  • Continue learning