test_faultDetection

test_faultDetection.faultdetection(show_plots, r_c1, r_c2, valid1, valid2, faultMode)[source]

Test the faultdetection module. Setup a simulation

test_faultDetection.test_faultdetection(show_plots, r_c1, r_c2, valid1, valid2, faultMode)[source]

Validation Test Description

This module tests the fault detection scenario. The logic behind the fault detection is explained in the doxygen documentation. In order to properly test the proper functioning of the fault detection, all the possible combinations are run (8). The expected results are computed in python and are tested with the output.

Test Parameters

absolute accuracy value of 1E-10 is used in this test

  • case 1: ([10, 10, 1], [10, 10, 1], 1, 1, 0)

    No measurement merge, all are valid, no faults

  • case 2: ([10, 10, 1], [10, 10, 1], 1, 0, 0)

    No measurement merge, one valid, no faults

  • case 3: ([10, 10, 1], [10, 10, 1], 1, 0, 2)

    No measurement merge, one valid, no faults, mode 2

  • case 4: ([10, 10, 1], [10, 10, 1], 0, 1, 0)

    No measurement merge, other valid, no faults

  • case 5: ([10, 10, 1], [10, 10, 1], 0, 1, 0)

    No measurement merge, other valid, no faults, mode 2

  • case 6: ([10, 10, 1], [10, 10, 1], 0, 1, 1)

    Merge on, other valid, no faults

  • case 7: ([10, 10, 1], [10, 10, 1], 0, 0, 0)

    No merge, none valid, no faults

  • case 8: ([10, 10, 1], [100, 10, 1], 1, 1, 0)

    No merge, all measurements valid, fault

  • case 9: ([10, 10, 1], [100, 10, 1], 1, 1, 1)

    Merge, all measurements valid, fault

  • case 10: ([10, 10, 1], [100, 10, 1], 1, 1, 2)

    Merge, all measurements valid, fault, mode 2

  • case 11: ([10, 10, 1], [10, 10, 1], 1, 1, 1)

    Merge, all measurements valid, no fault

Description of Variables Being Tested

The time, detection of a fault, measurement, and measurement covariances are tested on the output. These are r_BN_N, covar_N, time, faultDetected