goofi v3.0.0

Simulation

Explore how simple rules create motion, synchronization, memory, and patterns.

Simulation — illustrated recipe guide

Start a model, watch its output, and change one rule. The signal nodes calculate the simulation. Their matching graphics nodes turn its state into a picture.

Start here

Enable Simulation and Signal. Enable the graphics engine to use the matching display nodes. The numeric outputs can also be explored with line and image viewers.

Open a recipe to see the patch, viewers, and controls together in the Explore tab. The model produces numeric data; its matching graphics node displays that data.

Open the first recipe ↓ Bundle setup →

Meet the nodes

Use the node pictures to find the inputs and outputs. Each experiment points to a recipe you can build on.

01 / SIGNAL
Attractor rs
out

Explore a changing trajectory

Try it. Compare lorenz and rossler under attractor/system. Keep a, b, and c at 1 to start.

Good to know

Some systems can settle or become periodic at particular settings. A changing trace alone does not prove chaos.

Inputs: None

Outputs: out: ARRAY

02 / SIGNAL
Oscillator rs
drive
out

Explore a nonlinear cycle

Try it. Compare vanderpol and duffing under oscillator/model, then change oscillator/nonlinearity.

Good to know

Models interpret the shared controls differently. Reset after changing models before comparing traces.

Inputs: drive: ARRAY

Outputs: out: ARRAY

03 / SIGNAL
Population rs
out

Follow interacting populations

Try it. Start with lotkavolterra and watch how its two components rise and fall.

Good to know

These are simplified models. Their variables are not forecasts of a real ecosystem or epidemic.

Inputs: None

Outputs: out: ARRAY

04 / SIGNAL
Kuramoto rs
frequencies
coupling
phases
waveforms
order

Let oscillators fall into step

Try it. Raise kuramoto/coupling from 0 to 3 and watch order.

Good to know

Order near 1 means phases are aligned. Noise and the spread of natural frequencies affect whether alignment occurs.

Inputs: frequencies: ARRAY · coupling: ARRAY

Outputs: phases: ARRAY · waveforms: ARRAY · order: ARRAY

05 / SIGNAL
Boolean rs
state
activity

Explore a network of on/off rules

Try it. Compare boolean/connections at 1, 2, and 3, resetting between runs.

Good to know

Activity measures changing units. A fixed seed helps compare the generated networks.

Inputs: None

Outputs: state: ARRAY · activity: ARRAY

06 / SIGNAL
Branching rs
drive
state
activity
avalanche

Watch activity spread in cascades

Try it. Compare branching/branching below and above 1 while watching activity.

Good to know

Avalanche sizes are reported when a cascade finishes. A short run is not enough to infer a power law or criticality.

Inputs: drive: ARRAY

Outputs: state: ARRAY · activity: ARRAY · avalanche: ARRAY

07 / SIGNAL
Hopfield rs
patterns
cue
state
overlap
energy

Explore an associative memory

Try it. Start with its internally generated patterns and compare hopfield/mode values classic and modern.

Good to know

Wire patterns and cue for a controlled recall experiment. The default demonstration does not measure memory accuracy on your own data.

Inputs: patterns: ARRAY · cue: ARRAY

Outputs: state: ARRAY · overlap: ARRAY · energy: ARRAY

08 / SIGNAL
Physarum rs
attract
trail
positions

Grow trails from local movement

Try it. Change physarum/decay and watch how long trails remain visible.

Good to know

The trail field and agent positions are separate outputs. More agents and a larger field increase processing cost.

Inputs: attract: ARRAY

Outputs: trail: ARRAY · positions: ARRAY

09 / SIGNAL
Swarm rs
attraction
positions
velocities
phases
order

Explore collective movement

Try it. Compare boids and vicsek under swarm/model, then change alignment.

Good to know

The controls apply differently across models. Reset between comparisons and begin with a modest count.

Inputs: attraction: ARRAY

Outputs: positions: ARRAY · velocities: ARRAY · phases: ARRAY · order: ARRAY

10 / SIGNAL
Reservoir rs
input
connectivity
state

Turn an input into a changing internal state

Try it. Change reservoir/leak and watch how quickly state responds.

Good to know

The reservoir is not trained here. Readout learns a mapping from its state to a target.

Inputs: input: ARRAY · connectivity: ARRAY

Outputs: state: ARRAY

11 / SIGNAL
Readout rs
state
target
prediction
error
weights

Learn a target from a state

Try it. Watch error, then turn readout/learning off to hold the learned weights.

Good to know

This recipe reconstructs its current input. Low training error does not show that it can predict unseen data or the future.

Inputs: state: ARRAY · target: ARRAY

Outputs: prediction: ARRAY · error: ARRAY · weights: ARRAY

12 / SIGNAL
NeuralMass rs
input
connectivity
out

Model a population as a few variables

Try it. Compare mass/model values jansenrit and wilsoncowan, then change mass/drive.

Good to know

These are model variables. To analyse their spectrum, retain the sample rate and collect a complete window.

Inputs: input: ARRAY · connectivity: ARRAY

Outputs: out: ARRAY

13 / SIGNAL
Spiking rs
input
potentials
spikes
rate

Explore individual spikes

Try it. Increase neuron/drive gradually and watch rate beside potentials.

Good to know

Network size and time step affect cost and behaviour. Keep them fixed when comparing drive or coupling.

Inputs: input: ARRAY

Outputs: potentials: ARRAY · spikes: ARRAY · rate: ARRAY

14 / SIGNAL
Quantum rs
angles
probabilities
bloch
entropy

Explore a small simulated quantum state

Try it. Change quantum/angle, then compare quantum/entangle on and off.

Good to know

This runs a classical simulation of a quantum state. The state size grows quickly with qubit count.

Inputs: angles: ARRAY

Outputs: probabilities: ARRAY · bloch: ARRAY · entropy: ARRAY

15 / GRAPHICS
Attractor wgsl
out
out

Draw the model’s trajectory

Try it. Connect signal Attractor.out to the graphics node’s out input.

Good to know

The input is named out because it matches the model output. Use a buffered history if you want a longer path.

Inputs: out: ARRAY

Outputs: out: TEXTURE

16 / GRAPHICS
Kuramoto wgsl
phases
out

See phases around a circle

Try it. Connect phases and compare the cluster of dots with the signal node’s order value.

Good to know

The graphics node shows the latest sample of a block. Large populations may be sampled for display.

Inputs: phases: ARRAY

Outputs: out: TEXTURE

17 / GRAPHICS
Boolean wgsl
state
out

See a Boolean network

Try it. Connect state and compare the picture as the model changes its rules.

Good to know

This is a view of the signal model; it does not generate a second network.

Inputs: state: ARRAY

Outputs: out: TEXTURE

18 / GRAPHICS
Branching wgsl
state
activity
avalanche
out

See cascades of activity

Try it. Connect state, activity, and avalanche to the matching inputs.

Good to know

Keep all three inputs from the same Branching node so the display describes one run.

Inputs: state: ARRAY · activity: ARRAY · avalanche: ARRAY

Outputs: out: TEXTURE

19 / GRAPHICS
Hopfield wgsl
state
overlap
out

See memory states

Try it. Connect state and overlap, then compare recall under different settings.

Good to know

The display shows the state supplied by the signal model.

Inputs: state: ARRAY · overlap: ARRAY

Outputs: out: TEXTURE

20 / GRAPHICS
Physarum wgsl
trail
positions
out

Render trails and agents

Try it. Connect trail and positions, then compare dense and fading trails.

Good to know

The model creates the field; this node renders it as a texture.

Inputs: trail: ARRAY · positions: ARRAY

Outputs: out: TEXTURE

21 / GRAPHICS
Swarm wgsl
positions
velocities
phases
out

Render collective movement

Try it. Connect positions, velocities, and phases from one Swarm model.

Good to know

Keep the model in two dimensions for the simplest first view.

Inputs: positions: ARRAY · velocities: ARRAY · phases: ARRAY

Outputs: out: TEXTURE

22 / GRAPHICS
Reservoir wgsl
state
out

See the reservoir’s activity

Try it. Connect state and vary the input signal.

Good to know

The picture is a view of internal activations, not a measure of prediction quality.

Inputs: state: ARRAY

Outputs: out: TEXTURE

23 / GRAPHICS
Spiking wgsl
spikes
potentials
out

See spikes and membrane potentials

Try it. Connect spikes and potentials from the same model.

Good to know

Use the signal outputs when you need numeric analysis rather than a rendered picture.

Inputs: spikes: ARRAY · potentials: ARRAY

Outputs: out: TEXTURE

24 / GRAPHICS
Quantum wgsl
bloch
probabilities
out

See probabilities and Bloch vectors

Try it. Connect probabilities and bloch while changing the model’s rotation angle.

Good to know

The view describes a simulated state; it does not perform measurements on hardware.

Inputs: bloch: ARRAY · probabilities: ARRAY

Outputs: out: TEXTURE

Patch recipes

RECIPE 01

Three kinds of changing motion

Compare an attractor, a nonlinear oscillator, and a population model. Each runs independently.

Three kinds of changing motion — example node outputs
Each line follows two coordinates from the same run. The open circle marks the start; the solid dot marks the end. Attractor shows the Lorenz x–z projection, Oscillator shows a Van der Pol phase portrait, and Population shows prey against predator. Their axes have different meanings and scales. Recorded from Goofi; numeric outputs are plotted here.

Download patch ↓

  1. Open the line viewers on Attractor, Oscillator, and Population. These downloads use block output so each viewer receives several samples.
  2. Start with the default models and watch how their shapes differ.
  3. Change one model at a time, then press sim/reset to start it again.
Attractor.outAttractorGraphics.out

What to look for. The models can oscillate, settle, or change irregularly. Their variables and scales have different meanings.

Try it

Switch Attractor from lorenz to rossler. Compare the components, then restore lorenz and change attractor/a slightly.

To draw a longer trajectory, add a Buffer before graphics Attractor and keep the coordinate axis intact.

RECIPE 02

Oscillators that synchronize

Give oscillators different natural frequencies, then increase their influence on one another.

Oscillators that synchronize — example node outputs
Each dot is an oscillator’s phase; the arrow shows their mean direction and alignment. The lower trace follows the order parameter as coupling changes from 0 to 3, during the shaded interval between captures. A longer arrow and order closer to 1 indicate tighter phase alignment. Recorded from Goofi; numeric outputs are plotted here.

Download patch ↓

  1. Start with kuramoto/coupling at 0 and watch the phases spread around the circle.
  2. Raise coupling to 1, then 3. Give the model time to settle at each setting.
  3. Compare the circle with the numeric order output.
Kuramoto.phasesKuramotoGraphics.phases

What to look for. Stronger coupling can pull phases together. Order approaches 1 as the oscillators align.

Try it

Keep coupling fixed and increase kuramoto/spread. Compare the result, then reset with the same seed.

Kuramoto is the signal model; KuramotoGraphics is the matching display node. Open the graphics out texture in a viewer.

RECIPE 03

Rules, cascades, and memory

Compare three networks with different rules for changing their state.

Rules, cascades, and memory — example node outputs
Boolean: each row is one unit, with turquoise marking its on state. Branching: rises and falls show changing cascade activity. Hopfield: the first second after reset, with each line measuring overlap with one stored memory. Read these as three separate models. Recorded from Goofi; numeric outputs are plotted here.

Download patch ↓

  1. Watch Boolean.activity for units that keep changing.
  2. Watch Branching.activity as cascades spread and end.
  3. Inspect Hopfield.state and overlap to see which internally generated pattern the model approaches.
Boolean.stateBooleanGraphics.state
Branching.stateBranchingGraphics.state
Branching.activityBranchingGraphics.activity
Branching.avalancheBranchingGraphics.avalanche
Hopfield.stateHopfieldGraphics.state
Hopfield.overlapHopfieldGraphics.overlap

What to look for. Similar-looking arrays can describe different systems: on/off rules, spreading events, or an associative memory.

Try it

Change one model at a time. Try Boolean connections 1 versus 3, or Branching ratio 0.8 versus 1.2. Reset between runs.

The three graphics nodes display their matching models. Avalanche statistics require many completed events; this recipe introduces the controls.

RECIPE 04

