# I need help with a variational formulation

For this problem

$$\begin{cases} &\frac{d^2 u}{dx^2}=Log(1+x+y),in \quad\Omega=(0,1)^2\\ &u=0,\qquad on \quad\Gamma_{1}: x=0\\ &u=0,\qquad on \quad\Gamma_{3}: x=1\\ &\frac{du}{d\eta}=0,\qquad on \quad\Gamma_{2}: y=0\\ &\frac{du}{d\eta}=0,\qquad on \quad\Gamma_{4}: y=1\\ \end{cases}$$

Where $$\eta$$ is the unit normal vector.

My attempt to find the variational formulation

$$\int_{\Omega}\frac{du}{dx}\cdot\frac{dv}{dx}\operatorname*{dxdy}=-\int_{\Omega }Log(1+x+y).v\operatorname*{dxdy}$$

I don't know what is the space of solution and I'm not sure if this formulation is correct because I didn't get the results of the questions related to the formulation, and I'll appreciate a lot to help me to find some books we some examples like this one?

• Deriving the weak formulation is a standard step in both the theory of PDEs and of the finite element method. Where have you already looked to finding an answer to your question? – Wolfgang Bangerth Jun 23 '20 at 16:27
• exactly, it's a problem of the finite element method, you can see my attempt in my question, but it's false because I get different results from what I need to proove. but I don't know where is the problem – Almendrof66 Jun 23 '20 at 16:50
• Your domain is 2-dimensional but you only have derivatives in a single variable. Is this a mistake? If not, the problem is simpler, but requires a bit more thought – whpowell96 Jun 23 '20 at 17:40
• Yes, the domain is 2-dimensional and the derivative is just for x, there is no mistake : ) – Almendrof66 Jun 23 '20 at 17:45
• Of course you can do integration by parts in x. And the formulation is correct. The space is simply the set $\{v \in L_2: \int (\partial_x v)^2 < \infty, v(0)=v(1)=0 \}$. – Wolfgang Bangerth Jun 24 '20 at 15:10

## 1 Answer

The weak formulation is correct as stated. The space in which you are looking for solutions is $$X = \{ v \in L_2 : \int (\partial x)^2 < \infty, v(0,y)=0, v(1,y)=0 \}$$ and this is also the space from which the test functions come.

I will note that in the question, there are two other boundary conditions at the bottom and top of the box (i.e., at $$y=0$$ and $$y=1$$). But these can not be enforced and are consequently invalid. This can be seen by considering that the problem you have is really a two-point boundary value problem: For every $$y$$, you have to find a function $$u_y(x) = u(x,y)$$ so that $$u_y''(x) = \log(1+x+y), \\ u_y(0) = 0, \\ u_y(1) = 0$$ In other words, the solution $$u_0(x)=u(x,y=0)$$ just happens to be whatever it is based on the right hand side and boundary values on the left and right, and so are the solutions $$u_y(x)$$ for nearby $$y$$ values. As a consequence, $$\partial y u_y(x)$$ is also whatever it is -- you can't force it to be zero (and based on the right hand side $$\log(1+x+y)$$ one might suspect that $$\partial_y u_y(x) \neq 0$$).

• Thank you a lot for your explanation, Could I please ask you another question, I'm trying to calculate the value of $u$ at the node $a_5$ which is $(\frac{1}{2},\frac{1}{2})$, but after all my attempts using the local basis function I get a singular matrix, could you please give me indications on the process. Thank you in advance – Almendrof66 Jun 27 '20 at 15:51
• @Almendrof66 I have no idea what precisely you are doing, what matrix you are referring to, and what you have already done to debug your problem. There is nothing really I can do for you. – Wolfgang Bangerth Jun 29 '20 at 1:17