# 1DKDV Galerkin finite elment method

**URL:** <https://community.freefem.org/t/1dkdv-galerkin-finite-elment-method/1924>\
**Category:** General Discussion\
**Created:** [July 31, 2022, 3:03am UTC](https://community.freefem.org/t/1dkdv-galerkin-finite-elment-method/1924 "2022-07-31T03:03:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qianrui](https://avatars.discourse-cdn.com/v4/letter/q/9fc348/32.png) [@Qianrui](https://community.freefem.org/u/Qianrui)\
**Post date:** [July 31, 2022, 3:03am UTC](https://community.freefem.org/t/1dkdv-galerkin-finite-elment-method/1924/1 "2022-07-31T03:03:29Z")

</div>

Hello, I ran the following KdV program, but the error between the numerical solution and the exact solution is not quite right. The program is as follows  
[DGKDV(n=1)07.27.edp](https://community.freefem.org/uploads/short-url/r9o3esbSJdiXDnPk4wIJPAl1H4K.edp) (1.4 KB)  
1dkdv mathematical model is as follows  
 ![屏幕截图 2022-07-31 110027](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/9/938d9ad8ae1231d911dbbab197b4f37f2c24c456.png)  
The fully discrete format is as follows  
 ![屏幕截图 2022-07-31 110124](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/5/5d56b434cb2b9fbe8713da482ce3101cb56af566.png)

 ![屏幕截图 2022-07-31 110143](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/9/97019c8ae148d9e6c8a006fee8036f38064ebccc.png)

---

<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:** [August 3, 2022, 12:52pm UTC](https://community.freefem.org/t/1dkdv-galerkin-finite-elment-method/1924/2 "2022-08-03T12:52:20Z")

</div>

first this code is wrong, remember freefem++ solve directly just linear system no no linear  
so you have to use a algorithm to solve your no linear problem.

---

<div class="post-metadata">

**Author:** ![Qianrui](https://avatars.discourse-cdn.com/v4/letter/q/9fc348/32.png) [@Qianrui](https://community.freefem.org/u/Qianrui)\
**Post date:** [August 5, 2022, 4:51am UTC](https://community.freefem.org/t/1dkdv-galerkin-finite-elment-method/1924/3 "2022-08-05T04:51:57Z")

</div>

Sorry, I uploaded the wrong code. The following code corresponds to the above numerical format, but the error and convergence between the numerical solution and the exact solution have always been wrong.

[KDV(n=1)07.27.edp](https://community.freefem.org/uploads/short-url/c3u82sTagdKomNi1elAUdiFqJVV.edp) (1.8 KB)
