Advertisement
MysteriousWolf

Vaja2

May 6th, 2020
2,725
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Octave 0.83 KB | None | 0 0
  1. mu0=4*pi*1e-7;
  2. B1=[0.1:0.1:1.3];
  3. B2=B1/4;
  4. % kA/m pomnozimo s 1000, da dobimo A/m
  5. H=[0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4,5,6,7,8,10,12,14,16,18,20,22,24,26]*1000;
  6. B=[0, 0.45, 0.635, 0.75, 0.84, 0.89, 0.93, 0.96, 0.98, 1.02, 1.05, 1.07, 1.1, 1.14, 1.17, 1.2, 1.23, 1.25, 1.27, 1.29, 1.31, 1.32];
  7. figure(1);
  8. plot(H,B,'.-', 'linewidth',2)
  9.  
  10. H1=[];
  11. for Bx=B1
  12.   %Bx=B1(7)
  13.   i=sum(B<Bx);
  14.   %B(i), B(i+1), H(i), H(i+1)
  15.   Hx=H(i) + ( H(i+1) - H(i) ) / ( B(i+1) - B(i) ) *(Bx-B(i));
  16.   H1=[H1, Hx];
  17. end
  18.  
  19. H2=[];
  20. for Bx=B2
  21.   %Bx=B1(7)
  22.   i=sum(B<Bx);
  23.   %B(i), B(i+1), H(i), H(i+1)
  24.   Hx=H(i) + ( H(i+1) - H(i) ) / ( B(i+1) - B(i) ) *(Bx-B(i));
  25.   H2=[H2, Hx];
  26. end
  27. figure(2);
  28. plot(H,B,'.-', H1, B1,'.-', H2, B2, '.-')
  29.  
  30. %Amperov zakon!
  31. B2;
  32. I=(H1*0.355+H2*0.03+B2/mu0*1.4e-3)/3000;
  33. figure(3);
  34. plot(I,B1, 'linewidth',2, I, B2, 'linewidth',2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement