Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear;clc;
- %setting values of Zeeeez :D
- global w %i've used a global var to adjust it as i want :)
- w=377;
- %the zeez :D
- Z1 = 20 + i*xl(12e-3); Z2 = 40 + i*xl(60e-3); Z3 = 10 + i*xl(50e-3);
- Z4 = 50 - i*xc(10e-6); Z5 = 35 + i*xl(25e-3); Z6 = 60 + i*xl(30e-3);
- Z7 = 25 - i*xc(12e-6); Z8 = 15 + i*xl(5e-3); Z9 = 30 + i*xl(12e-3);
- Z10 = 16 - i*xc(7e-6); Z11 = 50 + i*xl(15e-3);
- %Setting the value of Zx :)
- Zx = 20:1:250;
- %Converting the Vmsin(wt) to complex :)
- V1 = (340/sqrt(2))*(cos(pi)+i*sin(pi));
- V2 = (340/sqrt(2))*(cos(-pi/2)+i*sin(-pi/2));
- V3 = (340/sqrt(2));
- V4 = (340/sqrt(2))*(cos(pi/2)+i*sin(pi/2));
- %creating Z matrix
- Z = [ Z1+Z2,-Z2,0,0,0,0,0;
- -Z2,(Z2+Z3+Z4),-Z4,0,0,0,0;
- 0,-Z4,0,-Z5,0,0,0;
- 0,0,-Z5,(Z11+Z5+Z6),-Z6,0,0;
- 0,0,0,-Z6,0,-Z7,0;
- 0,0,0,0,-Z7,(Z8+Z9+Z7),-Z9;
- 0,0,0,0,0,-Z9,(Z9+Z10)];
- %Creating V
- V = [+V1;-V2;+V2;0;-V3;+V3;-V4];
- %The loop :)
- for k=1:length(Zx)
- Z(3,3)=Z4+Z5+Zx(k);
- Z(3,5)=-Zx(k);
- Z(5,3)=-Zx(k);
- Z(5,5)=Z6+Z7+Zx(k);
- I=inv(Z)*V;
- %this is the most important part :) focus that >> abs(I3-I5)^2 * Rx <<
- P(k) = (abs(I(3)-I(5)))^2 * real(Zx(k));
- end
- [maxPower,index]=max(P); %as usual
- %printing the output
- fprintf('Max power is = %10.3f Watt \n and its Zx = %10.3f Ohm \n',maxPower,Zx(index));
- plot(Zx,P);
- xlabel('Zx Value');ylabel('Power Value');
- grid;
Advertisement
Add Comment
Please, Sign In to add comment