State Space unit step and initial conditions

195 ビュー (過去 30 日間)
David Bowden
David Bowden 2017 年 4 月 10 日
回答済み: Drishya Dinesh 2021 年 4 月 19 日
I am trying to get MATLAB to show a state space response with both a unit step input and initial conditions. All documentation shows only how to do one or the other, as if I try using step() or initial(), the second overrides the first. Thanks!

回答 (3 件)

Daniel Stankowski
Daniel Stankowski 2020 年 1 月 7 日
The above method works but you can also use an lsim command.
Do the following:
  • sys - defines your state space
  • u defines your input signal which in case of step input can be defined as u=ones(length(t)) % cause we know for step u(t)=1 (you can see it from laplace transform tables)
  • t - time, for example; t=linspace(0,5,10)
  • x0 = is a vector of initial conditions
  2 件のコメント
Xiaohan Tang
Xiaohan Tang 2021 年 1 月 3 日
Thank you!!!


Youngsik Kim
Youngsik Kim 2017 年 11 月 3 日
You can get the zero input response from initial() and zero state response from step() separately, and then you can add up later to plot the response.
[yi,ti,xi]=initial(systm,xinitial); [ystep,ts,xs]=step(systm,ti);
Then, the superposition of them is what you want. ytotal=yi+ystep; Then plot time .vs. ytotal.

Drishya Dinesh
Drishya Dinesh 2021 年 4 月 19 日
how to get a response with initial value of 10.
ylabel('Velocity,u (m/s)','fontsize',10);
title('Time Response');


Help Center および File ExchangeDynamic System Models についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by