1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
clc;
clear;
v=1200; thetav=0;
z1=60;
z2=6+12*%i;
z3=30-30*%i;
i1=v/z1;
i2=v/z2;
i3=v/z3;
s1=v*i1';
s2=v*i2';
s3=v*i3';
s=s1+s2+s3;
mprintf("voltage=%d angle %d\n",v,thetav);
mprintf("impedance1,Z1=%d+%dj ohms\n",real(z1),imag(z1));
mprintf("impedance1,Z2=%d+%dj ohms\n",real(z2),imag(z2));
mprintf("impedance1,Z3=%d+(%d)j ohms\n",real(z3),imag(z3));
mprintf("current,i1=%d+%dj A\n",real(i1),imag(i1));
mprintf("current,i2=%d+(%d)j A\n",real(i2),imag(i2));
mprintf("current,i3=%d+%dj A\n",real(i3),imag(i3));
mprintf("s1=v i1*=%d W+%dj var \n",real(s1),imag(s1));
mprintf("s2=v i2*=%d W+%dj var \n",real(s2),imag(s2));
mprintf("s3=v i3*=%d W+(%d)j var \n",real(s3),imag(s3));
mprintf("total complex power,s=s1+s2+s3=%d W+%dj var \n",real(s),imag(s));
|