Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

MATLAB step response of a signal

Status
Not open for further replies.

gmish27

Member level 1
Joined
May 12, 2011
Messages
34
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Activity points
1,553
to evaluate the step response of a transfer function, say Ts, we write in matlab: step(Ts)

Mathematically this is same as multiplying the transfer function Ts with 1/s and then plotting the inverse laplace transform of (1/s)*Ts.

I am trying the same in matlab. Have a look at the code:

Ts=tf[1,[1 6 9]);
step(Ts) %step response using step function
----------------------

syms s;
Tt=ilaplace(1/(s^3+6*(s^2)+9*s)); %product of Ts and 1/s
ezplot(Tt)
----------------------

In both cases am not getting the same plot. Can anyone provide help me with an explanation/solution???
 
Last edited:

There's an initial condition associated with the inverse Laplace. Could that be the problem?
 

There's an initial condition associated with the inverse Laplace. Could that be the problem?

well the initial conditions are all zeros. You can proceed with that...
 

Maybe it's a sampling-time issue. How different are the two results? Have you looked at the MATLAB website for answers?
 

Maybe it's a sampling-time issue. How different are the two results? Have you looked at the MATLAB website for answers?

Here is the image using both the methods:
untitled.jpgusing tf
untitled1.jpgusing ilaplace
 
Last edited:

Well, the first thing that jumps out at me is that your first plot, although having the right shape has a maximum of 0.1. It should be 1.0. Next, the time scale in the second plot starts at -6 seconds. What you've got there is a time machine.

BUT, I think your main problem is that you've got a bad transfer function. 1/(s^2 +6s +9)==> 1/(s+3)(s+3). Your step response is then: 1/(s(s+3)(s+3)), which is of the form: 1/s(s+a)(s+b). If you look at any table of Laplace transforms you'll see that the inverse transform of your step response is: 1/(a+b) * {1-[(be^-at)-(ae^-bt)]/(b-a)}. You've got a denominator of zero, which makes everybody unhappy.
 

Well, the first thing that jumps out at me is that your first plot, although having the right shape has a maximum of 0.1. It should be 1.0. Next, the time scale in the second plot starts at -6 seconds. What you've got there is a time machine.

BUT, I think your main problem is that you've got a bad transfer function. 1/(s^2 +6s +9)==> 1/(s+3)(s+3). Your step response is then: 1/(s(s+3)(s+3)), which is of the form: 1/s(s+a)(s+b). If you look at any table of Laplace transforms you'll see that the inverse transform of your step response is: 1/(a+b) * {1-[(be^-at)-(ae^-bt)]/(b-a)}. You've got a denominator of zero, which makes everybody unhappy.

the ilaplace of Y(s)=H(s)*X(s), that i am getting is: 1/9 - t/(3*exp(3*t)) - 1/(9*exp(3*t))
what's the problem with this.

And why output should be 1.0??? ( in case of step response)
 

First, I was wrong about 1.0; it SHOULD be 1/9. If you look at your transfer function , if you remember that s=jw, and assume jw=0 for a dc signal, your transfer function reduces to 1/9. The inverse Laplace that I get is:

1/9u(t) - (1/9)*exp(-3t) + (1/3)*t*exp(-3t) ; it looks like you've moved numerator and denominator terms. This also approaches a final value of 1/9. The step response and inverse Laplace plots are very similar, although I get a weird overshoot at the start of the inverse Laplace plot. Being mathematically challenged I don't understand some of this.

If you use the transform pair I posted previously... 1/(a+b) * {1-[(be^-at)-(ae^-bt)]/(b-a)}... everything goes to zero. That can't be right. I used partial fraction expansion to get my transform...maybe there's something wrong there. Here's my plots (hope I can figure out how to import pictures...)


https://obrazki.elektroda.pl/0_1314378798.jpg
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top