Implementing Numerical Integration

In summary, the conversation discusses using a numerical method to solve a partial differential equation for u(x,t). The method involves finding the solution at specific values of x and t, and using a recurrence relation to calculate subsequent values. Boundary conditions are also mentioned, and it is suggested that using these conditions will result in a set of simultaneous equations that can be solved through programming.
  • #1
Tangent87
148
0
Say we have some partial differential equation for u(x,t) and we devise a numerical method to solve it. For example if we say unm is the solution at x=hm and t=kn with m=0,...,M and n=0,...,N where h and k are the step-lengths, and then our method is something like:

[tex]u_m^{n+1}=u_m^{n-1}+2u_{m+1}^n-u_m^n-3u_{m-1}^n+k(u_{m+2}^n-u_{m-2}^n)[/tex]

and we're given u(x,0) and u(x,k) so we can work out u0m and u1m for all m. We then stick n=1 into the recurrence in a bid to work out u2m for all m. But what happens if we stick m=0 or 1 now into the recurrence do we just let u1m-2 and u1m+2 be equal to 0 or is the recurrence just not defined for m=0 or 1? In which case how do we find u20 say?
 
Physics news on Phys.org
  • #2
Ok I've figured out that if we use boundary conditions such as u(0,t)=u(1,t) for all t then *I think* the recurrence relation will set us up with a set of simultaneous equations, however I have no idea how we can program to solve this?
 

What is numerical integration?

Numerical integration is a mathematical method for approximating the value of a definite integral, which represents the area under a curve. It involves dividing a continuous function into smaller segments and calculating the areas of those segments to estimate the total area.

Why do we use numerical integration?

Numerical integration is used when it is not possible or practical to find the exact analytical solution to a definite integral. It is also useful when dealing with complex or high-dimensional functions that cannot be integrated by hand.

What are the different types of numerical integration?

The most commonly used types of numerical integration are the rectangular method, trapezoidal method, Simpson's rule, and Gaussian quadrature. Each method has its own strengths and limitations, and the choice of method depends on the specific problem at hand.

What are the potential sources of error in numerical integration?

The main sources of error in numerical integration are the step size (or interval width) used to divide the function, the choice of numerical method, and rounding errors in calculations. These errors can be minimized by using smaller step sizes and more accurate methods.

How can numerical integration be implemented in practice?

Numerical integration can be implemented using computer programs or mathematical software. The basic steps involve defining the function to be integrated, choosing a suitable method and step size, and then computing the approximation of the integral. The accuracy of the result can be improved by adjusting the step size and using more precise methods.

Similar threads

  • Calculus and Beyond Homework Help
Replies
3
Views
276
  • Calculus and Beyond Homework Help
Replies
3
Views
583
  • Calculus and Beyond Homework Help
Replies
9
Views
915
  • Calculus and Beyond Homework Help
Replies
21
Views
839
  • Calculus and Beyond Homework Help
Replies
10
Views
444
  • Calculus and Beyond Homework Help
Replies
8
Views
948
  • Calculus and Beyond Homework Help
Replies
17
Views
1K
  • Calculus and Beyond Homework Help
Replies
8
Views
665
  • Calculus and Beyond Homework Help
Replies
14
Views
246
  • Calculus and Beyond Homework Help
Replies
1
Views
287
Back
Top