Solve the Laplace equation in 2D

In summary: You just need to make sure you do the integration correctly.In summary, the problem at hand is to solve the Laplace equation in 2D by the method of separation of variables. The solution involves formulating the problem in terms of Fourier coefficients and solving ODEs to find the potential in a long, square, hollow tube with different potential on its four walls. The solution can be written as a sum of sine functions multiplied by hyperbolic trigonometric functions. In order to numerically calculate the solution, the problem can be made dimensionless by introducing new variables and integrating using the new variables.
  • #1
Selveste
7
0

Homework Statement



Solve the Laplace equation in 2D by the method of separation of variables. The problem is to determine the potential in a long, square, hollow tube, where four walls have different potential. The boundary conditions are as follows:

[tex]V(x=0, y) = 0[/tex]
[tex]V(x=L, y) = 0[/tex]
[tex]V(x, y=0) = 0[/tex]
[tex]V(x, y=L) = V_0(x)[/tex]

Formulate a solution in terms of the Fourier coefficients, in a way suitable for numerical calculation. Write a computer program that takes any function [itex]V_0(x) [/itex] and calculates [itex] V(x,y)[/itex] inside the square tube.

Homework Equations



[tex] \nabla^2 V = 0 [/tex]

The Attempt at a Solution



[tex]\frac{\partial^2V}{\partial x^2} + \frac{\partial^2V}{\partial y^2} = 0[/tex]
Separation of variables
[tex]V(x, y) = A(x)B(y)[/tex]
Laplace becomes
[tex]\frac{1}{A(x)}\frac{\partial^2A(x)}{\partial x^2}+\frac{1}{B(y)}\frac{\partial^2B(y)}{\partial y^2}=0[/tex]
which gives
[tex]\frac{\partial^2A(x)}{\partial x^2}= k^2A(x); \frac{\partial^2B(y)}{\partial y^2}= -k^2B(y) [/tex]
solving the ODE's gives
[tex]A(x)=A\sin{kx}+B\cos{kx}[/tex]
[tex]B(y)=Ce^{ky}+De^{-ky}[/tex]
[tex]V(x,y) = [A\sin{kx}+B\cos{kx}][Ce^{ky}+De^{-ky}][/tex]
Boundary conditions
[itex]V=0 [/itex] when [itex] x=0 \implies B=0.[/itex]
[itex]V=0 [/itex] when [itex] x=L \implies k=n\pi/L : n\in\mathbb{R}[/itex]
[itex]V=0 [/itex] when [itex] y=0 \implies C=-D.[/itex]
which gives
[tex]V(x,y) = A\sin{(\frac{n\pi x}{L})}[e^{\frac{n\pi y}{L}}-e^{-\frac{n\pi y}{L}}][/tex]
Here I think the term with the exponentials look a little fishy, but can't see a mistake so I move on. Laplace equation is linear, so we have
[tex]V(x,y) = \sum_{n=1}^{\infty}C_n\sin{(\frac{n\pi x}{L})}[e^{\frac{n\pi y}{L}}-e^{-\frac{n\pi y}{L}}][/tex]
[tex]V(x,L) = \sum_{n=1}^{\infty}C_n\sin{(\frac{n\pi x}{L})} = V_0(x)[/tex]
To find the Fourier coefficients we multiply both sides by [itex]\sin{(n'\pi x/L)}[/itex] and integrate from [itex]0[/itex] to [itex]L[/itex]:
[tex]\sum_{n=1}^{\infty}C_n \int_0^L \sin{(\frac{n'\pi x}{L})}\sin{(\frac{n\pi x}{L})}dx = \int_0^LV_0(x)\sin{(\frac{n'\pi x}{L})}dx[/tex]
Solution to the integral on the left side is
[itex] 0[/itex], if [itex]n \ne n' [/itex]
[itex] L/2[/itex], if [itex]n = n' [/itex]
so the left side reduces to [itex](L/2)C_{n'}[/itex], which implies
[tex]C_n = \frac{2}{L}\int_0^LV_0(x)\sin{(\frac{n\pi x}{L})}dx[/tex]
So the solution to the problem is
[tex]V(x,y) = \sum_{n=1}^{\infty}C_n\sin{(\frac{n\pi x}{L})}[e^{\frac{n\pi y}{L}}-e^{-\frac{n\pi y}{L}}][/tex]
with [itex]C_n[/itex] as above. Correct?

I now want to write a python program that takes any function [itex] V_0(x)[/itex] and calculates [itex] V[/itex] inside the square tube. I first make it dimensionless by introducing [itex]\xi =x/L[/itex] and [itex]\gamma= y/L [/itex] as variables instead of [itex]x, y[/itex].
[tex]V(\xi,\gamma) = \sum_{n=1}^{\infty}C_n\sin{(n\pi \xi)}[e^{n\pi \gamma}-e^{-n\pi \gamma}][/tex]
[tex]C_n = \frac{2}{L}\int_0^1V_0(\xi)\sin{(n\pi \xi)}d\xi[/tex]
Is this correct? Otherwise, where did it all go wrong? And what should I do with the [itex] 2/L [/itex] term in [itex] C_n [/itex]? Maybe I ought to have introduced the new variables at the very beginning? Thanks.
 
Physics news on Phys.org
  • #2
You're definitely on the right track.

Selveste said:
[tex]V(x,y) = A\sin{(\frac{n\pi x}{L})}[e^{\frac{n\pi y}{L}}-e^{-\frac{n\pi y}{L}}][/tex]
Here I think the term with the exponentials look a little fishy, but can't see a mistake so I move on.
This looks correct. You might consider replacing the two exponentials by one hyperbolic trig function.
Laplace equation is linear, so we have
[tex]V(x,y) = \sum_{n=1}^{\infty}C_n\sin{(\frac{n\pi x}{L})}[e^{\frac{n\pi y}{L}}-e^{-\frac{n\pi y}{L}}][/tex]
[tex]V(x,L) = \sum_{n=1}^{\infty}C_n\sin{(\frac{n\pi x}{L})} = V_0(x)[/tex]
In going from the first to the second equation, what happened to the contributions from the exponential functions evaluated at y = L? If you absorbed them into the expansion coefficients, then you need to make sure that you realize that the ##C_n## in the first equation are not the same as the ##C_n## in the second equation.
[tex]C_n = \frac{2}{L}\int_0^LV_0(x)\sin{(\frac{n\pi x}{L})}dx[/tex]

introducing [itex]\xi =x/L[/itex] and [itex]\gamma= y/L [/itex] as variables instead of [itex]x, y[/itex]
[tex]C_n = \frac{2}{L}\int_0^1V_0(\xi)\sin{(n\pi \xi)}d\xi[/tex]
The change of variables was not done correctly here. I'm not sure there is much of an advantage in introducing the new variables, but it is certainly OK to do so.
 
Last edited:
  • Like
Likes Selveste

1. What is the Laplace equation in 2D and why is it important?

The Laplace equation in 2D is a partial differential equation used to describe the distribution of a potential field in a two-dimensional space. It is important because it has many applications in physics, engineering, and other scientific fields, such as heat transfer, fluid mechanics, and electromagnetism.

2. How is the Laplace equation solved in 2D?

The Laplace equation in 2D can be solved using various mathematical methods, such as separation of variables, the method of images, and the method of conformal mapping. These methods involve manipulating the equation to obtain a solution that satisfies the boundary conditions of the problem.

3. What are the boundary conditions for solving the Laplace equation in 2D?

The boundary conditions for solving the Laplace equation in 2D depend on the specific problem being solved. However, they typically involve specifying the values or derivatives of the potential field at the boundaries of the domain.

4. Can the Laplace equation be solved in any shape of domain?

Yes, the Laplace equation can be solved in any shape of domain as long as the boundary conditions are specified and the problem is well-posed. However, the complexity of the solution may vary depending on the shape of the domain.

5. What are some real-world applications of solving the Laplace equation in 2D?

The Laplace equation in 2D has many practical applications, such as predicting the temperature distribution in a metal plate, calculating the electric potential in a circuit, and determining the velocity field in a fluid flow. It is also used in image processing and computer vision for image inpainting and denoising.

Similar threads

Replies
1
Views
604
  • Advanced Physics Homework Help
Replies
15
Views
2K
  • Advanced Physics Homework Help
Replies
6
Views
361
Replies
1
Views
694
Replies
1
Views
802
Replies
12
Views
1K
  • Advanced Physics Homework Help
Replies
3
Views
2K
  • Advanced Physics Homework Help
Replies
4
Views
941
  • Advanced Physics Homework Help
Replies
0
Views
657
  • Advanced Physics Homework Help
Replies
13
Views
2K
Back
Top