RHS of Laplace's Equation is f(u(x,y))

In summary, the conversation discusses the process of computationally solving a linear elliptic problem using discretization and a linear system of equations. The relevant equation for each point is given, and it results in a system of equations with a sparse matrix and a boundary condition vector. The system is then solved using a linear solver, and the result can be plotted as a surface. The conversation also addresses some questions about dealing with the right hand side of the system, which may not necessarily be 0, and clarifies that the difference-equation only holds for points not along an edge.
  • #1
beth92
16
0

Homework Statement



I need to (computationally) solve the following linear elliptic problem for the function u(x,y):

[itex] \Delta u(x,y) = u_{x,x} + u_{y,y} = k u(x,y) [/itex]

on the domain

[itex] \Omega = [0,1]\times[0,1] [/itex] with u(x,y) = 1 at all points on the boundary.

Homework Equations


[/B]
I know that I have to use discretization to solve the problem by considering u(x,y) as an n x n grid of points separated by distance h (and mapping them to a one dimensional array of points to make a vector U of n2 components). Then the relevant equation for each point Ui is:

(1) [itex] u_{x,x} + u_{y,y} = \frac{U_{i-1} + U_{i+1} +U_{i+n} + U_{i-n} - 4 U_{i}}{h^{2}} = k U_{i} [/itex]

This is known to be true for this problem (see the link http://en.wikipedia.org/wiki/Discrete_Laplace_operator#Finite_Differences for the explanation)

and it results in a linear system of equations as follows:

(2) [itex] A U = kU + B [/itex]

Where A is a sparse matrix which has five diagonals (1,1,-4,1,1) at the offsets ( -(n+1),-1,0,1,(n+1) ). Then B is another vector (of dimension n2) containing the boundary condition values - any point on the edge of the grid will contain a +1 term in equation (1) instead of the value of the point beside it (since U = 1 for all boundary points).

The system (2) should be solved by a linear solver (eg. conjugate gradient method or something similar) computationally. The result can be plotted as a surface and I believe all u(x,y) values should be between 0 and 1. (i.e. the surface should 'dip' down at all points within the boundaries.)

The Attempt at a Solution


[/B]
I understand the general theory behind writing the problem as a linear system of equations and that it should be solve-able as such. However when writing a program to solve this I'm unsure how to deal with

(a) The fact that the RHS of the linear system now depends on the solution U

(b) The boundary condition vector B

I'm used to solving linear systems of the form [itex]Ax=b[/itex] where the right hand side is a constant, known vector. So my question is, how do I make the system (2) look like this? I will input a LHS and RHS but should all values of U be on the left, and which side does the vector B go on? Am I right in thinking that the RHS of the system must be constantly updated?

Any comments are appreciated, and I'm happy to clarify any other info about the problem. Thank you
 
Physics news on Phys.org
  • #2
beth92 said:

Homework Statement



I need to (computationally) solve the following linear elliptic problem for the function u(x,y):

[itex] \Delta u(x,y) = u_{x,x} + u_{y,y} = k u(x,y) [/itex]

on the domain

[itex] \Omega = [0,1]\times[0,1] [/itex] with u(x,y) = 1 at all points on the boundary.

Homework Equations


[/B]
I know that I have to use discretization to solve the problem by considering u(x,y) as an n x n grid of points separated by distance h (and mapping them to a one dimensional array of points to make a vector U of n2 components). Then the relevant equation for each point Ui is:

(1) [itex] u_{x,x} + u_{y,y} = \frac{U_{i-1} + U_{i+1} +U_{i+n} + U_{i-n} - 4 U_{i}}{h^{2}} = k U_{i} [/itex]

This is known to be true for this problem (see the link http://en.wikipedia.org/wiki/Discrete_Laplace_operator#Finite_Differences for the explanation)

and it results in a linear system of equations as follows:

(2) [itex] A U = kU + B [/itex]

Where A is a sparse matrix which has five diagonals (1,1,-4,1,1) at the offsets ( -(n+1),-1,0,1,(n+1) ). Then B is another vector (of dimension n2) containing the boundary condition values - any point on the edge of the grid will contain a +1 term in equation (1) instead of the value of the point beside it (since U = 1 for all boundary points).

The system (2) should be solved by a linear solver (eg. conjugate gradient method or something similar) computationally. The result can be plotted as a surface and I believe all u(x,y) values should be between 0 and 1. (i.e. the surface should 'dip' down at all points within the boundaries.)

The Attempt at a Solution


[/B]
I understand the general theory behind writing the problem as a linear system of equations and that it should be solve-able as such. However when writing a program to solve this I'm unsure how to deal with

(a) The fact that the RHS of the linear system now depends on the solution U

(b) The boundary condition vector B

I'm used to solving linear systems of the form [itex]Ax=b[/itex] where the right hand side is a constant, known vector. So my question is, how do I make the system (2) look like this? I will input a LHS and RHS but should all values of U be on the left, and which side does the vector B go on? Am I right in thinking that the RHS of the system must be constantly updated?

Any comments are appreciated, and I'm happy to clarify any other info about the problem. Thank you

Your linear equations are of the form
[tex] \frac{1}{h^2} (U_{i-1} + U_{i+1} +U_{i+n} + U_{i-n} - 4 U_{i}) = k U_i \\
\;\;\;\;\;\;\text{or}\\
\frac{1}{h^2}(U_{i-1} + U_{i+1} +U_{i+n} + U_{i-n}) - \left(\frac{4}{h^2} + k \right) U_i = 0 \\
\;\;\;\;\;\; \text{or}\\
U_{i-1} + U_{i+1} +U_{i+n} + U_{i-n} - (4 + k h^2) U_i = 0
[/tex]
 
  • #3
That makes sense - would it be correct then to say that: rather than necessarily having 0 on the right hand side for the above equation, I have [itex]B_{i}[/itex] where [itex]B_{i}[/itex] is:

-2 for the four points on the corner of the grid
-1 for points along the edge
0 for all other points

Thanks for the quick reply
 
  • #4
beth92 said:
That makes sense - would it be correct then to say that: rather than necessarily having 0 on the right hand side for the above equation, I have [itex]B_{i}[/itex] where [itex]B_{i}[/itex] is:

-2 for the four points on the corner of the grid
-1 for points along the edge
0 for all other points

Thanks for the quick reply

It is important to note that the difference-equation holds only for points not along an edge (because the pde holds in the interior of ##\Omega##). So, in your 1-dimensional representation of the 2-dimensional region, let ##S = \{1,2, \ldots N \}## be the set of all possible ##i## values and ##E \subset S## be the points on an "edge". Then we ought to have
[tex] U_{i-1} + U_{i+1} +U_{i+n} + U_{i-n} - (4 + k h^2) U_i = 0, i \not \in E, \\
U_i = 1, i \in E . [/tex]
Of course, when ##i \not \in E##, some of the ##U_{i \pm 1}## or ##U_{i \pm n}## could be in ##E##, so you would substitute ##1## for them in that case. Basically, you have ##N - |E|## equations in ##N - |E|## unknowns (where ##|E|## denotes the cardinality of the set ##E##).
 

What is the RHS of Laplace's Equation?

The right-hand side (RHS) of Laplace's Equation is a function of the dependent variable u(x,y). It represents the sources or sinks of the potential function u(x,y) at any point in the domain.

What does it mean for the RHS to be a function of u(x,y)?

This means that the value of the RHS at any point is dependent on the value of the potential function u(x,y) at that point. In other words, the RHS is affected by the values of u(x,y) and can change as u(x,y) changes.

How does the RHS affect the solution of Laplace's Equation?

The RHS plays a crucial role in determining the solution of Laplace's Equation. It acts as a driving force, influencing the behavior of the potential function u(x,y) and ultimately determining the shape and characteristics of the solution.

Can the RHS of Laplace's Equation be a constant?

Yes, the RHS can be a constant, meaning that it does not change with respect to u(x,y). In this case, the solution of Laplace's Equation will also be a constant function. However, in most cases, the RHS is a function of u(x,y) and can vary across the domain.

What is the significance of the RHS in the physical interpretation of Laplace's Equation?

The RHS represents the sources or sinks of the potential function u(x,y) in a physical system. For example, in electrostatics, the RHS could represent the charge distribution in a region. Therefore, the RHS provides important information about the physical behavior of the system and helps in understanding the solution of Laplace's Equation.

Similar threads

  • Calculus and Beyond Homework Help
Replies
21
Views
836
  • Calculus and Beyond Homework Help
Replies
1
Views
640
  • Calculus and Beyond Homework Help
Replies
2
Views
2K
  • Calculus and Beyond Homework Help
Replies
6
Views
385
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
568
  • Calculus and Beyond Homework Help
Replies
2
Views
967
  • Calculus and Beyond Homework Help
Replies
1
Views
703
  • Calculus and Beyond Homework Help
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
11
Views
1K
Back
Top