Model railway cassette length matching calculator

Calculate train cassette assignments and rack-limited unassigned trains with your own figures.

Your numbers

Use the units shown. Results update as you change valid inputs.

Use train cassette assignments and rack-limited unassigned trains to compare changes to your inputs. The method and limits below explain the scope.

Examples

Examples

Try the starting example

Train lengths (millimetres)
800,1000,1200
Cassette usable lengths (millimetres)
900,1100
Available rack slots (count)
2
Train cassette assignments (JSON)
[1,2,null]
Rack-limited unassigned trains (count)
1

Try another scenario

Train lengths (millimetres)
700,900,1100
Cassette usable lengths (millimetres)
800,1000,1200
Available rack slots (count)
3
Train cassette assignments (JSON)
[1,2,3]
Rack-limited unassigned trains (count)
0
Calculation method

Calculation method

Train cassette assignments (JSON)

Match trains to cassette slots whose usable length>=train length; maximum-cardinality matching.

Rack-limited unassigned trains (count)

Count unmatched trains after limiting usable cassettes to first rack-slot count.

Symbols and units
a
Train lengths (millimetres)
b
Cassette usable lengths (millimetres)
c
Available rack slots (count)

Use the units shown. A list keeps the order in which you enter its values. The symbol ^ means “raised to the power of”.

Assumptions & limits

Assumptions & limits

  • One train per cassette; all cassettes occupy one user-measured rack slot. No overhang allowed. Supported limits: All numeric inputs and computed intermediates must remain finite. Supported numeric input magnitude is zero or 1e-12 through 1e12 in absolute value; reject values outside this bounded range. All lists/JSON record tables are limited to 100 records unless a stricter bound is stated; reject malformed record arity and wrong member types. Positive train/cassette lengths; cassette list represents distinct physical cassettes; first rack-slot-count cassettes are available.
Are these inputs private?

These calculations run in your browser. A shared link contains the values you choose to share. Only questions submitted to the separate AI finder are sent to OpenAI.

Share this page
Share this calculator

Leave unchecked to share the page without your entered values.