Escolar Documentos
Profissional Documentos
Cultura Documentos
APNDICES
Apndice A: Exerccio N1: Funo transferncia sistema
de suspenso magntica
clc
clear all
close all
% Calculo de parmetros
ie = ((a+ze)/a)*sqrt((2*m*g*a)/Lo);
A21 = -(Lo*ie^2)/(m*a^2*((a+ze)/a)^3);
A23 = -(Lo*ie)/(m*a*((a+ze)/a)^2);
A33 = -(R/L);
B13 = 1/L;
% Funo transferncia
[Num,Den]=ss2tf(A,B,C,D);
Gs= tf(Num,Den)
Gs =
-87.72
-----------------------------------
s^3 + 38.27 s^2 + 1749 s + 6.692e04
% Parmetros simblicos
syms wo ro m s
B= [ 0 0 0;
B21 0 0;
0 0 0;
0 B42 0;
0 0 0;
0 0 B63];
C= [ 1 0 0 0 0 0;
0 0 1 0 0 0;
0 0 0 0 1 0];
D= zeros(3);
% Funo transferncia
F= C*(s*eye(6)-A)^(-1)*B + D;
F =
/ 1 2 wo \
| ----, --------------, 0 |
| m #1 3 2 |
| m (s + s wo ) |
| |
| 2 2 |
| 2 wo s - 3 wo |
| - --------------------, ------------------, 0 |
| 3 2 4 2 2 |
| m (ro s + ro s wo ) m ro (s + s wo ) |
| |
| 1 |
| 0, 0, ------- |
\ m ro #1 /
Onde:
2 2
#1 == s + wo
Apndice C:
Exerccio N3.B: Pndulo simples
% Variveis Globais
global m b l g
% Parmetros constantes
m=0.1;
b=0.015;
L=0.2;
g=9.81;
% Calculo de variveis
pendulof=@(t,x)[x(2);-(b/(m*(L^2)))*x(2)-
(g/L)*sin(x(1))];
[t1,x1]=ode45(pendulof,[0 6],[pi/18 0]);
[t2,x2]=ode45(pendulof,[0 6],[pi/6 0]);
[t3,x3]=ode45(pendulof,[0 6],[pi/3 0]);
% Plota figuras
figure
subplot(2,1,1);
h = figure(1);
plot(t1,x1(:,1),'k','LineWidth',1.5);
hold
plot(t2,x2(:,1),'--k',t3,x3(:,1),':k');
legend('\theta_0 = \pi/18','\theta_0 =
\pi/6','\theta_0 = \pi/3')
xlabel('t[s]');ylabel('\theta[rad]');
subplot(2,1,2);
plot(t1,x1(:,2),'k','LineWidth',1.5);
hold
plot(t2,x2(:,2),'--k',t3,x3(:,2),':k');
legend('\theta_0 = \pi/18','\theta_0 =
\pi/6','\theta_0 = \pi/3')
xlabel('t[s]');ylabel('\omega[rad/s]');
%saveas(h,'pendulo.png');
% Calculo de variveis
pendulof=@(t,x)[x(2);-(b/(m*(L^2)))*x(2)-(g/L)*x(1)];
% Plot figuras
figure
subplot(2,1,1);
h = figure(1);
plot(t1,x1(:,1),'k','LineWidth',1.5);
hold
plot(t2,x2(:,1),'--k',t3,x3(:,1),':k');
legend('\theta_0 = \pi/18','\theta_0 =
\pi/6','\theta_0 = \pi/3')
xlabel('t[s]');ylabel('\theta[rad]');
saveas(h,'image.png');
subplot(2,1,2);
plot(t1,x1(:,2),'k','LineWidth',1.5);
hold
plot(t2,x2(:,2),'--k',t3,x3(:,2),':k');
legend('\theta_0 = \pi/18','\theta_0 =
\pi/6','\theta_0 = \pi/3')
xlabel('t[s]');ylabel('\omega[rad/s]');
%saveas(h,'pendulolinearizado.png');
pendulof1=@(t,x)[x(2);-(b/(m*(l^2)))*x(2)-
(g/l)*sin(x(1))];
pendulof2=@(tL,xL)[xL(2);-(b/(m*(l^2)))*xL(2)-
(g/l)*xL(1)];
% Plota grficos
figure
subplot(2,1,1)
h1 = figure(1);
plot(t1,(x1(:,1)-xL1(:,1)),'k','LineWidth',1.5);
hold
plot(t2,(x2(:,1)-xL2(:,1)),'--k',t3,(x3(:,1)-
xL3(:,1)),':k');
legend('error \theta_0 = \pi/18','error \theta_0 =
\pi/6','error\theta_0 = \pi/3')
xlabel('t[s]');ylabel('\theta[rad]');
subplot(2,1,2)
plot(t1,(x1(:,2)-xL1(:,2)),'k','LineWidth',1.5);
hold
plot(t2,(x2(:,2)-xL2(:,2)),'--k',t3,(x3(:,2)-
xL3(:,2)),':k');
legend('error \theta_0 = \pi/18','error \theta_0 =
\pi/6','error\theta_0 = \pi/3')
xlabel('t[s]');ylabel('\omega[rad/s]');