Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. function di=didt(t,i,R,L,v,f,Rsec)
  2.  
  3. i1=i(1); i2=i(2); A=L; D=L*R; w=2*pi*f;
  4.  
  5. di(1,1)=A(1,1)*(v*cos(w*t))+A(1,2)*Rsec*i2+A(1,3)*((D(3,1)*i1+D(3,2)*i2...
  6. -A(3,1)*(v*cos(w*t))-A(3,2)*Rsec*i2)/A(3,3))-D(1,1)*i1-D(1,2)*i2;
  7. di(2,1)=A(2,1)*(v*cos(w*t))+A(2,2)*Rsec*i2+A(2,3)*((D(3,1)*i1+D(3,2)*i2...
  8. -A(3,1)*(v*cos(w*t))-A(3,2)*Rsec*i2)/A(3,3))-D(2,1)*i1-D(2,2)*i2;
  9.  
  10. end
  11.  
  12. % Definição dos parâmetros
  13. R=[2.1581 0 0; 0 0.0114 0; 0 0 0.0556];
  14. L=[8.7492 -8.7828 0.0336; -8.7828 12.3082 -3.5254; 0.0336 -3.5254 3.4918];
  15. f=1e3; v=10e3; Rsec=100; i10=0; i20=0;
  16.  
  17. % Tempo de simulação
  18. ts=[0 10e-3];
  19.  
  20. [t,i]=ode45(@(t,y) didt(t,y,R,L,v,f,Rsec),ts ,[i10 i20])
  21. figure(1)
  22. plot(t,i(:,1), t,i(:,2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement