- 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
State Space unit step and initial conditions
조회 수: 117 (최근 30일)
이전 댓글 표시
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!
댓글 수: 0
답변 (3개)
Daniel Stankowski
2020년 1월 7일
The above method works but you can also use an lsim command.
Do the following:
lsim(sys,u,t,x0)
where;
댓글 수: 2
shivam sahil
2020년 4월 11일
A small correction, it should be:
u=ones(length(t),1) ;
instead of
u=ones(length(t))
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.
댓글 수: 0
Drishya Dinesh
2021년 4월 19일
how to get a response with initial value of 10.
t2=400;
u_del=(0.0022*k*(s+0.06931)*(s^2+0.4852*s+0.1492))/((s+0.04833)*(s+0.004352)*(s^2+0.06012*s+0.01331));
figure
step(u_del,t2);
ylabel('Velocity,u (m/s)','fontsize',10);
title('Time Response');
grid
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Dynamic System Models에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!