Example data table
| x | H(x − a) | y(x) |
|---|---|---|
| -1 | 0 | 2 |
| 0 | 0 | 2 |
| 1 | 0.5 | 4.5 |
| 2 | 1 | 7 |
| 3 | 1 | 7 |
Formula used
This calculator uses the Heaviside step function, written as H(x − a).
H(x − a) = h₀, if x = a
H(x − a) = 1, if x > a
Multiple: y(x) = offset + Σ Aᵢ·H(x − bᵢ)
How to use this calculator
- Select Single for one breakpoint, or Multiple to sum several steps.
- Enter x and an offset (the baseline value).
- Choose the equality rule to control the value when x equals a breakpoint.
- Provide A, a for Single mode, or add rows (bᵢ, Aᵢ) for Multiple mode.
- Turn on the range table to generate a sequence of values across an interval.
- Press Calculate; then export results using CSV or PDF buttons.
Defining a step function precisely
A step function changes value abruptly at one or more breakpoints. In this calculator, the core building block is the Heaviside term H(x−a), which equals 0 before a and 1 after a. The output y(x) is measured in the same units as the offset and step heights, so consistent units matter when modeling real thresholds. To avoid floating roundoff, equality is detected with a tiny tolerance (about 1e−12). Values within that window use the chosen breakpoint rule.
Single-step model for thresholds
For one breakpoint a, the model is y(x)=offset + A·H(x−a). If offset=2, A=5, and a=1, then y(0)=2 and y(2)=7. The computed H(x−a) indicator is useful for debugging: it shows whether the step is inactive (0), active (1), or at the jump.
Multiple steps for piecewise baselines
Many problems require several jumps. Multiple mode evaluates y(x)=offset + ΣAᵢ·H(x−bᵢ). For example, offset=10 with steps (b₁=−1,A₁=3) and (b₂=2,A₂=−1.5) yields y(−2)=10, y(0)=13, and y(3)=11.5. Sorting breakpoints improves interpretability and makes the exported table easier to scan.
Choosing the value at the breakpoint
At x=a, some textbooks define H(0)=0, others use 1, and many analyses prefer 0.5 for symmetry. Your selection affects only the exact breakpoint row, but it can matter in fitting routines or when using the table as test data. A custom equality value lets you match a house convention or a discrete-time rule.
Range tables for validation and export
The range section generates evenly spaced samples from xₛ to xₑ using Δx. Smaller Δx captures rapid transitions around breakpoints, while larger Δx reduces file size. If you set xₛ=−5, xₑ=5, and Δx=0.5, you obtain 21 points for plotting, QA checks, and downstream calculations. CSV and PDF exports reproduce the same grid. Use Max rows to cap outputs; 500–2000 rows suits fast checks. For smoother plots, shrink Δx and the interval instead of exporting huge tables in one click.
Common applications and interpretation
Step models appear in switching circuits, pricing tiers, control deadbands, inventory policies, and piecewise approximations of nonlinear curves. A positive A represents an upward jump; a negative A represents a drop. When you align bᵢ to real thresholds, the graph provides an immediate sanity check that y(x) matches the intended business or physical rule.
FAQs
This tool uses the Heaviside step H(x−a): 0 before the breakpoint, 1 after it, and a configurable value exactly at the breakpoint for consistency.
It only affects rows where x equals a breakpoint, but it can change test fixtures, fitted parameters, and discrete simulations that sample exactly on thresholds.
Each row contributes Aᵢ·H(x−bᵢ). When x passes bᵢ, that height is added to the running total, so upward and downward steps accumulate into a piecewise-constant curve.
Pick xₛ and xₑ to cover all breakpoints, then choose a smaller Δx near jumps. If the table grows too large, narrow the interval instead of forcing huge row counts.
The generator stops when it reaches the Max rows limit. Increase Max rows or use a larger Δx to reduce the number of samples.
Yes. Use a negative height A (or Aᵢ) for a drop, and use Offset to set the baseline value before any step activates.