Buscar

Q2_1

Esta é uma pré-visualização de arquivo. Entre para ver o arquivo original

[Content_Types].xml
 
 
 
 
 
 
 
 
_rels/.rels
 
 
 
 
 
 
 
matlab/document.xml
 %3° prova - Iasmyn Wene e José Antônio Itapary
%Questão 2.1
clear all
clc
syms s
p = s^2+7*s+10;
q = s+2;
A = collect(p*q,s)
syms s
Gs = tf([1 2],[1 7 10])
Pol = pole(Gs)
Zer = zero(Gs)
p1 = [1 7 10]
value = polyval(p1,-1) %Questão 2.2
clear all
clc
syms s
Gs = tf(1,[1 1]);
Hs = tf([1 2],[1 3]);
Is = tf(4);
Js = series(Gs,Hs);
Ks = feedback(Js,Is)
step(Ks) %Questão 2.3
T=[0:0.1:5];
gs = tf(1,[1 4 3])
gs = step(gs,T);
y=0.3333+0.1667*exp(-3*T)-0.5*exp(-T);
plot(T,gs,T,y); grid;
xlabel('Tempo');
ylabel('Amplitude') %Questão 2.4
m=10; k=1; b=0.5;
num=[1/m]; den=[1 b/m k/m];
gs = tf(1,[10 0.5 1])
t=[0:0.1:200];
step(gs,t) %Questão 2.5
%letra a
a=1; b=8; k=10.8e8; j=10.8e8;
g1 =tf((k*[1 a]),(j*[1 b 0 0]))
g2=feedback(g1,[1])
% letra b
T=[0:0.1:100];
f=10*pi/180; 
gsf=g2*f;
step(gsf,T);
hold on
%letra c
% 80%
j=10.8e8*0.8; 
g1 =tf((k*[1 a]),(j*[1 b 0 0]))
g2=feedback(g1,[1])
f=10*pi/180; 
gsf=g2*f;
step(gsf,T);
% 50%
j=10.8e+08*0.5; 
g1 =tf((k*[1 a]),(j*[1 b 0 0]))
g2=feedback(g1,[1])
f=10*pi/180; 
gsf=g2*f;
step(gsf,T);
hold off
%
xlabel('tempo (s)')
ylabel('Altitude')
legend('100 %','80 %', '50 %') %Questão 2.6
%letra a
g1 = tf(4)
h1 = tf(50)
g2 = tf(1,[1 1])
h2 = tf([4 2],[1 2 1])
g3 = tf(1,[1 0 2])
g4 = tf(1,[1 0 0])
h3 = tf([1 0 2],[1 0 0 14])
g41 = feedback(g4,h1,+1)
g23 = series(g2,g3)
g23_2 = feedback(g23,h2)
g42 = series(g23_2,g41)
g42_3 = feedback(g42,h3)
gf = series (g1,g42_3)
%letra b
pzmap(gf)
%letra c
pole(gf)
zero(gf)
 %Questão 2.7
l = 0.5; m = 1;g = 9.8;
theta30 = 30; 
theta_rad = deg2rad(theta30); 
theta = 0; 
T= [0 10]
% não linear
nl = @(t, x) [x(2); -g/l * sin(x(1))];
% linear
li = @(t, x) [x(2); -g/l * x(1)];
% soluçao
[tnl, ynl] = ode45(nl, T, [theta_rad theta]);
% soluçao
[tli, yli] = ode45(li, T, [theta_rad theta]);
ynl_g = rad2deg(ynl(:, 1));
yli_g = rad2deg(yli(:, 1));
% Plot the results
hold on;
plot(tnl, ynl_g, 'b');
plot(tli, yli_g, 'r--');
xlabel('Tempo');
ylabel('Angulo');
legend('Não linear', 'Linear');
grid on;
hold off;
 %Questão 2.8
