# Define initial value of an function

**URL:** <https://community.freefem.org/t/define-initial-value-of-an-function/707>\
**Category:** General Discussion\
**Created:** [December 24, 2020, 7:53am UTC](https://community.freefem.org/t/define-initial-value-of-an-function/707 "2020-12-24T07:53:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aicha](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@Aicha](https://community.freefem.org/u/Aicha)\
**Post date:** [December 24, 2020, 7:53am UTC](https://community.freefem.org/t/define-initial-value-of-an-function/707/1 "2020-12-24T07:53:32Z")

</div>

Hi,  
the initial value of a solution v(x,t) of an equation is defined by: v(x,0)= v\_0 \times Id\_{[0,x\_0]} where Id\_{[0,x\_0]} (x) is equal to 1 when x \in [0,x\_0], else it’s equal to 0.  
My question is: in FreeFem++, how we define Vold the initial value of v?

Thank’s in advance.

---

<div class="post-metadata">

**Author:** ![Sunrise](https://avatars.discourse-cdn.com/v4/letter/s/9fc29f/32.png) [@Sunrise](https://community.freefem.org/u/Sunrise)\
**Post date:** [December 28, 2020, 2:16pm UTC](https://community.freefem.org/t/define-initial-value-of-an-function/707/2 "2020-12-28T14:16:05Z")

</div>

Hi,  
I am not sure if I have understood your question correctly, if you want to define the function Id\_{[0,x\_0]} (x), you can use  
v(x,0)= v\_0 \* ( 0 \< x \< x\_0 )
