BlockWerk Guides

Running a Simulation

BlockWerk runs simulations using a compiled WebAssembly engine. Your block diagram is processed step by step at each time increment, with signal values updated at every sample point.

Starting, Pausing and Stopping

The simulation controls are in the toolbar at the bottom of the screen.

  • Play (Ctrl+Enter): Starts a new run from the configured Start Time. If paused, Play resumes from the current simulation time.
  • Pause: Suspends execution and freezes all signal displays. Click Play to continue from the same point.
  • Stop: Ends the run and returns to idle. Block displays keep their last values until the next run starts.

Time Settings

Expand the settings panel in the toolbar to configure the simulation window.

  • Start Time: The simulation clock begins here. Default: 0 s.
  • Stop Time: The simulation clock ends here. Default: 10 s.
  • Sample Time: How often signal values are recorded for display. Smaller values produce smoother plots but consume more memory. A good default is 0.01 s (100 Hz).

Choosing a Solver

The solver determines how differential equations in your diagram are numerically integrated.

  • Euler: First-order, fixed-step. Fast, but only reliable for simple or slow dynamics.
  • Heun (RK2): Second-order, fixed-step. Good balance of speed and accuracy for most systems.
  • RK4: Fourth-order, fixed-step. Recommended for general engineering models.
  • RK45: Variable-step adaptive solver (Dormand-Prince). Ideal when dynamics change suddenly or high precision is needed.
  • TR-BDF2: Implicit variable-step solver. Specifically designed for stiff systems where explicit solvers become unstable.

Step Size

For fixed-step solvers, the Step Size is the integration interval in seconds. A useful rule of thumb is to set it to one-tenth of the smallest time constant in your system. If you observe numerical instability or diverging values, reduce the step size.

Live Parameter Tuning

Parameters marked with a green LIVE badge in the property editor can be adjusted while the simulation is running. Changes take effect immediately on the next integration step — no restart needed.

Tip: Start with RK4 and a step size of 0.001 s. Switch to TR-BDF2 if your system is stiff, RK45 for adaptive precision, or Euler only when maximum speed matters and your dynamics are slow.

See Also

  • Integrator: Continuous-time state integration block.
  • Step: Standard test input signal.
  • uPlotDisplay: High-performance time-series viewer.

Simulate in BlockWerk

Interactive sandbox directly in your browser — zero installation, WASM-powered.

Simulate in BlockWerk →