text
stringlengths 105
4.17k
| source
stringclasses 883
values |
---|---|
In a vacuum, , a fundamental physical constant. The electromagnetic wave equation derives from Maxwell's equations. In most older literature, is called the magnetic flux density or magnetic induction. The following equations
$$
\begin{align}
\nabla \cdot \mathbf{E} &= 0\\
\nabla \cdot \mathbf{B} &= 0
\end{align}
$$
predicate that any electromagnetic wave must be a transverse wave, where the electric field and the magnetic field are both perpendicular to the direction of wave propagation.
## The origin of the electromagnetic wave equation
In his 1865 paper titled A Dynamical Theory of the Electromagnetic Field, James Clerk Maxwell utilized the correction to Ampère's circuital law that he had made in part III of his 1861 paper On Physical Lines of Force. In Part VI of his 1864 paper titled Electromagnetic Theory of Light, Maxwell combined displacement current with some of the other equations of electromagnetism and he obtained a wave equation with a speed equal to the speed of light. He commented:
The agreement of the results seems to show that light and magnetism are affections of the same substance, and that light is an electromagnetic disturbance propagated through the field according to electromagnetic laws.
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
He commented:
The agreement of the results seems to show that light and magnetism are affections of the same substance, and that light is an electromagnetic disturbance propagated through the field according to electromagnetic laws. See Maxwell 1864, page 499.
Maxwell's derivation of the electromagnetic wave equation has been replaced in modern physics education by a much less cumbersome method involving combining the corrected version of Ampère's circuital law with Faraday's law of induction.
To obtain the electromagnetic wave equation in a vacuum using the modern method, we begin with the modern 'Heaviside' form of Maxwell's equations.
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
Maxwell's derivation of the electromagnetic wave equation has been replaced in modern physics education by a much less cumbersome method involving combining the corrected version of Ampère's circuital law with Faraday's law of induction.
To obtain the electromagnetic wave equation in a vacuum using the modern method, we begin with the modern 'Heaviside' form of Maxwell's equations. In a vacuum- and charge-free space, these equations are:
$$
\begin{align}
\nabla \cdot \mathbf{E} & = 0 \\
\nabla \times \mathbf{E} & = -\frac{\partial \mathbf{B}} {\partial t}\\
\nabla \cdot \mathbf{B} & = 0 \\
\nabla \times \mathbf{B} & = \mu_0 \varepsilon_0 \frac{ \partial \mathbf{E}} {\partial t}\\
\end{align}
$$
These are the general Maxwell's equations specialized to the case with charge and current both set to zero.
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
Taking the curl of the curl equations gives:
$$
\begin{align}
\nabla \times \left(\nabla \times \mathbf{E} \right) &= \nabla \times \left(-\frac{\partial \mathbf{B}}{\partial t} \right) = -\frac{\partial}{\partial t} \left(\nabla \times \mathbf{B} \right) = -\mu_0 \varepsilon_0 \frac{\partial^2 \mathbf{E}}{\partial t^2} \\
\nabla \times \left(\nabla \times \mathbf{B} \right) &= \nabla \times \left(\mu_0 \varepsilon_0 \frac{\partial \mathbf{E}}{\partial t} \right) =\mu_0 \varepsilon_0 \frac{\partial}{\partial t} \left(\nabla \times \mathbf{E} \right) = -\mu_0 \varepsilon_0 \frac{\partial^2 \mathbf{B}}{\partial t^2}
\end{align}
$$
We can use the vector identity
$$
\nabla \times \left(\nabla \times \mathbf{V} \right) = \nabla \left(\nabla \cdot \mathbf{V} \right) - \nabla^2 \mathbf{V}
$$
where is any vector function of space.
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
And
$$
\nabla^2 \mathbf{V} = \nabla \cdot \left(\nabla \mathbf{V} \right)
$$
where is a dyadic which when operated on by the divergence operator yields a vector.
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
Since
$$
\begin{align}
\nabla \cdot \mathbf{E} &= 0\\
\nabla \cdot \mathbf{B} &= 0
\end{align}
$$
then the first term on the right in the identity vanishes and we obtain the wave equations:
$$
\begin{align}
\frac{1}{c_0^2} \frac{\partial^2 \mathbf{E}}{\partial t^2} - \nabla^2 \mathbf{E} &= \mathbf{0}\\
\frac{1}{c_0^2} \frac{\partial^2 \mathbf{B}}{\partial t^2} - \nabla^2 \mathbf{B} &= \mathbf{0}
\end{align}
$$
where
$$
c_0 = \frac{1}{\sqrt{\mu_0 \varepsilon_0}} = 2.99792458 \times 10^8\;\textrm{m/s}
$$
is the speed of light in free space.
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
## Covariant form of the homogeneous wave equation
These relativistic equations can be written in contravariant form as
$$
\Box A^{\mu} = 0
$$
where the electromagnetic four-potential is
$$
A^{\mu}= \left (\frac{\phi}{c}, \mathbf{A} \right)
$$
with the Lorenz gauge condition:
$$
\partial_{\mu} A^{\mu} = 0,
$$
and where
$$
\Box = \nabla^2 - \frac{1}{c^2} \frac{\partial^2}{\partial t^2}
$$
is the d'Alembert operator.
## Homogeneous wave equation in curved spacetime
The electromagnetic wave equation is modified in two ways, the derivative is replaced with the covariant derivative and a new term that depends on the curvature appears.
$$
-{A^{\alpha ; \beta}}_{; \beta} + {R^{\alpha}}_{\beta} A^{\beta} = 0
$$
where
$$
{R^\alpha}_\beta
$$
is the Ricci curvature tensor and the semicolon indicates covariant differentiation.
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
## Covariant form of the homogeneous wave equation
These relativistic equations can be written in contravariant form as
$$
\Box A^{\mu} = 0
$$
where the electromagnetic four-potential is
$$
A^{\mu}= \left (\frac{\phi}{c}, \mathbf{A} \right)
$$
with the Lorenz gauge condition:
$$
\partial_{\mu} A^{\mu} = 0,
$$
and where
$$
\Box = \nabla^2 - \frac{1}{c^2} \frac{\partial^2}{\partial t^2}
$$
is the d'Alembert operator.
## Homogeneous wave equation in curved spacetime
The electromagnetic wave equation is modified in two ways, the derivative is replaced with the covariant derivative and a new term that depends on the curvature appears.
$$
-{A^{\alpha ; \beta}}_{; \beta} + {R^{\alpha}}_{\beta} A^{\beta} = 0
$$
where
$$
{R^\alpha}_\beta
$$
is the Ricci curvature tensor and the semicolon indicates covariant differentiation.
The generalization of the Lorenz gauge condition in curved spacetime is assumed:
$$
{A^\mu}_{; \mu} = 0.
$$
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
## Homogeneous wave equation in curved spacetime
The electromagnetic wave equation is modified in two ways, the derivative is replaced with the covariant derivative and a new term that depends on the curvature appears.
$$
-{A^{\alpha ; \beta}}_{; \beta} + {R^{\alpha}}_{\beta} A^{\beta} = 0
$$
where
$$
{R^\alpha}_\beta
$$
is the Ricci curvature tensor and the semicolon indicates covariant differentiation.
The generalization of the Lorenz gauge condition in curved spacetime is assumed:
$$
{A^\mu}_{; \mu} = 0.
$$
## Inhomogeneous electromagnetic wave equation
Localized time-varying charge and current densities can act as sources of electromagnetic waves in a vacuum. Maxwell's equations can be written in the form of a wave equation with sources. The addition of sources to the wave equations makes the partial differential equations inhomogeneous.
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
Maxwell's equations can be written in the form of a wave equation with sources. The addition of sources to the wave equations makes the partial differential equations inhomogeneous.
## Solutions to the homogeneous electromagnetic wave equation
The general solution to the electromagnetic wave equation is a linear superposition of waves of the form
$$
\begin{align}
\mathbf{E}(\mathbf{r}, t) &= g(\phi(\mathbf{r}, t)) = g(\omega t - \mathbf{k} \cdot \mathbf{r}) \\
\mathbf{B}(\mathbf{r}, t) &= g(\phi(\mathbf{r}, t)) = g(\omega t - \mathbf{k} \cdot \mathbf{r})
\end{align}
$$
for virtually well-behaved function of dimensionless argument , where is the angular frequency (in radians per second), and is the wave vector (in radians per meter).
Although the function can be and often is a monochromatic sine wave, it does not have to be sinusoidal, or even periodic. In practice, cannot have infinite periodicity because any real electromagnetic wave must always have a finite extent in time and space.
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
Although the function can be and often is a monochromatic sine wave, it does not have to be sinusoidal, or even periodic. In practice, cannot have infinite periodicity because any real electromagnetic wave must always have a finite extent in time and space. As a result, and based on the theory of Fourier decomposition, a real wave must consist of the superposition of an infinite set of sinusoidal frequencies.
In addition, for a valid solution, the wave vector and the angular frequency are not independent; they must adhere to the dispersion relation:
$$
k = | \mathbf{k} | = { \omega \over c } = { 2 \pi \over \lambda }
$$
where is the wavenumber and is the wavelength. The variable can only be used in this equation when the electromagnetic wave is in a vacuum.
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
In addition, for a valid solution, the wave vector and the angular frequency are not independent; they must adhere to the dispersion relation:
$$
k = | \mathbf{k} | = { \omega \over c } = { 2 \pi \over \lambda }
$$
where is the wavenumber and is the wavelength. The variable can only be used in this equation when the electromagnetic wave is in a vacuum.
### Monochromatic, sinusoidal steady-state
The simplest set of solutions to the wave equation result from assuming sinusoidal waveforms of a single frequency in separable form:
$$
\mathbf{E} (\mathbf{r}, t) = \Re \left \{ \mathbf{E}(\mathbf{r}) e^{i \omega t} \right \}
$$
where
- is the imaginary unit,
- is the angular frequency in radians per second,
- is the frequency in hertz, and
-
$$
e^{i \omega t} = \cos(\omega t) + i \sin(\omega t)
$$
is Euler's formula.
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
The variable can only be used in this equation when the electromagnetic wave is in a vacuum.
### Monochromatic, sinusoidal steady-state
The simplest set of solutions to the wave equation result from assuming sinusoidal waveforms of a single frequency in separable form:
$$
\mathbf{E} (\mathbf{r}, t) = \Re \left \{ \mathbf{E}(\mathbf{r}) e^{i \omega t} \right \}
$$
where
- is the imaginary unit,
- is the angular frequency in radians per second,
- is the frequency in hertz, and
-
$$
e^{i \omega t} = \cos(\omega t) + i \sin(\omega t)
$$
is Euler's formula.
### Plane wave solutions
Consider a plane defined by a unit normal vector
$$
\mathbf{n} = { \mathbf{k} \over k }.
$$
Then planar traveling wave solutions of the wave equations are
$$
\begin{align}
\mathbf{E}(\mathbf{r}) &= \mathbf{E}_0 e^{ -i \mathbf{k} \cdot \mathbf{r} } \\
\mathbf{B}(\mathbf{r}) &= \mathbf{B}_0 e^{ -i \mathbf{k} \cdot \mathbf{r} }
\end{align}
$$
where is the position vector (in meters).
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
### Monochromatic, sinusoidal steady-state
The simplest set of solutions to the wave equation result from assuming sinusoidal waveforms of a single frequency in separable form:
$$
\mathbf{E} (\mathbf{r}, t) = \Re \left \{ \mathbf{E}(\mathbf{r}) e^{i \omega t} \right \}
$$
where
- is the imaginary unit,
- is the angular frequency in radians per second,
- is the frequency in hertz, and
-
$$
e^{i \omega t} = \cos(\omega t) + i \sin(\omega t)
$$
is Euler's formula.
### Plane wave solutions
Consider a plane defined by a unit normal vector
$$
\mathbf{n} = { \mathbf{k} \over k }.
$$
Then planar traveling wave solutions of the wave equations are
$$
\begin{align}
\mathbf{E}(\mathbf{r}) &= \mathbf{E}_0 e^{ -i \mathbf{k} \cdot \mathbf{r} } \\
\mathbf{B}(\mathbf{r}) &= \mathbf{B}_0 e^{ -i \mathbf{k} \cdot \mathbf{r} }
\end{align}
$$
where is the position vector (in meters).
These solutions represent planar waves traveling in the direction of the normal vector .
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
### Plane wave solutions
Consider a plane defined by a unit normal vector
$$
\mathbf{n} = { \mathbf{k} \over k }.
$$
Then planar traveling wave solutions of the wave equations are
$$
\begin{align}
\mathbf{E}(\mathbf{r}) &= \mathbf{E}_0 e^{ -i \mathbf{k} \cdot \mathbf{r} } \\
\mathbf{B}(\mathbf{r}) &= \mathbf{B}_0 e^{ -i \mathbf{k} \cdot \mathbf{r} }
\end{align}
$$
where is the position vector (in meters).
These solutions represent planar waves traveling in the direction of the normal vector . If we define the direction as the direction of , and the direction as the direction of , then by Faraday's Law the magnetic field lies in the direction and is related to the electric field by the relation
$$
c^2{\partial B \over \partial z} = {\partial E \over \partial t}.
$$
Because the divergence of the electric and magnetic fields are zero, there are no fields in the direction of propagation.
This solution is the linearly polarized solution of the wave equations.
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
If we define the direction as the direction of , and the direction as the direction of , then by Faraday's Law the magnetic field lies in the direction and is related to the electric field by the relation
$$
c^2{\partial B \over \partial z} = {\partial E \over \partial t}.
$$
Because the divergence of the electric and magnetic fields are zero, there are no fields in the direction of propagation.
This solution is the linearly polarized solution of the wave equations. There are also circularly polarized solutions in which the fields rotate about the normal vector.
### Spectral decomposition
Because of the linearity of Maxwell's equations in a vacuum, solutions can be decomposed into a superposition of sinusoids. This is the basis for the Fourier transform method for the solution of differential equations.
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
### Spectral decomposition
Because of the linearity of Maxwell's equations in a vacuum, solutions can be decomposed into a superposition of sinusoids. This is the basis for the Fourier transform method for the solution of differential equations. The sinusoidal solution to the electromagnetic wave equation takes the form
$$
\begin{align}
\mathbf{E} (\mathbf{r}, t) &= \mathbf{E}_0 \cos(\omega t - \mathbf{k} \cdot \mathbf{r} + \phi_0) \\
\mathbf{B} (\mathbf{r}, t) &= \mathbf{B}_0 \cos(\omega t - \mathbf{k} \cdot \mathbf{r} + \phi_0)
\end{align}
$$
where
- is time (in seconds),
- is the angular frequency (in radians per second),
- is the wave vector (in radians per meter), and
- _ BLOCK1_ is the phase angle (in radians).
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
The sinusoidal solution to the electromagnetic wave equation takes the form
$$
\begin{align}
\mathbf{E} (\mathbf{r}, t) &= \mathbf{E}_0 \cos(\omega t - \mathbf{k} \cdot \mathbf{r} + \phi_0) \\
\mathbf{B} (\mathbf{r}, t) &= \mathbf{B}_0 \cos(\omega t - \mathbf{k} \cdot \mathbf{r} + \phi_0)
\end{align}
$$
where
- is time (in seconds),
- is the angular frequency (in radians per second),
- is the wave vector (in radians per meter), and
- _ BLOCK1_ is the phase angle (in radians).
The wave vector is related to the angular frequency by
$$
k = | \mathbf{k} | = { \omega \over c } = { 2 \pi \over \lambda }
$$
where is the wavenumber and is the wavelength.
The electromagnetic spectrum is a plot of the field magnitudes (or energies) as a function of wavelength.
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
The wave vector is related to the angular frequency by
$$
k = | \mathbf{k} | = { \omega \over c } = { 2 \pi \over \lambda }
$$
where is the wavenumber and is the wavelength.
The electromagnetic spectrum is a plot of the field magnitudes (or energies) as a function of wavelength.
### Multipole expansion
Assuming monochromatic fields varying in time as
$$
e^{-i \omega t}
$$
, if one uses Maxwell's Equations to eliminate , the electromagnetic wave equation reduces to the Helmholtz equation for :
$$
(\nabla^2 + k^2)\mathbf{E} = 0,\, \mathbf{B} = -\frac{i}{k} \nabla \times \mathbf{E},
$$
with as given above. Alternatively, one can eliminate in favor of to obtain:
$$
(\nabla^2 + k^2)\mathbf{B} = 0,\, \mathbf{E} = -\frac{i}{k} \nabla \times \mathbf{B}.
$$
A generic electromagnetic field with frequency can be written as a sum of solutions to these two equations.
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
### Multipole expansion
Assuming monochromatic fields varying in time as
$$
e^{-i \omega t}
$$
, if one uses Maxwell's Equations to eliminate , the electromagnetic wave equation reduces to the Helmholtz equation for :
$$
(\nabla^2 + k^2)\mathbf{E} = 0,\, \mathbf{B} = -\frac{i}{k} \nabla \times \mathbf{E},
$$
with as given above. Alternatively, one can eliminate in favor of to obtain:
$$
(\nabla^2 + k^2)\mathbf{B} = 0,\, \mathbf{E} = -\frac{i}{k} \nabla \times \mathbf{B}.
$$
A generic electromagnetic field with frequency can be written as a sum of solutions to these two equations. The three-dimensional solutions of the Helmholtz Equation can be expressed as expansions in spherical harmonics with coefficients proportional to the spherical Bessel functions. However, applying this expansion to each vector component of or will give solutions that are not generically divergence-free (), and therefore require additional restrictions on the coefficients.
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
The three-dimensional solutions of the Helmholtz Equation can be expressed as expansions in spherical harmonics with coefficients proportional to the spherical Bessel functions. However, applying this expansion to each vector component of or will give solutions that are not generically divergence-free (), and therefore require additional restrictions on the coefficients.
The multipole expansion circumvents this difficulty by expanding not or , but or into spherical harmonics. These expansions still solve the original Helmholtz equations for and because for a divergence-free field , .
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
The resulting expressions for a generic electromagnetic field are:
$$
\begin{align}
\mathbf{E} &= e^{-i \omega t} \sum_{l,m} \sqrt{l(l+1)} \left[ a_E(l,m) \mathbf{E}_{l,m}^{(E)} + a_M(l,m) \mathbf{E}_{l,m}^{(M)} \right] \\
\mathbf{B} &= e^{-i \omega t} \sum_{l,m} \sqrt{l(l+1)} \left[ a_E(l,m) \mathbf{B}_{l,m}^{(E)} + a_M(l,m) \mathbf{B}_{l,m}^{(M)} \right]\,,
\end{align}
$$
where
$$
\mathbf{E}_{l,m}^{(E)}
$$
and
$$
\mathbf{B}_{l,m}^{(E)}
$$
are the electric multipole fields of order (l, m), and
$$
\mathbf{E}_{l,m}^{(M)}
$$
and
$$
\mathbf{B}_{l,m}^{(M)}
$$
are the corresponding magnetic multipole fields, and and are the coefficients of the expansion.
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
The multipole fields are given by
$$
\begin{align}
\mathbf{B}_{l,m}^{(E)} &= \sqrt{l(l+1)} \left[B_l^{(1)} h_l^{(1)}(kr) + B_l^{(2)} h_l^{(2)}(kr)\right] \mathbf{\Phi}_{l,m} \\
\mathbf{E}_{l,m}^{(E)} &= \frac{i}{k} \nabla \times \mathbf{B}_{l,m}^{(E)} \\
\mathbf{E}_{l,m}^{(M)} &= \sqrt{l(l+1)} \left[E_l^{(1)} h_l^{(1)}(kr) + E_l^{(2)} h_l^{(2)}(kr)\right] \mathbf{\Phi}_{l,m} \\
\mathbf{B}_{l,m}^{(M)} &= -\frac{i}{k} \nabla \times \mathbf{E}_{l,m}^{(M)}\,,
\end{align}
$$
where are the spherical Hankel functions, and are determined by boundary conditions, and
$$
\mathbf{\Phi}_{l,m} = \frac{1}{\sqrt{l(l+1)}}(\mathbf{r} \times \nabla) Y_{l,m}
$$
are vector spherical harmonics normalized so that
$$
\int \mathbf{\Phi}^*_{l,m} \cdot \mathbf{\Phi}_{l', m'} d\Omega = \delta_{l,l'} \delta_{m, m'}.
$$
The multipole expansion of the electromagnetic field finds application in a number of problems involving spherical symmetry, for example antennae radiation patterns, or nuclear gamma decay.
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
In this regions, the and fields asymptotically approach
$$
\begin{align}
\mathbf{B} & \approx \frac{e^{i (kr-\omega t)}}{kr} \sum_{l,m} (-i)^{l+1} \left[a_E(l,m) \mathbf{\Phi}_{l,m} + a_M(l,m) \mathbf{\hat{r}} \times \mathbf{\Phi}_{l,m} \right] \\
\mathbf{E} & \approx \mathbf{B} \times \mathbf{\hat{r}}.
\end{align}
$$
The angular distribution of the time-averaged radiated power is then given by
$$
\frac{dP}{d\Omega} \approx \frac{1}{2k^2} \left| \sum_{l,m} (-i)^{l+1} \left[ a_E(l,m) \mathbf{\Phi}_{l,m} \times \mathbf{\hat{r}} + a_M(l,m) \mathbf{\Phi}_{l,m} \right] \right|^2.
$$
|
https://en.wikipedia.org/wiki/Electromagnetic_wave_equation
|
Software architecture is the set of structures needed to reason about a software system and the discipline of creating such structures and systems. Each structure comprises software elements, relations among them, and properties of both elements and relations.
The architecture of a software system is a metaphor, analogous to the architecture of a building. It functions as the blueprints for the system and the development project, which project management can later use to extrapolate the tasks necessary to be executed by the teams and people involved.
Software architecture is about making fundamental structural choices that are costly to change once implemented. Software architecture choices include specific structural options from possibilities in the design of the software. There are two fundamental laws in software architecture:
1. Everything is a trade-off
1. "Why is more important than how"
"Architectural Kata" is a teamwork which can be used to produce an architectural solution that fits the needs. Each team extracts and prioritizes architectural characteristics (aka non functional requirements) then models the components accordingly. The team can use C4 Model which is a flexible method to model the architecture just enough. Note that synchronous communication between architectural components, entangles them and they must share the same architectural characteristics.
Documenting software architecture facilitates communication between stakeholders, captures early decisions about the high-level design, and allows the reuse of design components between projects.
|
https://en.wikipedia.org/wiki/Software_architecture
|
Note that synchronous communication between architectural components, entangles them and they must share the same architectural characteristics.
Documenting software architecture facilitates communication between stakeholders, captures early decisions about the high-level design, and allows the reuse of design components between projects.
Software architecture design is commonly juxtaposed with software application design. Whilst application design focuses on the design of the processes and data supporting the required functionality (the services offered by the system), software architecture design focuses on designing the infrastructure within which application functionality can be realized and executed such that the functionality is provided in a way which meets the system's non-functional requirements.
Software architectures can be categorized into two main types: monolith and distributed architecture, each having its own subcategories.
Software architecture tends to become more complex over time. Software architects should use "fitness functions" to continuously keep the architecture in check.
## Scope
Opinions vary as to the scope of software architectures:
- Macroscopic system structure: this refers to architecture as a higher-level abstraction of a software system that consists of a collection of computational components together with connectors that describe the interaction between these components.
|
https://en.wikipedia.org/wiki/Software_architecture
|
Software architects should use "fitness functions" to continuously keep the architecture in check.
## Scope
Opinions vary as to the scope of software architectures:
- Macroscopic system structure: this refers to architecture as a higher-level abstraction of a software system that consists of a collection of computational components together with connectors that describe the interaction between these components.
- The important stuff—whatever that is: this refers to the fact that software architects should concern themselves with those decisions that have high impact on the system and its stakeholders.
- That which is fundamental to understanding a system in its environment
- Things that people perceive as hard to change: since designing the architecture takes place at the beginning of a software system's lifecycle, the architect should focus on decisions that "have to" be right the first time. Following this line of thought, architectural design issues may become non-architectural once their irreversibility can be overcome.
- A set of architectural design decisions: software architecture should not be considered merely a set of models or structures, but should include the decisions that lead to these particular structures, and the rationale behind them. This insight has led to substantial research into software architecture knowledge management.
There is no sharp distinction between software architecture versus design and requirements engineering (see
## Related fields
below). They are all part of a "chain of intentionality" from high-level intentions to low-level details.
|
https://en.wikipedia.org/wiki/Software_architecture
|
## Related fields
below). They are all part of a "chain of intentionality" from high-level intentions to low-level details.
## Software architecture style vs. software architecture pattern
Software Architecture Pattern refers to a reusable, proven solution to a recurring problem at the system level, addressing concerns related to the overall structure, component interactions, and quality attributes of the system. Software architecture patterns operate at a higher level of abstraction than software design patterns, solving broader system-level challenges. While these patterns typically affect system-level concerns, the distinction between architectural patterns and architectural styles can sometimes be blurry. Examples include Circuit Breaker.
Software Architecture Style refers to a high-level structural organization that defines the overall system organization, specifying how components are organized, how they interact, and the constraints on those interactions. Architecture styles typically include a vocabulary of component and connector types, as well as semantic models for interpreting the system's properties. These styles represent the most coarse-grained level of system organization. Examples include Layered Architecture, Microservices, and Event-Driven Architecture.
## Anti-patterns
The following architectural anti-patterns can arise when architects make decisions. These anti-patterns often follow a progressive sequence, where resolving one may lead to the emergence of another.
|
https://en.wikipedia.org/wiki/Software_architecture
|
The following architectural anti-patterns can arise when architects make decisions. These anti-patterns often follow a progressive sequence, where resolving one may lead to the emergence of another.
- An architect may delay or avoid making architectural decisions due to the fear of choosing incorrectly. To address this, ongoing and close collaboration with the development team is often necessary, with architectural choices being adjusted based on their feedback. Additionally, decisions are typically made at the "last responsible moment," ensuring there is enough information to justify and validate the decision, while avoiding unnecessary delays that could lead to analysis paralysis and hinder the team's progress.
- Another anti-pattern can arise when architectural decisions are forgotten, not documented, or not understood, leading to repeated discussions without resolution. This often occurs when email is used to communicate architectural decisions. To address these challenges, architects typically provide both technical and business justifications (often related to cost, user satisfaction, and time to market) in a single record of the architectural decision (usually an Architecture Decision Record). This record can be maintained in an accessible repository, such as a wiki. Communication via email focuses on the nature and context of the change and is directed only to relevant stakeholders, with a link to the centralized record. This ensures there is always a single updated source of truth.
|
https://en.wikipedia.org/wiki/Software_architecture
|
Communication via email focuses on the nature and context of the change and is directed only to relevant stakeholders, with a link to the centralized record. This ensures there is always a single updated source of truth. Additionally, if an architectural decision does not offer tangible business value, or if the business value is misaligned with business stakeholders, it may need to be reconsidered.
## Characteristics
Software architecture exhibits the following:
Multitude of stakeholders: software systems have to cater to a variety of stakeholders such as business managers, owners, users, and operators. These stakeholders all have their own concerns with respect to the system. Balancing these concerns and demonstrating that they are addressed is part of designing the system. This implies that architecture involves dealing with a broad variety of concerns and stakeholders, and has a multidisciplinary nature.
Separation of concerns: the established way for architects to reduce complexity is to separate the concerns that drive the design. Architecture documentation shows that all stakeholder concerns are addressed by modeling and describing the architecture from separate points of view associated with the various stakeholder concerns. These separate descriptions are called architectural views (see for example the 4+1 architectural view model).
|
https://en.wikipedia.org/wiki/Software_architecture
|
Architecture documentation shows that all stakeholder concerns are addressed by modeling and describing the architecture from separate points of view associated with the various stakeholder concerns. These separate descriptions are called architectural views (see for example the 4+1 architectural view model).
Quality-driven: classic software design approaches (e.g. Jackson Structured Programming) were driven by required functionality and the flow of data through the system, but the current insight is that the architecture of a software system is more closely related to its quality attributes such as fault-tolerance, backward compatibility, extensibility, reliability, maintainability, availability, security, usability, and other such –ilities. Stakeholder concerns often translate into requirements on these quality attributes, which are variously called non-functional requirements, extra-functional requirements, behavioral requirements, or quality attribute requirements.
Recurring styles: like building architecture, the software architecture discipline has developed standard ways to address recurring concerns. These "standard ways" are called by various names at various levels of abstraction. Common terms for recurring solutions are architectural style, tactic, reference architecture and architectural pattern.
Conceptual integrity: a term introduced by Fred Brooks in his 1975 book The Mythical Man-Month to denote the idea that the architecture of a software system represents an overall vision of what it should do and how it should do it. This vision should be separated from its implementation.
|
https://en.wikipedia.org/wiki/Software_architecture
|
Conceptual integrity: a term introduced by Fred Brooks in his 1975 book The Mythical Man-Month to denote the idea that the architecture of a software system represents an overall vision of what it should do and how it should do it. This vision should be separated from its implementation. The architect assumes the role of "keeper of the vision", making sure that additions to the system are in line with the architecture, hence preserving conceptual integrity.
Cognitive constraints: An observation first made in a 1967 paper by computer programmer Melvin Conway that organizations which design systems are constrained to produce designs which are copies of the communication structures of these organizations. Fred Brooks introduced it to a wider audience when he cited the paper and the idea in The Mythical Man-Month, calling it Conway's Law.
## Motivation
Software architecture is an "intellectually graspable" abstraction of a complex system. This abstraction provides a number of benefits:
- It gives a basis for analysis of software systems' behavior before the system has been built. The ability to verify that a future software system fulfills its stakeholders' needs without actually having to build it represents substantial cost-saving and risk-mitigation. A number of techniques have been developed to perform such analyses, such as ATAM or by creating a visual representation of the software system.
- It provides a basis for re-use of elements and decisions.
|
https://en.wikipedia.org/wiki/Software_architecture
|
A number of techniques have been developed to perform such analyses, such as ATAM or by creating a visual representation of the software system.
- It provides a basis for re-use of elements and decisions. A complete software architecture or parts of it, like individual architectural strategies and decisions, can be re-used across multiple systems whose stakeholders require similar quality attributes or functionality, saving design costs and mitigating the risk of design mistakes.
- It supports early design decisions that impact a system's development, deployment, and maintenance life. Getting the early, high-impact decisions right is important to prevent schedule and budget overruns.
- It facilitates communication with stakeholders, contributing to a system that better fulfills their needs. Communicating about complex systems from the point of view of stakeholders helps them understand the consequences of their stated requirements and the design decisions based on them. Architecture gives the ability to communicate about design decisions before the system is implemented, when they are still relatively easy to adapt.
- It helps in risk management. Software architecture helps to reduce risks and chance of failure.
- It enables cost reduction. Software architecture is a means to manage risk and costs in complex IT projects.
## History
The comparison between software design and (civil) architecture was first drawn in the late 1960s, but the term "software architecture" did not see widespread usage until the 1990s.
|
https://en.wikipedia.org/wiki/Software_architecture
|
Software architecture is a means to manage risk and costs in complex IT projects.
## History
The comparison between software design and (civil) architecture was first drawn in the late 1960s, but the term "software architecture" did not see widespread usage until the 1990s. The field of computer science had encountered problems associated with complexity since its formation. Earlier problems of complexity were solved by developers by choosing the right data structures, developing algorithms, and by applying the concept of separation of concerns. Although the term "software architecture" is relatively new to the industry, the fundamental principles of the field have been applied sporadically by software engineering pioneers since the mid-1980s. Early attempts to capture and explain software architecture of a system were imprecise and disorganized, often characterized by a set of box-and-line diagrams.
Software architecture as a concept has its origins in the research of Edsger Dijkstra in 1968 and David Parnas in the early 1970s. These scientists emphasized that the structure of a software system matters and getting the structure right is critical. During the 1990s there was a concerted effort to define and codify fundamental aspects of the discipline, with research work concentrating on architectural styles (patterns), architecture description languages, architecture documentation, and formal methods.
Research institutions have played a prominent role in furthering software architecture as a discipline.
|
https://en.wikipedia.org/wiki/Software_architecture
|
During the 1990s there was a concerted effort to define and codify fundamental aspects of the discipline, with research work concentrating on architectural styles (patterns), architecture description languages, architecture documentation, and formal methods.
Research institutions have played a prominent role in furthering software architecture as a discipline. Mary Shaw and David Garlan of Carnegie Mellon wrote a book titled Software Architecture: Perspectives on an Emerging Discipline in 1996, which promoted software architecture concepts such as components, connectors, and styles. The University of California, Irvine's Institute for Software Research's efforts in software architecture research is directed primarily in architectural styles, architecture description languages, and dynamic architectures.
IEEE 1471-2000, "Recommended Practice for Architecture Description of Software-Intensive Systems", was the first formal standard in the area of software architecture. It was adopted in 2007 by ISO as ISO/IEC 42010:2007. In November 2011, IEEE 1471–2000 was superseded by ISO/IEC/IEEE 42010:2011, "Systems and software engineering – Architecture description" (jointly published by IEEE and ISO).
|
https://en.wikipedia.org/wiki/Software_architecture
|
It was adopted in 2007 by ISO as ISO/IEC 42010:2007. In November 2011, IEEE 1471–2000 was superseded by ISO/IEC/IEEE 42010:2011, "Systems and software engineering – Architecture description" (jointly published by IEEE and ISO).
While in IEEE 1471, software architecture was about the architecture of "software-intensive systems", defined as "any system where software contributes essential influences to the design, construction, deployment, and evolution of the system as a whole", the 2011 edition goes a step further by including the ISO/IEC 15288 and ISO/IEC 12207 definitions of a system, which embrace not only hardware and software, but also "humans, processes, procedures, facilities, materials and naturally occurring entities". This reflects the relationship between software architecture, enterprise architecture and solution architecture.
## Architecture activities
Making architectural decisions involves collecting sufficient relevant information, providing justification for the decision, documenting the decision and its rationale, and communicating it effectively to the appropriate stakeholders.
It's software architect's responsibility to match architectural characteristics (aka non-functional requirements) with business requirements. For example:
- Having a high customer satisfactions requires availability, fault tolerance, security, testability, recoverability, agility and performance in the system.
|
https://en.wikipedia.org/wiki/Software_architecture
|
It's software architect's responsibility to match architectural characteristics (aka non-functional requirements) with business requirements. For example:
- Having a high customer satisfactions requires availability, fault tolerance, security, testability, recoverability, agility and performance in the system.
- Doing mergers and acquisitions (M&A) requires extensibility, scalability, adaptability, and interoperability
- Constrained budget and time requires feasibility and simplicity
- Faster time-to-market requires maintainability, testability and deployability.
There are four core activities in software architecture design. These core architecture activities are performed iteratively and at different stages of the initial software development life-cycle, as well as over the evolution of a system.
Architectural analysis is the process of understanding the environment in which a proposed system will operate and determining the requirements for the system.
|
https://en.wikipedia.org/wiki/Software_architecture
|
These core architecture activities are performed iteratively and at different stages of the initial software development life-cycle, as well as over the evolution of a system.
Architectural analysis is the process of understanding the environment in which a proposed system will operate and determining the requirements for the system. The input or requirements to the analysis activity can come from any number of stakeholders and include items such as:
- what the system will do when operational (the functional requirements)
- how well the system will perform runtime non-functional requirements such as reliability, operability, performance efficiency, security, compatibility defined in ISO/IEC 25010:2011 standard
- development-time of non-functional requirements such as maintainability and transferability defined in ISO 25010:2011 standard
- business requirements and environmental contexts of a system that may change over time, such as legal, social, financial, competitive, and technology concerns
The outputs of the analysis activity are those requirements that have a measurable impact on a software system's architecture, called architecturally significant requirements.
Architectural synthesis or design is the process of creating an architecture. Given the architecturally significant requirements determined by the analysis, the current state of the design and the results of any evaluation activities, the design is created and improved.
Architecture evaluation is the process of determining how well the current design or a portion of it satisfies the requirements derived during analysis.
|
https://en.wikipedia.org/wiki/Software_architecture
|
Given the architecturally significant requirements determined by the analysis, the current state of the design and the results of any evaluation activities, the design is created and improved.
Architecture evaluation is the process of determining how well the current design or a portion of it satisfies the requirements derived during analysis. An evaluation can occur whenever an architect is considering a design decision, it can occur after some portion of the design has been completed, it can occur after the final design has been completed or it can occur after the system has been constructed. Some of the available software architecture evaluation techniques include Architecture Tradeoff Analysis Method (ATAM) and TARA. Frameworks for comparing the techniques are discussed in frameworks such as SARA Report and Architecture Reviews: Practice and Experience.
Architecture evolution is the process of maintaining and adapting an existing software architecture to meet changes in requirements and environment. As software architecture provides a fundamental structure of a software system, its evolution and maintenance would necessarily impact its fundamental structure. As such, architecture evolution is concerned with adding new functionality as well as maintaining existing functionality and system behavior.
Architecture requires critical supporting activities. These supporting activities take place throughout the core software architecture process. They include knowledge management and communication, design reasoning and decision-making, and documentation.
### Architecture supporting activities
Software architecture supporting activities are carried out during core software architecture activities.
|
https://en.wikipedia.org/wiki/Software_architecture
|
They include knowledge management and communication, design reasoning and decision-making, and documentation.
### Architecture supporting activities
Software architecture supporting activities are carried out during core software architecture activities. These supporting activities assist a software architect to carry out analysis, synthesis, evaluation, and evolution. For instance, an architect has to gather knowledge, make decisions, and document during the analysis phase.
- Knowledge management and communication is the act of exploring and managing knowledge that is essential to designing a software architecture. A software architect does not work in isolation. They get inputs, functional and non-functional requirements, and design contexts, from various stakeholders; and provide outputs to stakeholders. Software architecture knowledge is often tacit and is retained in the heads of stakeholders. Software architecture knowledge management activity is about finding, communicating, and retaining knowledge. As software architecture design issues are intricate and interdependent, a knowledge gap in design reasoning can lead to incorrect software architecture design. Examples of knowledge management and communication activities include searching for design patterns, prototyping, asking experienced developers and architects, evaluating the designs of similar systems, sharing knowledge with other designers and stakeholders, and documenting experience on a wiki page.
-
### Design
reasoning and decision making is the activity of evaluating design decisions. This activity is fundamental to all three core software architecture activities.
|
https://en.wikipedia.org/wiki/Software_architecture
|
### Design
reasoning and decision making is the activity of evaluating design decisions. This activity is fundamental to all three core software architecture activities. It entails gathering and associating decision contexts, formulating design decision problems, finding solution options and evaluating tradeoffs before making decisions. This process occurs at different levels of decision granularity while evaluating significant architectural requirements and software architecture decisions, and software architecture analysis, synthesis, and evaluation. Examples of reasoning activities include understanding the impacts of a requirement or a design on quality attributes, questioning the issues that a design might cause, assessing possible solution options, and evaluating the tradeoffs between solutions.
- Documentation is the act of recording the design generated during the software architecture process. System design is described using several views that frequently include a static view showing the code structure of the system, a dynamic view showing the actions of the system during execution, and a deployment view showing how a system is placed on hardware for execution. Kruchten's 4+1 view suggests a description of commonly used views for documenting software architecture; Documenting Software Architectures: Views and Beyond has descriptions of the kinds of notations that could be used within the view description. Examples of documentation activities are writing a specification, recording a system design model, documenting a design rationale, developing a viewpoint, documenting views.
|
https://en.wikipedia.org/wiki/Software_architecture
|
Kruchten's 4+1 view suggests a description of commonly used views for documenting software architecture; Documenting Software Architectures: Views and Beyond has descriptions of the kinds of notations that could be used within the view description. Examples of documentation activities are writing a specification, recording a system design model, documenting a design rationale, developing a viewpoint, documenting views.
## Software Architecture Design Strategies
Software architecture inherently deals with uncertainties, and the size of architectural components can significantly influence a system's outcomes, both positively and negatively. Neal Ford and Mark Richards propose an iterative approach to address the challenge of identifying and right-sizing components. This method emphasizes continuous refinement as teams develop a more nuanced understanding of system behavior and requirements.
The approach typically involves a cycle with several stages:
- A high-level partitioning strategy is established, often categorized as technical or domain-based. Guidelines for the smallest meaningful deployable unit, referred to as "quanta," are defined. While these foundational decisions are made early, they may be revisited later in the cycle if necessary.
- Initial components are identified based on the established strategy.
|
https://en.wikipedia.org/wiki/Software_architecture
|
Guidelines for the smallest meaningful deployable unit, referred to as "quanta," are defined. While these foundational decisions are made early, they may be revisited later in the cycle if necessary.
- Initial components are identified based on the established strategy.
- Requirements are assigned to the identified components.
- The roles and responsibilities of each component are analyzed to ensure clarity and minimize overlap.
- Architectural characteristics, such as scalability, fault tolerance, and maintainability, are evaluated.
- Components may be restructured based on feedback from development teams.
This cycle serves as a general framework and can be adapted to different domains.
## Software architecture topics
### Software architecture and agile development
There are also concerns that software architecture leads to too much big design up front, especially among proponents of agile software development. A number of methods have been developed to balance the trade-offs of up-front design and agility, including the agile method DSDM which mandates a "Foundations" phase during which "just enough" architectural foundations are laid. IEEE Software devoted a special issue to the interaction between agility and architecture.
### Software architecture erosion
Software architecture erosion refers to a gradual gap between the intended and implemented architecture of a software system over time.
|
https://en.wikipedia.org/wiki/Software_architecture
|
IEEE Software devoted a special issue to the interaction between agility and architecture.
### Software architecture erosion
Software architecture erosion refers to a gradual gap between the intended and implemented architecture of a software system over time. The phenomenon of software architecture erosion was initially brought to light in 1992 by Perry and Wolf alongside their definition of software architecture.
Software architecture erosion may occur in each stage of the software development life cycle and has varying impacts on the development speed and the cost of maintenance. Software architecture erosion occurs due to various reasons, such as architectural violations, the accumulation of technical debt, and knowledge vaporization. A famous case of architecture erosion is the failure of Mozilla Web browser. Mozilla is an application created by Netscape with a complex codebase that became harder to maintain due to continuous changes. Due to initial poor design and growing architecture erosion, Netscape spent two years redeveloping the Mozilla Web browser, demonstrating the importance of proactive architecture management to prevent costly repairs and project delays.
Architecture erosion can decrease software performance, substantially increase evolutionary costs, and degrade software quality. Various approaches and tools have been proposed to detect architecture erosion. These approaches are primarily classified into four categories: consistency-based, evolution-based, defect-based, and decision-based approaches.
|
https://en.wikipedia.org/wiki/Software_architecture
|
Various approaches and tools have been proposed to detect architecture erosion. These approaches are primarily classified into four categories: consistency-based, evolution-based, defect-based, and decision-based approaches. For instance, automated architecture conformance checks, static code analysis tools, and refactoring techniques help identify and mitigate erosion early.
Besides, the measures used to address architecture erosion contain two main types: preventative and remedial measures. Preventative measures include enforcing architectural rules, regular code reviews, and automated testing, while remedial measures involve refactoring, redesign, and documentation updates.
### Software architecture recovery
Software architecture recovery (or reconstruction, or reverse engineering) includes the methods, techniques, and processes to uncover a software system's architecture from available information, including its implementation and documentation. Architecture recovery is often necessary to make informed decisions in the face of obsolete or out-of-date documentation and
architecture erosion: implementation and maintenance decisions diverging from the envisioned architecture. Practices exist to recover software architecture as static program analysis. This is a part of the subjects covered by the software intelligence practice.
Related fields
Design
Architecture is design but not all design is architectural. In practice, the architect is the one who draws the line between software architecture (architectural design) and detailed design (non-architectural design).
|
https://en.wikipedia.org/wiki/Software_architecture
|
Related fields
Design
Architecture is design but not all design is architectural. In practice, the architect is the one who draws the line between software architecture (architectural design) and detailed design (non-architectural design). There are no rules or guidelines that fit all cases, although there have been attempts to formalize the distinction.
According to the Intension/Locality Hypothesis, the distinction between architectural and detailed design is defined by the Locality Criterion, according to which a statement about software design is non-local (architectural) if and only if a program that satisfies it can be expanded into a program that does not. For example, the client–server style is architectural (strategic) because a program that is built on this principle can be expanded into a program that is not client–server—for example, by adding peer-to-peer nodes.
### Requirements engineering
Requirements engineering and software architecture can be seen as complementary approaches: while software architecture targets the 'solution space' or the 'how', requirements engineering addresses the 'problem space' or the 'what'. Requirements engineering entails the elicitation, negotiation, specification, validation, documentation, and management of requirements. Both requirements engineering and software architecture revolve around stakeholder concerns, needs, and wishes.
|
https://en.wikipedia.org/wiki/Software_architecture
|
Requirements engineering entails the elicitation, negotiation, specification, validation, documentation, and management of requirements. Both requirements engineering and software architecture revolve around stakeholder concerns, needs, and wishes.
There is considerable overlap between requirements engineering and software architecture, as evidenced for example by a study into five industrial software architecture methods that concludes that "the inputs (goals, constraints, etc.) are usually ill-defined, and only get discovered or better understood as the architecture starts to emerge" and that while "most architectural concerns are expressed as requirements on the system, they can also include mandated design decisions". In short, required behavior impacts solution architecture, which in turn may introduce new requirements. Approaches such as the Twin Peaks model aim to exploit the synergistic relation between requirements and architecture.
### Other types of 'architecture'
Computer architecture
Computer architecture targets the internal structure of a computer system, in terms of collaborating hardware components such as the CPU – or processor – the bus and the memory.
Serverless architecture
Serverless architecture is a cloud computing paradigm that is often misunderstood as being server-free. It essentially shifts server management responsibilities from developers to cloud service providers. This allows businesses to run their backend code on cloud infrastructure, eliminating the need for physical server management.
|
https://en.wikipedia.org/wiki/Software_architecture
|
It essentially shifts server management responsibilities from developers to cloud service providers. This allows businesses to run their backend code on cloud infrastructure, eliminating the need for physical server management. The event-driven approach of serverless architecture relies on small, task-specific functions that are executed on-demand. These functions are known as Function as a Service (FaaS), and they offer cost-efficiency through a pay-as-you-go billing model and dynamic resource scaling based on application demand.
Systems architecture
The term systems architecture has originally been applied to the architecture of systems that consist of both hardware and software. The main concern addressed by the systems architecture is then the integration of software and hardware in a complete, correctly working device. In another common – much broader – meaning, the term applies to the architecture of any complex system which may be of a technical, sociotechnical or social nature.
Enterprise architecture
The goal of enterprise architecture is to "translate business vision and strategy into effective enterprise". Enterprise architecture frameworks, such as TOGAF and the Zachman Framework, usually distinguish between different enterprise architecture layers. Although terminology differs from framework to framework, many include at least a distinction between a business layer, an application (or information) layer, and a technology layer. Enterprise architecture addresses among others the alignment between these layers, usually in a top-down approach.
|
https://en.wikipedia.org/wiki/Software_architecture
|
In computer science, a B-tree is a self-balancing tree data structure that maintains sorted data and allows searches, sequential access, insertions, and deletions in logarithmic time. The B-tree generalizes the binary search tree, allowing for nodes with more than two children. Unlike other self-balancing binary search trees, the B-tree is well suited for storage systems that read and write relatively large blocks of data, such as databases and file systems.
## History
While working at Boeing Research Labs, Rudolf Bayer and Edward M. McCreight invented B-trees to efficiently manage index pages for large random-access files. The basic assumption was that indices would be so voluminous that only small chunks of the tree could fit in main memory. Bayer and McCreight's paper Organization and maintenance of large ordered indices was first circulated in July 1970 and later published in Acta Informatica.
Bayer and McCreight never explained what, if anything, the B stands for; Boeing, balanced, between, broad, bushy, and Bayer have been suggested. McCreight, when asked "I want to know what B in B-Tree stands for," answered:Everybody does!
So you just have no idea what a lunchtime conversation can turn into. So there we were, Rudy and I, at lunch. We had to give the thing a name....
|
https://en.wikipedia.org/wiki/B-tree
|
So there we were, Rudy and I, at lunch. We had to give the thing a name.... We were working for Boeing at the time, but we couldn't use the name without talking to the lawyers. So there's a B.
It has to do with Balance. There's another B.
Rudy was the senior author. Rudy (Bayer) was several years older than I am, and had ... many more publications than I did. So there's another B.
And so at the lunch table, we never did resolve whether there was one of those that made more sense than the rest.
What Rudy likes to say is, the more you think about what the B in B-Tree means, the better you understand B-Trees!
## Definition
According to Knuth's definition, a B-tree of order m is a tree which satisfies the following properties:
1. Every node has at most m children.
1. Every node, except for the root and the leaves, has at least ⌈m/2⌉ children.
1. The root node has at least two children unless it is a leaf.
1. All leaves appear on the same level.
1. A non-leaf node with k children contains k−1 keys.
Each internal node's keys act as separation values which divide its subtrees.
|
https://en.wikipedia.org/wiki/B-tree
|
A non-leaf node with k children contains k−1 keys.
Each internal node's keys act as separation values which divide its subtrees. For example, if an internal node has 3 child nodes (or subtrees) then it must have 2 keys: a1 and a2. All values in the leftmost subtree will be less than a1, all values in the middle subtree will be between a1 and a2, and all values in the rightmost subtree will be greater than a2.
Internal nodes
Internal nodes (also known as inner nodes) are all nodes except for leaf nodes and the root node. They are usually represented as an ordered set of elements and child pointers. Every internal node contains a maximum of U children and a minimum of L children. Thus, the number of elements is always 1 less than the number of child pointers (the number of elements is between L−1 and U−1). U must be either 2L or 2L−1; therefore each internal node is at least half full. The relationship between U and L implies that two half-full nodes can be joined to make a legal node, and one full node can be split into two legal nodes (if there's room to push one element up into the parent). These properties make it possible to delete and insert new values into a B-tree and adjust the tree to preserve the B-tree properties.
|
https://en.wikipedia.org/wiki/B-tree
|
The relationship between U and L implies that two half-full nodes can be joined to make a legal node, and one full node can be split into two legal nodes (if there's room to push one element up into the parent). These properties make it possible to delete and insert new values into a B-tree and adjust the tree to preserve the B-tree properties.
The root node
The root node's number of children has the same upper limit as internal nodes, but has no lower limit. For example, when there are fewer than L−1 elements in the entire tree, the root will be the only node in the tree with no children at all.
Leaf nodes
In Knuth's terminology, the "leaf" nodes are the actual data objects/chunks. The internal nodes that are one level above these leaves are what would be called the "leaves" by other authors: these nodes only store keys (at most m-1, and at least m/2-1 if they are not the root) and pointers (one for each key) to nodes carrying the data objects/chunks.
A B-tree of depth n+1 can hold about U times as many items as a B-tree of depth n, but the cost of search, insert, and delete operations grows with the depth of the tree. As with any balanced tree, the cost grows much more slowly than the number of elements.
|
https://en.wikipedia.org/wiki/B-tree
|
A B-tree of depth n+1 can hold about U times as many items as a B-tree of depth n, but the cost of search, insert, and delete operations grows with the depth of the tree. As with any balanced tree, the cost grows much more slowly than the number of elements.
Some balanced trees store values only at leaf nodes and use different kinds of nodes for leaf nodes and internal nodes. B-trees keep values in every node in the tree except leaf nodes.
### Differences in terminology
The literature on B-trees is not uniform in its terminology.
Bayer and McCreight (1972), Comer (1979), and others define the order of B-tree as the minimum number of keys in a non-root node. Folk and Zoellick points out that terminology is ambiguous because the maximum number of keys is not clear. An order 3 B-tree might hold a maximum of 6 keys or a maximum of 7 keys. Knuth (1998) avoids the problem by defining the order to be the maximum number of children (which is one more than the maximum number of keys).
The term leaf is also inconsistent. Bayer and McCreight (1972) considered the leaf level to be the lowest level of keys, but Knuth considered the leaf level to be one level below the lowest keys. There are many possible implementation choices.
|
https://en.wikipedia.org/wiki/B-tree
|
Bayer and McCreight (1972) considered the leaf level to be the lowest level of keys, but Knuth considered the leaf level to be one level below the lowest keys. There are many possible implementation choices. In some designs, the leaves may hold the entire data record; in other designs, the leaves may only hold pointers to the data record. Those choices are not fundamental to the idea of a B-tree.
For simplicity, most authors assume there are a fixed number of keys that fit in a node. The basic assumption is the key size is fixed and the node size is fixed. In practice, variable-length keys may be employed.
## Informal description
### Node structure
As with other trees, B-trees can be represented as a collection of three types of nodes: root, internal (a.k.a. interior), and leaf.
Note the following variable definitions:
- : Maximum number of potential search keys for each node in a B-tree. (this value is constant over the entire tree).
- : The pointer to a child node which starts a sub-tree.
- : The pointer to a record which stores the data.
- : The search key at the zero-based node index .
|
https://en.wikipedia.org/wiki/B-tree
|
Note the following variable definitions:
- : Maximum number of potential search keys for each node in a B-tree. (this value is constant over the entire tree).
- : The pointer to a child node which starts a sub-tree.
- : The pointer to a record which stores the data.
- : The search key at the zero-based node index .
In B-trees, the following properties are maintained for these nodes:
- If exists in any node in a B-tree, then exists in that node where
$$
i \ge 1
$$
.
- All leaf nodes have the same number of ancestors (i.e., they are all at the same depth).
Each internal node in a B-tree has the following format:
+Internal node structurept0k0pt1pr0k1pt2pr1...kK-1ptKprK-1
+Internal node pointer structure when exists and exist exists,and does not exist and do not exist exists does not exist :Points to subtreein which all search keys is empty. Points to a record with a value is empty.
Each leaf node in a B-tree has the following format:
+Leaf node structurepr0k0pr1k1...prK-1kK-1
+Leaf node pointer structure when exists when does not existPoints to a record with a value equal to .Here, is empty.
|
https://en.wikipedia.org/wiki/B-tree
|
Points to a record with a value is empty.
Each leaf node in a B-tree has the following format:
+Leaf node structurepr0k0pr1k1...prK-1kK-1
+Leaf node pointer structure when exists when does not existPoints to a record with a value equal to .Here, is empty.
The node bounds are summarized in the table below:
Node type number of keys number of child nodes Min Max Min MaxRoot node when it is a leaf node000Root node when it is an internal node12Internal nodeLeaf node00
###
### Insertion
and deletion
To maintain the predefined range of child nodes, internal nodes may be joined or split.
Usually, the number of keys is chosen to vary between and
$$
2d
$$
, where is the minimum number of keys, and
$$
d+1
$$
is the minimum degree or branching factor of the tree. The factor of 2 will guarantee that nodes can be split or combined.
If an internal node has
$$
2d
$$
keys, then adding a key to that node can be accomplished by splitting the hypothetical
$$
2d+1
$$
key node into two key nodes and moving the key that would have been in the middle to the parent node. Each split node has the required minimum number of keys.
|
https://en.wikipedia.org/wiki/B-tree
|
If an internal node has
$$
2d
$$
keys, then adding a key to that node can be accomplished by splitting the hypothetical
$$
2d+1
$$
key node into two key nodes and moving the key that would have been in the middle to the parent node. Each split node has the required minimum number of keys. Similarly, if an internal node and its neighbor each have keys, then a key may be deleted from the internal node by combining it with its neighbor. Deleting the key would make the internal node have
$$
d-1
$$
keys; joining the neighbor would add keys plus one more key brought down from the neighbor's parent. The result is an entirely full node of
$$
2d
$$
keys.
A B-tree is kept balanced after insertion by splitting a would-be overfilled node, of
$$
2d+1
$$
keys, into two -key siblings and inserting the mid-value key into the parent. Depth only increases when the root is split, maintaining balance. Similarly, a B-tree is kept balanced after deletion by merging or redistributing keys among siblings to maintain the -key minimum for non-root nodes. A merger reduces the number of keys in the parent potentially forcing it to merge or redistribute keys with its siblings, and so on.
|
https://en.wikipedia.org/wiki/B-tree
|
Similarly, a B-tree is kept balanced after deletion by merging or redistributing keys among siblings to maintain the -key minimum for non-root nodes. A merger reduces the number of keys in the parent potentially forcing it to merge or redistribute keys with its siblings, and so on. The only change in depth occurs when the root has two children, of and (transitionally)
$$
d-1
$$
keys, in which case the two siblings and parent are merged, reducing the depth by one.
This depth will increase slowly as elements are added to the tree, but an increase in the overall depth is infrequent, and results in all leaf nodes being one more node farther away from the root.
### Comparison to other trees
Because a range of child nodes is permitted, B-trees do not need re-balancing as frequently as other self-balancing search trees, but may waste some space, since nodes are not entirely full.
B-trees have substantial advantages over alternative implementations when the time to access the data of a node greatly exceeds the time spent processing that data, because then the cost of accessing the node may be amortized over multiple operations within the node. This usually occurs when the node data are in secondary storage such as disk drives.
|
https://en.wikipedia.org/wiki/B-tree
|
B-trees have substantial advantages over alternative implementations when the time to access the data of a node greatly exceeds the time spent processing that data, because then the cost of accessing the node may be amortized over multiple operations within the node. This usually occurs when the node data are in secondary storage such as disk drives. By maximizing the number of keys within each internal node, the height of the tree decreases and the number of expensive node accesses is reduced. In addition, rebalancing of the tree occurs less often. The maximum number of child nodes depends on the information that must be stored for each child node and the size of a full disk block or an analogous size in secondary storage. While 2–3 B-trees are easier to explain, practical B-trees using secondary storage need a large number of child nodes to improve performance.
### Variants
The term B-tree may refer to a specific design or a general class of designs. In the narrow sense, a B-tree stores keys in its internal nodes but need not store those keys in the records at the leaves. The general class includes variations such as the B+ tree, the B* tree and the B*+ tree.
- In the B+ tree, the internal nodes do not store any pointers to records, thus all pointers to records are stored in the leaf nodes.
|
https://en.wikipedia.org/wiki/B-tree
|
The general class includes variations such as the B+ tree, the B* tree and the B*+ tree.
- In the B+ tree, the internal nodes do not store any pointers to records, thus all pointers to records are stored in the leaf nodes. In addition, a leaf node may include a pointer to the next leaf node to speed up sequential access. Because B+ tree internal nodes have fewer pointers, each node can hold more keys, causing the tree to be shallower and thus faster to search.
- The B* tree balances more neighboring internal nodes to keep the internal nodes more densely packed. This variant ensures non-root nodes are at least 2/3 full instead of 1/2. As the most costly part of operation of inserting the node in B-tree is splitting the node, B*-trees are created to postpone splitting operation as long as they can. To maintain this, instead of immediately splitting up a node when it gets full, its keys are shared with a node next to it. This spill operation is less costly to do than split, because it requires only shifting the keys between existing nodes, not allocating memory for a new one. For inserting, first it is checked whether the node has some free space in it, and if so, the new key is just inserted in the node.
|
https://en.wikipedia.org/wiki/B-tree
|
This spill operation is less costly to do than split, because it requires only shifting the keys between existing nodes, not allocating memory for a new one. For inserting, first it is checked whether the node has some free space in it, and if so, the new key is just inserted in the node. However, if the node is full (it has keys, where is the order of the tree as maximum number of pointers to subtrees from one node), it needs to be checked whether the right sibling exists and has some free space. If the right sibling has keys, then keys are redistributed between the two sibling nodes as evenly as possible. For this purpose, keys from the current node, the new key inserted, one key from the parent node and keys from the sibling node are seen as an ordered array of keys. The array becomes split by half, so that lowest keys stay in the current node, the next (middle) key is inserted in the parent and the rest go to the right sibling. (The newly inserted key might end up in any of the three places.) The situation when right sibling is full, and left isn't is analogous. When both the sibling nodes are full, then the two nodes (current node and a sibling) are split into three and one more key is shifted up the tree, to the parent node.
|
https://en.wikipedia.org/wiki/B-tree
|
The situation when right sibling is full, and left isn't is analogous. When both the sibling nodes are full, then the two nodes (current node and a sibling) are split into three and one more key is shifted up the tree, to the parent node. If the parent is full, then spill/split operation propagates towards the root node. Deleting nodes is somewhat more complex than inserting however.
- The B*+ tree combines the main B+ tree and B* tree features together.
- B-trees can be turned into order statistic trees to allow rapid searches for the Nth record in key order, or counting the number of records between any two records, and various other related operations.
## B-tree usage in databases
### Sorted file search time
Sorting and searching algorithms can be characterized by the number of comparison operations that must be performed using order notation. A binary search of a sorted table with records, for example, can be done in roughly comparisons. If the table had 1,000,000 records, then a specific record could be located with at most 20 comparisons: .
Large databases have historically been kept on disk drives. The time to read a record on a disk drive far exceeds the time needed to compare keys once the record is available due to seek time and a rotational delay.
|
https://en.wikipedia.org/wiki/B-tree
|
Large databases have historically been kept on disk drives. The time to read a record on a disk drive far exceeds the time needed to compare keys once the record is available due to seek time and a rotational delay. The seek time may be 0 to 20 or more milliseconds, and the rotational delay averages about half the rotation period. For a 7200 RPM drive, the rotation period is 8.33 milliseconds. For a drive such as the Seagate ST3500320NS, the track-to-track seek time is 0.8 milliseconds and the average reading seek time is 8.5 milliseconds. For simplicity, assume reading from disk takes about 10 milliseconds.
The time to locate one record out of a million in the example above would take 20 disk reads times 10 milliseconds per disk read, which is 0.2 seconds.
The search time is reduced because individual records are grouped together in a disk block. A disk block might be 16 kilobytes. If each record is 160 bytes, then 100 records could be stored in each block. The disk read time above was actually for an entire block. Once the disk head is in position, one or more disk blocks can be read with little delay. With 100 records per block, the last 6 or so comparisons don't need to do any disk reads—the comparisons are all within the last disk block read.
|
https://en.wikipedia.org/wiki/B-tree
|
Once the disk head is in position, one or more disk blocks can be read with little delay. With 100 records per block, the last 6 or so comparisons don't need to do any disk reads—the comparisons are all within the last disk block read.
To speed up the search further, the time to do the first 13 to 14 comparisons (which each required a disk access) must be reduced.
### Index performance
A B-tree index can be used to improve performance. A B-tree index creates a multi-level tree structure that breaks a database down into fixed-size blocks or pages. Each level of this tree can be used to link those pages via an address location, allowing one page (known as a node, or internal page) to refer to another with leaf pages at the lowest level. One page is typically the starting point of the tree, or the "root". This is where the search for a particular key would begin, traversing a path that terminates in a leaf. Most pages in this structure will be leaf pages which refer to specific table rows.
Because each node (or internal page) can have more than two children, a B-tree index will usually have a shorter height (the distance from the root to the farthest leaf) than a Binary
### Search
Tree. In the example above, initial disk reads narrowed the search range by a factor of two.
|
https://en.wikipedia.org/wiki/B-tree
|
### Search
Tree. In the example above, initial disk reads narrowed the search range by a factor of two. That can be improved by creating an auxiliary index that contains the first record in each disk block (sometimes called a sparse index). This auxiliary index would be 1% of the size of the original database, but it can be searched quickly. Finding an entry in the auxiliary index would tell us which block to search in the main database; after searching the auxiliary index, we would have to search only that one block of the main database—at a cost of one more disk read.
In the above example the index would hold 10,000 entries and would take at most 14 comparisons to return a result. Like the main database, the last six or so comparisons in the auxiliary index would be on the same disk block. The index could be searched in about eight disk reads, and the desired record could be accessed in 9 disk reads.
Creating an auxiliary index can be repeated to make an auxiliary index to the auxiliary index. That would make an aux-aux index that would need only 100 entries and would fit in one disk block.
Instead of reading 14 disk blocks to find the desired record, we only need to read 3 blocks. This blocking is the core idea behind the creation of the B-tree, where the disk blocks fill out a hierarchy of levels to make up the index.
|
https://en.wikipedia.org/wiki/B-tree
|
Instead of reading 14 disk blocks to find the desired record, we only need to read 3 blocks. This blocking is the core idea behind the creation of the B-tree, where the disk blocks fill out a hierarchy of levels to make up the index. Reading and searching the first (and only) block of the aux-aux index which is the root of the tree identifies the relevant block in aux-index in the level below. Reading and searching that aux-index block identifies the relevant block to read, until the final level, known as the leaf level, identifies a record in the main database. Instead of 150 milliseconds, we need only 30 milliseconds to get the record.
The auxiliary indices have turned the search problem from a binary search requiring roughly disk reads to one requiring only disk reads where is the blocking factor (the number of entries per block: entries per block in our example; reads).
In practice, if the main database is being frequently searched, the aux-aux index and much of the aux index may reside in a disk cache, so they would not incur a disk read. The B-tree remains the standard index implementation in almost all relational databases, and many nonrelational databases use them too.
### Insertions and deletions
If the database does not change, then compiling the index is simple to do, and the index need never be changed. If there are changes, managing the database and its index require additional computation.
|
https://en.wikipedia.org/wiki/B-tree
|
### Insertions and deletions
If the database does not change, then compiling the index is simple to do, and the index need never be changed. If there are changes, managing the database and its index require additional computation.
Deleting records from a database is relatively easy. The index can stay the same, and the record can just be marked as deleted. The database remains in sorted order. If there are a large number of lazy deletions, then searching and storage become less efficient.
Insertions can be very slow in a sorted sequential file because room for the inserted record must be made. Inserting a record before the first record requires shifting all of the records down one. Such an operation is just too expensive to be practical. One solution is to leave some spaces. Instead of densely packing all the records in a block, the block can have some free space to allow for subsequent insertions. Those spaces would be marked as if they were "deleted" records.
Both insertions and deletions are fast as long as space is available on a block. If an insertion won't fit on the block, then some free space on some nearby block must be found and the auxiliary indices adjusted. The best case is that enough space is available nearby so that the amount of block reorganization can be minimized. Alternatively, some out-of-sequence disk blocks may be used.
|
https://en.wikipedia.org/wiki/B-tree
|
The best case is that enough space is available nearby so that the amount of block reorganization can be minimized. Alternatively, some out-of-sequence disk blocks may be used.
### Usage in databases
The B-tree uses all of the ideas described above. In particular, a B-tree:
- keeps keys in sorted order for sequential traversing
- uses a hierarchical index to minimize the number of disk reads
- uses partially full blocks to speed up insertions and deletions
- keeps the index balanced with a recursive algorithm
In addition, a B-tree minimizes waste by making sure the interior nodes are at least half full. A B-tree can handle an arbitrary number of insertions and deletions.
## Best case and worst case heights
Let be the height of the classic B-tree (see for the tree height definition). Let be the number of entries in the tree. Let m be the maximum number of children a node can have. Each node can have at most keys.
It can be shown (by induction for example) that a B-tree of height h with all its nodes completely filled has entries.
|
https://en.wikipedia.org/wiki/B-tree
|
Each node can have at most keys.
It can be shown (by induction for example) that a B-tree of height h with all its nodes completely filled has entries. Hence, the best case height (i.e. the minimum height) of a B-tree is:
$$
h_{\mathrm{min}} = \lceil \log_{m} (n+1) \rceil -1
$$
Let
$$
d
$$
be the minimum number of children an internal (non-root) node must have. For an ordinary B-tree,
$$
d = \left\lceil m/2 \right\rceil.
$$
Comer (1979) and Cormen et al. (2001) give the worst case height (the maximum height) of a B-tree as
$$
h_{\mathrm{max}} = \left\lfloor \log_{d}\frac{n+1}{2} \right\rfloor .
$$
## Algorithms
Search
Searching is similar to searching a binary search tree. Starting at the root, the tree is recursively traversed from top to bottom. At each level, the search reduces its field of view to the child pointer (subtree) whose range includes the search value. A subtree's range is defined by the values, or keys, contained in its parent node. These limiting values are also known as separation values.
|
https://en.wikipedia.org/wiki/B-tree
|
A subtree's range is defined by the values, or keys, contained in its parent node. These limiting values are also known as separation values.
Binary search is typically (but not necessarily) used within nodes to find the separation values and child tree of interest.
Insertion
All insertions start at a leaf node. To insert a new element, search the tree to find the leaf node where the new element should be added. Insert the new element into that node with the following steps:
1. If the node contains fewer than the maximum allowed number of elements, then there is room for the new element. Insert the new element in the node, keeping the node's elements ordered.
1. Otherwise the node is full, evenly split it into two nodes so:
1. A single median is chosen from among the leaf's elements and the new element that is being inserted.
1. Values less than the median are put in the new left node, and values greater than the median are put in the new right node, with the median acting as a separation value.
1. The separation value is inserted in the node's parent, which may cause it to be split, and so on. If the node has no parent (i.e., the node was the root), create a new root above this node (increasing the height of the tree).
|
https://en.wikipedia.org/wiki/B-tree
|
The separation value is inserted in the node's parent, which may cause it to be split, and so on. If the node has no parent (i.e., the node was the root), create a new root above this node (increasing the height of the tree).
If the splitting goes all the way up to the root, it creates a new root with a single separator value and two children, which is why the lower bound on the size of internal nodes does not apply to the root. The maximum number of elements per node is U−1. When a node is split, one element moves to the parent, but one element is added. So, it must be possible to divide the maximum number U−1 of elements into two legal nodes. If this number is odd, then U=2L and one of the new nodes contains (U−2)/2 = L−1 elements, and hence is a legal node, and the other contains one more element, and hence it is legal too. If U−1 is even, then U=2L−1, so there are 2L−2 elements in the node. Half of this number is L−1, which is the minimum number of elements allowed per node.
An alternative algorithm supports a single pass down the tree from the root to the node where the insertion will take place, splitting any full nodes encountered on the way pre-emptively.
|
https://en.wikipedia.org/wiki/B-tree
|
Half of this number is L−1, which is the minimum number of elements allowed per node.
An alternative algorithm supports a single pass down the tree from the root to the node where the insertion will take place, splitting any full nodes encountered on the way pre-emptively. This prevents the need to recall the parent nodes into memory, which may be expensive if the nodes are on secondary storage. However, to use this algorithm, we must be able to send one element to the parent and split the remaining U−2 elements into two legal nodes, without adding a new element. This requires U = 2L rather than U = 2L−1, which accounts for why some textbooks impose this requirement in defining B-trees.
### Deletion
There are two popular strategies for deletion from a B-tree.
1. Locate and delete the item, then restructure the tree to retain its invariants, OR
1. Do a single pass down the tree, but before entering (visiting) a node, restructure the tree so that once the key to be deleted is encountered, it can be deleted without triggering the need for any further restructuring
The algorithm below uses the former strategy.
There are two special cases to consider when deleting an element:
1. The element in an internal node is a separator for its child nodes
1.
|
https://en.wikipedia.org/wiki/B-tree
|
There are two special cases to consider when deleting an element:
1. The element in an internal node is a separator for its child nodes
1. Deleting an element may put its node under the minimum number of elements and children
The procedures for these cases are in order below.
#### Deletion from a leaf node
1. Search for the value to delete.
1. If the value is in a leaf node, simply delete it from the node.
1. If underflow happens, rebalance the tree as described in section "
#### Rebalancing after deletion
" below.
#### Deletion from an internal node
Each element in an internal node acts as a separation value for two subtrees, therefore we need to find a replacement for separation. Note that the largest element in the left subtree is still less than the separator. Likewise, the smallest element in the right subtree is still greater than the separator. Both of those elements are in leaf nodes, and either one can be the new separator for the two subtrees. Algorithmically described below:
1. Choose a new separator (either the largest element in the left subtree or the smallest element in the right subtree), remove it from the leaf node it is in, and replace the element to be deleted with the new separator.
1.
|
https://en.wikipedia.org/wiki/B-tree
|
Choose a new separator (either the largest element in the left subtree or the smallest element in the right subtree), remove it from the leaf node it is in, and replace the element to be deleted with the new separator.
1. The previous step deleted an element (the new separator) from a leaf node. If that leaf node is now deficient (has fewer than the required number of nodes), then rebalance the tree starting from the leaf node.
Rebalancing after deletion
Rebalancing starts from a leaf and proceeds toward the root until the tree is balanced. If deleting an element from a node has brought it under the minimum size, then some elements must be redistributed to bring all nodes up to the minimum. Usually, the redistribution involves moving an element from a sibling node that has more than the minimum number of nodes. That redistribution operation is called a rotation. If no sibling can spare an element, then the deficient node must be merged with a sibling. The merge causes the parent to lose a separator element, so the parent may become deficient and need rebalancing. The merging and rebalancing may continue all the way to the root. Since the minimum element count doesn't apply to the root, making the root be the only deficient node is not a problem.
|
https://en.wikipedia.org/wiki/B-tree
|
The merging and rebalancing may continue all the way to the root. Since the minimum element count doesn't apply to the root, making the root be the only deficient node is not a problem. The algorithm to rebalance the tree is as follows:
- If the deficient node's right sibling exists and has more than the minimum number of elements, then rotate left
- Copy the separator from the parent to the end of the deficient node (the separator moves down; the deficient node now has the minimum number of elements)
- Replace the separator in the parent with the first element of the right sibling (right sibling loses one node but still has at least the minimum number of elements)
- The tree is now balanced
- Otherwise, if the deficient node's left sibling exists and has more than the minimum number of elements, then rotate right
- Copy the separator from the parent to the start of the deficient node (the separator moves down; deficient node now has the minimum number of elements)
- Replace the separator in the parent with the last element of the left sibling (left sibling loses one node but still has at least the minimum number of elements)
- The tree is now balanced
-
|
https://en.wikipedia.org/wiki/B-tree
|
The algorithm to rebalance the tree is as follows:
- If the deficient node's right sibling exists and has more than the minimum number of elements, then rotate left
- Copy the separator from the parent to the end of the deficient node (the separator moves down; the deficient node now has the minimum number of elements)
- Replace the separator in the parent with the first element of the right sibling (right sibling loses one node but still has at least the minimum number of elements)
- The tree is now balanced
- Otherwise, if the deficient node's left sibling exists and has more than the minimum number of elements, then rotate right
- Copy the separator from the parent to the start of the deficient node (the separator moves down; deficient node now has the minimum number of elements)
- Replace the separator in the parent with the last element of the left sibling (left sibling loses one node but still has at least the minimum number of elements)
- The tree is now balanced
- Otherwise, if both immediate siblings have only the minimum number of elements, then merge with a sibling sandwiching their separator taken off from their parent
- Copy the separator to the end of the left node (the left node may be the deficient node or it may be the sibling with the minimum number of elements)
- Move all elements from the right node to the left node (the left node now has the maximum number of elements, and the right node – empty)
- Remove the separator from the parent along with its empty right child (the parent loses an element)
_
|
https://en.wikipedia.org/wiki/B-tree
|
Otherwise, if the deficient node's left sibling exists and has more than the minimum number of elements, then rotate right
- Copy the separator from the parent to the start of the deficient node (the separator moves down; deficient node now has the minimum number of elements)
- Replace the separator in the parent with the last element of the left sibling (left sibling loses one node but still has at least the minimum number of elements)
- The tree is now balanced
- Otherwise, if both immediate siblings have only the minimum number of elements, then merge with a sibling sandwiching their separator taken off from their parent
- Copy the separator to the end of the left node (the left node may be the deficient node or it may be the sibling with the minimum number of elements)
- Move all elements from the right node to the left node (the left node now has the maximum number of elements, and the right node – empty)
- Remove the separator from the parent along with its empty right child (the parent loses an element)
_ BLOCK0_Note: The rebalancing operations are different for B+ trees (e.g., rotation is different because parent has copy of the key) and B*-tree (e.g., three siblings are merged into two siblings).
|
https://en.wikipedia.org/wiki/B-tree
|
Otherwise, if both immediate siblings have only the minimum number of elements, then merge with a sibling sandwiching their separator taken off from their parent
- Copy the separator to the end of the left node (the left node may be the deficient node or it may be the sibling with the minimum number of elements)
- Move all elements from the right node to the left node (the left node now has the maximum number of elements, and the right node – empty)
- Remove the separator from the parent along with its empty right child (the parent loses an element)
_ BLOCK0_Note: The rebalancing operations are different for B+ trees (e.g., rotation is different because parent has copy of the key) and B*-tree (e.g., three siblings are merged into two siblings).
### Sequential access
While freshly loaded databases tend to have good sequential behaviour, this behaviour becomes increasingly difficult to maintain as a database grows, resulting in more random I/O and performance challenges.
### Initial construction
A common special case is adding a large amount of pre-sorted data into an initially empty B-tree. While it is quite possible to simply perform a series of successive inserts, inserting sorted data results in a tree composed almost entirely of half-full nodes. Instead, a special "bulk loading" algorithm can be used to produce a more efficient tree with a higher branching factor.
|
https://en.wikipedia.org/wiki/B-tree
|
While it is quite possible to simply perform a series of successive inserts, inserting sorted data results in a tree composed almost entirely of half-full nodes. Instead, a special "bulk loading" algorithm can be used to produce a more efficient tree with a higher branching factor.
When the input is sorted, all insertions are at the rightmost edge of the tree, and in particular any time a node is split, we are guaranteed that no more insertions will take place in the left half. When bulk loading, we take advantage of this, and instead of splitting overfull nodes evenly, split them as unevenly as possible: leave the left node completely full and create a right node with zero keys and one child (in violation of the usual B-tree rules).
At the end of bulk loading, the tree is composed almost entirely of completely full nodes; only the rightmost node on each level may be less than full. Because those nodes may also be less than half full, to re-establish the normal B-tree rules, combine such nodes with their (guaranteed full) left siblings and divide the keys to produce two nodes at least half full. The only node which lacks a full left sibling is the root, which is permitted to be less than half full.
|
https://en.wikipedia.org/wiki/B-tree
|
Because those nodes may also be less than half full, to re-establish the normal B-tree rules, combine such nodes with their (guaranteed full) left siblings and divide the keys to produce two nodes at least half full. The only node which lacks a full left sibling is the root, which is permitted to be less than half full.
## In filesystems
In addition to its use in databases, the B-tree (or ) is also used in filesystems to allow quick random access to an arbitrary block in a particular file. The basic problem is turning the file block
$$
i
$$
address into a disk block address.
Some operating systems require the user to allocate the maximum size of the file when the file is created. The file can then be allocated as contiguous disk blocks. In that case, to convert the file block address
$$
i
$$
into a disk block address, the operating system simply adds the file block address
$$
i
$$
to the address of the first disk block constituting the file. The scheme is simple, but the file cannot exceed its created size.
Other operating systems allow a file to grow. The resulting disk blocks may not be contiguous, so mapping logical blocks to physical blocks is more involved.
MS-DOS, for example, used a simple File Allocation Table (FAT).
|
https://en.wikipedia.org/wiki/B-tree
|
The resulting disk blocks may not be contiguous, so mapping logical blocks to physical blocks is more involved.
MS-DOS, for example, used a simple File Allocation Table (FAT). The FAT has an entry for each disk block, and that entry identifies whether its block is used by a file and if so, which block (if any) is the next disk block of the same file. So, the allocation of each file is represented as a linked list in the table. In order to find the disk address of file block
$$
i
$$
, the operating system (or disk utility) must sequentially follow the file's linked list in the FAT. Worse, to find a free disk block, it must sequentially scan the FAT. For MS-DOS, that was not a huge penalty because the disks and files were small and the FAT had few entries and relatively short file chains. In the FAT12 filesystem (used on floppy disks and early hard disks), there were no more than 4,080 entries, and the FAT would usually be resident in memory. As disks got bigger, the FAT architecture began to confront penalties. On a large disk using FAT, it may be necessary to perform disk reads to learn the disk location of a file block to be read or written.
TOPS-20 (and possibly TENEX) used a 0 to 2 level tree that has similarities to a B-tree.
|
https://en.wikipedia.org/wiki/B-tree
|
On a large disk using FAT, it may be necessary to perform disk reads to learn the disk location of a file block to be read or written.
TOPS-20 (and possibly TENEX) used a 0 to 2 level tree that has similarities to a B-tree. A disk block was 512 36-bit words. If the file fit in a 512 (29) word block, then the file directory would point to that physical disk block. If the file fit in 218 words, then the directory would point to an aux index; the 512 words of that index would either be NULL (the block isn't allocated) or point to the physical address of the block. If the file fit in 227 words, then the directory would point to a block holding an aux-aux index; each entry would either be NULL or point to an aux index. Consequently, the physical disk block for a 227 word file could be located in two disk reads and read on the third.
Apple's filesystem HFS+ and APFS, Microsoft's NTFS, AIX (jfs2) and some Linux filesystems, such as Bcachefs, Btrfs and ext4, use B-trees.
B*-trees are used in the HFS and Reiser4 file systems.
DragonFly BSD's HAMMER file system uses a modified B+-tree.
## Performance
A B-tree grows slower with growing data amount, than the linearity of a linked list.
|
https://en.wikipedia.org/wiki/B-tree
|
DragonFly BSD's HAMMER file system uses a modified B+-tree.
## Performance
A B-tree grows slower with growing data amount, than the linearity of a linked list. Compared to a skip list, both structures have the same performance, but the B-tree scales better for growing n. A T-tree, for main memory database systems, is similar but more compact.
## Variations
### Access concurrency
Lehman and Yao showed that all the read locks could be avoided (and thus concurrent access greatly improved) by linking the tree blocks at each level together with a "next" pointer. This results in a tree structure where both insertion and search operations descend from the root to the leaf. Write locks are only required as a tree block is modified. This maximizes access concurrency by multiple users, an important consideration for databases and/or other B-tree-based ISAM storage methods. The cost associated with this improvement is that empty pages cannot be removed from the btree during normal operations. (However, see for various strategies to implement node merging, and source code at.)
United States Patent 5283894, granted in 1994, appears to show a way to use a 'Meta Access Method' to allow concurrent B+ tree access and modification without locks.
|
https://en.wikipedia.org/wiki/B-tree
|
(However, see for various strategies to implement node merging, and source code at.)
United States Patent 5283894, granted in 1994, appears to show a way to use a 'Meta Access Method' to allow concurrent B+ tree access and modification without locks. The technique accesses the tree 'upwards' for both searches and updates by means of additional in-memory indexes that point at the blocks in each level in the block cache. No reorganization for deletes is needed and there are no 'next' pointers in each block as in Lehman and Yao.
### Parallel algorithms
Since B-trees are similar in structure to red-black trees, parallel algorithms for red-black trees can be applied to B-trees as well.
### Maple tree
A Maple tree is a B-tree developed for use in the Linux kernel to reduce lock contention in virtual memory management.
### (a,b)-tree
(a,b)-trees are generalizations of B-trees. B-trees require that each internal node have a minimum of
$$
\lfloor K / 2 \rfloor + 1
$$
children and a maximum of
$$
K
$$
children, for some preset value of
$$
K
$$
. In contrast, an (a,b)-tree allows the minimum number of children for an internal node to be set arbitrarily low.
|
https://en.wikipedia.org/wiki/B-tree
|
B-trees require that each internal node have a minimum of
$$
\lfloor K / 2 \rfloor + 1
$$
children and a maximum of
$$
K
$$
children, for some preset value of
$$
K
$$
. In contrast, an (a,b)-tree allows the minimum number of children for an internal node to be set arbitrarily low. In an (a,b)-tree, each internal node has between and children, for some preset values of and .
|
https://en.wikipedia.org/wiki/B-tree
|
In abstract rewriting, an object is in normal form if it cannot be rewritten any further, i.e. it is irreducible. Depending on the rewriting system, an object may rewrite to several normal forms or none at all. Many properties of rewriting systems relate to normal forms.
## Definitions
Stated formally, if (A,→) is an abstract rewriting system, x∈A is in normal form if no y∈A exists such that x→y, i.e. x is an irreducible term.
An object a is weakly normalizing if there exists at least one particular sequence of rewrites starting from a that eventually yields a normal form. A rewriting system has the weak normalization property or is (weakly) normalizing (WN) if every object is weakly normalizing. An object a is strongly normalizing if every sequence of rewrites starting from a eventually terminates with a normal form. A rewriting system is strongly normalizing, terminating, noetherian, or has the (strong) normalization property (SN), if each of its objects is strongly normalizing.
A rewriting system has the normal form property (NF) if for all objects a and normal forms b, b can be reached from a by a series of rewrites and inverse rewrites only if a reduces to b.
|
https://en.wikipedia.org/wiki/Normal_form_%28abstract_rewriting%29
|
A rewriting system is strongly normalizing, terminating, noetherian, or has the (strong) normalization property (SN), if each of its objects is strongly normalizing.
A rewriting system has the normal form property (NF) if for all objects a and normal forms b, b can be reached from a by a series of rewrites and inverse rewrites only if a reduces to b. A rewriting system has the unique normal form property (UN) if for all normal forms a, b ∈ S, a can be reached from b by a series of rewrites and inverse rewrites only if a is equal to b. A rewriting system has the unique normal form property with respect to reduction (UN→) if for every term reducing to normal forms a and b, a is equal to b.
## Results
This section presents some well known results. First, SN implies WN.
Confluence (abbreviated CR) implies NF implies UN implies UN→. The reverse implications do not generally hold. {a→b,a→c,c→c,d→c,d→e} is UN→ but not UN as b=e and b,e are normal forms.
|
https://en.wikipedia.org/wiki/Normal_form_%28abstract_rewriting%29
|
The reverse implications do not generally hold. {a→b,a→c,c→c,d→c,d→e} is UN→ but not UN as b=e and b,e are normal forms. {a→b,a→c,b→b} is UN but not NF as b=c, c is a normal form, and b does not reduce to c. {a→b,a→c,b→b,c→c} is NF as there are no normal forms, but not CR as a reduces to b and c, and b,c have no common reduct.
WN and UN→ imply confluence. Hence CR, NF, UN, and UN→ coincide if WN holds.
## Examples
One example is that simplifying arithmetic expressions produces a number - in arithmetic, all numbers are normal forms.
|
https://en.wikipedia.org/wiki/Normal_form_%28abstract_rewriting%29
|
Hence CR, NF, UN, and UN→ coincide if WN holds.
## Examples
One example is that simplifying arithmetic expressions produces a number - in arithmetic, all numbers are normal forms. A remarkable fact is that all arithmetic expressions have a unique value, so the rewriting system is strongly normalizing and confluent:
(3 + 5) * (1 + 2) ⇒ 8 * (1 + 2) ⇒ 8 * 3 ⇒ 24
(3 + 5) * (1 + 2) ⇒ (3 + 5) * 3 ⇒ 3*3 + 5*3 ⇒ 9 + 5*3 ⇒ 9 + 15 ⇒ 24
Examples of non-normalizing systems (not weakly or strongly) include counting to infinity (1 ⇒ 2 ⇒ 3 ⇒ ...) and loops such as the transformation function of the Collatz conjecture (1 ⇒ 2 ⇒ 4 ⇒ 1 ⇒ ..., it is an open problem if there are any other loops of the Collatz transformation). Another example is the single-rule system { r(x,y) → r(y,x) }, which has no normalizing properties since from any term, e.g. r(4,2) a single rewrite sequence starts, viz. r(4,2) → r(2,4) → r(4,2) → r(2,4) → ..., which is infinitely long. This leads to the idea of rewriting "modulo commutativity" where a term is in normal form if no rules but commutativity apply.
|
https://en.wikipedia.org/wiki/Normal_form_%28abstract_rewriting%29
|
Another example is the single-rule system { r(x,y) → r(y,x) }, which has no normalizing properties since from any term, e.g. r(4,2) a single rewrite sequence starts, viz. r(4,2) → r(2,4) → r(4,2) → r(2,4) → ..., which is infinitely long. This leads to the idea of rewriting "modulo commutativity" where a term is in normal form if no rules but commutativity apply.
The system {b → a, b → c, c → b, c → d} (pictured) is an example of a weakly normalizing but not strongly normalizing system. a and d are normal forms, and b and c can be reduced to a or d, but the infinite reduction b → c → b → c → ... means that neither b nor c is strongly normalizing.
### Untyped lambda calculus
The pure untyped lambda calculus does not satisfy the strong normalization property, and not even the weak normalization property. Consider the term
$$
\lambda x . x x x
$$
(application is left associative).
|
https://en.wikipedia.org/wiki/Normal_form_%28abstract_rewriting%29
|
It has the following rewrite rule: For any term
$$
t
$$
,
$$
(\mathbf{\lambda} x . x x x) t \rightarrow t t t
$$
But consider what happens when we apply
$$
\lambda x . x x x
$$
to itself:
$$
\begin{align}
(\mathbf{\lambda} x . x x x) (\lambda x . x x x)
& \rightarrow (\mathbf{\lambda} x . x x x) (\lambda x . x x x) (\lambda x . x x x)
\\
& \rightarrow (\mathbf{\lambda} x . x x x) (\lambda x . x x x) (\lambda x . x x x) (\lambda x . x x x)
\\
& \rightarrow (\mathbf{\lambda} x . x x x) (\lambda x . x x x) (\lambda x . x x x) (\lambda x . x x x) (\lambda x . x x x)
\\
& \rightarrow \ \cdots\,
\end{align}
$$
Therefore, the term
$$
(\lambda x . x x x) (\lambda x . x x x)
$$
is not strongly normalizing.
|
https://en.wikipedia.org/wiki/Normal_form_%28abstract_rewriting%29
|
And this is the only reduction sequence, hence it is not weakly normalizing either.
### Typed lambda calculus
Various systems of typed lambda calculus including the
simply typed lambda calculus, Jean-Yves Girard's System F, and Thierry Coquand's calculus of constructions are strongly normalizing.
A lambda calculus system with the normalization property can be viewed as a programming language with the property that every program terminates. Although this is a very useful property, it has a drawback: a programming language with the normalization property cannot be Turing complete, otherwise one could solve the halting problem by seeing if the program type checks. This means that there are computable functions that cannot be defined in the simply typed lambda calculus, and similarly for the calculus of constructions and System F. A typical example is that of a self-interpreter in a total programming language.
|
https://en.wikipedia.org/wiki/Normal_form_%28abstract_rewriting%29
|
In statistical mechanics, a microstate is a specific configuration of a system that describes the precise positions and momenta of all the individual particles or components that make up the system. Each microstate has a certain probability of occurring during the course of the system's thermal fluctuations.
In contrast, the macrostate of a system refers to its macroscopic properties, such as its temperature, pressure, volume and density. Treatments on statistical mechanics define a macrostate as follows: a particular set of values of energy, the number of particles, and the volume of an isolated thermodynamic system is said to specify a particular macrostate of it. In this description, microstates appear as different possible ways the system can achieve a particular macrostate.
A macrostate is characterized by a probability distribution of possible states across a certain statistical ensemble of all microstates. This distribution describes the probability of finding the system in a certain microstate. In the thermodynamic limit, the microstates visited by a macroscopic system during its fluctuations all have the same macroscopic properties.
In a quantum system, the microstate is simply the value of the wave function.
## Microscopic definitions of thermodynamic concepts
Statistical mechanics links the empirical thermodynamic properties of a system to the statistical distribution of an ensemble of microstates.
|
https://en.wikipedia.org/wiki/Microstate_%28statistical_mechanics%29
|
In a quantum system, the microstate is simply the value of the wave function.
## Microscopic definitions of thermodynamic concepts
Statistical mechanics links the empirical thermodynamic properties of a system to the statistical distribution of an ensemble of microstates. All macroscopic thermodynamic properties of a system may be calculated from the partition function that sums
$$
\text{exp}(-E_i/k_\text{B} T)
$$
of all its microstates.
At any moment a system is distributed across an ensemble of
$$
\Omega
$$
microstates, each labeled by
$$
i
$$
, and having a probability of occupation
$$
p_i
$$
, and an energy
$$
E_i
$$
. If the microstates are quantum-mechanical in nature, then these microstates form a discrete set as defined by quantum statistical mechanics, and
$$
E_i
$$
is an energy level of the system.
### Internal energy
The internal energy of the macrostate is the mean over all microstates of the system's energy
$$
U \,:=\, \langle E\rangle \,=\, \sum\limits_{i=1}^\Omega p_i \, E_i
$$
This is a microscopic statement of the notion of energy associated with the first law of thermodynamics.
|
https://en.wikipedia.org/wiki/Microstate_%28statistical_mechanics%29
|
If the microstates are quantum-mechanical in nature, then these microstates form a discrete set as defined by quantum statistical mechanics, and
$$
E_i
$$
is an energy level of the system.
### Internal energy
The internal energy of the macrostate is the mean over all microstates of the system's energy
$$
U \,:=\, \langle E\rangle \,=\, \sum\limits_{i=1}^\Omega p_i \, E_i
$$
This is a microscopic statement of the notion of energy associated with the first law of thermodynamics.
### Entropy
For the more general case of the canonical ensemble, the absolute entropy depends exclusively on the probabilities of the microstates and is defined as
$$
S \,:=\, -k_\text{B} \sum\limits_{i=1}^\Omega p_i \, \ln (p_i)
$$
where
$$
k_\text{B}
$$
is the Boltzmann constant. For the microcanonical ensemble, consisting of only those microstates with energy equal to the energy of the macrostate, this simplifies to
$$
S = k_B\,\ln \Omega
$$
with the number of microstates
$$
\Omega = 1/p_i
$$
.
|
https://en.wikipedia.org/wiki/Microstate_%28statistical_mechanics%29
|
### Entropy
For the more general case of the canonical ensemble, the absolute entropy depends exclusively on the probabilities of the microstates and is defined as
$$
S \,:=\, -k_\text{B} \sum\limits_{i=1}^\Omega p_i \, \ln (p_i)
$$
where
$$
k_\text{B}
$$
is the Boltzmann constant. For the microcanonical ensemble, consisting of only those microstates with energy equal to the energy of the macrostate, this simplifies to
$$
S = k_B\,\ln \Omega
$$
with the number of microstates
$$
\Omega = 1/p_i
$$
. This form for entropy appears on Ludwig Boltzmann's gravestone in Vienna.
The second law of thermodynamics describes how the entropy of an isolated system changes in time. The third law of thermodynamics is consistent with this definition, since zero entropy means that the macrostate of the system reduces to a single microstate.
### Heat and work
Heat and work can be distinguished if we take the underlying quantum nature of the system into account.
|
https://en.wikipedia.org/wiki/Microstate_%28statistical_mechanics%29
|
The third law of thermodynamics is consistent with this definition, since zero entropy means that the macrostate of the system reduces to a single microstate.
### Heat and work
Heat and work can be distinguished if we take the underlying quantum nature of the system into account.
For a closed system (no transfer of matter), heat in statistical mechanics is the energy transfer associated with a disordered, microscopic action on the system, associated with jumps in occupation numbers of the quantum energy levels of the system, without change in the values of the energy levels themselves.
Work is the energy transfer associated with an ordered, macroscopic action on the system. If this action acts very slowly, then the adiabatic theorem of quantum mechanics implies that this will not cause jumps between energy levels of the system. In this case, the internal energy of the system only changes due to a change of the system's energy levels.
|
https://en.wikipedia.org/wiki/Microstate_%28statistical_mechanics%29
|
If this action acts very slowly, then the adiabatic theorem of quantum mechanics implies that this will not cause jumps between energy levels of the system. In this case, the internal energy of the system only changes due to a change of the system's energy levels.
The microscopic, quantum definitions of heat and work are the following:
$$
\begin{align}
\delta W &= \sum_{i=1}^N p_i \, dE_i \\
\delta Q &= \sum_{i=1}^N E_i \, dp_i
\end{align}
$$
so that
$$
~dU = \delta W + \delta Q.
$$
The two above definitions of heat and work are among the few expressions of statistical mechanics where the thermodynamic quantities defined in the quantum case find no analogous definition in the classical limit. The reason is that classical microstates are not defined in relation to a precise associated quantum microstate, which means that when work changes the total energy available for distribution among the classical microstates of the system, the energy levels (so to speak) of the microstates do not follow this change.
## The microstate in phase space
|
https://en.wikipedia.org/wiki/Microstate_%28statistical_mechanics%29
|
## The microstate in phase space
### Classical phase space
The description of a classical system of F degrees of freedom may be stated in terms of a 2F dimensional phase space, whose coordinate axes consist of the F generalized coordinates qi of the system, and its F generalized momenta pi. The microstate of such a system will be specified by a single point in the phase space. But for a system with a huge number of degrees of freedom its exact microstate usually is not important. So the phase space can be divided into cells of the size h0 = ΔqiΔpi, each treated as a microstate. Now the microstates are discrete and countable and the internal energy U has no longer an exact value but is between U and U+δU, with
$$
\delta U\ll U
$$
.
The number of microstates Ω that a closed system can occupy is proportional to its phase space volume:
$$
\Omega(U) = \frac{1}{h_0^\mathcal{F}} \int \mathbf{1}_{\delta U}(H(x)-U) \prod_{i=1}^\mathcal{F} dq_i dp_i
$$
where
$$
\mathbf{1}_{\delta U}(H(x)-U)
$$
is an Indicator function.
|
https://en.wikipedia.org/wiki/Microstate_%28statistical_mechanics%29
|
Now the microstates are discrete and countable and the internal energy U has no longer an exact value but is between U and U+δU, with
$$
\delta U\ll U
$$
.
The number of microstates Ω that a closed system can occupy is proportional to its phase space volume:
$$
\Omega(U) = \frac{1}{h_0^\mathcal{F}} \int \mathbf{1}_{\delta U}(H(x)-U) \prod_{i=1}^\mathcal{F} dq_i dp_i
$$
where
$$
\mathbf{1}_{\delta U}(H(x)-U)
$$
is an Indicator function. It is 1 if the Hamilton function H(x) at the point x = (q,p) in phase space is between U and U+ δU and 0 if not. The constant
$$
{1}/{h_0^\mathcal{F}}
$$
makes Ω(U) dimensionless. For an ideal gas is
$$
\Omega (U)\propto\mathcal{F}U^{\frac{\mathcal{F}}{2}-1}\delta U
$$
.
In this description, the particles are distinguishable.
|
https://en.wikipedia.org/wiki/Microstate_%28statistical_mechanics%29
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.