# Get transfer function from data and known input

4 views (last 30 days)
Or Perez on 31 May 2022
Commented: Star Strider on 31 May 2022
Hey there :)
So this is what I know about the system:
• The system is a second order system
• The input is u(t) = 2·1(t)
• A structure has been given to me with y(t) against t(sec)
When I plot it I get this graph:
What I need:
I need to find the trasnfer function for the conditions above.
I know that I can find it analytically by finding Mp, Zeta, Wn and etc...
Is there a shortcut to find the transfer function?
I tried working with systemIdentification and tfest but both ways ask me to give the number of poles and zeros which I don't know + I can't tell the program that the data is for the input u(t) = 2·1(t).
This is what I get from systemIdentification tool, but I might be using it wrong:
The code:
data = iddata(Struc.y, Struc.time, 1*10^(-4));
plot(Struc.time, Struc.y, '--r');
hold 'all'
step(tf1)
%tf1 is generated from the systemIdentification tool and data
tnx!
##### 2 CommentsShowHide 1 older comment
Walter Roberson on 31 May 2022
Edited: Walter Roberson on 31 May 2022
What would you get for something like 12*sin(t)*exp(-t)+15 ?

Sign in to comment.

### Accepted Answer

Star Strider on 31 May 2022
If you know that the system is second-order, use the ssest funciton and specify the order as 2. (State space representations are the best optionos in any event.) You can then use the tf function to convert it to a transfer function.
##### 4 CommentsShowHide 3 older comments
Star Strider on 31 May 2022
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

Sign in to comment.

### Categories

Find more on Transfer Function Models 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!