How to generate model output given a transfer function and input signal
3 views (last 30 days)
Show older comments
Hello all,
I have used the systemIdentification toolbox to generate a transfer function from u to y as:
0.002879 s + 2.306e-05
----------------------------
s^2 + 0.003373 s + 0.0002227
Checking the box "Output model" gives an output y given the input vector as:
My question is how can I generate this output in code?
Thank you in advance!
0 Comments
Accepted Answer
Star Strider
on 21 Feb 2023
If you have the time vector and the matching input vector, use the lsim function to generate the output, however a more robust approach would be to use the compare function, specifically as described in Obtain Initial Conditions.
2 Comments
Star Strider
on 26 Feb 2023
My guess is that you are missing the initial conditions vector. This is one reason that using state space representation is preferable to other representations, especially since the ssest function will return the initial conditions if you request it. See the documentation section on Estimate Initial States as Independent Parameters for details.
The compare function incorporates it automatically if requested, the reason I suggested it.
More Answers (1)
Sulaymon Eshkabilov
on 20 Feb 2023
use tfestimate() - here is documentation how to use it:
0 Comments
See Also
Categories
Find more on Data Preparation Basics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!