Nonlinear Solver API
Run a second-order (geometrically nonlinear) 3D frame and shell analysis over HTTP. Send your structural model as JSON — nodes, elements (frame members or triangular shells), supports, loads, and section properties — and get back the deformed nodal positions and the internal forces of every frame member, computed by the same engine behind the Fast Nonlinear Buckling Solver.
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 magnitude: 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 members as
[nodeIndex, nodeIndex] pairs, or triangular
shell elements as
[nodeIndex, nodeIndex, nodeIndex] triplets.
|
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]. Frame members
take elasticity (Pa), area (m²),
momentInertiaZ, momentInertiaY
(m⁴), shearModulus (Pa), and
torsionalConstant (m⁴). Shell elements take
elasticity (Pa), poissonRatio, and
thickness (m) instead.
|
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). Hosted solving caps
maximum_iter at 500.
|
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).
Bending uses sagging-negative and hogging-positive signs;
transverse shear uses the paired convention (negative on
the left side and positive on the right side of a
start-to-end member under downward load). Axial force and
torsion retain their existing conventions. Only frame
members appear here — shell elements contribute to
positions only.
|
iterationCount |
Newton iterations needed to converge. |
Errors
Errors are returned as { "error": "message" }.
| Status | Meaning |
|---|---|
400 |
Invalid input — e.g. nodes missing or empty, or
an unsupported shell mesh (non-planar, non-manifold,
degenerate, or otherwise invalid shell input).
|
405 |
Method not allowed — only POST is accepted. |
413 |
Model too large — hosted solving is limited to 100 nodes and 200 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 throughout the beta 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].