Categories &

Functions List

Function Reference: initial

Function File: initial (sys, x0)
Function File: initial (sys1, sys2, …, sysN, x0)
Function File: initial (sys1, 'style1', …, sysN, 'styleN', x0)
Function File: initial (sys1, …, x0, t)
Function File: initial (sys1, …, x0, tfinal)
Function File: initial (sys1, …, x0, tfinal, dt)
Function File: [y, t, x] = initial (sys, x0)
Function File: [y, t, x] = initial (sys, x0, t)
Function File: [y, t, x] = initial (sys, x0, tfinal)
Function File: [y, t, x] = initial (sys, x0, tfinal, dt)

Initial condition response of a state-space model. If no output arguments are given, the response is printed on the screen.

Inputs

sys

LTI system in state-space representation.

x0

Vector of initial conditions for each state.

t

Optional time vector. Should be evenly spaced. If not specified, it is calculated by the poles of the system to reflect adequately the response transients.

tfinal

Optional simulation horizon. If not specified, it is calculated by the poles of the system to reflect adequately the response transients.

dt

Optional sampling time. Be sure to choose it small enough to capture transient phenomena. If not specified, it is calculated by the poles of the system.

’style’

Line style and color, e.g. ’r’ for a solid red line or ’-.k’ for a dash-dotted black line. See help plot for details.

Outputs

y

Output response array. Has as many rows as time samples (length of t) and as many columns as outputs.

t

Time row vector.

x

State trajectories array. Has length (t) rows and as many columns as states.

Example

Consider a continuous- or a discrete-time system of the form

Continuous Time: $$\dot{x}(t) = A\,x(t) + B\,u(t),\quad x(0)=x_0,\quad y(t) = C\,x(t) + D\,u(t)$$

Discrete Time: $$x(k+1) = A\,x(k) + B\,u(k),\quad x(0)=x_0,\quad y(k) = C\,x(k) + D\,u(K)$$

The dynamic behavior of the system for u=0 and only driven by the initial system state x(0) is given by

 sys = ss (A, B, C, D);
 initial (sys, x0);
 

Remark

For a SISO input-output model G and initial values for the output y and its derivatives up to order n-1 the corresponding state space represetaiton is computed by:

 [A,b,c,d] = ssdata (G);
 T = obsv (A, c);
 G_ss = ss2ss (ss (G), T);
 initial (G_ss, x0);
 

Note that, in general, the states of G_ss are only equal to the output y and its first n-1 time derivaties if u=0, which is the case for the initial condition response.

Source Code: initial