Numerical methods for differential equations

Click For Summary

Discussion Overview

The discussion revolves around numerical techniques for solving differential equations with periodic boundary conditions. Participants explore various methods, including spectral methods and finite difference methods, while addressing specific scenarios and challenges related to these techniques.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant inquires about numerical techniques for differential equations with periodic boundary conditions, mentioning familiarity with methods for other boundary conditions.
  • Another participant suggests using a spectral method for solving such equations.
  • A participant clarifies their specific differential equation and expresses concerns about applying Fourier series due to the nature of the coefficients involved.
  • It is proposed that spectral methods can be effective if the coefficients can be expressed as Fourier series or transforms.
  • A request for an example is made, specifically regarding a first-order equation involving the Heaviside step function with periodic boundary conditions.
  • A participant explains the finite difference method, detailing how to apply periodic boundary conditions and construct algebraic equations from the differential equations.
  • There is a reiteration of the finite difference method's approach to formulating an algebraic problem that can be solved numerically.
  • One participant expresses intent to explore both the spectral method and finite difference method for their original problem.

Areas of Agreement / Disagreement

Participants express differing views on the applicability of spectral methods based on the nature of the coefficients in the differential equations. While some suggest spectral methods are suitable, others highlight limitations in specific scenarios. The discussion remains unresolved regarding the best approach for the participant's specific problem.

Contextual Notes

Participants note that the effectiveness of numerical methods may depend on the specific forms of the differential equations and the coefficients involved. There are unresolved aspects regarding the application of Fourier series in certain cases.

SarthakC
Messages
10
Reaction score
0
Hi,
Are there any numerical techniques I can use to solve differential equations with periodic boundary conditions? I know of several techniques for other kinds of boundary conditions (such as Runge-Kutta method, Euler method etc.), but I am interested in knowing how to numerially solve differential equations with periodic boundary conditions..

Any help would be appreciated!
 
Physics news on Phys.org
Umm... Maybe I should make my specific scenario a little clearer. My differential equation is of the form $$f(x) \partial_x^2 y + g(x) \partial_x y + h(x) y =0$$

In this scenario, replacing ##y## with a Fourier series in ##x## is not really useful, because the functions ##f, g## and ##h## do not let me compare coefficients anymore, because in order to do that I would have to multiply by some element of the orthogonal Fourier basis, but these functions will not let me extract the information as I want. For example if i just had ##\partial_x y + \delta(x) y=0##, then replacing with ##y## with ##\sum_n c_n e^{inx}## would give me $$\sum_n c_n (i n + \delta(x)) e^{inx}=0$$
The only procedure I'm aware of would proceed from here by mulitplying by ##e^{-imx}## and integrating, but that would give me ##c_m (i m) + \sum_n c_n = 0##. This may not be the best example, but in general I would not get equations from where I could calculate the coefficients directly, right?Wouldn't a spectral method work nicely only when I had a simpler equation with constant coefficients or something?
 
The spectral method works as long as you can write the coefficients themselves as Fourier series or Fourier Transforms.
 
Could someone give me an example? For example let's just take a simple first order equation of $$y^\prime + \Theta(x) y = 0$$ where ##\Theta(x)## is the Heaviside step function, with a domain from ##(-\pi,\pi)##, with peridic boundary equations. Could anyone just show me a few steps from where I can proceed?
 
Actually, for most numerical methods, applying periodic boundary conditions is pretty straight forward.

Are you familiar with finite difference?

In finite difference we break the domain into a finite number of points:
x_0, x_1, \dots, x_i, \dots, x_N

Then we approximate the differential to create an algebraic equation for the interior points x_1 \dots x_{N-1}. For second order equations this equations is often of the form a x_{i-1} + bx_i + cx_{i+1} = f(x_i)

Then we have to apply the correct boundary conditions to the points at the edge of the domain x_0, x_N

For Dirichlet B.C we might set x_0 =0 and x_N =5

For periodic boundary conditions we can use the interior equation for x_0. Noting that x_{-1} = x_{N-1} gives the equations a x_{N-1} + bx_0 + cx_{1} = f(x_0).

For the end point we can use x_N =x_0. We often don't solve this last equations. Instead we enforce this equality in our the algebraic system of equations by replacing all x_N with x_0 just like we replaced x_{-1} with x_{N-1}. This reduces the error due to finite precision math and slightly reduces the computation time.
 
Hmm. So the idea is I use the finite difference method and the boundary conditions to give me an algebraic problem which I then solve numerically to get all the ##x_i##s?
 
SarthakC said:
Hmm. So the idea is I use the finite difference method and the boundary conditions to give me an algebraic problem which I then solve numerically to get all the ##x_i##s?

That's the general idea.

There are a few simple examples in the second half of this lecture:
http://www.mathematik.uni-dortmund.de/~kuzmin/cfdintro/lecture4.pdf
 
Thanks!
I'll give both the spectral method and the finite difference method a shot and try to solve my original problem. I'll get back to you guys if I have any more clarifications!

Thanks!
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 1 ·
Replies
1
Views
865
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K