Weierstrass–Mandelbrot function
![]() 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 formulationThe W-M function has the following definition: where:
![]() 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. HistoryThe 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 generationThe 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 / NumPyimport 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
External links |
Portal di Ensiklopedia Dunia