mass_adjuster: Mass adjuster

Description Usage Arguments Details Value Examples

View source: R/mass_adjuster.R

Description

This function adjusts the mass of the nodes so that the force in each direction over the mass for that direction produces an acceleration of 1.

Usage

1
mass_adjuster(g, force = "force", resolution_limit = TRUE)

Arguments

g

An igraph object. the network

force

A character string. The name of the network attribute contain the network forces. Default is "force"

resolution_limit

logical. If the forces in the network are smaller than the square root of the machine floating point limit then the mass is set to one. default is true

Details

This function can help stabilise the convergence of networks by preventing major imbalances between the force in the network and the mass of the nodes. in certain cases acceleration can become very large or very small in if force and mass are not well parametrised.

This function means that if the network were reduced to two nodes where each node contained all the mass and all the force of one of the two directions, then each node would have an acceleration of 1ms^-2

The function can become important when using SETSe_bicomp as the force mass ratio of biconnection components can vary widely from the total force mass ratio of the network.

Value

A numeric value giving the adjusted mass of the nodes in the network.

Examples

1
2
3
4
5
6
7
8
set.seed(234) #set the random see for generating the network

g <- generate_peels_network(type = "E") %>%
prepare_SETSe_binary(., node_names = "name", k = 1000, 
                     force_var = "class", 
                     positive_value = "A")

mass_adjuster(g, force = "force", resolution_limit = TRUE)

rsetse documentation built on Nov. 12, 2020, 5:08 p.m.