# Implement spring elements

**URL:** https://community.freefem.org/t/implement-spring-elements/2513
**Category:** General Discussion
**Created:** [May 31, 2023, 12:25pm UTC](https://community.freefem.org/t/implement-spring-elements/2513 "2023-05-31T12:25:04Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![arallu](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@arallu](https://community.freefem.org/u/arallu)
#### Post date: [May 31, 2023, 12:25pm UTC](https://community.freefem.org/t/implement-spring-elements/2513/1 "2023-05-31T12:25:04Z")

</div>

Hello,

What would be the best way to add ideal springs on a continuous media (a beam for example)? A solution could be to modify one matrix corresponding to the weak formulation, but it seems to be not so easy (I must know the number of the degree of freedom corresponding to the application point).

---

<div class="post-metadata">

### Author: ![marchywka](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@marchywka](https://community.freefem.org/u/marchywka)
#### Post date: [May 31, 2023, 12:54pm UTC](https://community.freefem.org/t/implement-spring-elements/2513/2 "2023-05-31T12:54:50Z")

</div>

As I understand this, the material model for a flexible beam would include  
linear elasticity similar to a linear hookian spring and distribute loads  
are apparently common examples. The issue is the point or delta function  
loading. You want to apply the displacement dependent force at one  
point or DOF. At least two problems arise, locating the single DOF and  
what magnitude to apply. I had an issue before adding a line charge  
to a 2D mesh and IIRC had some luck using isoline and curve or similar  
but I think I used area and lenedge to get the numbers right although  
I don’t think I looked too closely at the result. I guess you could also use P0  
elements.

---

<div class="post-metadata">

### Author: ![arallu](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@arallu](https://community.freefem.org/u/arallu)
#### Post date: [June 1, 2023, 3:18pm UTC](https://community.freefem.org/t/implement-spring-elements/2513/3 "2023-06-01T15:18:29Z")

</div>

Thanks Mike for your answer. Could you share your code please?

---

<div class="post-metadata">

### Author: ![marchywka](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@marchywka](https://community.freefem.org/u/marchywka)
#### Post date: [June 1, 2023, 5:00pm UTC](https://community.freefem.org/t/implement-spring-elements/2513/4 "2023-06-01T17:00:15Z")

</div>

I’m not sure it is an answer so much as just attempting to clarify the issue.  
I take it that is your stumbling point? For example, why can’t you just  
model the spring as another beam perpendicular to the first one?
