how to dising step function to be an input to 2nd order system?

Hello, I'm trying to dising a spasific step function, and to add a sine on it to get the data of the responce, and I couldn't find any function that does that.
My step function -
f(t)= { 0 t<0.7
0.5*t 0.7<t<0.77
0.77*0.5 t>0.77 }
and to add any sine to the step function, lets say - sin(8*t)
how can I do it on a 2nd order system and to get the raw data?
Hope my qution is clear, thank you!

Answers (1)

This shows how to simulate the response of a second order for system for a given input signal
sys = tf(1, [1 1 1]);
t = linspace(0,10,1000); % time from 0 to 10
u = [0*t(t<0.7) 0.5*t(0.7<t & t<0.77) 0.77*0.5*ones(size(t(0.77<t)))] + sin(t);
lsim(sys,u,t)

2 Comments

thank you, my system is relevant for me. How can I get the raw data of the plot?
My next step is to filter the output of the system.
You can get the data from lsim using
[y, t] = lsim(sys,u,t);
plot(t, y);

Sign in to comment.

Categories

Find more on System Identification Toolbox in Help Center and File Exchange

Tags

Asked:

on 2 Apr 2020

Commented:

on 2 Apr 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!