StateResponse
✖
StateResponse
gives the numeric state response of the state-space model sys to input u for tmin≤t≤tmax.
gives the response of the discrete-time state-space model sys to the input sequence u[i].
Details

- StateResponse solves the state differential or difference equations for the given input u.
- The state-space model sys can be a StateSpaceModel, a continuous-time AffineStateSpaceModel, or a continuous-time NonlinearStateSpaceModel.
- A linear StateSpaceModel sys can also be a descriptor and delay system.
- The initial states xi0 are taken to be the state operating values of sys unless specified.
- For descriptor systems, the initial states need to be consistent.
- For delay systems, the initial states include history and can be given as xi0[t] for t≤0. »
Examples
open allclose allBasic Examples (4)Summary of the most common use cases
The state response of a continuous-time system to a unit step input:

https://wolfram.com/xid/01ykmm5x0vy-50qh2f


https://wolfram.com/xid/01ykmm5x0vy-xwienr

The response of a discrete-time system with initial conditions {1,-1}:

https://wolfram.com/xid/01ykmm5x0vy-kqmx6a

https://wolfram.com/xid/01ykmm5x0vy-vbrbt0

The state-response of a system to a Dirac delta input:

https://wolfram.com/xid/01ykmm5x0vy-kd0lff


https://wolfram.com/xid/01ykmm5x0vy-ozthqy

The step response of a time-delay system:

https://wolfram.com/xid/01ykmm5x0vy-enqqej

https://wolfram.com/xid/01ykmm5x0vy-lh51s

Scope (26)Survey of the scope of standard use cases
Continuous-Time Systems (16)
The state response of a single-input system to a unit step:

https://wolfram.com/xid/01ykmm5x0vy-scesh6

The initial conditions are assumed to be zero:

https://wolfram.com/xid/01ykmm5x0vy-9fei9h

The state response for a generic continuous-time system:

https://wolfram.com/xid/01ykmm5x0vy-840t2

The response to a unit step input:

https://wolfram.com/xid/01ykmm5x0vy-ulo3

The response of a descriptor StateSpaceModel:

https://wolfram.com/xid/01ykmm5x0vy-tjrx4p


https://wolfram.com/xid/01ykmm5x0vy-fvws2s



The numeric response to a sinusoidal input:

https://wolfram.com/xid/01ykmm5x0vy-rotz0k


https://wolfram.com/xid/01ykmm5x0vy-x3bo6p

Specify {0.2,0.1} as the initial state values:

https://wolfram.com/xid/01ykmm5x0vy-p0viva


https://wolfram.com/xid/01ykmm5x0vy-3xncix

The response of a two-input system to input signals {SquareWave[t],Sin[t]}:

https://wolfram.com/xid/01ykmm5x0vy-5p9fve

The state response of a three-input system to inputs {Sin[t],Cos[t],Cos[t]}:

https://wolfram.com/xid/01ykmm5x0vy-vm2pfi


https://wolfram.com/xid/01ykmm5x0vy-iucpm9

If there are fewer input signals than inputs, the remaining inputs are assumed to be zero:

https://wolfram.com/xid/01ykmm5x0vy-0yxs3i

https://wolfram.com/xid/01ykmm5x0vy-59ahqf

If a scalar input signal is given for a multiple-input system, it is applied to each input in turn:

https://wolfram.com/xid/01ykmm5x0vy-habbfs

https://wolfram.com/xid/01ykmm5x0vy-lasudb

StateResponse[…,{t,tmin,tmax}] gives the result in terms of interpolating function objects:

https://wolfram.com/xid/01ykmm5x0vy-bfrc6w


https://wolfram.com/xid/01ykmm5x0vy-l7kecd

The step response of a singular descriptor system:

https://wolfram.com/xid/01ykmm5x0vy-h2wuyk

https://wolfram.com/xid/01ykmm5x0vy-lr1l0s

The symbolic response for a singular descriptor system:

https://wolfram.com/xid/01ykmm5x0vy-qfg82


https://wolfram.com/xid/01ykmm5x0vy-indaxy

The state response of an AffineStateSpaceModel to a UnitStep input:

https://wolfram.com/xid/01ykmm5x0vy-4ooqbv


https://wolfram.com/xid/01ykmm5x0vy-vpv6nm

The response from nonzero initial conditions:

https://wolfram.com/xid/01ykmm5x0vy-qqzq1k

The state response of a NonlinearStateSpaceModel to a sinusoidal input:

https://wolfram.com/xid/01ykmm5x0vy-1i33z2


https://wolfram.com/xid/01ykmm5x0vy-j7031r

Discrete-Time Systems (10)
The state response of a single-input system to a unit step input:

https://wolfram.com/xid/01ykmm5x0vy-c382p8

Plot the response for eight steps:

https://wolfram.com/xid/01ykmm5x0vy-06rw4e

The response for a generic discrete-time system:

https://wolfram.com/xid/01ykmm5x0vy-n23rsa

The response to a unit step sequence:

https://wolfram.com/xid/01ykmm5x0vy-i5i745

The response for a symbolic descriptor system:

https://wolfram.com/xid/01ykmm5x0vy-chq17

The state response to a sampled sinusoid:

https://wolfram.com/xid/01ykmm5x0vy-l62xmk

Plot the response with a zero-order hold:

https://wolfram.com/xid/01ykmm5x0vy-77ptsd

The state response of a two-input system to two randomly sampled inputs:

https://wolfram.com/xid/01ykmm5x0vy-720hnr


https://wolfram.com/xid/01ykmm5x0vy-0omx4

The response to a random input sequence:

https://wolfram.com/xid/01ykmm5x0vy-ys8a9x


https://wolfram.com/xid/01ykmm5x0vy-l3twk8

A two-input state-space model:

https://wolfram.com/xid/01ykmm5x0vy-ixjgt5
When only one input signal is given, the remaining inputs are set to zero:

https://wolfram.com/xid/01ykmm5x0vy-dqr8so

The second and fourth states are not excited because the second input is zero:

https://wolfram.com/xid/01ykmm5x0vy-r5bmqw

If a single-input sequence is given to a multi-input system, it is applied to each input in turn:

https://wolfram.com/xid/01ykmm5x0vy-38fkx

Discrete-time time-delay systems accept a history for time steps before k0:

https://wolfram.com/xid/01ykmm5x0vy-dic56t

https://wolfram.com/xid/01ykmm5x0vy-i2f5qb


https://wolfram.com/xid/01ykmm5x0vy-g1ickg

Generalizations & Extensions (3)Generalized and extended use cases
If the initial time is not specified, it is assumed to be zero:

https://wolfram.com/xid/01ykmm5x0vy-x8dm9

https://wolfram.com/xid/01ykmm5x0vy-fzwokp

For a state-delay system, the initial states can include history:

https://wolfram.com/xid/01ykmm5x0vy-bxz4vh

For discrete-time systems with delays, the initial states can be given as a sequence:

https://wolfram.com/xid/01ykmm5x0vy-hnefhc


https://wolfram.com/xid/01ykmm5x0vy-l6jvx8

Applications (4)Sample problems that can be solved with this function
The model of a stabilized inverted pendulum on a moving cart has the cart displacement d and velocity v, together with the pendulum's angular position θ and velocity ω as the state variables:

https://wolfram.com/xid/01ykmm5x0vy-ua0byb
Compute the acceleration a of the cart and the angular acceleration α of the pendulum by differentiating the cart's velocity and the pendulum's angular velocity obtained using StateResponse:

https://wolfram.com/xid/01ykmm5x0vy-pbqyfn



https://wolfram.com/xid/01ykmm5x0vy-gbq946

Analyze the response of the states to each control input for a multi-input system:

