Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Manipulation of data (I need to find an average dimple diameter from a data set of x and y)

Please login with a confirmed email address before reporting spam

I need to find the average dimple diameter for a number of dimples on a stright surface, The picture attached shows the exactly what I mean.

I have the x and y values i tried to manipulate it in matlab but I just need some ideas. I want to program it in a scrip to make the process easier.



1 Reply Last Post 20 juil. 2020, 05:50 UTC−4

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 20 juil. 2020, 05:50 UTC−4
Updated: 4 years ago 20 juil. 2020, 05:50 UTC−4

You need to sit down and think about a definition for the diameter that makes sense to your problem. For instance you could use the full-width at half-maximum (FWHM).

Once you have the right definition, finding a procedure is straightforward.

For instance if you use FWHM, the procedure might be

  1. Find all local maximas such that and
  2. For each maximum , search on the left for the first value such that . Likewise search on the right the first value such that . If you already know a bisect search for and for instance would be efficient
  3. FWHM is then simply

Another definition could be using an arbitrary treshold that defines the limit between interior and exterior of a dimple.

Again, once you have clarified for yourself what you mean exactly by "diameter", translating that definition into code is not hard.

You need to sit down and think about a definition for the diameter that makes sense to your problem. For instance you could use the full-width at half-maximum (FWHM). Once you have the right definition, finding a procedure is straightforward. For instance if you use FWHM, the procedure might be 1. Find all local maximas (x_i, y_i) such that y(x_i) = y_i and \partial_x y |_{x=x_i} = 0 2. For each maximum x_i, search on the left for the first value x_{i,left} \leq x_i such that y(x_{i,left}) = y_i / 2. Likewise search on the right the first value x_{i, right} > x_i such that y(x_{i,right}) =y_i / 2. If you already know x_{i-1}, x_{i}, x_{i+1} a bisect search for x_{i,left} and x_{i, right} for instance would be efficient 3. FWHM is then simply |x_{i,right} - x_{i, left}| Another definition could be using an arbitrary treshold that defines the limit between interior and exterior of a dimple. Again, once you have clarified for yourself what you mean exactly by "diameter", translating that definition into code is not hard.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.