Skip to main content
edited tags
Link
added 1 character in body
Source Link
Mahdi
  • 1.6k
  • 10
  • 23
 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};
 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 *)
 pined = {2,3};
 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 *)
 pinned = {2,3};
edited body
Source Link
Mahdi
  • 1.6k
  • 10
  • 23
 SeedRandom[30];
 (* initial coordinates of masses *)
 mass = RandomReal[{0, 3}, {4, 2}]; 
 (* mass 1 is connected to {2,3} and so on*)
 spring = {{21, 32}, {1, 43}, {12, 4}, {23, 34}}; 
 (* spring constant *)
 k = 2.;
 (* spring rest length*)
 l = 1.;
 (* step size *)
 step = 0.02;
 (* tolerance *)
 tol = 10^-10.;
 (* pinned masses *)
 pined = {2,3};
 SeedRandom[30];
 (* initial coordinates of masses *)
 mass = RandomReal[{0, 3}, {4, 2}]; 
 (* mass 1 is connected to {2,3} and so on*)
 spring = {{2, 3}, {1, 4}, {1, 4}, {2, 3}}; 
 (* spring constant *)
 k = 2.;
 (* spring rest length*)
 l = 1.;
 (* step size *)
 step = 0.02;
 (* tolerance *)
 tol = 10^-10.;
 (* pinned masses *)
 pined = {2,3};
 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 *)
 pined = {2,3};
Tweeted twitter.com/#!/StackMma/status/580718180236206081
deleted 35 characters in body
Source Link
Mahdi
  • 1.6k
  • 10
  • 23
Loading
Source Link
Mahdi
  • 1.6k
  • 10
  • 23
Loading