# Homework Help: Matlab step response. Just need a quick check

Tags:
1. Jan 27, 2016

### AnkleBreaker

1. The problem statement, all variables and given/known data
Could someone just quickly check my Step Reponse diagram which I made using Matlab. It does not look like the usual shape for a step response system which is making me a bit worried. I'm a fairly new to Matlab and Control Engineering

2. Relevant equations
G(s) = 3 / ((s^2) +3)

3. The attempt at a solution
This was the code which I entered in Matlab to obtain the above step response:
num = [3]
den = [1 0 3]
G=tf(num,den)
step(G)

2. Jan 27, 2016

### Staff: Mentor

3. Jan 27, 2016

### AnkleBreaker

Yes that's my image.. Very sorry.. I tried re uploading it and I thought it was working..

4. Jan 27, 2016

### Staff: Mentor

I added more to my previous post after you replied...

5. Jan 27, 2016

### AnkleBreaker

This is the new step response graph I am getting after I did like you asked

6. Jan 27, 2016

### Staff: Mentor

Correction:
Code (Matlab M):
G=tf(3, [1, 0, 3])
This is probably the same as what you initially tried.

I don't know much about Control Engineering, but I do know something about Laplace transforms and such. The inverse Laplace transform of your G(s) function, $\mathcal{L}^{-1}[G(s)]$, is $\sqrt{3}\sin(\sqrt{3}t)$. That would explain the oscillation of the graph you show, but it doesn't explain either the period of this graph or the range (low to high values). The time-domain function I show has a period of $\frac{2\pi}{\sqrt{3}}$ and an amplitude of $\sqrt{3}$, meaning the values should range between $-\sqrt{3}$ and $\sqrt{3}$. For your original graph, the values range between 0 and 2, and the period seems to be right around $2\pi$. There also seems to be an upward shift by 1 unit.

7. Jan 27, 2016

### AnkleBreaker

Thank you very much for your help. I'll try to ask Sir tomorrow what went wrong with my graph. One last question, on the time axis I have only put values up to 50. Is that enough or should I put more/less than 50, in your opinion

8. Jan 27, 2016

### Staff: Mentor

50 should be enough, I think.

You didn't show the rest of your m-file, so perhaps there's something wrong in it. Here's a link to the documentation for step() - http://www.mathworks.com/help/control/ref/step.html

9. Jan 27, 2016

### Staff: Mentor

That is a second order system with zero damping, so once it is given a jolt it will oscillate sinusoidally forever, as your graph demonstrates.

To see what to expect in terms of damping and natural frequency, compare your system's denominator s2 + 3
with the denominator for a general second-order system, viz.,
s2 + 2ζωns + ωn2

10. Jan 28, 2016

### AnkleBreaker

Ohh there was no damping ratio. I get it now. That explains a lot. Thank you very much

11. Jan 28, 2016

### AnkleBreaker

Thank you for all your help. User NascentOxygen's answer states that the graph oscillates infinitely due to there being an absence of a damper, which makes a lot of sense and explains a whole lot.

12. Jan 28, 2016

### Staff: Mentor

So possibly there is a mistake in your denominator? Perhaps you meant the denominator to be (s + 3)^2

How was the denominator determined?

13. Jan 28, 2016

### AnkleBreaker

This was part of a question. In the question they say:
Arm dynamics are represented by:
G(s) = 3 / ((s^2) +3)

So G(s) = 3 / ((s^2) +3) is part of the question and I did not derive it

And they want us to find a phase lead controller/compensator to fit required poles, which I did. I was just confused on why the step response of the original system didn't behave normally