simulate the closed loop system response of state space model
52 views (last 30 days)
Show older comments
Hi all, I am new to matlab and I am trying to write a code to simulate a closed loop system response. The state space model matrices are as below: A= [0 1 0;0 0 1; 24 14 -1]; B=[0;0;1]; C=[2 -1 1]; To stabilize the system poles will be located at −5 ± j5 and −10 and observer poles at −20, −20.1 and −20.1. If x1(0) = x2(0) = x3(0) = 3 , how do I simulate the closed loop signal with matlab code?
I assume I have to plot the estimate of x ?!
x_est=x_est+(A*x_est +B*u+ kob*(y-r-(C*x_est)))*Delta; Delta is the sampling rate and r is the reference signal.
I have done the controller gain as [ 524 164 19 ] and the observer gain as kob=[-48.4230; 188.3611; 344.4071] I just don't know how to plot the estimate now :(
Thanks
0 Comments
Answers (1)
Mark Schwab
on 6 Sep 2017
Hey Mahdieh,
There are many ways to plot responses to state space models in MATLAB. Many of these involve creating a system object and plotting the system object with an appropriate function. I believe the following documentation includes examples that are related to your workflow:
https://www.mathworks.com/help/control/examples/plotting-system-responses.html
Also, the "lsim" function is a pretty versatile function for controls in MATLAB that simulates the time response of dynamic systems. I would recommend looking into this function if you plan on continuing to work with controls in MATLAB. I have included the documentation below:
https://www.mathworks.com/help/control/ref/lsim.html
Mark Schwab
0 Comments
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!