Skip to main content
edited body
Source Link
HBR
  • 1.7k
  • 9
  • 7

Following the same procedure that for the first problem below, one would have the operator you proposed: $$ \tilde{D}=\frac{1}{\Delta x^2}\begin{bmatrix}-2& 1 & 0 & 0 & \dots & 0 & 0 & 0\\ 1 & -2 & 1 & 0 & \ddots& 0 & 0 & 0\\ \vdots & \ddots & \ddots & \ddots & \ddots & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 1 & -2 & 1 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 & -2 & 1\\ 0 & 0 & 0 & 0 & -1 & 4 & -5 & 2\end{bmatrix} \tag{2}$$

Notice that your matrix $\tilde{D}$ is now applied to the vector $\vec{u} = (u_1,...,u_N)^T$. Note that $\tilde{D}$ has the BC imposed on the first but on the last row there is not any Bc as it should be. Note also that the last row: $r_N$ can be obtained with the following operation: $$r_N = 2r_{N-1} -r_{N-2}$$

Therefore $\tilde{D}$ is non invertible and your problem does not have any definite solution.

This was for the first problem

Let us begin defining the following problem (without any BC as you do): $$ D\,u(x) = f(x) \qquad x\in[0,L] \tag{P}$$ where $D$ is the operator derivative: $$D = \frac{\partial }{\partial x} \tag{1}$$

that acts on some continuous function $u(x)$ in order to provide the derivative: $u_x = D\,u(x)$.

The discrete version of $D$, namely $\tilde{D}$ is the matrix: $$ \tilde{D}=\frac{1}{2\Delta x}\begin{bmatrix}-1& 0 & 1 & 0 & \dots\\ 0 & -1 & 0 & 1 & \ddots\\ \vdots & \ddots & \ddots & \ddots & \ddots \end{bmatrix} \tag{2}$$$$ \tilde{D}=\frac{1}{\Delta x}\begin{bmatrix}-1& 1 & 0 & 0 & \dots\\ 0 & -1 & 1 & 0 & \ddots\\ \vdots & \ddots & \ddots & \ddots & \ddots \end{bmatrix} \tag{2}$$ that acts on the discrete version of the continuous function: $\vec{u}=(u_0,u_1,...,u_N)^{T}$, to provide its discrete derivative: $\vec{u}_x=\tilde{D}\,\vec{u}$

You can see that $\tilde{D}$ is not a square matrix, and the discrete version of $(P)$, i.e. the equation $\tilde{D}\,\vec{u}=\vec{f}$ does not make any sense. This also occurs to $(1)$ where the equation $D\,u=f$ suffers from the same. The problem is that due to the fact that we have more variables than equations, the operator $\tilde{D}$ cannot be inverted and therefore the solution exists up to a constant. It can be shown that if $\vec{u}_0$ a the solution of the problem $(P)$ in its discrete form, any vector $\vec{v}$ such as $\vec{v} =\lambda (1,...,1)^T$ is also a solution. This means that the solution of this problem would be: $$\vec{u} = \vec{u}_0 + \lambda (1,...,1)^T$$ where $\lambda$ is an arbitrary constant. What is more, in the continuous case it is the same!! I mean, this results in cotinuumcontinuum reads: $$u(x) = u_0(x) + \lambda$$ where $\lambda$ is again an arbitrary constant.

Now guess where do we set the value of $\lambda$ from!!

To set $\lambda$ only ONE boundary condition is needed to be defined, i.e. $u(0) = 0$ or $u(L) = 0$ for $(1)$ or $u_0=0$ or $u_N=0$ for $(2)$.

This, is theory. The operator $\tilde{D}$, in practice, is defined WITH the BC. For example, if the BC considered is $u_0 = 0$ the operator $\tilde{D}$ reads: $$ \tilde{D}=\frac{1}{2\Delta x}\begin{bmatrix}0 & 1 & 0 & \dots\\ -1 & 0 & 1 & \dots\\ \vdots & \vdots & \vdots & \ddots \end{bmatrix} $$$$ \tilde{D}=\frac{1}{\Delta x}\begin{bmatrix} 1 & 0 & 0 & \dots\\ -1 & 1 & 0 & \dots\\ \vdots & \vdots & \vdots & \ddots \end{bmatrix} $$ And it would be applied to the vector of unknowns: $\vec{u} = (u_1,...,u_n)^T$.

This reasoning, can be extended to any order and derivative. Try the operator that approximates the second derivative w.r.t. $x$. You will be convinced of the need for two BC's.

As a result, what you propose: applying the forward and backward discretisation on the first and end nodes respectively a proper BC on one of them: must lead to a non-solvable system.

Following the same procedure that for the first problem below, one would have the operator you proposed: $$ \tilde{D}=\frac{1}{\Delta x^2}\begin{bmatrix}-2& 1 & 0 & 0 & \dots & 0 & 0 & 0\\ 1 & -2 & 1 & 0 & \ddots& 0 & 0 & 0\\ \vdots & \ddots & \ddots & \ddots & \ddots & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 1 & -2 & 1 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 & -2 & 1\\ 0 & 0 & 0 & 0 & -1 & 4 & -5 & 2\end{bmatrix} \tag{2}$$

Notice that your matrix $\tilde{D}$ is now applied to the vector $\vec{u} = (u_1,...,u_N)^T$. Note that $\tilde{D}$ has the BC imposed on the first but on the last row there is not any Bc as it should be. Note also that the last row: $r_N$ can be obtained with the following operation: $$r_N = 2r_{N-1} -r_{N-2}$$

Therefore $\tilde{D}$ is non invertible and your problem does not have any definite solution.

This was for the first problem

Let us begin defining the following problem (without any BC as you do): $$ D\,u(x) = f(x) \qquad x\in[0,L] \tag{P}$$ where $D$ is the operator derivative: $$D = \frac{\partial }{\partial x} \tag{1}$$

that acts on some continuous function $u(x)$ in order to provide the derivative: $u_x = D\,u(x)$.

The discrete version of $D$, namely $\tilde{D}$ is the matrix: $$ \tilde{D}=\frac{1}{2\Delta x}\begin{bmatrix}-1& 0 & 1 & 0 & \dots\\ 0 & -1 & 0 & 1 & \ddots\\ \vdots & \ddots & \ddots & \ddots & \ddots \end{bmatrix} \tag{2}$$ that acts on the discrete version of the continuous function: $\vec{u}=(u_0,u_1,...,u_N)^{T}$, to provide its discrete derivative: $\vec{u}_x=\tilde{D}\,\vec{u}$

You can see that $\tilde{D}$ is not a square matrix, and the discrete version of $(P)$, i.e. the equation $\tilde{D}\,\vec{u}=\vec{f}$ does not make any sense. This also occurs to $(1)$ where the equation $D\,u=f$ suffers from the same. The problem is that due to the fact that we have more variables than equations, the operator $\tilde{D}$ cannot be inverted and therefore the solution exists up to a constant. It can be shown that if $\vec{u}_0$ a the solution of the problem $(P)$ in its discrete form, any vector $\vec{v}$ such as $\vec{v} =\lambda (1,...,1)^T$ is also a solution. This means that the solution of this problem would be: $$\vec{u} = \vec{u}_0 + \lambda (1,...,1)^T$$ where $\lambda$ is an arbitrary constant. What is more, in the continuous case it is the same!! I mean, this results in cotinuum reads: $$u(x) = u_0(x) + \lambda$$ where $\lambda$ is again an arbitrary constant.

Now guess where do we set the value of $\lambda$ from!!

To set $\lambda$ only ONE boundary condition is needed to be defined, i.e. $u(0) = 0$ or $u(L) = 0$ for $(1)$ or $u_0=0$ or $u_N=0$ for $(2)$.

This, is theory. The operator $\tilde{D}$, in practice, is defined WITH the BC. For example, if the BC considered is $u_0 = 0$ the operator $\tilde{D}$ reads: $$ \tilde{D}=\frac{1}{2\Delta x}\begin{bmatrix}0 & 1 & 0 & \dots\\ -1 & 0 & 1 & \dots\\ \vdots & \vdots & \vdots & \ddots \end{bmatrix} $$ And it would be applied to the vector of unknowns: $\vec{u} = (u_1,...,u_n)^T$.

This reasoning, can be extended to any order and derivative. Try the operator that approximates the second derivative w.r.t. $x$. You will be convinced of the need for two BC's.

As a result, what you propose: applying the forward and backward discretisation on the first and end nodes respectively a proper BC on one of them: must lead to a non-solvable system.

Following the same procedure that for the first problem below, one would have the operator you proposed: $$ \tilde{D}=\frac{1}{\Delta x^2}\begin{bmatrix}-2& 1 & 0 & 0 & \dots & 0 & 0 & 0\\ 1 & -2 & 1 & 0 & \ddots& 0 & 0 & 0\\ \vdots & \ddots & \ddots & \ddots & \ddots & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 1 & -2 & 1 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 & -2 & 1\\ 0 & 0 & 0 & 0 & -1 & 4 & -5 & 2\end{bmatrix} \tag{2}$$

Notice that your matrix $\tilde{D}$ is now applied to the vector $\vec{u} = (u_1,...,u_N)^T$. Note that $\tilde{D}$ has the BC imposed on the first but on the last row there is not any Bc as it should be. Note also that the last row: $r_N$ can be obtained with the following operation: $$r_N = 2r_{N-1} -r_{N-2}$$

Therefore $\tilde{D}$ is non invertible and your problem does not have any definite solution.

This was for the first problem

Let us begin defining the following problem (without any BC as you do): $$ D\,u(x) = f(x) \qquad x\in[0,L] \tag{P}$$ where $D$ is the operator derivative: $$D = \frac{\partial }{\partial x} \tag{1}$$

that acts on some continuous function $u(x)$ in order to provide the derivative: $u_x = D\,u(x)$.

The discrete version of $D$, namely $\tilde{D}$ is the matrix: $$ \tilde{D}=\frac{1}{\Delta x}\begin{bmatrix}-1& 1 & 0 & 0 & \dots\\ 0 & -1 & 1 & 0 & \ddots\\ \vdots & \ddots & \ddots & \ddots & \ddots \end{bmatrix} \tag{2}$$ that acts on the discrete version of the continuous function: $\vec{u}=(u_0,u_1,...,u_N)^{T}$, to provide its discrete derivative: $\vec{u}_x=\tilde{D}\,\vec{u}$

You can see that $\tilde{D}$ is not a square matrix, and the discrete version of $(P)$, i.e. the equation $\tilde{D}\,\vec{u}=\vec{f}$ does not make any sense. This also occurs to $(1)$ where the equation $D\,u=f$ suffers from the same. The problem is that due to the fact that we have more variables than equations, the operator $\tilde{D}$ cannot be inverted and therefore the solution exists up to a constant. It can be shown that if $\vec{u}_0$ a the solution of the problem $(P)$ in its discrete form, any vector $\vec{v}$ such as $\vec{v} =\lambda (1,...,1)^T$ is also a solution. This means that the solution of this problem would be: $$\vec{u} = \vec{u}_0 + \lambda (1,...,1)^T$$ where $\lambda$ is an arbitrary constant. What is more, in the continuous case it is the same!! I mean, this results in continuum reads: $$u(x) = u_0(x) + \lambda$$ where $\lambda$ is again an arbitrary constant.

Now guess where do we set the value of $\lambda$ from!!

To set $\lambda$ only ONE boundary condition is needed to be defined, i.e. $u(0) = 0$ or $u(L) = 0$ for $(1)$ or $u_0=0$ or $u_N=0$ for $(2)$.

This, is theory. The operator $\tilde{D}$, in practice, is defined WITH the BC. For example, if the BC considered is $u_0 = 0$ the operator $\tilde{D}$ reads: $$ \tilde{D}=\frac{1}{\Delta x}\begin{bmatrix} 1 & 0 & 0 & \dots\\ -1 & 1 & 0 & \dots\\ \vdots & \vdots & \vdots & \ddots \end{bmatrix} $$ And it would be applied to the vector of unknowns: $\vec{u} = (u_1,...,u_n)^T$.

This reasoning, can be extended to any order and derivative. Try the operator that approximates the second derivative w.r.t. $x$. You will be convinced of the need for two BC's.

As a result, what you propose: applying the forward and backward discretisation on the first and end nodes respectively a proper BC on one of them: must lead to a non-solvable system.

added 97 characters in body
Source Link
HBR
  • 1.7k
  • 9
  • 7

Following the same procedure that for the first problem below, one would have the operator you proposed: $$ \tilde{D}=\frac{1}{2\Delta x}\begin{bmatrix}-2& 1 & 0 & 0 & \dots & 0 & 0 & 0\\ 1 & -2 & 1 & 0 & \ddots& 0 & 0 & 0\\ \vdots & \ddots & \ddots & \ddots & \ddots & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 1 & -2 & 1 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 & -2 & 1\\ 0 & 0 & 0 & 0 & -1 & 4 & -5 & 2\end{bmatrix} \tag{2}$$$$ \tilde{D}=\frac{1}{\Delta x^2}\begin{bmatrix}-2& 1 & 0 & 0 & \dots & 0 & 0 & 0\\ 1 & -2 & 1 & 0 & \ddots& 0 & 0 & 0\\ \vdots & \ddots & \ddots & \ddots & \ddots & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 1 & -2 & 1 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 & -2 & 1\\ 0 & 0 & 0 & 0 & -1 & 4 & -5 & 2\end{bmatrix} \tag{2}$$

Notice that your matrix $\tilde{D}$ is now applied to the vector $\vec{u} = (u_1,...,u_N)^T$. Note that $\tilde{D}$ has the BC imposed on the first but on the last row there is not any Bc as it should be. Note also that the last row: $r_N$ can be obtained with the following operation: $$r_N = 2r_{N-1} -r_{N-2}$$

Therefore $\tilde{D}$ is non invertible and your problem does not have any definite solution.

This was for the first problem

Let us begin defining the following problem (without any BC as you do): $$ D\,u(x) = f(x) \qquad x\in[0,L] \tag{P}$$ where $D$ is the operator derivative: $$D = \frac{\partial }{\partial x} \tag{1}$$

that acts on some continuous function $u(x)$ in order to provide the derivative: $u_x = D\,u(x)$.

The discrete version of $D$, namely $\tilde{D}$ is the matrix: $$ \tilde{D}=\frac{1}{2\Delta x}\begin{bmatrix}-1& 0 & 1 & 0 & \dots\\ 0 & -1 & 0 & 1 & \ddots\\ \vdots & \ddots & \ddots & \ddots & \ddots \end{bmatrix} \tag{2}$$ that acts on the discrete version of the continuous function: $\vec{u}=(u_0,u_1,...,u_N)^{T}$, to provide its discrete derivative: $\vec{u}_x=\tilde{D}\,\vec{u}$

You can see that $\tilde{D}$ is not a square matrix, and the discrete version of $(P)$, i.e. the equation $\tilde{D}\,\vec{u}=\vec{f}$ does not make any sense. This also occurs to $(1)$ where the equation $D\,u=f$ suffers from the same. The problem is that due to the fact that we have more variables than equations, the operator $\tilde{D}$ cannot be inverted and therefore the solution exists up to a constant. It can be shown that if $\vec{u}_0$ a the solution of the problem $(P)$ in its discrete form, any vector $\vec{v}$ such as $\vec{v} =\lambda (1,...,1)^T$ is also a solution. This means that the solution of this problem would be: $$\vec{u} = \vec{u}_0 + \lambda (1,...,1)^T$$ where $\lambda$ is an arbitrary constant. What is more, in the continuous case it is the same!! I mean, this results in cotinuum reads: $$u(x) = u_0(x) + \lambda$$ where $\lambda$ is again an arbitrary constant.

Now guess where do we set the value of $\lambda$ from!!

To set $\lambda$ only ONE boundary condition is needed to be defined, i.e. $u(0) = 0$ or $u(L) = 0$ for $(1)$ or $u_0=0$ or $u_N=0$ for $(2)$.

This, is theory. The operator $\tilde{D}$, in practice, is defined WITH the BC. For example, if the BC considered is $u_0 = 0$ the operator $\tilde{D}$ reads: $$ \tilde{D}=\frac{1}{2\Delta x}\begin{bmatrix}0 & 1 & 0 & \dots\\ -1 & 0 & 1 & \dots\\ \vdots & \vdots & \vdots & \ddots \end{bmatrix} $$ And it would be applied to the vector of unknowns: $\vec{u} = (u_1,...,u_n)^T$.

This reasoning, can be extended to any order and derivative. Try the operator that approximates the second derivative w.r.t. $x$. You will be convinced of the need for two BC's.

As a result, what you propose: applying the forward and backward discretisation on the first and end nodes respectively a proper BC on one of them: must lead to a non-solvable system.

Following the same procedure that for the first problem below, one would have the operator you proposed: $$ \tilde{D}=\frac{1}{2\Delta x}\begin{bmatrix}-2& 1 & 0 & 0 & \dots & 0 & 0 & 0\\ 1 & -2 & 1 & 0 & \ddots& 0 & 0 & 0\\ \vdots & \ddots & \ddots & \ddots & \ddots & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 1 & -2 & 1 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 & -2 & 1\\ 0 & 0 & 0 & 0 & -1 & 4 & -5 & 2\end{bmatrix} \tag{2}$$

Notice that your matrix $\tilde{D}$ is now applied to the vector $\vec{u} = (u_1,...,u_N)^T$. Note that $\tilde{D}$ has the BC imposed on the first but on the last row there is not any Bc as it should be. Note also that the last row: $r_N$ can be obtained with the following operation: $$r_N = 2r_{N-1} -r_{N-2}$$

This was for the first problem

Let us begin defining the following problem (without any BC as you do): $$ D\,u(x) = f(x) \qquad x\in[0,L] \tag{P}$$ where $D$ is the operator derivative: $$D = \frac{\partial }{\partial x} \tag{1}$$

that acts on some continuous function $u(x)$ in order to provide the derivative: $u_x = D\,u(x)$.

The discrete version of $D$, namely $\tilde{D}$ is the matrix: $$ \tilde{D}=\frac{1}{2\Delta x}\begin{bmatrix}-1& 0 & 1 & 0 & \dots\\ 0 & -1 & 0 & 1 & \ddots\\ \vdots & \ddots & \ddots & \ddots & \ddots \end{bmatrix} \tag{2}$$ that acts on the discrete version of the continuous function: $\vec{u}=(u_0,u_1,...,u_N)^{T}$, to provide its discrete derivative: $\vec{u}_x=\tilde{D}\,\vec{u}$

You can see that $\tilde{D}$ is not a square matrix, and the discrete version of $(P)$, i.e. the equation $\tilde{D}\,\vec{u}=\vec{f}$ does not make any sense. This also occurs to $(1)$ where the equation $D\,u=f$ suffers from the same. The problem is that due to the fact that we have more variables than equations, the operator $\tilde{D}$ cannot be inverted and therefore the solution exists up to a constant. It can be shown that if $\vec{u}_0$ a the solution of the problem $(P)$ in its discrete form, any vector $\vec{v}$ such as $\vec{v} =\lambda (1,...,1)^T$ is also a solution. This means that the solution of this problem would be: $$\vec{u} = \vec{u}_0 + \lambda (1,...,1)^T$$ where $\lambda$ is an arbitrary constant. What is more, in the continuous case it is the same!! I mean, this results in cotinuum reads: $$u(x) = u_0(x) + \lambda$$ where $\lambda$ is again an arbitrary constant.

Now guess where do we set the value of $\lambda$ from!!

To set $\lambda$ only ONE boundary condition is needed to be defined, i.e. $u(0) = 0$ or $u(L) = 0$ for $(1)$ or $u_0=0$ or $u_N=0$ for $(2)$.

This, is theory. The operator $\tilde{D}$, in practice, is defined WITH the BC. For example, if the BC considered is $u_0 = 0$ the operator $\tilde{D}$ reads: $$ \tilde{D}=\frac{1}{2\Delta x}\begin{bmatrix}0 & 1 & 0 & \dots\\ -1 & 0 & 1 & \dots\\ \vdots & \vdots & \vdots & \ddots \end{bmatrix} $$ And it would be applied to the vector of unknowns: $\vec{u} = (u_1,...,u_n)^T$.

This reasoning, can be extended to any order and derivative. Try the operator that approximates the second derivative w.r.t. $x$. You will be convinced of the need for two BC's.

As a result, what you propose: applying the forward and backward discretisation on the first and end nodes respectively a proper BC on one of them: must lead to a non-solvable system.

Following the same procedure that for the first problem below, one would have the operator you proposed: $$ \tilde{D}=\frac{1}{\Delta x^2}\begin{bmatrix}-2& 1 & 0 & 0 & \dots & 0 & 0 & 0\\ 1 & -2 & 1 & 0 & \ddots& 0 & 0 & 0\\ \vdots & \ddots & \ddots & \ddots & \ddots & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 1 & -2 & 1 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 & -2 & 1\\ 0 & 0 & 0 & 0 & -1 & 4 & -5 & 2\end{bmatrix} \tag{2}$$

Notice that your matrix $\tilde{D}$ is now applied to the vector $\vec{u} = (u_1,...,u_N)^T$. Note that $\tilde{D}$ has the BC imposed on the first but on the last row there is not any Bc as it should be. Note also that the last row: $r_N$ can be obtained with the following operation: $$r_N = 2r_{N-1} -r_{N-2}$$

Therefore $\tilde{D}$ is non invertible and your problem does not have any definite solution.

This was for the first problem

Let us begin defining the following problem (without any BC as you do): $$ D\,u(x) = f(x) \qquad x\in[0,L] \tag{P}$$ where $D$ is the operator derivative: $$D = \frac{\partial }{\partial x} \tag{1}$$

that acts on some continuous function $u(x)$ in order to provide the derivative: $u_x = D\,u(x)$.

The discrete version of $D$, namely $\tilde{D}$ is the matrix: $$ \tilde{D}=\frac{1}{2\Delta x}\begin{bmatrix}-1& 0 & 1 & 0 & \dots\\ 0 & -1 & 0 & 1 & \ddots\\ \vdots & \ddots & \ddots & \ddots & \ddots \end{bmatrix} \tag{2}$$ that acts on the discrete version of the continuous function: $\vec{u}=(u_0,u_1,...,u_N)^{T}$, to provide its discrete derivative: $\vec{u}_x=\tilde{D}\,\vec{u}$

