Advanced maths

Continuous to discrete state space calculator with zero order hold

Convert a small continuous A,B model using an augmented exponential,including singular A.

Your numbers

One real matrix row per line, comma-separated entries.
One row per state; one or two input columns.
Use a finite value within the stated calculator limits.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Convert a small continuous A,B model using an augmented exponential,including singular A.

THE FORMULAAd=exp(AT);Bd=integral_0^T exp(Aτ)B dτ.

A worked example

The double integrator at T=0.1 gives Ad=[[1,0.1],[0,1]] and Bd=[0.005,0.1].

Good to know

1–4 states,1–2 inputs,augmented order≤6,positive T≤20;time-scaled exponential norm≤100. Numerical zero-order hold,finite results;no sampling-rate advice.

Sampled inputs define the discretization

A continuous state equation x′=Ax+Bu describes changes at every instant. A discrete update x[k+1]=Ad x[k]+Bd u[k] instead relates samples separated by a specified interval. This page converts between those descriptions under the zero-order-hold assumption:the input remains constant between consecutive sample times.

That hold assumption is part of the mathematical model,not an implementation detail. A linearly interpolated input or an impulse train generally gives a different input matrix even when the state-transition matrix is unchanged. Keep the sample interval and hold convention with the returned matrices.

Continuous to discrete state space worked example with zero order holdConstant input u=1Δv=0.1;Δx=0.005Singular A supported
Scroll across to see the full diagram.
The double integrator at T=0.1 gives Ad=[[1,0.1],[0,1]] and Bd=[0.005,0.1].

Compare this with the Matrix exponential calculator e^(At). Convert A,B and a sample period to exact-ZOH Ad,Bd,including singular A,not simply exponentiate an input matrix.

Match states and input channels

Enter a square real A and a B with one row per state. The supported model has at most four states and one or two input channels,with a combined augmented order no greater than six. A positive interval describes how far forward each discrete step advances.

Ordering is significant. If a state changes units or two states are exchanged,A and B must change consistently before conversion. The page does not infer physical dimensions or select a useful sampling frequency for the application;it computes the entered finite mathematical model.

The state matrix is a matrix exponential

The exact held-input solution has Ad=exp(AT) and Bd equal to the integral of exp(Aτ)B from zero to T. Exact here describes the analytical discretization formula. Its evaluation in this calculator still uses bounded floating-point matrix arithmetic and a numerical exponential algorithm.

For a constant input,the integral combines the influence of the input over the entire interval. Multiplying B by T alone is generally insufficient because the system dynamics act while that input is applied. The state transition and input accumulation should therefore be interpreted together.

Avoid assuming that A is invertible

A familiar expression uses A inverse times(Ad−I)B,but it requires an invertible A. Integrators and other useful systems often have singular state matrices. This implementation avoids that restriction by exponentiating the block matrix with A,B and a zero lower block.

The top-left exponential block is Ad and the top-right block is Bd. The method includes the nonsingular case without switching formulas and handles repeated zero eigenvalues naturally. Large exponential norms are rejected by the underlying bounded implementation rather than returned as unchecked overflow.

A double integrator checks the singular case

For A with rows(0,1) and(0,0),B=(0,1) transpose,and T=0.1,the result is Ad=[[1,0.1],[0,1]] and Bd=(0.005,0.1) transpose. The quadratic term in Bd reflects the position change caused by constant acceleration during the interval.

Starting from rest with unit input gives velocity0.1 and position0.005 after one sample. A calculation using Bd=TB would miss the position contribution. This example also shows why a formula involving A inverse cannot be the only supported route:the double-integrator A is singular.

Numerical bounds and useful checks

The exponential implementation uses scaling,squaring and a converged power series on the scaled matrix. It checks finite values and restricts the norm of the time-scaled augmented matrix. A rejection means that this numerical interface did not support the requested scale,not that the exact exponential is undefined.

For repeated sample intervals,the state matrices should satisfy the semigroup identity Ad(T1+T2)=Ad(T2)Ad(T1). Held-input matrices obey a corresponding composition identity when the same input is maintained. These provide independent checks without pretending that every decimal entry is an exact symbolic expression.

Use the converted model under the same hold

The output is suitable for simulations and linear sampled-data calculations with a constant input over each step. It does not add sensor delays,quantization,actuator limits or stochastic process noise. Such extensions need their own discretization assumptions and should not be inferred from A and B alone.

The page returns only the state and input conversion. Output and feedthrough matrices remain the same under the ordinary sampled-output convention,but unusual observation averaging can change that model. Record the state order,interval and hold assumption when transferring the result to another control package.

A few questions, answered

Can A be singular?

Yes. The augmented exponential avoids the formula requiring A inverse.

What is held constant?

The input vector is constant over each sample interval.

Is the result symbolic?

No. The exact analytical hold formula is evaluated numerically.

Are output matrices converted too?

The interface converts A and B;ordinary sampled-output C,D remain a separate model choice.

Find your calculator

Start typing to explore the library.