```python
from IPython.display import Math

from sympy import Symbol
from sympy.core.containers import Tuple
from sympy import pi, cos, sin, exp
from sympy import expand

from sympde.core import Constant
from sympde.calculus import grad, dot, inner, outer, cross, rot, curl, div
from sympde.calculus import laplace, hessian, bracket, convect, D, conv
from sympde.calculus import ArgumentTypeError
from sympde.calculus import jump, avg, Dn, minus, plus
from sympde.topology import Domain, Boundary
from sympde.topology import ScalarFunctionSpace, VectorFunctionSpace
from sympde.topology import ProductSpace
from sympde.topology import H1Space, HcurlSpace, HdivSpace, L2Space, UndefinedSpace
from sympde.topology import TestFunction, ScalarTestFunction, VectorTestFunction
from sympde.topology import ScalarField, VectorField
from sympde.topology import element_of, elements_of
from sympde.expr     import LinearForm
from sympde.expr     import integral
from sympde.expr     import linearize
from sympde.printing.latex import latex
```

# Nonlinear problems

### Nonlinear poisson

Let us consider the weak formulation $l(v)=0$, where

\begin{align}
  l(v) = \int_{\Omega} \nabla u \cdot \nabla v + e^{-u}v ~d\Omega 
  \label{eq:nonlinear-example-wf}
\end{align}

The linearization of such a linear form means that we replace $u$ by an expansion $u + \epsilon \delta u$ then we compute the Taylor expansion with respect to $\epsilon$.
The linearisation leads to the construction of a bilinear form that has arguments $\left( \delta u, v \right)$, as shown in the follozing Python code:


```python
domain = Domain('Omega', dim=2)
Gamma_N = Boundary('Gamma_N', domain.interior)
x,y = domain.coordinates

V = ScalarFunctionSpace('V', domain)

u, du,v = elements_of(V, names='u, delta_u, v')

int_0 = lambda expr: integral(domain, expr)

expr = int_0(dot(grad(v), grad(u)) -4.*exp(-u)*v) 
l = LinearForm(v, expr )
```


```python
# linearising l around u, using du
a = linearize(l, u, trials=du)
```


```python
Math(latex(a))
```




$\displaystyle \left( \delta_{u}, v \right) \mapsto \int_{\Omega} 4.0 \delta_{u} v e^{- u} ~d\mathbf{x} + \int_{\Omega} \nabla{\delta_{u}} \cdot \nabla{v} ~d\mathbf{x}$




```python

```

a831f5c15cb0f4d143b936bd1a2d75b6da886101
ipynb
Jupyter Notebook
notebooks/nonlinear_examples.ipynb
pyccel/sympde
69e6a6634b2045d46286a0453cb66deab5f2e76c
MIT
2018-09-02T17:50:19.000Z
2022-03-08T01:26:47.000Z
notebooks/nonlinear_examples.ipynb
pyccel/sympde
69e6a6634b2045d46286a0453cb66deab5f2e76c
MIT
2019-08-18T14:50:01.000Z
2021-09-16T13:54:58.000Z
notebooks/nonlinear_examples.ipynb
pyccel/sympde
69e6a6634b2045d46286a0453cb66deab5f2e76c
MIT
2019-10-04T18:05:48.000Z
2020-10-17T02:15:10.000Z
Qwen/Qwen-72B
1. YES
2. YES