You can see that $\tilde{D}$ is not a square matrix, and the discrete version of $(P)$, i.e. the equation $\tilde{D}\,\vec{u}=\vec{f}$ does not make any sense. This also occurs to $(1)$ where the equation $D\,u=f$ suffers from the same. The problem is that due to the fact that we have more variables than equations, the operator $\tilde{D}$ cannot be inverted and therefore the solution exists up to a constant. It can be shown that if $\vec{u}_0$ a the solution of the problem $(P)$ in its discrete form, any vector $\vec{v}$ such as $\vec{v} =\lambda (1,...,1)^T$ is also a solution. This means that the solution of this problem would be: $$\vec{u} = \vec{u}_0 + \lambda (1,...,1)^T$$ where $\lambda$ is an arbitrary constant. What is more, in the continuous case it is the same!! I mean, this results in cotinuum reads: $$u(x) = u_0(x) + \lambda$$ where $\lambda$ is again an arbitrary constant.

Now guess where do we set the value of $\lambda$ from!!

To set $\lambda$ only ONE boundary condition is needed to be defined, i.e. $u(0) = 0$ or $u(L) = 0$ for $(1)$ or $u_0=0$ or $u_N=0$ for $(2)$.

This, is theory. The operator $\tilde{D}$, in practice, is defined WITH the BC. For example, if the BC considered is $u_0 = 0$ the operator $\tilde{D}$ reads: $$ \tilde{D}=\frac{1}{2\Delta x}\begin{bmatrix}0 & 1 & 0 & \dots\\ -1 & 0 & 1 & \dots\\ \vdots & \vdots & \vdots & \ddots \end{bmatrix} $$ And it would be applied to the vector of unknowns: $\vec{u} = (u_1,...,u_n)^T$.

This reasoning, can be extended to any order and derivative. Try the operator that approximates the second derivative w.r.t. $x$. You will be convinced of the need for two BC's.

As a result, what you propose: applying the forward and backward discretisation on the first and end nodes respectively a proper BC on one of them: must lead to a non-solvable system.

textbf -> markdown
Source Link
Kirill
  • 11.5k
  • 2
  • 27
  • 51

Following the same procedure that for the first problem below, one would have the operator you proposed: $$ \tilde{D}=\frac{1}{2\Delta x}\begin{bmatrix}-2& 1 & 0 & 0 & \dots & 0 & 0 & 0\\ 1 & -2 & 1 & 0 & \ddots& 0 & 0 & 0\\ \vdots & \ddots & \ddots & \ddots & \ddots & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 1 & -2 & 1 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 & -2 & 1\\ 0 & 0 & 0 & 0 & -1 & 4 & -5 & 2\end{bmatrix} \tag{2}$$

Notice that your matrix $\tilde{D}$ is now applied to the vector $\vec{u} = (u_1,...,u_N)^T$. Note that $\tilde{D}$ has the BC imposed on the first but on the last row there is not any Bc as it should be. Note also that the last row: $r_N$ can be obtained with the following operation: $$r_N = 2r_{N-1} -r_{N-2}$$

$\textbf{This was for the first problem}$This was for the first problem

Let us begin defining the following problem (without any BC as you do): $$ D\,u(x) = f(x) \qquad x\in[0,L] \tag{P}$$ where $D$ is the operator derivative: $$D = \frac{\partial }{\partial x} \tag{1}$$

that acts on some continuous function $u(x)$ in order to provide the derivative: $u_x = D\,u(x)$.

The discrete version of $D$, namely $\tilde{D}$ is the matrix: $$ \tilde{D}=\frac{1}{2\Delta x}\begin{bmatrix}-1& 0 & 1 & 0 & \dots\\ 0 & -1 & 0 & 1 & \ddots\\ \vdots & \ddots & \ddots & \ddots & \ddots \end{bmatrix} \tag{2}$$ that acts on the discrete version of the continuous function: $\vec{u}=(u_0,u_1,...,u_N)^{T}$, to provide its discrete derivative: $\vec{u}_x=\tilde{D}\,\vec{u}$

You can see that $\tilde{D}$ is not a square matrix, and the discrete version of $(P)$, i.e. the equation $\tilde{D}\,\vec{u}=\vec{f}$ does not make any sense. This also occurs to $(1)$ where the equation $D\,u=f$ suffers from the same. The problem is that due to the fact that we have more variables than equations, the operator $\tilde{D}$ cannot be inverted and therefore the solution exists up to a constant. It can be shown that if $\vec{u}_0$ a the solution of the problem $(P)$ in its discrete form, any vector $\vec{v}$ such as $\vec{v} =\lambda (1,...,1)^T$ is also a solution. This means that the solution of this problem would be: $$\vec{u} = \vec{u}_0 + \lambda (1,...,1)^T$$ where $\lambda$ is an arbitrary constant. What is more, in the continuous case it is the same!! I mean, this results in cotinuum reads: $$u(x) = u_0(x) + \lambda$$ where $\lambda$ is again an arbitrary constant.

Now guess where do we set the value of $\lambda$ from!!

