{'fraction_non_alphanumeric': 0.03075453677172875, 'fraction_numerical': 0.006876790830945559, 'mean_word_length': 4.949005681818182, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Similarity Analysis of Macroecology

We perform a full similarity analysis of an idealized ecosystem using Buckingham's $\Pi$ theorem to obtain dimensionless similarity parameters given that some (non- unique) method exists that can differentiate different functional groups of individuals within an ecosystem. We then obtain the relationship between the similarity parameters under the assumptions of (i) that the ecosystem is in a dynamically balanced steady state and (ii) that these functional groups are connected to each other by the flow of resource. The expression that we obtain relates the level of complexity that the ecosystem can support to intrinsic macroscopic variables such as density, diversity and characteristic length scales for foraging or dispersal, and extrinsic macroscopic variables such as habitat size and the rate of supply of resource. This expression relates these macroscopic variables to each other, generating commonly observed macroecological patterns; these broad trends simply reflect the similarity property of ecosystems. We thus find that details of the ecosystem function are not required to obtain these broad macroecological patterns this may explain why they are ubiquitous. Departures from our relationship may indicate that the ecosystem is in a state of rapid change, i.e., abundance or diversity explosion or collapse. Our result provides normalised variables that can be used to isolate the trend in one ecosystem variable from another, providing a new method for isolating macroecological patterns in data. A dimensionless control parameter for ecosystem complexity emerges from our analysis and this will be a control parameter in dynamical models for ecosystems based on energy flow and conservation and will order the emergent behaviour of these models.

the relationship between the similarity parameters under the assumptions of (i) that the ecosystem is in a dynamically balanced steady state and (ii) that these functional groups are connected to each other by the flow of resource. The expression that we obtain relates the level of complexity that the ecosystem can support to intrinsic macroscopic variables such as density, diversity and characteristic length scales for foraging or dispersal, and extrinsic macroscopic variables such as habitat size and the rate of supply of resource. This expression relates these macroscopic variables to each other, generating commonly observed macroecological patterns; these broad trends simply reflect the similarity property of ecosystems. We thus find that details of the ecosystem function are not required to obtain these broad macroecological patterns this may explain why they are ubiquitous. Departures from our relationship may indicate that the ecosystem is in a state of rapid change, i.e., abundance or diversity explosion or collapse. Our result provides normalised variables that can be used to isolate the trend in one ecosystem variable from another, providing a new method for isolating macroecological patterns in data. A dimensionless control parameter for ecosystem complexity emerges from our analysis and this will be a control parameter in dynamical models for ecosystems based on energy flow and conservation and will order the emergent behaviour of these models.

I. INTRODUCTION
The rapid increase in the availability of large-scale ecological data [1,2] has increased knowledge of global patterns and stimulated the search for the underlying processes that determine them (see [3]). Examples of the large-scale, macroecological, patterns [4] to have emerged from empirical analyses include the species-area and the species-latitude relationships, and trends in density and diversity with body size. These are broad scale patterns and generalised rules rather than mechanistic processes, and a range of theories have been proposed to explain why these patterns emerge. This has led to the development of a perspective in which the detailed biological characteristics of the species (traits) do not determine their abundance and that the processes affecting community structure can be considered as neutral [5][6][7], see also [8,9]. The fact that these patterns are both approximate and ubiquitous, suggests that they do not reflect the details of how ecosystems operate, rather that they emerge from underlying general constraints.
The diversity seen throughout ecology has meant that the very possibility of existence of universal laws remains controversial [10][11][12]. In stark contrast, universal laws are an essential feature of physics. One reason for this dichotomy is the covariance principle, which asserts that the laws of physics can be represented in a form equally valid for all observers [13][14][15][16]. Any physical principles relevant to a classical natural system thus cannot depend on arbitrarily chosen units [17] i.e. they must be expressible in terms of dimensionless parameters which are invariant under a change of fundamental units of measurement. It implies that the functions describing the behaviour of a system must have arguments which are dimensionless quantities, known as "similarity parameters" Π i [15,18]. Underpinning even this is a deeper classical measurement postulate, that of the possibility of controllable, repeatable, and observer-independent measurement. Furthermore in physics the existence of symmetries gives rise to conservation principles governing the relationship between physical quantities. Such conservation properties will constrain the relationships which can exist between the Π i , and will therefore give rise to patterns in these quantities. Ecological patterns are seen and measured in a range of quantities, some of which have physical units.
A natural question [19,20], that we address here, then arises: to what extent do physical processes determine the major trends observed in macroecology?
We now briefly review the essential idea of similarity analysis with reference to a well known example in fluid dynamics. Figure 1 shows two realizations of a von Karman vortex "street". These are on quite different scales, they are (a) cloud bearing airflow over an island at sea and (b) a laboratory based experiment in water (for experiments of this type, see [21]). The full dynamics is strongly non-linear and the functional form of the observed vortex street pattern is non-trivial to obtain. Nevertheless, we can see that these patterns are quite similar and we can characterize the vortex street by two lengthscales, the width of the pattern, or the obstacle around which the fluid is flowing (L o ), and the distance downstream between successive vortices (L d ). Figure 1 (a) and (b) look similar because the ratio of these lengthscales, L o /L d is similar, despite the fact that L o is tens of kilometers for the island, and is millimeters to centimeters in size in the laboratory. The ratio L o /L d is just the dimensionless Strouhal number, S = f L o /U in fluid dynamics, since L d = U/f where U is the background flow speed and f is the frequency at which vortices are shed at the obstacle (in air, the "aeolian tone"). Clearly, L o and L d , (or L 0 , U and f ) are governing parameters that characterize the observed vortex street pattern that is formed, with a corresponding dimensionless similarity parameter that is just the Strouhal number. The question that arises is, what determines this observed pattern, specifically, why are these two situations at very different spatial scales, similar? Now, there are other governing parameters for fluid flow.
A dimensionless parameter involving ν, is R e = UL o /ν, the Reynolds number. If there are no other governing parameters, then the observed vortex street pattern, specifically, its Strouhal number, can only depend upon the Reynolds number, that is, S = F (R e ) [22]. This result can be tested experimentally by plotting S versus R e . Such a plot reveals that the Strouhal number has only weak dependence on the Reynolds number for R e ∼ 10 3 − 10 6 , for which S ∼ 0.2. This is approximately what we see on Figure 1 where the Reynolds numbers are at either end of this range.
Rayleigh [22] used similarity analysis to obtain the similarity parameters R e and S for the vortex street without obtaining a model or mathematical form for the detailed nonlinear function that describes them. The origin of the precise functional relationship between R e and S (S = F (R e )) remains a topic of current research [23,24]. Notably, Rayleigh's procedure [25] was to (i) identify the similarity parameters, R e and S then (ii) note that these parameters ordered the experimental data and finally (iii) propose an approximate form for F that modeled the observed dependence of S upon R e . An important corollary of Rayleigh's result is that the observations, when plotted in dimensional units, will show patterns or trends, for example, the frequency f will increase linearly with flow speed U, for a given size obstacle. Furthermore, if data from a number of experiments with different obstacle size are aggregated, such a plot will still show this trend, but with considerable scatter. Any organizing principle based on physical properties will thus only clearly emerge if the dataset is plotted in terms of dimensionless similarity parameters. In this paper we will perform this important first step, we will obtain similarity parameters for ecosystems. This will suggest a new method to test this data for such organizing principles, and we suggest may explain observed macroecological patterns or trends. Importantly, similarity does not presuppose self-similarity but does encompass it. Selfsimilarity is the property of generalized power law dependence where there is no characteristic scale, (e.g [15] pp 86ff; [26]). Scaling relationships between subsets of observed macroecological variables have been proposed (see e.g. [28,29]) and self-similarity is intrin-sic to some models of metabolism, dispersal and foraging [30]. Although an important topic, self-similarity is an extra assumption that we do not need to make here, and are not making.
Although most familiar in physics and engineering [16], the application of dimensional techniques to biological problems dates back to Galileo's application of similarity arguments to the load bearing capacity of bones [31]. Dimensional arguments find widespread application in the scaling of numerical simulations in biology, as elsewhere. By contrast, as noted by [19] and more recently [20], only very limited explorations have been made so far of the use of full similarity analysis to codify the set of possible relationships between macroscopic variables in ecology. An interesting exception was the conjecture [32] that "life-like processes [might] require a flux of energy above some minimal value in order to get going and keep going". Lovelock made an explicit analogy with the observation by "Reynolds that turbulent eddies in gases and liquids could only form if the rate of flow was above some critical value in relation to local conditions." In this paper we will perform such a similarity analysis of macroecological variables.
Rather than exploiting statistical constraints as in maximum entropy inference [6,[33][34][35], we focus on physical and dimensional constraints and how these in turn constrain the relationships that can exist between intrinsic variables such as density, diversity and characteristic lengthscales for foraging or dispersal, and extrinsic variables such as habitat size and the rate of supply of resource.
The starting point in any similarity analysis is to identify the 'governing parameters' [15], that is, the variables or quantities that are necessary for any description of the system. Similarity analysis in essence takes these governing parameters as its input, and as its output identifies the dimensionless similarity parameters. Here, we will use the extensive body of observations in macroecology to specify a set of governing parameters. Importantly, these parameters encompass both size based and species based approaches [36] to describing an ecosystem. They are intrinsic variables such as the diversity of species (richness), the density of individuals, characteristic length scales for foraging or dispersal, metabolic rate, and extrinsic variables such as habitat size and the rate of supply of resource. Provided that the governing parameters have physical dimension (dimensional units), similarity analysis constrains the possible relationships that can exist between them. The functional relationships we obtain here are between dimensional quantities, which in practice tend to arise from approaches which focus on flows of materials and energy through the ecosystem.
Similarity analysis does not specify a unique relationship between these parameters. We can only obtain this if in addition there are known physical constraints, such as conservation principles. The flow of energy and resource has been one of several key threads of ecosystem analysis [37] since for example the work of Lotka, Lindeman and the Odums [38][39][40]. The physical constraint that is central to this paper is that we consider ecosystems which adapt dynamically to changes in external parameters to maintain a balance between the rate of uptake and of utilization of resources taken over the ecosystem as a whole. This is our key assumption. This does not mean that the system is in a fixed state, only that over the time scales being considered the inputs/outputs are balanced and this balance constrains the overall structure and functioning of the ecosystem. The concept of ecosystems which compensate dynamically to remain in homeostasis has been explored previously [41,42] but not developed using dimensional analysis.
In this paper we adopt the formal definition of an ecosystem; that the different functional groups of individuals within the ecosystem are connected to each other by the flow of resource. All individuals within the ecosystem ultimately derive resource from that taken up by that ecosystem's primary producers. We assume that the ecosystem is in a dynamically balanced steady state in that the total rate of uptake of resource is just balanced by the rate summed over the ecosystem at which it is utilized. We will show that this is sufficient to obtain an expression that constrains the relationships that can exist between these (dimensional) ecosystem variables. We will see that this constraint is reflected in overall macroecological trends that are observed. Further, we obtain the relationship between these trends. At minimum this determines for the first time the dimensionless, or normalised variables that isolate trends in one ecosystem variable from another. This new method for isolating macroecological trends provides the basis for understanding dependencies between factors such as size and metabolic rate that quantify the flow of resource, and factors that categorize individuals into distinct species and types. The more resource that is available, the more complex an ecosystem can in principle be, in the sense that more distinct species and types, and relationships between them, can be supported. At maximum, we obtain a dimensionless control parameter and relate it to this level of complexity that the ecosystem can support. This points towards 'thresholds for life', that is, a parametrization of the minimum level of complexity that can potentially be supported by an ecosystem in dynamic balance.
Process based models of ecosystems that aim to predict macroecological patterns tend to fall into two approaches. The first of these relates area, diversity and abundance by means of models for dispersal, occupancy and coexistence/competition and speciation in physical space (see e.g. [3,7,43,44]). The second relates abundance, body mass and metabolic rate by means of models and constraints for the availability and flow of resource ( [28], see the review of [29]). The relationship that we obtain here links the key parameters of both these approaches, suggesting a synthesis of them. It is important to emphasize at the outset that we do not present a theory of how ecosystems work, nor do we develop an ecosystem model.
Rather we use formal similarity analysis to explore the constraints that must operate on the variables observed in real ecosystems, given the single key assumption of balance between the ecosystem summed rates of resource uptake and utilization.
As noted above many of the specific relationships between variables that we examine are known and been explored [4][5][6][7]. These include the species-area, species-latitude and productivity-diversity relationships. The major insight we provide is to show how these different relationships are related and under what conditions they will emerge. We also show that they are an expected consequence of the physical constraints on the system.

II. SIMILARITY ANALYSIS AND A BOTTOM UP-APPROACH TO AN ECOSYSTEM
The Π theorem formalises the principle of similitude as follows. Any physical system that depends upon V variables, (the governing parameters), Q 1 , Q 2 , ..Q V will have a function F that relates them: [15]. The physical system that we discuss here is that which captures general physical aspects of ecosystem function, specifically the uptake and utilization of resource. The essential idea of similarity analysis is that this function can only depend upon dimensionless similarity only. These dimensionless parameters Π 1..M (Q 1..V ) are formed directly from the governing parameters Q 1 , Q 2 , ..Q V . Similarity analysis as in Buckingham's Π theorem ( [13][14][15], see also [45]) is simply the process to obtain the similarity parameters, that is, these dimensionless groups of variables. If one then has additional information about the system, such as a conservation property, the Π 1..M (Q 1..V ) can be related to each other to make F explicit. If the V governing parameters Q 1..V are expressed in W physical dimensions (i.e. mass, length, time) then from [13] there will be at least M = V − W dimensionless similarity parameters or groups Π 1..M (Q 1..V ) which we now progressively identify.
We will build our understanding by first considering the simplest possible idealized ecosystem and then successively increasing the level of complexity; at each stage, additional governing parameters (ecosystem variables) are introduced. Our approach is to use similarity analysis at each stage to find the constraints that act on this general description of an ecosystem. Importantly, we seek to describe an 'observed macroscopic ecosystem', that is, the variables that we will ultimately identify include observed intrinsic properties such as density, diversity, body size, and metabolic rate. Introducing progressively more specific detail inevitably introduces more governing parameters-this procedure could be taken further to explore specific detailed ecosystem models by the input of more detailed ecosystem functional properties into the dimensional analysis. Our aim here is rather to explore the ecosystem constraints that emerge for the minimum set of assumptions and model inputs.
These are related by the physical constraint that the system is in dynamical balance so that the rate at which energy is taken up over the ecosystem is the rate at which it is utilized, so that: which is Π 1 = Π 2 . This expression simply tracks the flow of energy into and through the ecosystem-it assumes that all other processes necessary for the ecosystem to function, such as the recycling of resources such as Nitrogen, occur. Introducing a typical metabolic rate for the single cell organisms has fixed an energetic minimum threshold for life which is Π 1 = 1, that is, one cell in the habitat (one cell ecosystem). B.
More than one kind of single cell organism.
We next consider single cell organisms that can be differentiated from each other, either by their function or their structure, or both. These would represent distinct types or species and different methods for categorizing and distinguishing individuals will yield different sets of species. What will follow will be independent of the precise details of this differentiation method, we only need assume that such a differentiation is now possible. A schematic of such a system is shown in Figure 2 (b). In the ecosystem there are S types (species) and there is a species label k = 1..S, the density of the k th species is n(k). We can always define an average density of the single cell organisms: so that the variable n in (1) is now replaced byn and Π 2 =nL D . The additional variable S is dimensionless; so that we now have 6 governing parameters and 3 dimensions, and so 3 dimensionless similarity parameters with Π 3 = S. These are again related by the physical constraint that the system is in dynamical balance: multicellular organisms. There is a non-trivial correspondence between average size B(p) and how complex an organism can be. Within each p there will be a number k = 1..S(p) of differentiable species each with density n(k, p) all with average body size B(p) and with average density, for that p of Our governing parameters, density and diversity, are now taken to relate to the observation of a given category p * that is embedded in the ecosystem; we observe n * =n(p * ), S * = S(p * ). Individuals in the observed category also have a characteristic average size B * = B(p * ) (number of cells so dimensionless) which introduces an additional governing parameter giving a total of 7 governing parameters and hence 4 dimensionless similarity parameters: The physical constraint of a dynamically balanced ecosystem is now: We can write (7) in terms of our observed p th * category: We then have an expression of the form: where Ψ(p * ) is a dimensionless function; 1/(Ψ(p * )) is the fraction of the total rate of resource supplied to the ecosystem that is utilized by the observed (p th * ) category. Importantly, all of the species and categories are connected into the same resource flow, so that fundamentally, (9) will constrain how observed density, diversity and body size are related to each other across the ecosystem, with consequences for macroecological patterns as we will discuss.
These dimensionless similarity parameters (6), and their relationship (9)  Generally, organisms will not be uniformly distributed in space so that the observed density depends on the length scale r over which it is observed, so that n = n(r, k, p) and similarly, the efficiency of the primary producers, which depends on their density, is α = α(r).
The lengthscale over which the density varies can either arise from how individuals subdivide and grow, forage, or other forms of influence they have on each other and on the environment. This is important since in (7-9) the density refers to that measured over the habitat of the entire ecosystem on scale L and any observation will be on a more local scale r << L, which in turn relates to the lengthscale of over which the density varies. This will introduce a variable for the scale of observation of the p th * category; r * (dimension [L]) finally giving 8 governing parameters so 5 dimensionless similarity parameters: where α * = α(r * ) so that all variables refer to a consistent set of observations on lengthscale r * . The density can be generally expressed as n(r, k, p) = n(L, k, p)/g(k, p, r/L) where g is dimensionless and expresses the spatial variation of the p th category; similarly α(r) = α(L)/g α (r/L). If the categorization p is based on function and structure then one can anticipate that an average of g over the S(p) species in the category is meaningful so that: n(r, p) =< n(r, k, p) > k = 1 S(p) If we explicitly reference lengthscale L, expression (8) for a consistent set of observations for all p categories on the same lengthscale r * this is: or writing the spatial variation in a single function G(r/L) =ḡ(r/L)/g α (r/L) Spatial variation in density thus leads to spatial trends in diversity, or species-area rules; this has arisen quite generally as a consequence of the physical constraint (14) and we will discuss this next.
Essentially, (14) is: The dimensionless functions Ψ and G contain all the details of the ecosystem function; Ψ encapsulates the details of how individuals in the ecosystem are categorized and G the details of how these categories of individuals are dispersed in space. Our expressions (14) and (15)  Importantly, the function Ψ also incorporates the method of categorization. The complexity of an observed ecosystem inevitably depends in part on how the observed data are categorized. However, the observed values, i.e., the observed density, diversity and so forth of a given category, will depend on how the observer defines that category, i.e. what organisms are included in it. These ideas can be used to re-order the observations to understand the role played by how the data is categorized as we discuss in the appendix.
A physical analogy to this is the relationship between the Reynolds number in turbulence and the number of excited modes or degrees of freedom. The Reynolds number is the ratio of a rate of energy input on the largest, driving scale to a rate of energy dissipation on the smallest scale, as is Π 1 here, and similarity analysis, along with the assumption of steady state (no energy pile up) is sufficient (see eg [45]) to constrain the number of degrees of freedom to grow with increasing Reynolds number.

ACROSS ECOSYSTEMS
Observations both within and across ecosystems consist of specifying a method for classifying individuals into particular groups or categories and then for each of the p th categories, observing the average density, diversity, bodysize, and metabolic rate. From the constraint (14): we see that these variables are not independent, and (14) suggests relationships between them which we will now discuss.
Let us consider that a scheme for classifying individuals is consistently adopted, and observations of average density, diversity, bodysize, and metabolic rate of these categories are made. These observations simultaneously collect a range of values of n * , S * , B * for a given r * , L and P . We will first consider the case where 'similar' ecosystems are compared, or where a comparison is made within a single ecosystem, that is, the order parameter Ψ is not varying. Subsets of the variables in equation (14) will then show functional relationships, this has been found for example by [47,48] who demonstrate a relationship between species richness, area and a measure of productivity.
For 'similar' ecosystems then, expression (14) is result. This points to a need to isolate changes in one variable from another and we will provide a method for this.
We can formalize these constraints as follows. Expression (16) is An increase in diversity with total net productivity integrated over the habitat is Wright's Rule (the species-energy relationship) [49]. However, to only see an increase in diversity, one would also need the contents of [...] to be constant, that is, K constant in: Thus if a set of observations are indeed across an ecosystem, in the sense that all the observed categories are linked by the flow of resource, then when Wright's rule is seen, the 'resource flow constraint' (18) should also be seen.
The general relationship that we have derived (16) presents, for the first time as far as we are aware, a view of how the major physical and biological variables that determine key aspects of the structure and functioning of ecosystems are related. It relates the scale and energy turnover to the variables that describe the internal structure of the ecosystem (the complexity). The relationship emerges as a result of the dimensions of the underlying variables, but is also constrains and gives the wider context for the relationships between specific variables. It shows that although specific variables are related, the relationship is dependent on the modifying effects of other interacting variables. The variables are not independent but instead can co-vary and equation (16) provides the basis for understanding how they are expected to interactively affect the relationships between specific variables.
This is a crucial point as it highlights why particular relationships can emerge only under particular conditions. In the following we consider a set of well known macro-ecological relationships to show how they emerge from our analysis and also what equation (16) tells us about how the relationship is affected by the other key variables. For each of these macro-ecological relationships there will be a resource flow constraint in the sense of (18) which we will now identify: • Diversity and Wright's Rule: S * ∝ αP L 2 as in (17) so that the number of species (diversity) increases with total net productivity integrated over the habitat rather than productivity alone; this is Wright's rule [49]. Whilst Wright's rule is to some extent ecologically trivial (a greater net energy input allows more individuals, see [50]) the interesting aspect of this result is that it predicts an increase in diversity (richness) and not just individuals. As we would anticipate from the resource flow constraint (18) the relationship between productivity and species diversity also varies with spatial scale as is found [51]. Equation (17) also suggests that the internal configuration of the ecosystem in terms of density, biomass and metabolic rate of the species present will affect the relationship.
• Diversity and metabolic rate: S * ∝ 1/R since: so that diversity decreases with increasing metabolic rate: we expect ecosystems dominated by endothermic organisms with high metabolic rate to have lower diversity than those dominated by ectothermic, low-metabolism, organisms (e.g. [4]). The resource flow constraint is now n * B * G( r * L )L D−2 /(α * P ) = K constant, which specifies how variation in the scale and productivity of the ecosystems considered could mask the effects of changing metabolic rate.
• Latitudinal gradient rule: Diversity will also increase with resource, since: The resource flow constraint is now Rn * B * G( r * L )L D−2 = K constant. Provided that other factors, i.e. α * , that link resource uptake to available sunlight do not vary [50] our general macroecological relationship encapsulates the latitudinal gradient rule. Again, this trend is present alongside patterns in the other variables when K is not constant, as discussed by [52]. For example, (20) predicts that low metabolic rate ecosystems where the rate of resource supply is high will be more diverse that high metabolic rate ecosystems where the rate of resource supply is low; this may suggest a refined version of the latitudinal gradient rule and allow comparison of diverse ecosystems.
• Species Area Relationships: A corollary of length-scale dependence of the density is that diversity will vary with habitat size (which is a function of L) since: More explicitly, diversity will vary both with habitat size (which is a function of L) and the lengthscale of the observation or characteristic lengthscale of some process (which is a function of r * ); these are known as Species Area Relationships (SAR) (see eg [53]).
Thus if the individuals grow in clumps, say by division, or live on a fractal structure (tree, coral, mountain, river) or forage in a random walk pattern (21) will constrain the resulting ecosystem SAR. For example power law SAR arise if available productive surface area or volume orders the availability and uptake of resource [54] and that this is in turn ordered by the roughness of the terrain which can be modeled simply as a fractal [55,56], see also [57]. The resource flow constraint is α * P/(Rn * B * ) = K constant.
Thus these SAR and the underlying constraint on dispersal and clumping from which they originate are also found to interact with other variables such as productivity [59] and bodysize [60]. Observations over the largest regional or continental scales tend to integrate or aggregate over detailed spatial dependence and over other variable factors such as metabolic rate. These scales exceed that over which the terrain varies, and over which processes occur that yield spatial clumping, over such large scales the effective G → 1 and the landscape is essentially 'flat' so that D = 2. Hence on these largest scales the spatial dependence (21) vanishes, we have that P ∼ S * , and positive relationships between productivity and diversity emerge as has been found [51]. Within a given ecosystem, diversity and abundance will also both vary with the r * over which they are observed, as well as with each other. If all other variables are not strongly varying, their functional dependence on r * can be obtained from the data by the method of scaling collapse as has been done by [58].
• Abundance, the 'more individuals' hypothesis: The abundance (density of individuals in each species) increases with productivity integrated over the habitat and decreases with the typical metabolic rate (e.g. [4]), since: As we increase the total ecosystem energy uptake rate, from equation (22) both the diversity and abundance can increase (for fixed metabolic rate). We will find the above patterns when one effect does not dominate, for example, Wright's rule will not be seen if the increase is entirely in abundance, and not in diversity. The relationship between the number of individuals and the number of species has long intrigued ecologists, and whilst a positive relationship is sometimes assumed (the 'more individuals' hypothesis for the increase in richness with overall abundance: see [50]) the detailed mechanism(s) involved are far from clear.
• Abundance and diversity decrease with increasing with body size: our expression (16) gives an inverse relationship between abundance, diversity and bodysize provided the resource flow constraint α * P/(RG( r * L )L D−2 ) is constant or weakly varying, indeed the average abundance [61][62][63][64][65] and diversity [4] are found to have statistical trends that decrease with increasing average body size.
• Trends in trophic level and nett productivity: the number of trophic levels that the ecosystem can support is seen to increase with total net productivity summed over the habitat and decreases with the typical metabolic rate [4]. This follows since we have from (14): Either bodymass relates to trophic level, or the number of trophic levels may be determined by the level of complexity Ψ which increases with total net productivity summed over the habitat and decreases with the typical metabolic rate. This pattern will be seen provided n * S * G( r * L )L D is constant.
The above relationships (17)- (24) show that well known macroecological relationships emerge from the single expression (14)  conditions. We thus expect these patterns to emerge most clearly when the corresponding resource flow constraint is slowly varying and this can be tested for in data. It also suggests that taking account of that co-variation will allow a much more rigorous basis for analysing available data to test for the existence of particular macroecological relationships and using those relationships to test our understanding of the factors that determine ecosystem structure and function more generally. In the following section we illustrate the power of this insight by examining how the co-variability can affect the capacity to detect particular relationships.
A corollary of this is that we can use (14) to identify a method to isolate these patterns.
A particular example of this is testing for SAR. From equation (21), to test for a SAR one should plot the normalized diversityS versus L: Such a comparison can be made if Ψ(p * ) is not strongly varying ('similar' ecosystems), or if Ψ(p * ) can be found from the data by the method described in the appendix.
We illustrate this process in Figure 3 where we have modeled synthetic data for a speciesarea comparison. We have generated synthetic data in the same manner as described in the appendix, such that there are trends in abundance, species richness, and body size, and also random scatter in all variables, constrained such that all the sampled categories of individuals share the same function Ψ. In addition each group of data is from a different habitat size and has a dependence on area predicted by our result (14) with power law dependence of G on L. This simple illustrative exercise demonstrates that an underlying clear pattern emerges in normalized diversity with a corresponding SAR pattern of diversity versus area which has considerable scatter.

IV. CONCLUSIONS
We have used a 'bottom up' approach to fix the minimum set of governing parameters needed to specify a generic idealized ecosystem and have used these to perform a similarity analysis of the ecosystem. Physical constraints of energy flow and utilization over the ecosystem then relate the similarity parameters, which in turn gives an expression which relate the level of complexity that the ecosystem can support to intrinsic variables such as density, diversity and characteristic lengthscales for foraging or dispersal, and extrinsic variables such as habitat size and the rate of supply of resource. These constraints hold regardless of the details of how a given ecosystem functions and require only the assumption that the ecosystem is in a dynamically balanced steady state, that is, that the total rate of resource uptake is balanced by the rate of resource utilization summed over the ecosystem. We thus find the constraint on the relationships that can exist between these (dimensional) ecosystem variables which is reflected in observed macroecological patterns.
Our result may explain why these general, approximate statistical trends appear to be so ubiquitous in nature: we obtain these patterns without recourse to any detailed information about the structure or dynamics of ecosystems or indeed how the data are collected. They simply reflect the underlying similarity properties of the ecosystem and energy conservation in dynamical steady state.
Our result also shows how these different observed macroecological relationships are related to each other and how they are affected by changes in other variables, and hence why particular macroecological relationships may emerge only under particular conditions. This leads to the dimensionless, or normalised variables that need to be constructed to isolate the trend in one ecosystem variable from another; we thus provide a new method for isolating macroecological patterns. Comparisons could thus be made between datasets by controlling for (normalizing against) characteristic metabolic rate, abundance and diversity in order to isolate the statistical pattern with respect to one of these variables. In particular this method isolates a function that expresses how complex the ecosystem is and it would be intriguing to order the data in this way to determine the level of complexity of ecosystems that are found in nature, and to what conditions they correspond. An example would be comparisons across extinct ecosystems, or between extinct and contemporary ecosystems, provided a comparable sample group could be identified. The fact that Wright's rule, species area rules and latitudinal gradient rules emerge often, but not always, from the observational data gathered across ecosystems may reflect varying levels of complexity in these ecosystems, or the effect of different schemes for categorizing individuals within ecosystems and our results provide a method to control for this.
Departures from these statistical patterns where ecosystems are similar, and consistently sampled, then may imply that the system is in a state of rapid change, i.e., abundance or diversity explosion or collapse. Any ecosystem which is dynamically balanced in the sense discussed above will fall within these macroecological patterns, it does not need to be a climax or maximum energy utilization system but simply needs to balance the rate of energy uptake with that of usage integrated over the ecosystem.
Finally, we have identified a dimensionless control parameter for ecosystem density and diversity, namely (productivity) × (habitat size)/(typical metabolic rate) which emerges quite generally from our dimensional analysis as a similarity parameter. This we suggest will be a control parameter in dynamical models for ecosystems based on energy flow and conservation and will order the emergent behaviour of these models. We relate this control parameter to the level of complexity that a dynamically balanced ecosystem can support (its order parameter). This control parameter is the ratio of energy input rate to the ecosystem to the metabolic rate of the smallest possible unit of life, a single cell. If it is reasonable to identify a smallest possible unit of life then this parameterizes the threshold at which life, defined in this manner, can occur (c.f. Lovelock's conjecture about dimensionless control parameters for prebiotic planets [32]). This procedure is illustrated in Figure 4 where we have modelled synthetic data. Our synthetic data are generated such that there are power law trends in abundance, diversity and body size, and also random scatter in all variables. Importantly this random scatter is generated to be constrained such that all the sampled categories of individuals share the same function Ψ. The plots show that the functional dependence of Ψ only emerges in a plot of 1/S * n * B * versus body size B * . This also offers a method to compare different categorization schemes which for the same ecosystem could yield different Ψ(p); one could then in principle normalize for (ie compensate for) any 'bias' introduced by a particular choice of categorization.