Scientific ML Studio
Learn/ Studio Tour/ 2.3
2.3 · Working on the canvas

Read and change a block's settings

Select a block, edit its fields. Some fields appear only when others are set; formulas are written as maths, not code.

Click a block and its settings open in the panel on the right. The top of the panel names the block and gives a one-sentence description of what it is for. Below that, the fields come in groups with small capital headings (Geometry, Sampling, Time on a Domain block, for example).

Your screenshot · the panel for a Domain block, showing two or three groups, one field with its (i) icon hovered.

The (i) icon

Next to most fields is a small (i). Hover over it, or tab to it, and a bubble explains the field: what it controls, what range makes sense, and what happens if you get it wrong. If you are unsure what a setting does, read its bubble before you change it.

Kinds of field

Field looks like What to enter Example
A number Any number; scientific notation works 0.001, 1e-3
A whole number An integer; a decimal is rounded 5000
A dropdown Pick one. Some dropdowns change what else is shown Geometry type
A checkbox On or off. Often reveals further fields Time dimension
A formula Maths in the coordinates; see below -pi**2*sin(pi*x)
A list Numbers separated by commas Hidden layers 40, 40, 40, 40
A table One row per boundary Points per boundary
A button Does something once Detect boundaries

A number field left empty goes back to its default value.

Fields that appear when you need them

The panel shows only the fields that apply right now. Tick Time dimension on a Domain block and t initial, t final, Time points and Initial points appear, and the block grows an Initial port. Choose Rectangle and y min and y max appear. Choose the Heat equation and Diffusivity a appears; choose Wave and Wave speed c appears instead.

If a field you expected is missing, a setting above it is not what you think. Check the dropdowns and checkboxes at the top of the block first.

Writing formulas

Source terms, boundary values, initial profiles and custom residuals are all formulas. You write them as maths, and the Lab translates them to PyTorch. It never runs the text you type; it reads it as an expression and rebuilds it, which is why only a safe set of things is allowed.

What you can use

  • Numbers, +, -, *, /, parentheses, and ** for powers.
  • The constants pi and e.
  • The functions sin, cos, tan, sinh, cosh, tanh, exp, log, sqrt, abs, sign, erf, atan, asin, acos. Each takes exactly one argument.
  • The coordinates of your Domain: x; x and y; and t if the Domain has time switched on.

What you cannot use

  • ^ for powers. Write x**2, not x^2. A ^ is rejected, because in the language the Lab reads it is a different operator.
  • Implied multiplication. Write 2*pi*x, not 2pi x.
  • Anything else: names you invented, function calls with several arguments, text.
You want Write
$\sin(\pi x)$ sin(pi*x)
$-2\pi^2\sin(\pi x)\sin(\pi y)$ -2*pi**2*sin(pi*x)*sin(pi*y)
$50\,e^{-20((x-0.5)^2+(y-0.5)^2)}$ 50*exp(-20*((x-0.5)**2 + (y-0.5)**2))
A value that changes in time on a boundary sin(pi*t)

A formula that cannot be read does not stop you. The Lab replaces it with a constant so the script still generates, and the Graph check tells you what was wrong: for example Source term: unknown symbol 'z' (available here: e, pi, x) or, for a formula written with ^, Boundary value: operator BitXor is not allowed. Always read the Graph check after typing a formula.

Where t is allowed. t is a legal symbol in a boundary value on a time-dependent problem. It is not allowed in an initial condition, because an initial condition is evaluated at one fixed time. On a steady problem (time off), t is not available anywhere.

Buttons in the panel

Button On What it does
Detect boundaries Domain Reads the geometry and reports its boundaries as BC1, BC2, …
Plot geometry and points Domain Draws the domain, the sampled points, and each boundary in its own colour with outward normals
Plot network diagram Network Draws the network as columns of neurons
Load preset PDE (general coefficient form) Fills the coefficient table with a standard equation

The two plot buttons are previews of what the settings produce. Nothing in the studio trains a model, so nothing here is a picture of a result.

Changes are saved as you type

The studio saves a notebook shortly after each change, so there is nothing to confirm. Typing in a field is not undoable with Ctrl+Z, so note the old value before you experiment with a number you care about.

Chapter 3 now goes through the blocks one at a time, starting with the Domain.