## ← 07-03 Hanging Rope

• 1 Follower
• 20 Lines

### Get Embed Code x Embed video Use the following code to embed this video. See our usage guide for more details on embedding. Paste this in your document somewhere (closest to the closing body tag is preferable): ```<script type="text/javascript" src='https://amara.org/embedder-iframe'></script> ``` Paste this inside your HTML body, where you want to include the widget: ```<div class="amara-embed" data-url="http://www.youtube.com/watch?v=p1UhkrDwC5w" data-team="udacity"></div> ``` 1 Language

Showing Revision 1 created 10/24/2012 by Amara Bot.

1. Now let's try out some of these ideas with the flexible rope.
2. We'll fix both ends of that rope
3. and want to see what the equilibrium shape is going to be
4. under the influence of gravity.
5. The obvious choice of finite elements is springs.
6. Springs of a given rest length, so that the potential energy of each spring
7. amounts to 1/2 times the spring constant times the square of the extension of the spring,
8. which is the distance between the two endpoints minus the rest length of the string.
9. To model the mass of that rope, we attach mass points to these strings.
10. Of course, these mass points carry potential energy due to gravity.
11. Given the constants that we provide, compute the potential energy of that rope.
12. The one end of that rope will be fixed at x = 0, y = 0.
13. The other end of that rope will be fixed at x = 1.3 m and y = 0.4 m.
14. Our code starts with a random initialization
15. and then applies a pretty simplistic strategy to minimize the energy.
16. For a certain number of times it's going to pick one of the masses
17. and change the position of that mass point by a random vector.
18. If the energy decreases, it keeps that new position.
19. If it doesn't, it returns to the position before.
20. Very simple, but highly inefficient.