potting the integral of a state

1视图(最近30天)
Basetsana Sebolao
Basetsana Sebolao on 19 May 2021
Edited: Paul on 20 May 2021
Hi everyone
I would like to enquire about integralting a state.Afer solving a state space equation on matlab sing ode45, how does one go about plotting the integral of a state, please kindly assist, thank you in advance!

Answers (1)

托斯滕
托斯滕 on 19 May 2021
If y'(t)=f(t,y) is the state space equation, you get the integral of y by simultaneously solving z'(t)=y(t), z(0)=0.
2 Comments
Paul
Paul on 19 May 2021
Edited:Paul on 20 May 2021
Implement what @torsten 建议。
Change the last line of sys to:
di = [Ai + Bv; i];
Change iniCon to:
iniCon = [0;0;0;0;zeros(4,1)];% assuming you want the integrals of y(i) to start from zero
Then y will have 8 states, the first 4 are i and the second 4 are the integrals of i

Sign in to comment.

s manbetx 845


发布

R2020a

Community Treasure Hunt

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

开始狩猎!