0
\$\begingroup\$

I've got the next transfer function:

$$ \frac{\hat{\alpha}}{\hat{\alpha_{ref}}} =\frac{w_n^2}{s^2+2w_n \xi s+ w_n^2} $$

Now I want to draw a step response input at height of \$\alpha_{ref}\$, where \$\xi\$ comes with differing values (i.e different graphs on the same axis for different values of \$\xi\$, and the value of \$w_n\$ depends on \$\xi\$).

How to implement this in Matlab?

Thanks in advance.

\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

A not-at-all elegant way to do it is:

zeta=[...]; %your zeta values wn = ... % calculate your wn values according to your zeta values figure; hold('on'); for idx = 1:length(zeta) % sys = tf([wn(idx)],[1 2*wn(idx)*zeta(idx) wn(idx)^2]); %system's transfer function % EDIT : numerator corrected sys = tf([wn(idx)^2],[1 2*wn(idx)*zeta(idx) wn(idx)^2]); %system's transfer function step(alpharef*sys); end 
\$\endgroup\$
4
  • \$\begingroup\$ Thanks it should the numerator \$wn(idx)^2\$, other than that looks ok to me. \$\endgroup\$ Commented Nov 18, 2012 at 2:57
  • \$\begingroup\$ I haven't noticed that. Thanks for pointing it out. Edited my answer accordingly. \$\endgroup\$ Commented Nov 18, 2012 at 11:13
  • \$\begingroup\$ You can write hold on instead of hold('on'); \$\endgroup\$ Commented Nov 18, 2012 at 13:39
  • \$\begingroup\$ Well yeah, but I usually try to use the function syntax. I think it gives the code more consistency. Syntax documentation can be found here: mathworks.com/help/matlab/ref/syntax.html mathworks.com/help/matlab/matlab_prog/… \$\endgroup\$ Commented Nov 19, 2012 at 6:26

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.