### 1.28 Determine the state response of a system to only initial conditions in state space

Problem: Given a system with 2 states, represented in state space, how to determine the state change due some existing initial conditions, when there is no input forces?

Mathematica

 Remove["Global*"]; a = {{-0.5572,-0.7814},{0.7814, 0}}; c = {{1.9691, 6.4493}}; sys=StateSpaceModel[ {a,{{1},{0}},c,{{0}}}]  x0 = {1,0}; {x1,x2} = StateResponse[ {sys,x0},0,{t,0,20}]; Plot[{x1,x2},{t,0,20}, PlotRange->All, GridLines->Automatic, GridLinesStyle->Dashed, Frame->True, ImageSize->350, AspectRatio->1, FrameLabel->{{"y(t)",None}, {"t", "first and second state\ change with time" }}, RotateLabel->False, PlotStyle->{Red,Blue}, BaseStyle -> 12] 

Matlab

 clear; A = [-0.5572 -0.7814;0.7814 0]; B = [1;0]; C = [1.9691 6.4493]; x0 = [1 ; 0]; sys = ss(A,B,C,[]); [y,t,x]=initial(sys,x0,20); plot(t,x(:,1),'r',t,x(:,2),'b'); title('x1 and x2 state change with time'); xlabel('t (sec)'); ylabel('x(t)'); grid set(gcf,'Position',[10,10,320,320]); `