# Formulation mixte sur FreeFem

**URL:** <https://community.freefem.org/t/formulation-mixte-sur-freefem/3488>\
**Category:** General Discussion\
**Created:** [September 17, 2024, 11:47am UTC](https://community.freefem.org/t/formulation-mixte-sur-freefem/3488 "2024-09-17T11:47:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@daniel](https://community.freefem.org/u/daniel)\
**Post date:** [September 17, 2024, 11:47am UTC](https://community.freefem.org/t/formulation-mixte-sur-freefem/3488/1 "2024-09-17T11:47:57Z")

</div>

Bonjour les doyens, j’ai un sous sur comment procéder pour résoudre un problème de formulation mixte issu d’un problème de contrôle optimal d’une EPD linéaire. Cette formulation mixte dépend de deux variables que je cherche à déterminer numériquement par la méthode des éléments finis.  
Est-ce que vous pouvez m’aider ?

---

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [September 17, 2024, 2:16pm UTC](https://community.freefem.org/t/formulation-mixte-sur-freefem/3488/2 "2024-09-17T14:16:58Z")

</div>

Hello Daniel,  
You need to formulate your equations so that someone can help you…  
You can use latex style between dollars to write equations.  
Eventually you can discuss of a simplified problem. Please write in English so that everybody can understand.

---

<div class="post-metadata">

**Author:** ![daniel](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@daniel](https://community.freefem.org/u/daniel)\
**Post date:** [September 17, 2024, 3:15pm UTC](https://community.freefem.org/t/formulation-mixte-sur-freefem/3488/3 "2024-09-17T15:15:32Z")

</div>

Thank you very much for your advice.

---

<div class="post-metadata">

**Author:** ![daniel](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@daniel](https://community.freefem.org/u/daniel)\
**Post date:** [September 17, 2024, 3:17pm UTC](https://community.freefem.org/t/formulation-mixte-sur-freefem/3488/4 "2024-09-17T15:17:54Z")

</div>

```
This work is devoted to the problem of null controllability for the following parabolic equation:
\begin{eqnarray}
	\begin{cases} \label{W32}
		\varphi_t - \Delta \varphi + B(x, t) \cdot \nabla \varphi + a(x, t) \varphi = u \chi_O & \text{in } Q, \\
		\varphi = 0 & \text{on } \Sigma, \\
		\varphi(x,0) = \varphi_0(x) & \text{in } \Omega
	\end{cases}
\end{eqnarray}
We transform this problem into an optimization problem and obtain:
\begin{equation} \label{W37}
	\min_{y \in W_\epsilon} \hat{J}^\ast_\epsilon(y) := \frac{1}{2} \iint_{q} \rho_0^{-2} |y(x, t)|^2 \, dx \, dt + \frac{\epsilon}{2} \|y(\cdot, T)\|^2_{L^2(\Omega)} + (\varphi_0, y(\cdot, 0))_{L^2(\Omega)}.
\end{equation}
where 
\[
W_\epsilon = \{ y \in \Phi_\epsilon : L^\ast y = 0 \text{ in } L^2(Q) \}
\]
with
\begin{eqnarray} \label{W36}
	\begin{cases}
		L^\ast y =	-y_t - \Delta y + B(x, t) \cdot \nabla y + a(x, t) y 0 \quad \text{in} \; Q, \\
		y = 0 \quad \text{on} \; \Sigma, \\
		y(\cdot, T) = y_T \quad \text{in} \; \Omega,
	\end{cases}
\end{eqnarray}
We consider the following mixed formulation: find \( (y_\epsilon, \lambda_\epsilon) \in \Phi_\epsilon \times L^2(Q) \) that solves
\begin{equation} \label{W38}
	\begin{cases}
		a_\epsilon(y_\epsilon, y) + b(y, \lambda_\epsilon) = l(y), \forall y \in \Phi_\epsilon, \\
		b(y_\epsilon, \lambda) = 0, \forall \lambda \in L^2(Q),
	\end{cases}	
\end{equation}
where
\[
a_\epsilon : \Phi_\epsilon \times \Phi_\epsilon \rightarrow \mathbb{R}, \quad a_\epsilon(y, y') := \iint_{q} \rho_0^{-2} y y' \, dx \, dt + \epsilon (y(\cdot, T), y'(\cdot, T))_{L^2(\Omega)}
\]
\[
b : \Phi_\epsilon \times L^2(Q) \rightarrow \mathbb{R}, \quad b(y, \lambda) := - \iint_{Q} L^\ast y \, \lambda \, dx \, dt
\]
\[
l : \Phi_\epsilon \rightarrow \mathbb{R}, \quad l(y) := - (\varphi_0, y(\cdot, 0))_{L^2(\Omega)}.
\]
The continuation of the work shows that \(u_\epsilon := \rho_0^{-2} y_\epsilon \chi_\omega\), 
\[
\iint_{q} u_\epsilon \, \bar{y} \, dx \, dt + (\epsilon y_\epsilon(\cdot, T), \bar{y}(\cdot, T)) - \iint_{Q} L^\ast \bar{y}(x, t) \lambda_\epsilon(x, t) \, dx \, dt = l(\bar{y}), \quad \forall \bar{y} \in \Phi_\epsilon.
\]
The objective is to numerically determine the functions $u$ et $\lambda$

```

---

<div class="post-metadata">

**Author:** ![lassounon](https://avatars.discourse-cdn.com/v4/letter/l/bbe5ce/32.png) [@lassounon](https://community.freefem.org/u/lassounon)\
**Post date:** [September 18, 2024, 7:32am UTC](https://community.freefem.org/t/formulation-mixte-sur-freefem/3488/5 "2024-09-18T07:32:33Z")

</div>

Just give the pdf image of your problem. It’s easy to read.

---

<div class="post-metadata">

**Author:** ![daniel](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@daniel](https://community.freefem.org/u/daniel)\
**Post date:** [September 18, 2024, 9:53am UTC](https://community.freefem.org/t/formulation-mixte-sur-freefem/3488/6 "2024-09-18T09:53:00Z")

</div>

I believe it is not possible to attach a PDF document

---

<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 18, 2024, 11:23am UTC](https://community.freefem.org/t/formulation-mixte-sur-freefem/3488/7 "2024-09-18T11:23:49Z")

</div>

![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/2/20a8bba141a0adc027fe45368c60ab9f96872d89.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:** [September 18, 2024, 12:13pm UTC](https://community.freefem.org/t/formulation-mixte-sur-freefem/3488/8 "2024-09-18T12:13:06Z")

</div>

With E. Trelat and G. lance we write a book on this subject and  
all exemples are here

> **[PDE-constrained optimization within FreeFEM](https://freefem.org/Optim/)**
>
> FreeFEM website

t the pdf of the book is here: [https://www.ljll.fr/hecht/ftp/tmp/PDE-constrained%20optimization%20within%20FreeFEM-07-07-24.pdf](https://www.ljll.fr/hecht/ftp/tmp/PDE-constrained%20optimization%20within%20FreeFEM-07-07-24.pdf)
