compare_loop_list: Compare two loop lists

Description Usage Arguments Details Value Examples

View source: R/further_functions.R

Description

Compared two loop lists and returns the indices of those loops that are identical in both lists, that switch only the sign or that do not occur in both lists

Usage

1
compare_loop_list(loop_list_a, loop_list_b)

Arguments

loop_list_a, loop_list_b

Loop lists with columns loop and sign, for example generated from find_loops.

Details

Indices of loops are given with respect to the order of the loops in the first supplied loop list as well as for the second loop list. The loops are sorted to represent their loops starting from the smallest variable index (using the function sort_loop_index).

Value

A list with 5 (possible empty) vectors as entries.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#sample Jacobian matrix of a system with 4 variables
jac_matrix <- rbind(c(-1,0,0,-1),c(1,-1,0,1),c(0,1,-1,0),c(0,0,1,-1))
#find the feedback loops of the system
loop_list <- find_loops(jac_matrix,10)
#a slightly different Jacobian matrix of the system with 4 variables
jac_matrix_alt <- rbind(c(-1,0,0,1),c(1,-1,0,-1),c(0,1,-1,0),c(0,0,1,-1))
#find the feedback loops of the system
loop_list_alt <- find_loops(jac_matrix_alt,10)
#compare the loop lists
comp_loop_list <- compare_loop_list(loop_list,loop_list_alt)
#loops that switch sign
comp_loop_list[['ind_a_switch']]

LoopDetectR documentation built on July 20, 2020, 5:07 p.m.