Is there a nice way to discretely simulate an LTI system using a function block in Simulink?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Vinh
am 10 Apr. 2024
Kommentiert: Vinh
am 11 Apr. 2024
I want to simulate an LTI system in Simulink such that with each timestep, I call/use a function block to advance the discrete system one timestep forward. I have tried to do this but I ran into algebraic loop problems when trying to feed the function output (the next state of the system) back into its inputs (the current state of the system) for integration. Can I just throw a delay on equal to my discrete timestep between the output of the function and the input? This will need to be loaded and implemented on hardware eventually if that makes a difference.
Also, the reason I am doing it this way is that I need a bunch of extra logic on top of the simulation which would definitely be easier to implement in code form.
0 Kommentare
Akzeptierte Antwort
Fangjun Jiang
am 11 Apr. 2024
Bearbeitet: Fangjun Jiang
am 11 Apr. 2024
Yes. For sys = ss(A,B,C,D,ts), the following equation should be used to advance the simulation step by step. Make sure to use c2d() if your LTI is provided in continuous-time.
x[n+1]=Ax[n]+Bu[n]
y[n]=Cx[n]+Du[n]
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Schedule Model Components finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!