Finding the index number on a stretched cartesian grid

  • Context: Undergrad 
  • Thread starter Thread starter jonasboy
  • Start date Start date
  • Tags Tags
    Cartesian Grid Index
Click For Summary
SUMMARY

The discussion focuses on determining the index of points on a stretched Cartesian grid, where the spacing (dx) is not constant. The formula for a uniform grid index is given as i = floor(x/dx). However, for a non-uniform grid defined by a function f(i), the index can be derived using the inverse function, specifically as floor(f-1(x)). This analytical approach allows for accurate index calculation even when the grid is stretched.

PREREQUISITES
  • Understanding of Cartesian grids and indexing
  • Familiarity with mathematical functions and their inverses
  • Knowledge of the floor function in mathematics
  • Basic concepts of discrete mathematics
NEXT STEPS
  • Study the properties of non-linear functions and their inverses
  • Learn about the floor function and its applications in indexing
  • Explore numerical methods for approximating inverse functions
  • Investigate the implications of grid stretching on computational geometry
USEFUL FOR

Mathematicians, computer scientists, and anyone involved in computational geometry or numerical analysis who needs to work with non-uniform grids and indexing methods.

jonasboy
Messages
1
Reaction score
0
Imagine I have a set of discrete points equally spaced out and indexed from 1 to n (a 1D grid). On a cartesian grid if the spacing, dx, is constant the index can be obtained simply by:

i = floor(x/dx)

That was pretty simple, now if the cartesian grid is stretched (i.e. dx is not constant), it is not clear to me how to go about finding the index analytically. I am guessing that since we know the grid analytically we should be able to find the index analytically regardless if the grid is stretched or not. Any thoughts?

Thanks in advance.
 
Mathematics news on Phys.org
Not entirely certain of the question but...
Suppose the grid points are given by xi = f(i), some suitably nice function f. Wouldn't the grid point next below x be floor(f-1(x))?
 

Similar threads

  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
Replies
9
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 50 ·
2
Replies
50
Views
7K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K