Weierstrass–Mandelbrot function

A fractal surface generated using the Weierstrass–Mandelbrot function rendered in Blender

The Weierstrass–Mandelbrot function (often abbreviated W-M function) is a generalization of the classical Weierstrass function, extended to higher dimensions to model natural fractal phenomena. It is frequently used in terrain generation, particularly in simulated environments for robotics and autonomous vehicle testing. Unlike its 1D counterpart, the W-M function in multiple dimensions displays directionality, anisotropy, and multifractality, making it suitable for simulations of physically realistic surfaces.[1]

Mathematical formulation

The W-M function has the following definition:

where:

  • is the terrain height at the spatial coordinates ,
  • are the 2D spatial coordinates on the ground plane,
  • is a normalization factor,
  • is the frequency scaling factor,
  • is the fractal dimension,
  • is a uniformly distributed random phase,
  • is the number of angular directions,
  • is the maximum frequency index,
  • is the sampling length,
  • is the scaling coefficient.[2]
The Weierstrass-Mandelbrot function, top view

The W-M function generates statistically self-similar surfaces with control over roughness, orientation, and frequency distribution, making it ideal for modeling realistic and irregular topographies.

History

The Weierstrass–Mandelbrot function was first explicitly studied and named in a 1980 paper by Michael V. Berry and Z. V. Lewis, titled “On the Weierstrass–Mandelbrot Fractal Function.”[3] This work was published in the Proceedings of the Royal Society and marked the initial introduction of the function as a fractal object with applications in physics and mathematics. Berry and Lewis provided computer-generated visualizations of the function, helping establish it as a useful model for fractal phenomena. The function extends the classical Weierstrass function, which was originally introduced in the late 19th century by Karl Weierstrass as an example of a continuous but nowhere differentiable function. The Weierstrass–Mandelbrot function builds on this foundation by incorporating multifractal and multidimensional characteristics, as further explored in subsequent studies such as those by Marcel Ausloos and D. H. Berman in 1985. Since then, the function has been adopted in a range of fields, including terrain modeling, due to its ability to simulate realistic, self-similar rough surfaces.

Use in terrain generation

The Weierstrass–Mandelbrot function has found wide usage in procedural generation of digital terrains. Its multifractal nature allows the synthesis of realistic elevation maps for evaluating the performance of ground vehicles, particularly autonomous robots navigating rough or off-road environments.[4]

The function is especially useful for testing suspension, traction, and path planning modules of autonomous ground vehicles in computer simulations.

Implementation in Python / NumPy

import numpy as np


def weierstrass_mandelbrot_3d(x, y, D, G, L, gamma, M, n_max):
    """
    Compute the 3D Weierstrass–Mandelbrot function z(x, y).

    Parameters:
        x, y : 2D np.ndarrays
            Meshgrid arrays of spatial coordinates.
        D : float
            Fractal dimension (typically between 2 and 3).
        G : float
            Amplitude roughness coefficient.
        L : float
            Transverse width of the profile.
        gamma : float
            Frequency scaling factor (typically > 1).
        M : int
            Number of ridges (azimuthal angles).
        n_max : int
            Upper cutoff frequency index.

    Returns:
        z : 2D np.ndarray
            The height field generated by the WM function.
    """
    A = L * (G / L) ** (D - 2) * (np.log(gamma) / M) ** 0.5
    z = np.zeros_like(x)

    for m in range(1, M + 1):
        theta_m = np.arctan2(y, x) - np.pi * m / M
        phi_mn = np.random.uniform(0, 2 * np.pi, size=n_max + 1)

        for n in range(n_max + 1):
            gamma_n = gamma**n
            r = np.sqrt(x**2 + y**2)
            term = np.cos(phi_mn[n]) - np.cos(
                2 * np.pi * gamma_n * r / L * np.cos(theta_m) + phi_mn[n]
            )
            z += gamma ** ((D - 3) * n) * term

    return A * z

See also

References

  1. ^ Robert L. Jackson (2023). Fractal terrain generation for vehicle simulation. Academia.edu. [1]
  2. ^ Marcel Ausloos and D. H. Berman (1985). "A Multivariate Weierstrass–Mandelbrot Function." Proceedings of the Royal Society. 400 (1819): 331–350. DOI:10.1098/rspa.1985.0083
  3. ^ Berry, Michael V.; Lewis, Z. V. (1980). "On the Weierstrass–Mandelbrot Fractal Function" (PDF). Proceedings of the Royal Society A. 370 (1743): 459–484. doi:10.1098/rspa.1980.0080.
  4. ^ Casey D. Majhor and Jeremy P. Bos. "Multifractal Terrain Generation for Evaluating Autonomous Off-Road Ground Vehicles." arXiv preprint arXiv:2501.02172 (2025). arXiv:2501.02172
Prefix: a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9

Portal di Ensiklopedia Dunia

Kembali kehalaman sebelumnya