0001 function outputsesoln(idx, sigma, z, z_est, error_sqrsum)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 fd = 1;
0014
0015 fprintf(fd, '\n================================================================================');
0016 fprintf(fd, '\n| Comparison of measurements and their estimations |');
0017 fprintf(fd, '\n| NOTE: In the order of PF, PT, PG, Va, QF, QT, QG, Vm (if applicable) |');
0018 fprintf(fd, '\n================================================================================');
0019 fprintf(fd, '\n Type Index Measurement Estimation');
0020 fprintf(fd, '\n (#) (pu) (pu) ');
0021 fprintf(fd, '\n ----------- ----------- ----------- ----------');
0022 cnt = 0;
0023 len = length(idx.idx_zPF);
0024 for i = 1: len
0025 fprintf(fd, '\n PF %3d %10.4f %10.4f', idx.idx_zPF(i), z(i+cnt), z_est(i+cnt));
0026 end
0027 cnt = cnt + len;
0028 len = length(idx.idx_zPT);
0029 for i = 1: len
0030 fprintf(fd, '\n PT %3d %10.4f %10.4f', idx.idx_zPT(i), z(i+cnt), z_est(i+cnt));
0031 end
0032 cnt = cnt + len;
0033 len = length(idx.idx_zPG);
0034 for i = 1: len
0035 fprintf(fd, '\n PG %3d %10.4f %10.4f', idx.idx_zPG(i), z(i+cnt), z_est(i+cnt));
0036 end
0037 cnt = cnt + len;
0038 len = length(idx.idx_zVa);
0039 for i = 1: len
0040 fprintf(fd, '\n Va %3d %10.4f %10.4f', idx.idx_zVa(i), z(i+cnt), z_est(i+cnt));
0041 end
0042 cnt = cnt + len;
0043 len = length(idx.idx_zQF);
0044 for i = 1: len
0045 fprintf(fd, '\n QF %3d %10.4f %10.4f', idx.idx_zQF(i), z(i+cnt), z_est(i+cnt));
0046 end
0047 cnt = cnt + len;
0048 len = length(idx.idx_zQT);
0049 for i = 1: len
0050 fprintf(fd, '\n QT %3d %10.4f %10.4f', idx.idx_zQT(i), z(i+cnt), z_est(i+cnt));
0051 end
0052 cnt = cnt + len;
0053 len = length(idx.idx_zQG);
0054 for i = 1: len
0055 fprintf(fd, '\n QG %3d %10.4f %10.4f', idx.idx_zQG(i), z(i+cnt), z_est(i+cnt));
0056 end
0057 cnt = cnt + len;
0058 len = length(idx.idx_zVm);
0059 for i = 1: len
0060 fprintf(fd, '\n Vm %3d %10.4f %10.4f', idx.idx_zVm(i), z(i+cnt), z_est(i+cnt));
0061 end
0062
0063 fprintf(fd, '\n\n[Weighted sum of squared errors]:\t%f\n', error_sqrsum);