# Shift operator for periodic functions

**URL:** https://community.freefem.org/t/shift-operator-for-periodic-functions/1637
**Category:** Feature Request
**Created:** [April 1, 2022, 9:08am UTC](https://community.freefem.org/t/shift-operator-for-periodic-functions/1637 "2022-04-01T09:08:48Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Alexandru](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@Alexandru](https://community.freefem.org/u/Alexandru)
#### Post date: [April 1, 2022, 9:08am UTC](https://community.freefem.org/t/shift-operator-for-periodic-functions/1637/1 "2022-04-01T09:08:48Z")

</div>

Dear all,

Assume u is a periodic scalar field on [0,1] (i.e. u(0)=u(1)) and the variational formulation of the problem depends on u(x) and u(x+a).

Is there a simple procedure to obtain u(x+a) from u(x) (right shift) in the same fespace ?

Thanks, Alexandru

---

<div class="post-metadata">

### Author: ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)
#### Post date: [April 2, 2022, 10:09am UTC](https://community.freefem.org/t/shift-operator-for-periodic-functions/1637/2 "2022-04-02T10:09:53Z")

</div>

Use periodic key word in fespace definition (see documentation or exemple)

---

<div class="post-metadata">

### Author: ![Alexandru](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@Alexandru](https://community.freefem.org/u/Alexandru)
#### Post date: [April 3, 2022, 9:00am UTC](https://community.freefem.org/t/shift-operator-for-periodic-functions/1637/3 "2022-04-03T09:00:36Z")

</div>

Thank you ! I apologize, my question was not very clear : obviously, we need u in a periodic fespace of periodic functions but my question is how to use u and its shift u(x+a) (the shift of u) in the same variational formulation.

---

<div class="post-metadata">

### Author: ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)
#### Post date: [April 4, 2022, 3:30pm UTC](https://community.freefem.org/t/shift-operator-for-periodic-functions/1637/4 "2022-04-04T15:30:23Z")

</div>

no way, I am sorry.But in this case u(x) == u(x+a) so no problem  
And can you write what is the variational formulation in math.

---

<div class="post-metadata">

### Author: ![Alexandru](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@Alexandru](https://community.freefem.org/u/Alexandru)
#### Post date: [April 8, 2022, 3:50pm UTC](https://community.freefem.org/t/shift-operator-for-periodic-functions/1637/5 "2022-04-08T15:50:00Z")

</div>

Let me reformulate the question : let f be a periodic function of period 1, i.e. f(0)=f(1), declared as such in a FE space of periodic functions. Is there a way to use f(x+a) (the shift of f by a fixed amount but with 0\<a\<1, where obviously, x+a is understand mod 1) in a variational formulation (of a non-local problem) ?

---

<div class="post-metadata">

### Author: ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)
#### Post date: [April 8, 2022, 3:56pm UTC](https://community.freefem.org/t/shift-operator-for-periodic-functions/1637/6 "2022-04-08T15:56:23Z")

</div>

No, because it is non local …
