Stochastic Modeling in R

Fig. 1: 2D random set distributions resembling microstructures

This ensemble study explores stochastic modeling techniques in the context of materials science, using R and RStudio for implementation. ## Overview

This programming project explores applications of stochastic geometry techniques to model and analyse features resembling microstructures of materials. The emphasis lies on implementation in R and best practices of developing such models using RStudio. This work involves image-based analysis, probabilistic modeling, and statistical simulation to investigate the geometric and topological properties of random material structures. This ensemble consists of 4 tasks:

  • Morphological Analysis Using Minkowski Functionals,
  • Morphological Openings and Boolean Model Evaluation,
  • Wicksell’s corpuscle problem, and
  • Monte Carlo Estimation of Quermass Densities.

This project was a part of the course module "Stochastic methods for material scientists" in TU Bergakademie Freiberg. The project was expected to be delivered within 2 weeks, and without any assistance from productivity enhancement tools. It was intended to be an entry point to stochastic modeling and R programming language.

Tasks

Morphological analysis using Minkowski functionals: Given realizations of 2D sets which are similar in shape to microstructures of materials, and are of compact, non-convex sets, the task was to evaluate Minkowski functionals (area, perimeter, Euler characteristic) using R and perform a comparative analysis with appropriate plots. This exercise is intended to explain the characteristics of structural complexity by comparing connectivity and homogeneity across different random set realizations.

Morphological openings and Boolean model evaluation: This two-part task is a part of microstructure characterization pipeline. First, morphological openings are applied to a random 2D set similar to those described earlier. By iteratively increasing the size of a disc-shaped structuring element, the image is effectively 'filtered'. Upon realization of physical scale of features, a boolean model is constructed where objects are placed at random locations. To ensure that the model is a valid representation, Monte Carlo simulations are performed. The intention is to introduce the idea that a combination of these techniques could be used to predict material behaviour under different conditions.

Wicksell’s corpuscle problem: Wicksell’s corpuscle problem (formulated by Sven Wicksell in 1925) asks: "If we have a volume containing spheres of unknown sizes, and we take a random 2D slice, can we determine the size distribution of the 3D spheres based only on the 2D circles we see?" The task is to demonstrate Saltykov method, which is a discrete numerical solution to the Abel-type integral equation that Wicksell derived.

Wicksell’s corpuscle problem image

Fig. 2: Wicksell’s corpuscle problem image

Monte Carlo estimation of Quermass densities: The idea is to conduct a Monte Carlo study to estimate the Quermass densities: the area fraction, boundary length, and Euler characteristic. By varying the underlying Poisson intensity (λ), the statistical 'crowding' of particles impacts the bulk geometric properties of the material was quantified. Box plots and standard deviation analysis were used to assess the precision of these geometric estimators, which is critical for determining how many image samples are needed to get a reliable measurement of a real material's microstructure. The analysis was performed over Matérn Type III Hard-Disc Model to simulate realistic, non-overlapping particle distributions.

Tools & Techniques

  • R & RStudio
  • spatstat, EBImage, ggplot2, dplyr, stats

Outcome

The project successfully demonstrates the potential of stochastic methods and spatial statistics, implemented in R, to quantify and interpret complex structural behaviors in random materials. This provides a foundation for predictive modeling and digital material design workflows.

Cluster of images showing plots of Minkowski functions for a 2D random set distribution

Fig. 3: Morphological analysis using Minkowski functionals

Original Image
After 1 application cycle
After 2 cycles
After 3 cycles

Fig. 4: Progression of Morphological openings

Source code: GitLab