Advanced Petri Net Simulator Calculator

Explore token dynamics across structured discrete systems. Test firing sequences, capacities, and transition conflicts easily. Understand net behavior through examples, formulas, visuals, and exports.

Enter Petri net data

Comma-separated names, such as P1,P2,P3.
Comma-separated names, such as T1,T2,T3.
One nonnegative integer per place.
Use integers, or inf for unlimited places.
The simulator stops at this limit or earlier.
Choose automatic firing or a requested sequence.
Used only in automatic mode.
Enter transition names or 1-based indices, separated by commas.
One row per place and one column per transition. Separate values by commas.
Use the same row and column order as the pre-incidence matrix.

Example data table

Item Example value Meaning
Places P1, P2, P3 Three token storage positions.
Transitions T1, T2, T3 Three events that move tokens.
Initial marking 3, 0, 0 All tokens begin in P1.
Capacities 5, 5, 5 Each place holds at most five tokens.
Pre matrix [1,0,0] / [0,1,0] / [0,0,1] Each transition consumes one token from its source place.
Post matrix [0,1,0] / [0,0,1] / [1,0,0] Each transition sends one token to the next place.
Expected behavior Cyclic token circulation The marking rotates through places without changing total tokens.

Formula used

A transition is enabled when every required input token exists and every capacity remains valid after firing.

Enabled(t) if M(p) ≥ Pre(p,t) for all places p, and M'(p) ≤ K(p).

The next marking follows the standard state update rule.

M'(p) = M(p) − Pre(p,t) + Post(p,t)

The incidence matrix helps summarize net token change by transition.

C = Post − Pre

The compact state equation for one firing step is shown below.

M(k+1) = M(k) + C · σ(k)

Here, σ(k) is the firing vector for the selected transition at step k.

How to use this calculator

  1. Enter all place names in the exact row order you want.
  2. Enter transition names in the exact column order you want.
  3. Provide the initial marking with one integer per place.
  4. Add capacities if you want bounded-place checks during firing.
  5. Paste the pre and post matrices using the same row and column order.
  6. Choose automatic mode for rule-based firing, or sequence mode for manual testing.
  7. Set the maximum steps, then run the simulation.
  8. Review the result summary, simulation log, matrices, graph, and export buttons.

Frequently asked questions

1) What does this simulator calculate?

It simulates token movement in a discrete Petri net. The page checks enabled transitions, applies firings, tracks markings over time, counts visited states, and highlights deadlocks or blocked requests.

2) What is the difference between pre and post matrices?

The pre matrix shows tokens consumed from each place by each transition. The post matrix shows tokens produced into each place after that same transition fires.

3) What happens when a requested transition is not enabled?

The simulator records the blocked request and stops sequence mode. This helps you test invalid event orders, resource shortages, or capacity conflicts within the modeled system.

4) Does the tool prove reachability or liveness?

No formal proof is attempted here. The tool reports the markings reached during the simulated path only. That path-based evidence is still useful for debugging models and testing scenarios.

5) Why can total tokens remain unchanged?

Some nets conserve tokens because each firing only relocates them. If the total stays constant across all simulated steps, the chosen firing path behaved conservatively.

6) Can I use unlimited capacities?

Yes. Enter inf for any place capacity you want treated as unbounded. Leave the whole capacity field blank if every place should be considered unlimited.

7) What does the automatic strategy change?

It changes which enabled transition fires next. First enabled is deterministic, cyclic rotates choices, and highest output weight prefers transitions that produce the greatest total tokens.

8) What is the graph showing?

The line chart shows token counts for each place after every step. The bar chart shows how often each transition fired during the completed simulation.

Related Calculators

linear model calculatorpolynomial regression modelnash equilibrium calculatorhazard function calculatormodel selection aicgravity model calculatornonlinear regression tooldiscrete event simulatorbayesian network tool

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.