To set $\lambda$ only ONE boundary condition is needed to be defined, i.e. $u(0) = 0$ or $u(L) = 0$ for $(1)$ or $u_0=0$ or $u_N=0$ for $(2)$.

This, is theory. The operator $\tilde{D}$, in practice, is defined WITH the BC. For example, if the BC considered is $u_0 = 0$ the operator $\tilde{D}$ reads: $$ \tilde{D}=\frac{1}{2\Delta x}\begin{bmatrix}0 & 1 & 0 & \dots\\ -1 & 0 & 1 & \dots\\ \vdots & \vdots & \vdots & \ddots \end{bmatrix} $$ And it would be applied to the vector of unknowns: $\vec{u} = (u_1,...,u_n)^T$.

This reasoning, can be extended to any order and derivative. Try the operator that approximates the second derivative w.r.t. $x$. You will be convinced of the need for two BC's.

As a result, what you propose: applying the forward and backward discretisation on the first and end nodes respectively a proper BC on one of them: must lead to a non-solvable system.

Following the same procedure that for the first problem below, one would have the operator you proposed: $$ \tilde{D}=\frac{1}{2\Delta x}\begin{bmatrix}-2& 1 & 0 & 0 & \dots & 0 & 0 & 0\\ 1 & -2 & 1 & 0 & \ddots& 0 & 0 & 0\\ \vdots & \ddots & \ddots & \ddots & \ddots & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 1 & -2 & 1 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 & -2 & 1\\ 0 & 0 & 0 & 0 & -1 & 4 & -5 & 2\end{bmatrix} \tag{2}$$

Notice that your matrix $\tilde{D}$ is now applied to the vector $\vec{u} = (u_1,...,u_N)^T$. Note that $\tilde{D}$ has the BC imposed on the first but on the last row there is not any Bc as it should be. Note also that the last row: $r_N$ can be obtained with the following operation: $$r_N = 2r_{N-1} -r_{N-2}$$

$\textbf{This was for the first problem}$

Let us begin defining the following problem (without any BC as you do): $$ D\,u(x) = f(x) \qquad x\in[0,L] \tag{P}$$ where $D$ is the operator derivative: $$D = \frac{\partial }{\partial x} \tag{1}$$

that acts on some continuous function $u(x)$ in order to provide the derivative: $u_x = D\,u(x)$.

The discrete version of $D$, namely $\tilde{D}$ is the matrix: $$ \tilde{D}=\frac{1}{2\Delta x}\begin{bmatrix}-1& 0 & 1 & 0 & \dots\\ 0 & -1 & 0 & 1 & \ddots\\ \vdots & \ddots & \ddots & \ddots & \ddots \end{bmatrix} \tag{2}$$ that acts on the discrete version of the continuous function: $\vec{u}=(u_0,u_1,...,u_N)^{T}$, to provide its discrete derivative: $\vec{u}_x=\tilde{D}\,\vec{u}$

You can see that $\tilde{D}$ is not a square matrix, and the discrete version of $(P)$, i.e. the equation $\tilde{D}\,\vec{u}=\vec{f}$ does not make any sense. This also occurs to $(1)$ where the equation $D\,u=f$ suffers from the same. The problem is that due to the fact that we have more variables than equations, the operator $\tilde{D}$ cannot be inverted and therefore the solution exists up to a constant. It can be shown that if $\vec{u}_0$ a the solution of the problem $(P)$ in its discrete form, any vector $\vec{v}$ such as $\vec{v} =\lambda (1,...,1)^T$ is also a solution. This means that the solution of this problem would be: $$\vec{u} = \vec{u}_0 + \lambda (1,...,1)^T$$ where $\lambda$ is an arbitrary constant. What is more, in the continuous case it is the same!! I mean, this results in cotinuum reads: $$u(x) = u_0(x) + \lambda$$ where $\lambda$ is again an arbitrary constant.

Now guess where do we set the value of $\lambda$ from!!

To set $\lambda$ only ONE boundary condition is needed to be defined, i.e. $u(0) = 0$ or $u(L) = 0$ for $(1)$ or $u_0=0$ or $u_N=0$ for $(2)$.

This, is theory. The operator $\tilde{D}$, in practice, is defined WITH the BC. For example, if the BC considered is $u_0 = 0$ the operator $\tilde{D}$ reads: $$ \tilde{D}=\frac{1}{2\Delta x}\begin{bmatrix}0 & 1 & 0 & \dots\\ -1 & 0 & 1 & \dots\\ \vdots & \vdots & \vdots & \ddots \end{bmatrix} $$ And it would be applied to the vector of unknowns: $\vec{u} = (u_1,...,u_n)^T$.

