State Space Trajectory Calculator

Model linear states with configurable inputs and time steps. View trajectories and stability metrics instantly. Compare motion patterns across parameters using plotted phase paths.

Calculator Inputs

Use the matrix entries, constant inputs, initial state, and simulation controls below. Large screens show three columns, smaller screens show two, and mobile shows one.

State matrix entry for x in x'.
State matrix entry for y in x'.
State matrix entry for x in y'.
State matrix entry for y in y'.
Constant forcing term in x'.
Constant forcing term in y'.
Starting x state.
Starting y state.
Smaller values increase accuracy and point count.
Full simulation horizon.
RK4 usually gives better trajectories than Euler.

Formula Used

This tool models a two state continuous linear system with constant inputs. The state vector is s(t) = [x(t), y(t)]ᵀ.

x'(t) = a·x(t) + b·y(t) + u
y'(t) = c·x(t) + d·y(t) + v
A = [ [a, b], [c, d] ],   f(s) = A·s + [u, v]ᵀ
Euler update: sn+1 = sn + h·f(sn)
RK4 update: sn+1 = sn + h(k₁ + 2k₂ + 2k₃ + k₄)/6
Trace τ = a + d, Determinant Δ = ad - bc, Eigenvalues λ = (τ ± √(τ² - 4Δ))/2
Equilibrium s* solves A·s* + [u, v]ᵀ = 0

The phase graph plots x versus y. The time graph plots each state against time. Stability labels come from trace, determinant, and discriminant of the system matrix.

How to Use This Calculator

  1. Enter the matrix values a, b, c, and d for your two state system.
  2. Add constant inputs u and v if an external forcing term exists.
  3. Set initial conditions x(0) and y(0).
  4. Choose a time step and total simulation time.
  5. Select RK4 for better numerical accuracy or Euler for a simpler update.
  6. Press the submit button to generate stability metrics, output tables, and graphs.
  7. Download the computed data as CSV or PDF after the result appears.

Example Data Table

This sample table illustrates the kind of trajectory output the calculator produces.

Step Time x(t) y(t) Radius
00.002.0000000.5000002.061553
201.001.336341-1.0563041.703358
402.00-0.057482-1.5382101.539284
603.00-1.072544-0.7551461.311734
804.00-1.0648820.3119941.109653

Frequently Asked Questions

1) What does this calculator solve?

It simulates a two state continuous linear system with optional constant forcing. It computes the trajectory, equilibrium point, eigenvalues, trace, determinant, and a stability class, then plots the phase path and time response.

2) When should I use RK4 instead of Euler?

Use RK4 when you want better accuracy for oscillatory, stiff leaning, or longer simulations. Euler is faster and simpler, but it can distort spiral paths or exaggerate growth and decay when the time step is too large.

3) How is the equilibrium point computed?

The equilibrium is the state where both derivatives are zero. The calculator solves A·s* + input = 0. If the determinant of A is zero, a unique equilibrium may not exist.

4) What does a saddle classification mean?

A saddle means one direction decays while another grows. Small perturbations along the unstable direction move the state away from equilibrium, so the system is overall unstable even if one axis appears attractive.

5) Do constant inputs change the eigenvalues?

No. Constant inputs shift the equilibrium location, but the eigenvalues depend only on the system matrix. That means the path shape near equilibrium is controlled by A, not by the constant offset.

6) How small should the time step be?

Choose a step small enough to capture the fastest motion in your system. Start with a smaller value like 0.01 or 0.05, then compare results. If the graph changes noticeably, your previous step was too large.

7) Can I use this for nonlinear systems?

Directly, no. This calculator is built for linear two state models. You can still analyze a nonlinear system locally by linearizing it around an operating point and entering the resulting Jacobian values.

8) Why does the radius sometimes grow before shrinking?

Transient geometry can cause temporary growth, especially when state directions are coupled. Even stable systems may stretch first and contract later, depending on initial conditions, matrix orientation, and the chosen numerical step.

Related Calculators

cellular automata simulatorphase portrait plotterdynamical system simulatorcobweb diagram generatorbasin of attraction calculatorhopf bifurcation calculator

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.