syms s
Z_5 = 5; Z_10 = 10; Z_15 = 15;
g_5 = collect(20/Z_5*(s+Z_5)/(s^2 + 3*s + 20),s)
g_10 = collect(20/Z_10*(s+Z_10)/(s^2 + 3*s + 20),s)
g_15 = collect(20/Z_15*(s+Z_15)/(s^2 + 3*s + 20),s)
g_5 = tf([4 20],[1 3 20])
g_10 = tf([2 20],[1 3 20])
g_15 = tf([4 60],[3 9 60])
step(g_5);hold on
step(g_10)
step(g_15)
hold off %Questão 2.9
%letra a
gs = tf([1 1],[1 2])
hs= tf(1,[1 1])
rs = feedback(gs,hs)
%letra b
pzmap(rs)
pole(rs)
zero(rs)
%letra c
rs = minreal(rs) %Questão 2.10
K=[0.1:0.1:10]
gs=tf([1],[1 20 20])
for i=1:length(K)
 cs=K(i)
 g1=tf(cs);
 g2=feedback(g1*gs,1);
 g3=feedback(gs,g1);
 y1=step(g2);
 Tf1(i)=y1(end);
 y2=step(g3);
 Tf2(i)=y2(end);
end
plot(K,Tf1,K,Tf2,'--')
xlabel('K') %Questão 3.1
%letra a
g1 = tf(1,[1 1])
e1 = ss(g1)
%letra b
g2 = tf([1 1 1],[2 1 1])
e2 = ss(g2)
%letra c
g3 = tf([1 1],[3 2 1 1])
e3 = ss(g3) %Questão 3.2
%letra a
g1 = tf(1,[1 1])
e1 = ss(g1)
g1 = tf(e1)
%letra b
g2 = tf([1 1 1],[2 1 1])
e2 = ss(g2)
g2 = tf(e2)
%letra c
g3 = tf([1 1],[3 2 1 1])
e3 = ss(g3)
g3 = tf(e3) %Questão 3.3
syms R C L s Vs 
zr = R; zl = s*L; zc = 1/(s*C);
I = Vs/(zr+zl+zc)
Vc = collect(zc*I,[s,Vs])
Gs = 1/(C*L*s^2 + C*R*s + 1)
%letra a
R = 1; L = 0.5; C = 1;
gs = 1/(C*L*s^2 + C*R*s + 1)
gs = tf(1,[1/2 1 1])
V = ss(gs)
%letra b
step(V) %Questão 3.4
a=[0 1 0; 0 0 1; -4 -1 -6];
b=[0;0;1];
c=[1 0 0];
d=[0];
%letra a
e1= ss(a,b,c,d)
gs = tf(e1)
%letra b
x0 = [0 -1 1];
T = [0:0.1:20];
u = 0*T;
[y,T,x] = lsim(e1,u,T,x0)
plot(T,x(:,1),T,x(:,2),':',T,x(:,3),'--')
xlabel('time (sec)')
ylabel('x(t)')
grid on
xf = x(length(T),:)'
%letra c
dt = 20;
Phi = expm(a*dt);
xf_phi = Phi.*x0 %Questão 3.5
%letra a
a=[0 1 0; 0 0 1; -4 -5 -8];
b=[0;0;4];
c=[1 0 0];
d=[0];
e1= ss(a,b,c,d)
g1 = tf(e1)
%letra b
a=[ 0.5000 0.5000 0.7071;
 -0.5000 -0.5000 0.7071;
 -6.3640 -0.7071 -8.000];
