Finding a system impulse response.

Discussion in 'Homework Help' started by wiz0r, Nov 29, 2008.

  1. wiz0r

    Thread Starter Active Member

    May 2, 2008
    64
    0
    I have the following block diagram(it is in the attachment).

    H(s) = (2000*(s+5)) / ((s+6)*(s+12-15i)*(s+12+15i))

    Now, I need to find the system’s impulse response.

    As far as I know, the system's impulse can be found taking the inverse laplace transform to the input X(s) and the output Y(s), and then we would have something like;

    H(t) = Y(t)/X(t)
    That would be the system's impulse response, right?

    http://en.wikibooks.org/wiki/Control_Systems/Transfer_Functions

    I can do that without a problem, but my problem is; How do I know which is X(s) and Y(s)? Y(s) is definitally not (2000*(s+5)), right? Nor is X(s) = ((s+6)*(s+12-15i)*(s+12+15i))? So what can I do? How can I find Y(s) and X(s)?

    I need help on this step to be sure I'll do the next steps correctly.
     
    Last edited: Nov 29, 2008
  2. wiz0r

    Thread Starter Active Member

    May 2, 2008
    64
    0
    I'll post everything that I have to do, just incase I wasn't too clear with my initial problem.

    Given the transfer function shown below, do the following:

    1. Find the system’s impulse response and plot it using MATLAB.
    2. Repeat (1), but use the MATLAB command “impulse” to obtain the impulse
    response. Are both responses the same?
    3. Use MATLAB to find the system’s response y(t) for the following inputs:
    4. x(t)=10 u(t)
    5. x(t)=5t2 u(t)
    6. x(t)=4cos(200pt) u(t)
    7. Use MATLAB to obtain the Bode diagram of the system. What type of filter does
    this system resemble?
     
  3. blazedaces

    Active Member

    Jul 24, 2008
    130
    0
    First of all, H(t) DOES NOT equal Y(t)/X(t).

    See, the relationship in time between h(t), y(t), and x(t) is y(t) = the convolution of h(t) and x(t).

    BUT... in the laplace domain convolution becomes multiplication and so the relationship becomes Y(s) = H(s)*X(s) which you can then use to say H(s) = Y(s)/X(s).

    Secondly, impulse response implies that your input is a pulse (delta function in time), which in the laplace domain means 1/s.

    So, since you have your H(s) to obtain your impulse response you simply need to multiply your H(s) by your X(s) where your X(s) input = 1/s.

    Then, after you have your Y(s) you simply take the inverse laplace to obtain y(t) and that's your impulse response.

    Do the same thing for your other inputs, as in, convert them to their appropriate laplace domain equivalents, multiply them by H(s), then turn your resultant Y(s) into y(t)...

    Does this make sense?

    -blazed

    Edit: Yeah, I looked at the wikipedia article, and to be quite honest, I think it to be not true. But I would ask someone else who knows what he/she is talking about to either support my statement or set me straight...
     
  4. steveb

    Senior Member

    Jul 3, 2008
    2,433
    469
    That reference you quoted appears to have a mistake in it.

    The impulse response h(t) is the inverse Laplace transform of the transfer function H(s).

    Note that y(t) = h(t)*x(t) where * indicates convolution
    and Y(s) = H(s) X(s)

    It is not correct to say that h(t) = y(t)/x(t) where / indicates division. This appears to be a typo, because later in the description they correctly talk about convolution and the definition of h(t).
     
  5. wiz0r

    Thread Starter Active Member

    May 2, 2008
    64
    0
    Oh yes, that makes a lot of sense, blazed. I was reading the info of the link I gave before, and I was trying to understand how did H(s) really worked, but your explanation made it a lot clearer to me. Anyway, I have one question. According to the link I gave first;

    Example: Impulse Response

    From a Laplace transform table, we know that the Laplace transform of the impulse function, δ(t) is:

    [​IMG]

    So, when we plug this result into our relationship between the input, output, and transfer function, we get:

    Y(s) = X(s)H(s)
    Y(s) = (1)H(s)
    Y(s) = H(s)

    In other words, the "impulse response" is the output of the system when we input an impulse function.

    So, they say that the laplace transform of a impulse is 1, instead of 1/s, like you said. They say that the step response is 1/s, not the impulse response. So, which is correct?

    Anyway, I must say once again that I'm really grateful for all your help, if it wasn't for you I would probably woulda have gotten a zero on my assigment. So yeah, thank you.

    ~Edwin
     
  6. wiz0r

    Thread Starter Active Member

    May 2, 2008
    64
    0
    Oh, so the article had a mistake.. thank you for poiting that out, steveb. So, the correct way to do it is the method that blazed pointed out?
     
  7. steveb

    Senior Member

    Jul 3, 2008
    2,433
    469
    Yes, but as you noted, he made a mistake when he said that the Laplace transform of an impulse is 1/s. It is 1 as you pointed out. I'm sure he just made a simple mental error since 1/s is the transform of a step function. It's easy to make a mistake like that if you haven't thought about these concepts for a while. Many of us have been out of school for some time. The good thing about this forum is that there is always someone ready to catch us when we slip. :)
     
  8. wiz0r

    Thread Starter Active Member

    May 2, 2008
    64
    0
    Oh, alright. I totally understand, hehe. Thank you very much both of you. I'll get onto it now. See you soon if I get stuck or something. :)

    Edwin
     
  9. wiz0r

    Thread Starter Active Member

    May 2, 2008
    64
    0
    Sigh.. I have a problem with step 2.

    So, I have to use the command "impulse" to obtain the impulse response of the system. So, what do I do;

    Code ( (Unknown Language)):
    1. H = (2000.*(s+5)) / ((s+6).*(s^2 + 24.*s + 369));
    2. impulse(H)
    So, I tried that way and I get a "Not enough input arguments." error. So, I defined t = 0:0.001:5;, and tried again;

    Code ( (Unknown Language)):
    1. t = 0:0.001:1.5;
    2. H = (2000.*(s+5)) / ((s+6).*(s^2 + 24.*s + 369));
    3. impulse(H,t)
    And, of course I get another weird error. ;<

    So, what am I doing wrong?

    Edwin
     
  10. wiz0r

    Thread Starter Active Member

    May 2, 2008
    64
    0
    Okay, nevermind that!

    I found out how to do it;

    I had to declare that;

    Code ( (Unknown Language)):
    1. s = tf('s');
    2. H = (2000*(s+5)) / ((s+6)*(s + 12 + 15*i)*(s + 12 - 15*i))
    Now, everything works fine, I got the plot and all, however, plot 1 and plot 2 are different. So, that means I'm doing something wrong with part 1, or are they supposed to look different?

    Here's the code for step 1;

    Code ( (Unknown Language)):
    1. t = 0:0.001:.5;
    2. x = (-7.663.*exp(-6.*t) + 136.398.*exp(-12.*t).*cos(15.*t+86.78));
    3. plot(t,x);
    Edit1: Fixed one of the graphs.

    Edit2: Well, I did the inverse laplace transform with MATLAB, then I plotted the result, and yeah, obviously the plot is the same as the impulse one. So, yeah, let's see what is my error..

    Edit3: I fixed some errors, and I got the #2 attached graph. They look pretty similar now, but still, they are a few differences between each plot. So, umm, maybe they are some errors thanks to the timed vector t? Or, are they still errors with my calcs?
     
    Last edited: Nov 30, 2008
  11. blazedaces

    Active Member

    Jul 24, 2008
    130
    0
    First of all, yeah, sorry about that, my mistake. Except I don't really have the excuse that I haven't worked with this stuff in a while since I'm in my fourth year of college at the moment... but, bleh, mistakes happen.

    And... I don't know if you realize this but, your t's are different, could it really be that simple? One of your t's goes up to 1.5, the other only up to .5...

    But I don't think that's it. Are you sure your laplace transform calculation is correct? Try using matlab to do the transform for you and see what you get...

    -blazed
     
  12. wiz0r

    Thread Starter Active Member

    May 2, 2008
    64
    0
    Hey, blazed. A little time before you posted, I updated my graph. They look a lot similar now, and both runs from 0-.5 as you can see in my upgraded "myimpulse" graph in my previous post. I also added what it is in Edit3. Like I said, they are still some small differences in the plots, though.

    About the error, who cares? Mistakes happens to everyone. Anyway, I'm very grateful for you help.

    Well, I hope I can finish this tomorrow, gotta get some rest now.

    Edwin
     
  13. The Electrician

    AAC Fanatic!

    Oct 9, 2007
    2,281
    326
    The quantity 86.78 in the last term appears to be in degrees. You need to use radians here. Change that last term to:

    cos(15.*t-1.5146) and you will get the same plot.
     
  14. blazedaces

    Active Member

    Jul 24, 2008
    130
    0
    Wow dude, good call.

    -blazed
     
  15. wiz0r

    Thread Starter Active Member

    May 2, 2008
    64
    0
    Awesome, thank you Electrician. I remember you from my last semester. :] Thanks a lot!

    Thanks to you, blazed, steve, and Electrician!!

    Now, to finish the homework, and then I'll start doing my electronics assigment.. Hope ya'll could help me there, too. :]

    Edwin
     
Loading...