diff options
Diffstat (limited to '1055/CH23')
-rwxr-xr-x | 1055/CH23/EX23.1/ch23_1.sce | 48 | ||||
-rwxr-xr-x | 1055/CH23/EX23.2/ch23_2.sce | 29 | ||||
-rwxr-xr-x | 1055/CH23/EX23.3/ch23_3.sce | 14 | ||||
-rwxr-xr-x | 1055/CH23/EX23.4/ch23_4.sce | 14 |
4 files changed, 105 insertions, 0 deletions
diff --git a/1055/CH23/EX23.1/ch23_1.sce b/1055/CH23/EX23.1/ch23_1.sce new file mode 100755 index 000000000..fca058b35 --- /dev/null +++ b/1055/CH23/EX23.1/ch23_1.sce @@ -0,0 +1,48 @@ +// To determine the state vector at the end of first iteration
+clear
+clc;
+C1=.02*100;
+C2=.05;
+Fs=100;
+S1=.41 -%i*.11;
+S2=-.4 +%i*.10;
+S3=-.105 +%i*.11;
+S4=-.105 +%i*.11;
+S5=.14 -%i*.14;
+S6=-.7 +%i*.35;
+Z12=.08+%i*.24;
+Z23=.06+%i*.18;
+Z31=.02+%i*.06;
+Z21=Z12;
+Z32=Z23;
+Z13=Z31;
+W1=(50*10^(-6))/((C1*abs(S1)+(C2*(Fs)))^2);
+W2=(50*10^(-6))/((C1*abs(S2)+C2*(Fs))^2);
+W3=(50*10^(-6))/((C1*abs(S3)+C2*(Fs))^2);
+W4=(50*10^(-6))/((C1*abs(S4)+C2*(Fs))^2);
+W5=(50*10^(-6))/((C1*abs(S5)+C2*(Fs))^2);
+W6=(50*10^(-6))/((C1*abs(S6)+C2*(Fs))^2);
+disp(W1,"W1=");//Answers for W1,W2,W3,W4,W5,W6 in the book is wrongly Calculated
+disp(W2,"W2=");
+disp(W3,"W3=");
+disp(W4,"W4=");
+disp(W5,"W5=");
+disp(W6,"W6=");
+a1=W1/(abs(13)^2)
+[D]=diag([W1/(abs(Z13)^2);W2/(abs(Z31)^2);W3/(abs(Z12)^2);W4/(abs(Z21)^2);W5/(abs(Z23)^2);W6/(abs(Z32)^2)]);
+A=[-1 0 1;1 0 -1;1 -1 0;-1 1 0;0 1 -1;0 -1 1];
+B=[-1 0;1 0;1 -1;-1 1;0 1;0 -1];
+b=[1;-1;0;0;-1;1];
+C=(B')*D;//Assuming Transpose(B)D=C
+F=(B')*D*B;//Assuming Transpose(B)*D*B=F
+G=(inv(F))*C;//Assuming(BTDB)-1*(BT)*D=F
+E1=1.05;
+E2=E1;
+E3=E1;
+invH=diag([Z31/E3;Z13/E1;Z12/E1;Z21/E2;Z23/E2;Z32/E2]);
+Sm=[.41+%i*.11;-.4-%i*.1;-.105-%i*.11;.14+%i*.14;.72+%i*.37;-.7+%i*.35];
+EMo=invH*Sm;
+a=EMo-b*E1;
+E=G*a;
+disp(E,"E="); //Answers differs due to wrong calculation of W1,W2,W3,W4,W5,W6
+
diff --git a/1055/CH23/EX23.2/ch23_2.sce b/1055/CH23/EX23.2/ch23_2.sce new file mode 100755 index 000000000..562fd7401 --- /dev/null +++ b/1055/CH23/EX23.2/ch23_2.sce @@ -0,0 +1,29 @@ +// Determine The States of the systems at the end of first iteration.
+clear
+clc
+Qm1=-.24;
+Qm2=-.24;
+Qm3=.5;
+do=0;
+Pm1=.12;
+Pm2=.21;
+Pm3=-.30;
+W1=3;
+r1=W1;//assuming r1=Inverse(R1)
+W2=5;
+r2=W2;//assuming r2=Inverse(R1)
+W3=2;
+r3=W3;//assuming r3=Inverse(R1)
+X12=%i*.03;
+X13=%i*.01;
+X23=%i*.02;
+X21=X12;
+X31=X13;
+X32=X23;
+Vo=[1.05;1.05];
+H=[-1/.03 -1/.01;((1/.03)+(1/.02)) -1/.02;-1/.02 ((1/.01)+1/.02)];//assuming dh/dl=H
+A1=[3327+34700+5000 9990-20825-15000;-25835 30000+12500+45000];
+V=Vo+inv(A1)*(H')*(diag([W1;W2;W3]))*[Qm1;Qm2;Qm3];
+d=do+inv(A1)*(H')*(diag([W1;W2;W3]))*[Pm1;Pm2;Pm3];//assuming d=dell matrix and do=intial matrix=0
+disp(V,"V=");
+disp(d,"d=");
diff --git a/1055/CH23/EX23.3/ch23_3.sce b/1055/CH23/EX23.3/ch23_3.sce new file mode 100755 index 000000000..de131b163 --- /dev/null +++ b/1055/CH23/EX23.3/ch23_3.sce @@ -0,0 +1,14 @@ +//Problem on State Estimator Linear Model
+
+clear
+clc;
+A=[-3.33 0;0 10;5 -5];
+R=[10^-4 0 0;0 10^-4 0;0 0 10^-4];
+O=inv(((A')*(inv(R))*(A)))*((A')*(inv(R))*[.12;.21;-.30]);//assuming theat matrix=0
+f12=-3.33*(O(1,1));
+f31=10*(O(2,1));
+f23=5*(O(1,1)-O(2,1));
+J=(((.12-f12)^2)+((.21-f31)^2)+((-.3-f23)^2))/(10^-4);
+disp(O,"O=");//Answer does not match due to difference in rounding off of digits
+disp(J,"J=");//Answer does not match due to difference in rounding off of digits
+
diff --git a/1055/CH23/EX23.4/ch23_4.sce b/1055/CH23/EX23.4/ch23_4.sce new file mode 100755 index 000000000..f645f9d9f --- /dev/null +++ b/1055/CH23/EX23.4/ch23_4.sce @@ -0,0 +1,14 @@ +//Determine theta1 Theta2
+clear
+clc;
+A=[5 -5;2.5 0;4 -4];
+R=[10^-4 0 0;0 10^-4 0;0 0 10^-4];
+O=inv(((A')*(inv(R))*(A)))*((A')*(inv(R))*[.60;.05;.35]);//assuming theat matrix=0
+f12=5*(O(1,1)-O(2,1));
+f13=2.5*(O(1,1));
+f32=-4*(O(2,1));
+J=(((.6-f12)^2)+((.05-f13)^2)+((.35-f32)^2))/(10^-4);
+//Answer does not match due to difference in rounding off of digits
+disp(O(1,1),"Theta1=");
+disp(O(2,1),"Theta2=");
+
|