b=[0;0;4];
c=[0.7071 -0.7071 0];
d=[0];
e2 = ss(a,b,c,d);
g2 = tf(e2) %Questão 3.6
g1 = tf(3,[1 3])
g2 = tf(1,[1 2 5])
%letra a
e1 = ss(g1)
%letra b
e2 = ss(g2)
%letra c
g12 = series(g1,g2);
gs = feedback(g12,[1]);
impulse(gs) %Questão 3.7
a=[0 1;-4 -7]; 
b=[0;1]; 
c=[1 0]; 
d=[0];
e1 = ss(a,b,c,d);
x0=[1;0];
T=[0:0.1:10]; 
u=0*t;
[y,t,x]=lsim(e1,u,T,x0);
plot(T,x(:,1),T,x(:,2),'--')
xlabel('Tempo')
ylabel('Resposta')
legend('x1','x2')
grid on %Questão 3.8
matlab/output.xml
 manual code error 0.4 symbolic <math xmlns='http://www.w3.org/1998/Math/MathML' display='block' xmlns:mw='https://www.mathworks.com/MathML/extensions'>
 <semantics>
 <mrow mw:template='plus' mw:dataCategory='structure'>
 <mrow mw:dataCategory='placeholder'>
 <msup mw:template='power' mw:dataCategory='structure'>
 <mrow mw:dataCategory='placeholder'>
 <mi>s</mi>
 </mrow>
 <mrow mw:dataCategory='placeholder'>
 <mn>3</mn>
 </mrow>
 </msup>
 <mo>+</mo>
 <mrow mw:template='times' mw:dataCategory='structure'>
 <mrow mw:dataCategory='placeholder'>
 <mn>9</mn>
 <mo form='infix' mw:dataCategory='static'>&InvisibleTimes;</mo>
 <msup mw:template='power' mw:dataCategory='structure'>
 <mrow mw:dataCategory='placeholder'>
 <mi>s</mi>
 </mrow>
 <mrow mw:dataCategory='placeholder'>
 <mn>2</mn>
 </mrow>
 </msup>
 </mrow>
 </mrow>
 <mo>+</mo>
 <mrow mw:template='times' mw:dataCategory='structure'>
 <mrow mw:dataCategory='placeholder'>
 <mn>24</mn>
 <mo form='infix' mw:dataCategory='static'>&InvisibleTimes;</mo>
 <mi>s</mi>
 </mrow>
 </mrow>
 <mo>+</mo>
 <mn>20</mn>
 </mrow>
 </mrow>
 <annotation encoding='OutputVersion'>
 1.0
 </annotation>
 
 </semantics>
</math>
 A 9 text Gs =
 
 s + 2
 --------------
 s^2 + 7 s + 10
 
Continuous-time transfer function.
<a href="matlab:disp(char('',' Numerator: {[0 1 2]} ',' Denominator: {[1 7 10]} ',' Variable: ''s'' ',' IODelay: 0 ',' InputDelay: 0 ',' OutputDelay: 0 ',' InputName: {''''} ',' InputUnit: {''''} ',' InputGroup: [1×1 struct] ',' OutputName: {''''} ',' OutputUnit: {''''} ',' OutputGroup: [1×1 struct] ',' Notes: [0×1 string] ',' UserData: [] ',' Name: '''' ',' Ts: 0 ',' TimeUnit: ''seconds'' ',' SamplingGrid: [1×1 struct] ',' '))">Model Properties</a>
 false false 12 matrix Pol 2×1 2 1 double -5
 -2
 double double [[{"value":"{\"value\":\"-5\"}"},{"value":"{\"value\":\"-2\"}"}]] 13 variable Zer -2 1 1 14 matrix p1 1×3 1 3 double 1 7 10
 double double [[{"value":"{\"value\":\"1\"}"},{"value":"{\"value\":\"7\"}"},{"value":"{\"value\":\"10\"}"}]] 15 variable value 4 1 1 16 error 'syms' requires <a href="matlab:matlab.internal.addons.launchers.showExplorer('ErrorRecovery', 'identifier', 'SM', 'focused', 'syms');">Symbolic Math Toolbox</a>. runtime 144 true false 0 3 3 false false 1 4 4 false false 2 5 5 false false 3 6 6 false false 4 7 7 false false 5 8 8 0 false false 6 10 10 false false 7 11 11 1 false false 8 12 12 2 false false 9 13 13 3 false false 10 14 14 4 false true 11 15 15 5 true false 12 150 150 6 false false 13 151 151 false false 14 153 153 false false 15 155 155 false false 16 157 157 false false 17 160 160 false false 18 162 162 false false 19 164 164 false false 20 166 166 false false 21 167 167 false false 22 168 168 false true 23 169 169 
metadata/coreProperties.xml
 
 2023-07-08T20:46:08Z
 2023-07-09T00:06:51Z
metadata/mwcoreProperties.xml
 
 application/vnd.mathworks.matlab.code
MATLAB Code
 R2023a
metadata/mwcorePropertiesExtension.xml
 
 0c16eaa0-4741-438d-b970-04cb7b7915bf
metadata/mwcorePropertiesReleaseInfo.xml
 
 9.14.0.2286388
 R2023a
 Update 3
 May 25 2023
 921240961

Teste o Premium para desbloquear

Aproveite todos os benefícios por 3 dias sem pagar! 😉
Já tem cadastro?

Continue navegando