# Questions about nonlinear problem with mixed boundary condition

**URL:** <https://community.freefem.org/t/questions-about-nonlinear-problem-with-mixed-boundary-condition/1862>\
**Category:** General Discussion\
**Created:** [June 30, 2022, 9:32pm UTC](https://community.freefem.org/t/questions-about-nonlinear-problem-with-mixed-boundary-condition/1862 "2022-06-30T21:32:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![m31phy](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/m31phy/32/1216_2.png) [@m31phy](https://community.freefem.org/u/m31phy)\
**Post date:** [June 30, 2022, 9:32pm UTC](https://community.freefem.org/t/questions-about-nonlinear-problem-with-mixed-boundary-condition/1862/1 "2022-06-30T21:32:22Z")

</div>

Hello all users

I have a question about making a FreeFEM code for my problem. To be specific, as a simple nonlinear problem, I tried to solve the following differential equations.

F’‘(x) + F(x) - F(x)^3 =0, F(0) =0, F’(\infty) = 0

So, the solution for the above differential equation is tanh(x/\sqrt(2)).

In order to solve this nonlinear equation, I follow some examples in official documents.

The below codes are my code;

```auto
func InitialCondition = 1. * (x>0) + 0.;
mesh Th = square(100, 10, [10 *x, 2 * y]);
fespace Vh(Th, P2 , periodic = [[1,x], [3,x] ] );
Vh u, v;
Vh du;
Vh uold = InitialCondition;

for(int i = 1; i < 7; i++){
solve example(du,v)
  = int2d(Th)( ( dx(du ) * dx(v) + dy(du) * dy(v) ) - du * v + 3 * ( dx(du))* uold * uold * v )
    - int2d(Th)( ( dx(uold) * dx(v) + dy(uold) * dy(v) ) - uold * v + uold * uold * uold * v)
    + on( 4, du = 0);
    uold[] -= du[];

    plot(uold );
}

```

Whenever I modified this code, I couldn’t reach to correct solutions.

Thank you for your help
