-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlab_4.m
More file actions
42 lines (30 loc) · 778 Bytes
/
Copy pathlab_4.m
File metadata and controls
42 lines (30 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
close all;
clear all;
clc;
t_a = 0:0.001:30;
t_b = 0:0.001:6;
%ft a)
disp('============== Primeira ordem ==============')
s = tf('s');
gamma = 5
T = 3
P_a = 5/(3*s+1);
y_a = step(P_a, t_a);
figure, plot(t_a, y_a, '-b');
xlabel('Tempo (s)');
ylabel('Amplitude');
title('Resposta ao degrau');
%ft b)
%P_b = (4*(8.060^2))/(s^2 + 2*0.20092*8.060*s + (8.060^2));
disp('============== Segunda ordem ============== ')
gamma = 4
pss = 100 * ((6.1 - gamma)/gamma)
E = (log(100/pss))/(pi^2 + (log(100/pss))^2)^(1/2)
wn = 4/(2.47*E)
tp = pi/(wn * (1-(E^2))^(1/2))
P_b = (gamma*(wn^2))/(s^2 + 2*E*wn*s + (wn^2));
y_b = step(P_b, t_b);
figure, plot(t_b, y_b, '-b');
xlabel('Tempo (s)');
ylabel('Amplitude');
title('Resposta ao degrau');