Structural analysis in JavaScript

A real finite-element solver — 3D beams, frames and trusses, with EN 1993-1-1 steel checks — compiled from Rust to WebAssembly and published on npm. It runs in your users' browsers, so there is no server to operate, no request per solve and no model leaving their machine.

npm install @ferscloud/fers-calculation-web

The whole integration

No initialisation call, no API key, no network. You hand it model JSON and it hands back an envelope you branch on.

import { calculate_from_json } from "@ferscloud/fers-calculation-web";

// A 5 m cantilever, IPE 180 in S235, 1 kN down at the tip.
const res = JSON.parse(calculate_from_json(JSON.stringify(model)));

if (res.ok) {
  const dy = res.result.results.loadcases["End Load"]
    .displacement_nodes["2"].dy;
  console.log(`Tip deflection: ${(dy * 1000).toFixed(3)} mm`);
  // Tip deflection: -15.065 mm
  // Hand check: PL³/3EI_z = 1000·5³ / (3 · 210e9 · 13.17e-6) = 15.07 mm
} else {
  console.error(res.error.code, res.error.message);
}

The printed value is the real output for those inputs, and the comment is the closed-form check it agrees with. That habit is worth copying: solve a case you already know before trusting one you do not.

Why put the solver in the browser

Nothing to operate

There is no solver service to deploy, scale, patch or pay for. The computation happens on the device that asked for it, so a page solving ten thousand times a day costs you the same as one solving once.

Fast enough to be live

A typical frame solves in milliseconds with no round-trip, so a slider can re-solve as it moves. Interfaces that would be unusable at network latency become obvious ones.

The model stays put

Geometry never leaves the visitor's machine. When the model is a client's building, not posting it to a third party is a feature you can state plainly.

The loop a web form cannot do

One solve is a calculator. A thousand solves is a search — and once each one is free and instant, sweeping a parameter stops being something you batch overnight and becomes something the page does while someone drags a slider.

import { calculate_from_json } from "@ferscloud/fers-calculation-web";

// Which of these sections keeps the span within its deflection limit?
const limit = span / 300;

for (const section of catalogue) {
  const res = JSON.parse(
    calculate_from_json(JSON.stringify(buildModel(span, section))),
  );
  if (!res.ok) continue;

  const sag = Math.abs(midspanDeflection(res.result));
  if (sag <= limit) {
    console.log(section.name, (sag * 1000).toFixed(1), "mm");
  }
}

// Runs entirely in the visitor's browser: no request per iteration,
// no rate limit, no per-solve cost.

The solver is synchronous and CPU-bound, so for anything substantial run it in a Web Worker and keep the UI thread free.

// solver.worker.ts — keep the UI thread free.
import { calculate_from_json } from "@ferscloud/fers-calculation-web";

self.onmessage = (e: MessageEvent<{ id: number; model: string }>) => {
  const out = calculate_from_json(e.data.model);
  self.postMessage({ id: e.data.id, out });
};

Where it runs

Two packages are published from the same engine with an identical API: @ferscloud/fers-calculation-web for anything behind a bundler, and @ferscloud/fers-calculation for Node. React, Vue, Svelte and plain JavaScript all consume it the same way, and generated TypeScript model types ship alongside.

This is not a demo build. The FERS web app, the 2D frame calculator and every beam calculator on this site run on the same package you would install — so you can see exactly what it does before adding a dependency.

What it costs

Free for models up to 100 members, with no account and no key — that covers most beams, portal frames and small trusses. A short-lived signed token from your server raises the ceiling to 10,000 members. There is no per-solve charge in either case, because there is no server doing the solving.

Not building a front end?

  • Structural analysis in Python — the same engine from a script, for anything repetitive or version-controlled.
  • REST API — plain HTTP from any language, with an OpenAPI 3.1 spec.
  • MCP server — let Claude, ChatGPT, Cursor or VS Code build and check models directly.

Frequently asked questions

Is this a real finite-element solver or a set of formulas?

It is the full FERS engine — a Rust finite-element solver for 3D beams, frames and trusses — compiled to WebAssembly. It assembles and solves a stiffness matrix, so it handles arbitrary geometry, redundant frames and combined load cases, not just the cases a closed-form formula covers. The FERS web app runs this same build.

How large a model can it handle in a browser?

Up to 100 members on the free tier and 10,000 with a Pro solve token. Speed is a function of the visitor's machine rather than of a shared server, so a typical frame solves in milliseconds and there is no queue in front of it.

Do my users need an account or an API key?

No. The free tier requires neither, so an anonymous visitor to your page can solve a model. A key is only needed on your server if you want to mint the token that raises the member limit.

Does the model get uploaded anywhere?

No. The solve happens in the visitor's browser, so the model and the results never leave their machine. That matters when the geometry is a client's building and you would otherwise be posting it to a third party.

What does it cost to run?

Nothing per solve. Because the computation happens on the visitor's device, a page that solves ten thousand times a day costs you exactly as much bandwidth as one that solves once — there is no per-request billing to pass on.

Can I use it server-side in Node instead?

Yes. @ferscloud/fers-calculation is the Node build, with an identical API and no bundler configuration. Use it for scheduled jobs, report generation or anywhere you would rather not ship the solver to the client.

Are the results verified?

Every result is checked against closed-form solutions and the standard NAFEMS finite-element benchmarks, with the target-versus-FERS error published rather than asserted. You can run the benchmark set yourself, in the browser, on the NAFEMS page.

Does it do Eurocode checks too?

Yes — EN 1993-1-1 steel member checks come back with a per-clause trace, so each utilization can be read as a hand calculation rather than taken on trust. See the worked example.

Which frameworks does it work with?

Any of them. It is a plain ES module, so React, Vue, Svelte and vanilla JavaScript all work the same way. Vite and Next.js need a one-time WebAssembly setting — the JavaScript docs have both configs.

Can I try it before installing anything?

The free 2D frame calculator and every beam calculator on this site run on this exact package in your browser right now. What you see there is what the npm package does.