This reasoning, can be extended to any order and derivative. Try the operator that approximates the second derivative w.r.t. $x$. You will be convinced of the need for two BC's.

As a result, what you propose: applying the forward and backward discretisation on the first and end nodes respectively a proper BC on one of them: must lead to a non-solvable system.

Following the same procedure that for the first problem below, one would have the operator you proposed: $$ \tilde{D}=\frac{1}{2\Delta x}\begin{bmatrix}-2& 1 & 0 & 0 & \dots & 0 & 0 & 0\\ 1 & -2 & 1 & 0 & \ddots& 0 & 0 & 0\\ \vdots & \ddots & \ddots & \ddots & \ddots & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 1 & -2 & 1 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 & -2 & 1\\ 0 & 0 & 0 & 0 & -1 & 4 & -5 & 2\end{bmatrix} \tag{2}$$

Notice that your matrix $\tilde{D}$ is now applied to the vector $\vec{u} = (u_1,...,u_N)^T$. Note that $\tilde{D}$ has the BC imposed on the first but on the last row there is not any Bc as it should be. Note also that the last row: $r_N$ can be obtained with the following operation: $$r_N = 2r_{N-1} -r_{N-2}$$

This was for the first problem

Let us begin defining the following problem (without any BC as you do): $$ D\,u(x) = f(x) \qquad x\in[0,L] \tag{P}$$ where $D$ is the operator derivative: $$D = \frac{\partial }{\partial x} \tag{1}$$

that acts on some continuous function $u(x)$ in order to provide the derivative: $u_x = D\,u(x)$.

The discrete version of $D$, namely $\tilde{D}$ is the matrix: $$ \tilde{D}=\frac{1}{2\Delta x}\begin{bmatrix}-1& 0 & 1 & 0 & \dots\\ 0 & -1 & 0 & 1 & \ddots\\ \vdots & \ddots & \ddots & \ddots & \ddots \end{bmatrix} \tag{2}$$ that acts on the discrete version of the continuous function: $\vec{u}=(u_0,u_1,...,u_N)^{T}$, to provide its discrete derivative: $\vec{u}_x=\tilde{D}\,\vec{u}$

You can see that $\tilde{D}$ is not a square matrix, and the discrete version of $(P)$, i.e. the equation $\tilde{D}\,\vec{u}=\vec{f}$ does not make any sense. This also occurs to $(1)$ where the equation $D\,u=f$ suffers from the same. The problem is that due to the fact that we have more variables than equations, the operator $\tilde{D}$ cannot be inverted and therefore the solution exists up to a constant. It can be shown that if $\vec{u}_0$ a the solution of the problem $(P)$ in its discrete form, any vector $\vec{v}$ such as $\vec{v} =\lambda (1,...,1)^T$ is also a solution. This means that the solution of this problem would be: $$\vec{u} = \vec{u}_0 + \lambda (1,...,1)^T$$ where $\lambda$ is an arbitrary constant. What is more, in the continuous case it is the same!! I mean, this results in cotinuum reads: $$u(x) = u_0(x) + \lambda$$ where $\lambda$ is again an arbitrary constant.

Now guess where do we set the value of $\lambda$ from!!

To set $\lambda$ only ONE boundary condition is needed to be defined, i.e. $u(0) = 0$ or $u(L) = 0$ for $(1)$ or $u_0=0$ or $u_N=0$ for $(2)$.

This, is theory. The operator $\tilde{D}$, in practice, is defined WITH the BC. For example, if the BC considered is $u_0 = 0$ the operator $\tilde{D}$ reads: $$ \tilde{D}=\frac{1}{2\Delta x}\begin{bmatrix}0 & 1 & 0 & \dots\\ -1 & 0 & 1 & \dots\\ \vdots & \vdots & \vdots & \ddots \end{bmatrix} $$ And it would be applied to the vector of unknowns: $\vec{u} = (u_1,...,u_n)^T$.

This reasoning, can be extended to any order and derivative. Try the operator that approximates the second derivative w.r.t. $x$. You will be convinced of the need for two BC's.

As a result, what you propose: applying the forward and backward discretisation on the first and end nodes respectively a proper BC on one of them: must lead to a non-solvable system.

added 774 characters in body
Source Link
HBR
  • 1.7k
  • 9
  • 7
Loading
edited body
Source Link
HBR
  • 1.7k
  • 9
  • 7
Loading
added 57 characters in body
Source Link
HBR
  • 1.7k
  • 9
  • 7
Loading
added 1 character in body
Source Link
HBR
  • 1.7k
  • 9
  • 7
Loading
added 1 character in body
Source Link
HBR
  • 1.7k
  • 9
  • 7
Loading
Source Link
HBR
  • 1.7k
  • 9
  • 7
Loading