# Algorithm for homogenization of non-equidistant 1-D grid

5 views (last 30 days)
Michal on 1 Dec 2021
Edited: Michal on 1 Dec 2021
I am looking for proper algorithm for so called "delta-homogenization" of 1-D non-equidistant grid.
Definition: The sorted monotonically changing vector x is delta-homogeneous if for specified , the differences ratio satisfy to the condition: , for , where Problem: In a case of non delta-homogeneous vector x, how to find minimum number of additional points , to be vector delta-homogeneous?
The problem is motivaded by proper design of non-equidistant grids, which are able to guarantee numerical stability of PDEs solution.
Example:
> x = (1:4).*(1:4)
1 4 9 16
>d = 1.5;
ratioviolationIdx =
1×2 logical array
0 1
ratios =
1.6667 1.4000
deltalimits =
0.6667 1.5000
So, x is not delta-homogeneous for delta = 1.5. But , the x is delta-homogeneous for delta = 2
>> [~,ratioviolationIdx,ratios,deltalimits] = isdeltahomog([x],2)
ratioviolationIdx =
1×2 logical array
1 1
ratios =
1.6667 1.4000
deltalimits =
0.5000 2.0000
An finaly, when I add several points to the vector x for delta = 1.5, I have delta-homogeneous vector
>> [~,ratioviolationIdx,ratios,deltalimits] = isdeltahomog([x 2.5 6 12],1.5)
ratioviolationIdx =
1×5 logical array
1 1 1 1 1
ratios =
1.0000 1.3333 1.5000 1.0000 1.3333
deltalimits =
0.6667 1.5000
See attached code...
Thanks in advance for any help.

### Categories

Find more on Mathematics and Optimization in Help Center and File Exchange

R2021b

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!