Nonlinear Solver API

Run a second-order (geometrically nonlinear) 3D frame analysis over HTTP. Send your structural model as JSON — nodes, elements, supports, loads, and section properties — and get back the deformed nodal positions and the internal forces of every member, computed by the same engine behind the Fast Nonlinear Buckling Solver.

Free No API key CORS enabled Up to 500 nodes & 500 elements

POST https://awatif.co/api/solve

Quick start

A 3 m steel cantilever column, fixed at the base, pushed sideways with 5 kN while carrying 200 kN of axial compression (SI units: m, N, Pa):

curl -X POST https://awatif.co/api/solve \
  -H "Content-Type: application/json" \
  -d '{
    "nodes": [[0, 0, 0], [0, 0, 3]],
    "elements": [[0, 1]],
    "supports": [[0, [true, true, true, true, true, true]]],
    "loads": [[1, [5000, 0, -200000, 0, 0, 0]]],
    "elementsProps": [
      [0, {
        "elasticity": 2e11,
        "area": 0.01,
        "momentInertiaZ": 1e-5,
        "momentInertiaY": 1e-5,
        "shearModulus": 8e10,
        "torsionalConstant": 2e-5
      }]
    ]
  }'

The response (values rounded for readability):

{
  "positions": [0, 0, 0, 0.0218, 0, 2.9996],
  "internalForces": [
    [0, {
      "N": [-199958.4, -199958.4],
      "Vy": [5000, 5000],
      "Vz": [0, 0],
      "Mx": [0, 0],
      "My": [0, 0],
      "Mz": [-19351.8, 0]
    }]
  ],
  "iterationCount": 2
}

Note the base moment: 19.4 kN·m instead of the 15 kN·m a first-order analysis would give — the solver captures the extra moment from the axial load acting on the deflected shape (P–Δ).

JavaScript

Same request from the browser or Node:

const response = await fetch("https://awatif.co/api/solve", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    nodes: [[0, 0, 0], [0, 0, 3]],
    elements: [[0, 1]],
    supports: [[0, [true, true, true, true, true, true]]],
    loads: [[1, [5000, 0, -200000, 0, 0, 0]]],
    elementsProps: [
      [0, {
        elasticity: 2e11,
        area: 0.01,
        momentInertiaZ: 1e-5,
        momentInertiaY: 1e-5,
        shearModulus: 8e10,
        torsionalConstant: 2e-5,
      }],
    ],
  }),
});

if (!response.ok) throw new Error((await response.json()).error);

const { positions, internalForces, iterationCount } = await response.json();

Awatif client

If you are building on awatif, the components package wraps this API with typed, Map-based inputs that match the awatif data model (npm install @awatif/components):

import { getNlPositionsAndForcesRemote } from "@awatif/components";

const { positions, internalForces, iterationCount } =
  await getNlPositionsAndForcesRemote(
    nodes,
    elements,
    loads,
    supports,
    elementsProps
  );

Request

All fields are JSON. Indices refer to positions in the nodes or elements arrays. The Map-like fields (loads, supports, elementsProps, releases) are sent as [index, value] entry arrays.

Field Description
nodes Required. Node coordinates as [x, y, z] triplets, in meters.
elements Required. Frame elements as [nodeIndex, nodeIndex] pairs.
supports Entries of [nodeIndex, [six booleans]]: restrained degrees of freedom [dx, dy, dz, rx, ry, rz].
loads Entries of [nodeIndex, [fx, fy, fz, mx, my, mz]], forces in N and moments in N·m.
elementsProps Entries of [elementIndex, props] with elasticity (Pa), area (m²), momentInertiaZ, momentInertiaY (m⁴), shearModulus (Pa), and torsionalConstant (m⁴).
releases Optional. Entries of [elementIndex, [booleans]] for member end releases.
simSettings Optional. { "tol": 1e-3, "maximum_iter": 1000 } — convergence tolerance and Newton iteration cap (defaults shown).

Response

Field Description
positions Deformed node coordinates as a flat [x, y, z, x, y, z, …] array, in node order.
internalForces Entries of [elementIndex, forces] where each of N, Vy, Vz, Mx, My, Mz is a [start, end] pair in the element's local axes (N, N·m).
iterationCount Newton iterations needed to converge.

Errors

Errors are returned as { "error": "message" }.

Status Meaning
400 Invalid input — e.g. nodes missing or empty.
405 Method not allowed — only POST is accepted.
413 Model too large — hosted solving is limited to 500 nodes and 500 elements. For larger models, contact the author.
422 The solver did not converge within maximum_iter iterations — often a sign the structure is unstable or past its buckling load.
500 / 502 Solver error or solver temporarily unreachable.

Fair use & legal

The API is free for reasonable, interactive use — no account or key required. Results are a computational aid and must be independently verified by a qualified engineer before being relied on. Submitted models are processed in memory to compute the response and are not stored. See the Terms of Service and Privacy Policy for details, or reach out at [email protected].