https://wolfram.com/xid/01ykmm5x0vy-0oienu

https://wolfram.com/xid/01ykmm5x0vy-e2sm72

The state-space model of a production and inventory control system with desired production rate and sales rate as inputs and actual production rate and inventory level as states:

https://wolfram.com/xid/01ykmm5x0vy-es0ry0
Determine the response for a given production rate and 10% jump in sales from the initial equilibrium condition:

https://wolfram.com/xid/01ykmm5x0vy-s9hifn

Plot the response for specific initial conditions:

https://wolfram.com/xid/01ykmm5x0vy-262fe2

The Clohessy–Wiltshire equations model the relative motion between two satellites orbiting a central body:


https://wolfram.com/xid/01ykmm5x0vy-p98pk
Use StateResponse to obtain the closed relative orbits from a particular set of launch conditions:

https://wolfram.com/xid/01ykmm5x0vy-gj3mb0

https://wolfram.com/xid/01ykmm5x0vy-kq2yop

Properties & Relations (3)Properties of the function, and connections to other functions
The results of StateResponse and OutputResponse match for state output:

https://wolfram.com/xid/01ykmm5x0vy-xsst8y

State output occurs when the output matrix is identity and the transmission matrix is zero:

https://wolfram.com/xid/01ykmm5x0vy-308m0r

The natural response is determined by the poles of the system:

https://wolfram.com/xid/01ykmm5x0vy-4ggyzq

It is invariant under any similarity transformation:

https://wolfram.com/xid/01ykmm5x0vy-kc3y9j


https://wolfram.com/xid/01ykmm5x0vy-c2q5kh

The initial states for a descriptor system are chosen to be consistent for the inputs:

https://wolfram.com/xid/01ykmm5x0vy-huclh

https://wolfram.com/xid/01ykmm5x0vy-knj6o

The second state equals the derivative of the input:

https://wolfram.com/xid/01ykmm5x0vy-r2c57

When inconsistent conditions are given, they are replaced:

https://wolfram.com/xid/01ykmm5x0vy-e1l7za




https://wolfram.com/xid/01ykmm5x0vy-klh2ji

Consistent initial states depend on the slow subsystem in KroneckerModelDecomposition:

https://wolfram.com/xid/01ykmm5x0vy-624bj

For continuous-time systems, the initial conditions are given by :

https://wolfram.com/xid/01ykmm5x0vy-i46028

Possible Issues (2)Common pitfalls and unexpected behavior
Symbolic state responses do not support time delays:

https://wolfram.com/xid/01ykmm5x0vy-erfy8



https://wolfram.com/xid/01ykmm5x0vy-ce9uu3

For descriptor systems, solutions only exist when Det[λ e - a]≠0 for some λ:

https://wolfram.com/xid/01ykmm5x0vy-hfa3f1


Wolfram Research (2010), StateResponse, Wolfram Language function, https://reference.wolfram.com/language/ref/StateResponse.html (updated 2014).
Text
Wolfram Research (2010), StateResponse, Wolfram Language function, https://reference.wolfram.com/language/ref/StateResponse.html (updated 2014).
Wolfram Research (2010), StateResponse, Wolfram Language function, https://reference.wolfram.com/language/ref/StateResponse.html (updated 2014).
CMS
Wolfram Language. 2010. "StateResponse." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/StateResponse.html.
Wolfram Language. 2010. "StateResponse." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/StateResponse.html.
APA
Wolfram Language. (2010). StateResponse. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/StateResponse.html
Wolfram Language. (2010). StateResponse. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/StateResponse.html
BibTeX
@misc{reference.wolfram_2025_stateresponse, author="Wolfram Research", title="{StateResponse}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/StateResponse.html}", note=[Accessed: 29-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_stateresponse, organization={Wolfram Research}, title={StateResponse}, year={2014}, url={https://reference.wolfram.com/language/ref/StateResponse.html}, note=[Accessed: 29-March-2025
]}