From 20ac98114df84064a7ebc9d01e7c244307805ba9 Mon Sep 17 00:00:00 2001 From: garydblack Date: Thu, 3 Dec 2020 07:59:21 -0800 Subject: [PATCH] Defined PI out to 16 decimal places to match double precision accuracy, which cleared up some angle calculation differences between C++ and MATLAB with test harness matrices. Also fixed an issue in prep_R where psuedo-measurement values weren't being re-initialized when GS_OPTIMIZE wasn't set. --- state-estimator/include/SELoopWorker.hpp | 9 +++++++++ state-estimator/src/state-estimator.cpp | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/state-estimator/include/SELoopWorker.hpp b/state-estimator/include/SELoopWorker.hpp index 5e92812..35a89d8 100644 --- a/state-estimator/include/SELoopWorker.hpp +++ b/state-estimator/include/SELoopWorker.hpp @@ -1525,6 +1525,7 @@ class SELoopWorker { #endif // -- compute K = P_predict*J'*S^-1 + // TODO December 21, 2020 CHECK Supd, Kupd between C++ and MATLAB #ifdef DEBUG_PRIMARY double startTime; @@ -2271,6 +2272,14 @@ class SELoopWorker { #endif } } +#ifndef GS_OPTIMIZE + // for psuedo-measurements when not using the GS optimized + // C-sparse functions, Rraw is created from scratch to need + // to re-initialize those values every prep_R call + else + cs_entry_negl(Rraw,zary.zidxs[zid],zary.zidxs[zid], + zary.zsigs[zid]*zary.zsigs[zid]); +#endif } #ifndef GS_OPTIMIZE diff --git a/state-estimator/src/state-estimator.cpp b/state-estimator/src/state-estimator.cpp index 0cba12a..b7bb91d 100644 --- a/state-estimator/src/state-estimator.cpp +++ b/state-estimator/src/state-estimator.cpp @@ -16,6 +16,7 @@ // test harness related conditional compilation values //#define TEST_HARNESS_DIR "test_4" //#define TEST_HARNESS_DIR "test_4vinj" +//#define TEST_HARNESS_DIR "test_4net" //#define TEST_HARNESS_DIR "test_13assets" #ifdef TEST_HARNESS_DIR // whether to get node_vnoms from file or hardwire to 1 @@ -26,7 +27,7 @@ //#define TEST_HARNESS_WRITE_FILES //#define TEST_HARNESS_DEBUG -#define PI 3.1415926535 +#define PI 3.141592653589793 #include