Trails and flocks

Explore two forms of collective movement: agents that follow trails and particles that follow neighbours.

Trails and flocks — example node outputs
Three stages of the same run. Physarum’s trail fields share one colour scale, so brightness can be compared across time. Swarm arrows show position and heading; arrow lengths are equal so they show direction, not speed. Times are seconds since recording began. Recorded from Goofi; numeric outputs are plotted here.

Download patch ↓

  1. Open Physarum.trail in an image viewer. Let the trail develop before changing a control.
  2. Open the graphics outputs to see the rendered models.
  3. Change physarum/decay or swarm/alignment while keeping the other model fixed.
Physarum.trailPhysarumGraphics.trail
Physarum.positionsPhysarumGraphics.positions
Swarm.positionsSwarmGraphics.positions
Swarm.velocitiesSwarmGraphics.velocities
Swarm.phasesSwarmGraphics.phases

What to look for. Physarum retains a spatial history through its trail field. Swarm updates particles from their interactions.

Try it

Raise physarum/decay from 0.005 to 0.08 to shorten the trail memory. In Swarm, compare vicsek with boids and reset before each run.

The starting counts are modest. Physarum starts with long-lived trails and gentle turns; Swarm starts in Vicsek mode so neighbours can align. Increase the counts after the patch runs smoothly.

RECIPE 05

Learn a simple readout

Drive a reservoir with a slow wave and train a readout to reconstruct that wave.

Learn a simple readout — example node outputs
Compare the prediction with the target above, then read the signed error below. Samples use their recorded timestamps; the heatmap interpolates them onto an even display grid for all 32 reservoir units. Readout is reset at the start and learning remains enabled. Matching the current target does not demonstrate forecasting. Recorded from Goofi; numeric outputs are plotted here.

Download patch ↓

  1. LFO sends a single changing value to Reservoir.input and Readout.target.
  2. Reservoir.state feeds Readout.state. Watch prediction and error as learning runs.
  3. Turn readout/learning off to freeze the weights.
LFO.outReservoir.input
LFO.outReadout.target
Reservoir.stateReadout.state
Reservoir.stateReservoirGraphics.state

What to look for. The readout adjusts its weights to match the supplied target. It is learning from the current input, not forecasting a future one.

Try it

Freeze learning, then change LFO’s frequency. Compare error before and after enabling learning again.

Reset Readout after changing reservoir size or starting a new learning task. Keep target timing aligned with the state you want to train on.

RECIPE 06

Populations, spikes, and quantum states

Compare three independent models and the different kinds of data they produce.

Populations, spikes, and quantum states — example node outputs
NeuralMass and Spiking show the final recorded second. Each tick in the spike raster is a firing event. Quantum compares the eight three-qubit outcomes with entangling gates enabled and disabled, using the same seed and rotation settings. These are independent models. Recorded from Goofi; numeric outputs are plotted here.

Download patch ↓

  1. Inspect NeuralMass.out as a line: its variables describe neural populations.
  2. Inspect Spiking.rate and the matching graphics output for individual spike activity.
  3. Inspect Quantum.probabilities and its graphics view while changing quantum/angle.
Spiking.spikesSpikingGraphics.spikes
Spiking.potentialsSpikingGraphics.potentials
Quantum.blochQuantumGraphics.bloch
Quantum.probabilitiesQuantumGraphics.probabilities

What to look for. Each output belongs to its model. A population variable, a spike rate, and a probability are different quantities.

Try it

Increase neuron/drive on Spiking. Then leave that model alone and switch quantum/entangle off to explore the quantum model separately.

These are simulations for exploration. The patch uses a small spiking network and three simulated qubits to keep the starting workload modest.

Working practice

Reset for a fair comparison

Choose a fixed seed where available and reset between runs. Change one parameter at a time, then allow the model to settle before comparing.

Separate a model from its picture

Use the signal outputs for measurements. Graphics nodes are views of those outputs; their colours and display settings do not change the underlying simulation.

Start small

Begin with the supplied network and particle counts. Increase size only after the patch runs comfortably. Keep time step and output rate fixed while comparing model behaviour.

Connect an output to a parameter → · All cookbooks