Tri's Lab by FEAScript: Finite elements, for fun.

Tri's Lab is the FEAScript playground for the finite element method: games, and a block editor for building your own simulations. Every picture in them is a real simulation, solved in your browser. Your guide is Tri, the triangle robot of FEAScript.

Free No install, no account Powered by open-source FEAScript

Meet Tri

Hi, I'm Tri. The triangle robot of FEAScript.

Tri is the FEAScript logo come to life. Look closely: Tri's body is cut into small elements, the same kind of mesh FEAScript solves on.

Every picture here is a real simulation!

Where you meet Tri

GAMES Physics guide

In the games, FEAScript does the maths and Tri explains what it means, keeping Field Notes on the physics you meet.

FEM BLOCKS Mission guide

In the block editor, Tri introduces each of the nine missions, thinks while FEAScript solves, and cheers when your simulation meets the goal.

TUTORIALS Tips

In the tutorials, Tri leaves short technical tips on what the text leaves out, with links to the documentation.

Play and build

Play and build. Real simulations inside.

Play a game while FEAScript solves the physics behind every move, or build a simulation yourself, block by block. Nothing is a fake animation: every temperature, bent beam and swirl of fluid comes from FEAScript solving the actual equations.

Critical Mesh: the engineer walks on a glowing heat map of the Plate

PLAY Game · story campaign

Critical Mesh

Nodessa, 2089. The city runs on a single glowing plate of alloy, and you're its new night engineer. Roll the die, carry heat cells across the floor and mount them, then watch FEAScript solve the temperature under your boots. Push your luck too far, and the Plate melts down.

  • A story campaign of 10 night shifts and 3 engineering interludes, plus an endless mode with high scores
  • Four FEAScript models: heat conduction (with a Gmsh mesh), beam bending, front propagation and Stokes flow
  • The equation is always on screen, and 15 Field Notes explain the physics as you meet it
▶ Play Critical Mesh
FEM Blocks: pixel blocks on the left, a heat map and the heat equation on the right

BUILD Block editor · no code

FEM Blocks

Snap pixel blocks together to build a simulation: a shape, a material, heaters and what happens at every edge. Press Run and FEAScript solves it. The editor is built on Blockly, and Tri guides you through nine missions, from a warm wire to a swirling tank of honey.

  • Click any block to see which part of the equation it controls
  • Every program is real FEAScript code: see it, copy it, use it
  • "The math" tab explains the equation, then shows your mesh, your nodes and your matrix K
▶ Start building

SOON More games

Critical Mesh is the first Tri's Lab game, and more are on the way. Have an idea for one? Tell us on Discord or GitHub.

What you learn

The ideas behind every simulation.

Engineers use the finite element method (FEM) to design bridges, engines and phones. Everything in the lab is built on six of its big ideas, and each one is simple enough to try for yourself.

−∇·(k ∇T) = Q

Every equation is a balance

Physics equations say that something balances at every point: heat in a plate, forces in a beam, fluid in a pipe. In the heat equation, the heat flowing in, flowing out and made there all add up.

T = T₀ or ∂T/∂n = 0

The edges matter

An edge can be held at a fixed temperature, cooled by air, or insulated so no heat escapes. These boundary conditions change the whole answer.

T ≈ Σ Tᵢ Nᵢ

Split the shape into elements

A shape too complicated to solve in one go is split into many small, simple pieces called elements. They meet at points called nodes, and the temperature is worked out at each node.

K · T = F

Solve all the nodes together

Each node gets one equation, linked to its neighbours. FEAScript solves all of them at once, usually in well under a second.

copper k ≈ 400 · foam k ≈ 0.03

Materials change the result

The conductivity k says how easily heat moves through a material. Copper spreads heat fast, foam almost stops it. That's why pans are metal and their handles aren't.

beam · front · flow

One method, many problems

Swap the equation and the same steps solve other problems: how a beam bends, how molten metal freezes and how a thick fluid flows.