Finite difference terms for boundaries

Click For Summary
SUMMARY

The discussion focuses on deriving finite difference terms for boundary conditions in numerical methods, specifically for first and second derivatives. The user presents the first derivative boundary term as \(\frac{dy}{dx}_{0}=\frac{4y_{1}-y_{2}}{3}\) when \(i=1\). The conversation also seeks additional boundary formulae for second-order derivatives. The context is a MATLAB implementation aimed at optimizing performance while calculating these derivatives.

PREREQUISITES
  • Understanding of finite difference methods
  • Familiarity with numerical differentiation
  • Basic knowledge of MATLAB programming
  • Concept of boundary conditions in numerical analysis
NEXT STEPS
  • Research finite difference boundary conditions in numerical analysis
  • Explore MATLAB's built-in functions for numerical differentiation
  • Learn about optimizing MATLAB code for performance
  • Investigate higher-order finite difference methods
USEFUL FOR

Numerical analysts, MATLAB programmers, and anyone involved in computational mathematics or engineering who needs to implement efficient numerical differentiation techniques.

hunt_mat
Homework Helper
Messages
1,816
Reaction score
33
Hi,

We all know that the finite difference formulae for the derivatives are given by:
[tex] \frac{dy}{dx}_{i}=\frac{y_{i}-y_{i-1}}{\delta x}[/tex]
and
[tex] \frac{d^{2}y}{dx^{2}}=\frac{y_{i-1}-2y_{i}+y_{i+1}}{\delta x^{2}}[/tex]
What would be the formulae for the boundary terms? when i=1? I think I can show that:
[tex] \frac{dy}{dx}_{0}=\frac{4y_{1}-y_{2}}{3}[/tex]
Are there any other formulae? What about the second order derivative?

This is for a numerical code in matlab, I can use inbuilt functions but I want my code to run as fast as possible.

Mat
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 31 ·
2
Replies
31
Views
7K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K