SeedRandom[30];
(* initial coordinates of masses *)
mass = RandomReal[{0, 3}, {4, 2}];
(* mass 1 is connected to {2,3} and so on*)
spring = {{1, 2}, {1, 3}, {2, 4}, {3, 4}};
(* spring constant *)
k = 2.;
(* spring rest length*)
l = 1.;
(* step size *)
step = 0.02;
(* tolerance *)
tol = 10^-10.;
(* pinned masses *)
pinedpinned = {2,3};