Simulating a difference equation with certain initial values
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi, I'm trying to simulate the following difference equation in Matlab using the lsim function:
y(k) + a*y(k-1) = b*u(k) + c*u(k-1). Where u is the input, y is the ouput, and [a,b,c] are scalar parameters. y(1)=0.5, u(0)=u(1)=1 are the initial values.
However I cant figure out how to implement these initial values. The document on the lsim function says that it only allows initial values when working with state-space models. I wrote it as a transfer function: tf([b c],[1 a],ts,'Variable','q^-1') but then when i simulate it y(1) will just become equal to u(1) probably because y(0) and u(0) haven been set to 0. How would you guys recommend to solve this?
Thanks for your time!
Working with Matlab R2015a
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Dynamic System Models finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!