# NOT RUN {
g_prep <- biconnected_network%>%
prepare_edges(.) %>%
prepare_continuous_force(., node_names = "name", force_var = "force", k = NULL)
#the base configuration does not work
divergent_result <- setse_expanded(g_prep, k = "weight", tstep = 0.1)
#with a smaller timestep the algorithm converges
convergent_result <- setse_expanded(g_prep, k = "weight", tstep = 0.01)
# }
# NOT RUN {
library(ggplot2)
#plot the results for a given node
convergent_result %>%
ggplot(aes(x = t, y = net_force, colour = node)) + geom_line()
#re-plot with divergent_result to see what it looks like
# }
Run the code above in your browser using DataLab