# Time fractional PDE

**URL:** <https://community.freefem.org/t/time-fractional-pde/2003>\
**Category:** General Discussion\
**Created:** [September 13, 2022, 11:44am UTC](https://community.freefem.org/t/time-fractional-pde/2003 "2022-09-13T11:44:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deepika](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@Deepika](https://community.freefem.org/u/Deepika)\
**Post date:** [September 13, 2022, 11:44am UTC](https://community.freefem.org/t/time-fractional-pde/2003/1 "2022-09-13T11:44:32Z")

</div>

![time-fractional pde](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/b/bc1ebc1e0c97894e02baf46345ca255cd70cbe1a.png)

Hello,

I want to solve this problem by FreeFEM for alpha = 0.6 in a unit square domain.  
Kindly share your suggestions.  
Thanks

---

<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:** [September 20, 2022, 3:58pm UTC](https://community.freefem.org/t/time-fractional-pde/2003/2 "2022-09-20T15:58:39Z")

</div>

I sorry, no real idea but a problem is due to the no local in time of the time fractional term, so I think the simple way is to use Fourier method.

---

<div class="post-metadata">

**Author:** ![Deepika](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@Deepika](https://community.freefem.org/u/Deepika)\
**Post date:** [September 28, 2022, 8:56am UTC](https://community.freefem.org/t/time-fractional-pde/2003/3 "2022-09-28T08:56:49Z")

</div>

Dear Sir,

I somehow tried to solve the problem, but I don’t know where I am going wrong as answer is not what is expected.

border AB(t= 0, 1){x=t; y=0; label = 1;};  
border BC(t= 0, 1){x=1; y=t; label = 2;};  
border CD(t= 1, 0){x=t; y=1; label = 3;};  
border DA(t= 1, 0){x=0; y=t; label = 4;};  
int n=20;  
mesh Th = buildmesh(AB(n)+BC(n)+CD(n)+DA(n));  
plot(Th, wait=1);

func u0 = sin(pi\*x)_sin(pi_y);  
real T= 1;  
real dt= 0.1;  
real alpha = 0.7;  
real gm = 1/tgamma(2- alpha);

fespace Vh(Th, P1);  
Vh u, v;

Vh[int] uu(15);  
Vh[int] sum11(15);  
// first iteration

//for(real t = 0; t \< T; t += ){  
for(int k=0; k \< 10 ; k++){  
uu[0]=u0;  
u= uu[k+1];

sum11[0] =0;  
sum11[1] =0;  
for(int j=0; j\<= k; j++){  
sum11[3] = sum11[0] + uu[k+1-j]_((j+1)^(1-alpha))/(dt)^alpha - uu[k+1-j]_((j)^(1-alpha))/(dt)^alpha ;  
sum11[2] = sum11[1] + uu[k-j]_((j+1)^(1-alpha))/(dt)^alpha - uu[k-j]_((j)^(1-alpha))/(dt)^alpha ;  
sum11[0] = sum11[3];  
sum11[1] = sum11[2];  
}

solve thermic(u, v)  
= int2d(Th)( sum11[0]_v_gm)  
- int2d(Th)( sum11[1]_v_gm)  
+ int2d(Th)(dx(u) \* dx(v)+ dy(u) \* dy(v))  
+ on(1,2,3,4, u=0);

plot(u, cmm=“time=”+k, fill=1, wait=0, value=1);

uu[k+1] = u;  
//dt = 0.1 + dt;  
}
