Step Response
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
a=[0.2,0.4,0.5,0.7,2,1]
g = (tf(1, [1 2*a 1]));
S= stepinfo(g)
This is a step response problem where as you can see 'a' is the variable to be multiplied. I know that we can solve this by using the stepinfo(g)and the step information with display the results automatically.
My question is how does matlab calculate the results?
% RiseTime: 1.1308
% SettlingTime: 38.7087
% SettlingMin: 0.4685
% SettlingMax: 1.7292
% Overshoot: 72.1625
% Undershoot: 0
% Peak: 1.7292
% PeakTime: 3.1416
I got these numbers by doing this:
a= 0.1
g= tf(1,[1 2*a, 1])
[ y, t ] =step(g) % default of 60 seconds
S = stepinfo(y,t)
plot ( t, y )
So you can solve this for any values, how can use indexing within the transfer function?
Now I need to just label each, do we need to input calculations just use
function S=stepinfo(y,t)
Frequency response:
a=[0.2,0.4,0.5,0.7,2,1]
g = (tf(1, [1 2*a 1]));
a=[0.2;0.3;0.4;0.7;1;2]'
H =(tf(1, [1 2*a(index) 1]));
bode(H,{0.1,10})
My goal here is to graph the freq response for all values so I am thinking to subplot and index also. I am not sure how this can be done with Bode.
This works, I double checked but can I index and subplot for 6 values?
a=0.1
H =(tf(1, [1 2*a 1]));
bode(H,{0.1,10})
Any information will help, I am just going in circles, mean while I will be reading the book again and again.
Gabriel
0 comentarios
Respuestas (1)
Arnaud Miege
el 19 de Abr. de 2011
First, a comment: it would help if your question was properly formatted. As it is, it's very difficult to read.
If I understand your question correctly, the best way is probably to use a for loop:
a=[0.2,0.4,0.5,0.7,2,1];
for k=1:length(a)
g(k) = tf(1,[1 2*a 1]);
[y(k,:), t(k,:)] = step(g(k));
S(k) = stepinfo(y(k,:),t(k,:));
end
This grows the variables in a loop, so is not exactly best practice, but it should work:
>> S(1).RiseTime
ans =
0.8600
You can then pass the whole g to the bode command:
bode(g,{0.1,100})
or again, do this in a loop if you want to do them one by one.
HTH,
Arnaud
5 comentarios
Arnaud Miege
el 20 de Abr. de 2011
bode is from the Control System Toolbox, whereas freqs is from the Signal Processing Toolbox. bode allows you to compute/display the Bode plot (magnitude & phase) of any LTI system (Linear-Time Invariant), transfer function, zero-pole gain or state-space system. freqs, on the other hand, only displays/computes the frequency response of an analog filter.
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!