calc_spring_area: Calculate the cross sectional area of the edge

Description Usage Arguments Details Value Examples

View source: R/calc_spring_area.R

Description

This function adds the graph characteristic A which is the cross sectional area of the edge.

Usage

1
calc_spring_area(g, value, minimum_value, range)

Arguments

g

an igraph object. The graph representing the network

value

a character string. The name of the edge attribute that is used as value from which Area will be calculated

minimum_value

a numeric value. Indicating the most thinnest edge

range

a numeric value. This gives the range of A values above the minimum.

Details

This function is pretty niche but calculates a cross sectional area of an edge. This is useful when you wish to calculate the spring coefficient k using Young's modulus. The function coerces and edge characteristic to be within a certain range of values preventing negative/zero/infinite values.

Value

a igraph object with the new edge attribute "Area" for each edge

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 

library(igraph)
set.seed(234)
g_prep <- generate_peels_network("A") %>%
 set.edge.attribute(., name = "edge_characteristic", value = rep(1:16, each = 10))

g <- calc_spring_area(g_prep, value = "edge_characteristic", minimum_value = 10, range = 20)

get.edge.attribute(g, "Area")

rsetse documentation built on June 11, 2021, 5:07 p.m.