716
Views
4
CrossRef citations to date
0
Altmetric
Research Article

A micro-macro hybrid model with application for material and pedestrian flow

& | (Reviewing editor)
Article: 1476049 | Received 26 Jan 2018, Accepted 08 May 2018, Published online: 07 Jun 2018

Abstract

In this paper, a hybrid modeling approach for granular flow-like applications is presented. The approach allows to switch for a priori fixed points in time between the different levels of description which are the microscopic and macroscopic scale, respectively. Based on the numerical discretization of the models, the switching procedure is able to interpret information on individual objects as density distributions and vice versa. In particular, the reverse direction, i.e. from a macroscopic to a microscopic perspective, requires the solution of a nonlinear least squares problem subject to further constraints. Simulation results are given and demonstrate the good performance of the algorithm in the case of material and pedestrian flow models.

Maths Subject classifications:

PUBLIC INTEREST STATEMENT

Conveyor belts are commonly used in many industries to transport a large amount of goods. Typical applications include for example bottling, canning and packaging. We introduce a hierarchy of models enabling to consider different levels of simulation accuracy. Our intention is to develop a hybrid numerical framework which is able to switch between the scales at user-defined points in time. This allows for either a fine or coarse resolution of the underlying equations to detect collisions or identify free flow regimes. Based on the numerical approximations, the switching procedure is able to interpret information on individual goods as density distributions and vice versa. In particular, the reverse direction requires the solution of a restricted nonlinear least squares problem. Simulation results are presented to demonstrate the good performance of the algorithm in the case of material flow models.

1. Introduction

Multi-scale models are a common tool to simulate the behavior of granular materials in many engineering applications. Such models are for example used to simulate pedestrian flow (Cristiani, Piccoli, & Tosin, Citation2014; Etikyala, Göttlich, Klar, & Tiwari, Citation2014), granular flow (Cristiani, Piccoli, & Tosin, Citation2011), traffic flow on roads (Herty & Moutari, Citation2009; Moutari & Rascle, Citation2007) or material flow on conveyor belts (Göttlich, Hoher, Schindler, Schleper, & Verl, Citation2014). Multi-scale models combine the microscopic scale, where the trajectories of single objects are considered separately (e.g. pedestrian flow (Helbing, Farkas, & Vicsek, Citation2000), granular flow (Cleary & Sawley, Citation2002; Cundall & Strack, Citation1979)), with the macroscopic scale, where the entity of objects is treated as a mass distribution (e.g. (Colombo, Garavello, & Lécureux-Mercier, Citation2012; Colombo & Lécureux-Mercier, Citation2012)). Typically, multi-scale models are derived from the microscopic scale via hydrodynamic limits. An overview on multi-scale models for crowd dynamics is given in (Bellomo, Piccoli, & Tosin, Citation2012). Hybrid multi-scale traffic flow models have been investigated in Herty & Moutari, (Citation2009) and Moutari & Rascle, (Citation2007). However, the transition between the different scales has been mostly analyzed from a theoretical point of view and there exist only a limited number of contributions, where simulation techniques have been applied to switch the dynamics (Herty & Moutari, Citation2009; Moutari & Rascle, Citation2007). Our intention is now to develop a numerical framework which is able to switch between the microscopic and macroscopic scale at fixed user-defined points in time. This allows for either a fine or coarse resolution of the underlying model equations depending on special situations (e.g. queuing effects).

For the presentation of the micro-macro hybrid model within this article, the formal derivation of limiting macroscopic equations is omitted and only briefly explained. The focus is on a hybrid switching method to convert the different scales without loosing information and properties of the model. In the case of material and pedestrian flow problems, we present the model equations, introduce suitable discretizations methods and explain how special model characteristics are incorporated in the implementation of the switching algorithm. Different to (Herty & Moutari, Citation2009; Moutari & Rascle, Citation2007), the switching procedure works directly in Eulerian coordinates and the problems are defined on a two-dimensional domain.

Figure illustrates the switching directions, i.e. from the microscopic to the macroscopic scale and vice versa. For the switch from the microscopic to the macroscopic representation, the idea is to place a Gaussian bell curve corresponding to the mass of each object. The total sum of all curves then leads to a density distribution with high density in dense regions and low density in regions, where the objects are widely spread. The transformation from the macroscopic to the microscopic scale is more involved since the precise positioning is in general not possible. In order to have the objects placed as dense as possible in regions of high density, the idea is to fill the geometry completely and to remove objects according to the density distribution. Therefore, the density is interpreted as a probability density and a nonlinear least squares problem is solved to meet the given density distribution as best as possible. An update algorithm ensures that the objects do not overlap and the placement is admissible.

Figure 1. Idea of the switch: from microscopic to macroscopic scale and vice versa.

Figure 1. Idea of the switch: from microscopic to macroscopic scale and vice versa.

The article is organized as follows. Section 1 is concerned with the general description of multi-scale models. The model equations are presented and embedded into the context of hybrid switching. In Section 2, the model switch is applied to a material flow model (Göttlich et al., Citation2014) and a pedestrian model (Helbing et al., Citation2000). Section 3 deals with the implementation of the multi-scale model and the hybrid switching algorithm. Finally, in Section 4, numerical examples are analyzed to evaluate the accuracy of the switching method.

2. Multi-scale models

In this section, we present the microscopic and macroscopic scale of the hybrid multi-scale model in a general framework as well as the transition between the levels. Furthermore, the switching idea is introduced based on some key characteristics.

Multi-scale models are commonly used to simulate the evolution of objects over time under certain conditions and inside a given geometry. However, assuming a high number of objects, there might be scenarios, where statistical values of the averaged behavior of objects such as flow (objects per time) or density (objects per area) are sufficient (see e.g. (Colombo et al., Citation2012; Göttlich et al., Citation2014)). The general multi-scale model considered here consists of two simulation levels: a microscopic one, described by Newton’s equations of motion, and a macroscopic one relying on a hyperbolic conservation law in two space dimensions (Bellomo et al., Citation2012; Göttlich, Klar, & Tiwari, Citation2015).

The setting we are interested in are bounded domains with time-independent external forces. The latter can be exerted for example by the boundaries of the geometry, the friction of a conveyor belt (see Section 2.1) or a desired velocity for pedestrians (see Section 2.2). Other external forces (e.g. gravitational forces) are also possible. The objects are assumed to be uniform and indistinguishable, meaning that they have the same mass, shape and set of parameters. They are assumed to be incompressible and are not allowed to overlap.

2.1. From microscopic to macroscopic scale

The microscopic model is based on Newton’s equations of motion (e.g. (Bellomo et al., Citation2012)). Being N the number of objects in the system, xiR2,i=1,,N the spatial coordinate, v iR2 the velocity of object i and m the mass of a single object, the equations are characterized by

(1.1a) dx idt=vi(1.1a)
(1.1b) mdv idt=ijF(x ix j,v iv j)+G(xi,v i)(1.1b)

together with an initial condition

(1.2) xi(0)=xi,0,vi(0)=vi,0.(1.2)

Equation (1.1a) describes the velocity of the objects and Equation (1.1b) includes all forces influencing their acceleration. The force term F:R2×R2R2 collects the interaction forces, whereas the force term G:R2×R2R2 describes exterior forces as for example interactions with boundaries or friction forces.

To derive the limiting macroscopic equations of (1.1), the following formal computations have to be done. We refer to Carrillo et al. (Citation2009); Etikyala et al. (Citation2014); Göttlich et al. (Citation2015); Ruzhansky, Cho, Agarwal, & Area (Citation2017) where such considerations are made for swarming, pedestrian and material flow models in a more detailed way.

We start with the Liouville equation

tf(N)+i=1Ndivxi(x.if(N))+divvi(v.if(N))=0,

where f(N)=f(N)(x1,...,xN,v1,...,vN) describes the distribution function in the phase space. We integrate over dΩ1=dx2dxN×dv2dvN and make use of Equation (1.1b). We consider the chaos assumption f(2)(x1,v1,x2,v2)=f(1)(x1,v1)f(2)(x2,v2), set F12=F(x1x2,v1v2) and let N go to infinity, then the resulting equation for the distribution function f(x,v,t) is the mean field equation

(1.3) tf+vxf+Sf=0(1.3)

with

Sf=1mvF(xy,vw)f(y,w)dydwf(x,v)+1mv(G(x,v)f(x,v)).

We define the density

ρ(x,t)=f(x,v,t)dv

and velocity

u(x,t)=vf(x,v,t)dvf(x,v,t)dv.

Then, the temporal derivative of the density ρ leads to the continuity equation

(1.4) tρ+x(ρu)=0(1.4)

and the computation of the temporal derivative of ρu yields the momentum equation

(1.5) tu+1ρux(ρu)+1ρxvvfdv=1ρ+1mF(xy,vw)f(y,w)dydw+1mG(x,v)f(x,v)dv.(1.5)

A monokinetic closure function

fρ(x,t)δu(x,t)(v(t))

is used to close the system, i.e. fluctuations are neglected. Moreover, we ignore the velocity dependence meaning that the elastic normal forces dominate the friction forces. So Equation (1.5) reduces to the hydrodynamic limit equation

(1.6) tu+1ρux(ρu)+1ρx(uuρ)dv=1m(Fρ)(x)+1mG(x,u)(1.6)

which describes the system together with the continuity Equation (1.4).

To reduce the system to a scalar limit equation, a quasi-stationary approach is considered, where the temporal and spatial derivatives are set to zero. We get

G(x,u)=(Fρ)(x).

If the forces F and G are known, we get an expression for u, the so-called closure velocity (analogous to (Göttlich, Knapp, & Schillen, Citation2017)) that is of the form

(1.7) u=u(ρ,x)=f(ρ)(x)+g(x),(1.7)

where the first part depends explicitly on the density ρ and the second term only depends on the spatial variable x. We plug the closure velocity u into the continuity Equation (1.4) to get the scalar limit equation

(1.8) tρ+x(ρ(f(ρ)+g(x)))=0(1.8)

which defines the macroscopic model.

The macroscopic model is obviously given by a hyperbolic conservation law in two space dimensions (Aggarwal, Colombo, & Goatin, Citation2015). The density distribution is denoted by ρ(x,t) with spatial coordinate xR2 and time variable tR+. The velocity function corresponds to the closure velocity (1.7).

Note that the model is nonlocal since u(ρ,x) does not only depend on ρ(x) but on the density distribution ρ over the whole geometry. The boundaries of the domain are denoted by ΩW and the inner normal vector is called n(x). The model Equation (1.8) together with the closure velocity (1.7) and additional initial and boundary conditions can be expressed as follows:

(1.9a) tρ+x(ρ u(ρ,x))=0(1.9a)
(1.9b) ρ(x,0)=ρ0(x),xR2(1.9b)
(1.9c) ρ(x,t)=0xΩinflow(1.9c)
(1.9d) u(ρ,x),n(x)=0,xΩW.(1.9d)

Equation (1.9a) describes evolution of density governed by the hyperbolic conservation law, see Equation (1.8). The initial data is given by (1.9b), the inflow condition is stated by (1.9c) and the condition that no mass is going through the boundaries is ensured by (1.9d).

2.2. Hybrid switching method

The goal of the hybrid switching method is to provide a computational framework to change the scale from the microscopic description (1.1) to the macroscopic (1.9) and vice versa. The switch is directly based on the Eulerian representation, contrary to the situation considered in (Herty & Moutari, Citation2009; Moutari & Rascle, Citation2007), and works for a priori defined fixed points in time.

As one might imagine, the transformation from the microscopic to the macroscopic level is straightforward since all necessary information is available. Averaged quantities such as density or flux can be computed in a straightforward way and are sufficient to describe the approximate behavior of the system over time. However, the lack of missing information is the more challenging problem while transforming the system back. Therefore, the main task is to find a method to place the objects inside a given domain such that the given density distribution matches the position of objects in the microscopic scale. For application purposes, the transformation from the macroscopic to the microscopic representation is necessary whenever the trajectory of single objects is needed.

The consistent relation between the amount of mass and the number of objects is ensured by

(1.10) mtot=N23r2ρmax(1.10)

with mtot being the total mass in the system, r the radius of an object and N again the total number of objects. Note that this number is independent on the switching direction and the derivation is as follows: If we have a domain of maximal density ρmax, the corresponding object distribution is as dense as possible which is a hexagonal configuration (Degond, Ferreira, & Motsch, Citation2017). Then, the volume corresponding to one object corresponds the volume of a hexagon with inner circle radius r. The area of such an hexagon is Ahex=23r2. The volume for one object therefore is

(1.11) Vobject=Ahexρmax=23r2ρmax.(1.11)

2.3. Switch from microscopic to macroscopic scale

The transformation from the microscopic to the macroscopic representation is performed such that the original position of objects can be interpreted as a density distribution. Thus, the idea is to spend a two-dimensional Gaussian bell curve for each object representing the density distribution and sum them all up. Since the volume of a two-dimensional Gaussian function with variance σ0 is normalized and the volume per object has to be equal to Vobject, we have to multiply by the corresponding volume as done in Equation (1.11). The x- resp. y-coordinates of the objects are given by the vectors Xo and Yo and the continuous density distribution for one object i is then

(1.12) Di(x,y)=1ρmax2πσ02exp12σ02xXo,i22+yYo,i22Vobject,(1.12)

where Xo,i and Yo,i is the i-th component of the vector Xo and Yo, respectively. Summing the densities for each object

(1.13) ρ(x,y)=i=1NDi(x,y),(1.13)

we end up with the desired continuous density distribution.

2.4. Switch from macroscopic to microscopic scale

The switch becomes more involved when the system is transformed from the macroscopic to the microscopic representation. This is due to missing detailed information on individual objects at the macroscopic level. To remedy this drawback, we need to solve an optimization problem to find a good guess for the microscopic density interpretation. To do so, the density distribution is considered as a normalized probability distribution, meaning that the maximal density is ρmax=1. Since it is not possible to compare the placement of objects to the macroscopic density distribution ρmac, the object distribution has to be transformed back to a density distribution called ρapp, cf. (1.13). Given the position of objects Xo,Yo respecting the boundaries and the non-overlapping conditions, we can set up an optimization problem of the following form:

(1.14a) min ρmacρapp22(1.14a)
(1.13) with ρappρ(x,y)=i=1NDi(x,y)asinequation(1.13)
(1.14b) s.t.#objects=N(1.14b)
(1.14c) (Xo,i,Yo,i)Ωad i1,,N(1.14c)
(1.14d) (Xo,iXo,j)2+(Yo,iYo,j)2 > 2ri,j1,,N,i  j,(1.14d)

where Ωad is the admissible interior domain such that objects placed here do not interact with the boundaries. The optimization problem (1.14) is in fact a nonlinear least squares problem subject to the constraints that the total numbers of objects is met (1.14b), the objects are placed inside the admissible domain (1.14c) and do not overlap (1.14d). For the numerical implementation, the constraints (1.14c) and (1.14d) are ensured by an update algorithm and are not considered directly in the solution of the optimization problem.

A crucial point is to find an admissible start solution ρapp. Therefore, we require that high-density regions, where ρmax is attained, are packed as dense as possible such that the geometry is filled completely and then remove objects until the number N=mtotVobject is reached. First, objects, where the density is lower than a certain tolerance value ϵ, are removed. For any other placement, remove the object with a probability of (1ρ(x)), where x is the center of the corresponding object. This means that in each possible position, the objects are placed in a Bernoulli distributed way with probability equal to the density. In general, the number of objects is not equal to N after this procedure. So if the number of objects is too large, remove objects in low density regions. Otherwise, if the number of objects is too low, refill positions in high-density regions.

Further details on the numerical solution of (1.14) and the update algorithm can be found in sub section 3.1.

In the next section, we present two applications to demonstrate the switching idea. They mainly differ in the evaluation of the force terms in particular the exterior forces.

3. Applications

3.1. Material flow model

We briefly introduce the microscopic and macroscopic material flow model. The models are described in detail in Göttlich et al. (Citation2014, Citation2015) and the formal derivation of the macroscopic via the hydrodynamic limit is given in Göttlich et al. (Citation2015).

3.2. Microscopic model

In the considered application case, circular-shaped parts of radius r are transported on a conveyor belt. The arising exterior forces are the interaction forces between parts and boundaries as well as the friction force induced by the conveyor belt. Analogous to Göttlich et al. (Citation2015), we have to specify the force terms in (1.1) as F being the interaction force between the parts and G the friction force of the belt combined with wall forces. The interaction force F in Equation (1.1b) can be split into a tangential part ft and a normal part fn:

(2.1) F(x,v)=H(2rx)(fn(x,v)+ft(x,v)),(2.1)

where H denotes the common Heaviside function with H()=1 if x∥< 2r and 0 otherwise. The normal force component itself can be split into an elastic repulsive part feln and a dissipative part fdissn:

fn(x,v)=knxx(2rx)=felnγnv,xxxx=fdissn.

The repulsive force is modeled by a spring damper model with the normal spring constant kn while the dissipative force is equipped with the normal viscous coefficient γn. The tangential force is given by

ft(x,v)=min(γtvt,μfn)vtvt

with Coulomb friction coefficient μ and tangential viscous damping coefficient γt. The tangential velocity vt is

vt=vv,nn.

The friction force ffric describes the interaction between a part and the surface of the conveyor belt

ffric(vi)=min(μbmg,γbvivT)vivTvivT

with constant positive velocity of the conveyor belt vT, part mass m and gravitational constant g. The bottom friction coefficient μb and the bottom viscous damping coefficient γb depend on the material of the belt and of the parts.

The interaction force between the parts and the boundaries of the conveyor belt are modeled in the same way as the interaction force of the parts. The set containing the indices of walls and boundaries is called W.

The exterior forces are the sum of the interaction forces with the boundaries and the friction forces between the parts and the conveyor belt

(2.2) G(xi,vi)=wWH(rdist(xi,w))(fw,in+fw,it)+ffric(vi)(2.2)

with fw,in and fw,it the normal and tangential forces exerted by the walls on part i.

The complete microscopic material flow model is obtained by inserting these force terms into the general microscopic model (1.1) and reads

(2.3a) dx idt=v i(2.3a)
(2.3b) mdvidt=ijF(xixj,vivj)+G(xi,vi)(2.3b)

with F and G as in (2.1), (2.2) and initial conditions xi(0)=xi,0,vi(0)=vi,0.

3.3. Macroscopic model

The static space-dependent velocity g(x) in Equation (1.7) represents the friction force of the conveyor belt and the force exerted by the boundaries of the given setting, see Figure . The resulting velocity field is shown in Figure . The dynamic velocity f(ρ) is needed to deal with situations of maximal density ρmax.

Figure 2. Sketch of the conveyor belt.

Figure 2. Sketch of the conveyor belt.

For the formulation of the macroscopic model as in (1.9a) we set

(2.4) f(ρ)=vdyn(ρ),g(x)=vstat(x),(2.4)

where the static velocity field vstat is as in Figure . The nonlocal dynamic vector field vdyn should be active if the density exceeds a maximal density ρmax and parts start to pile up. Below the maximal density, vdyn is inactive, i.e. free flow regime, and the parts are transported with the velocity given by vstat. Thus, the dynamic vector field includes the interaction between parts weighted by the factor ϵ > 0 and models the formation of congestion in front of an obstacle by the collision operator I(ρ):

(2.5) vdyn(ρ)=H(ρρmax)I(ρ),(2.5)

where H denotes the common Heaviside function and

(2.6) I(ρ)=ϵ(ηρ)1+(ηρ)22.(2.6)

The negative of the gradient of the convolution means that if there is a pile of maximal density, the mass will be pushed in a region with lower density. Inside a pile with maximal density, this force will be zero. Additionally, we have the initial condition

(2.7) ρ(x,0)=ρ0(x),xR2(2.7)

and the boundary condition

u(x,ρ),n(x)=0,xΩW.

The computational domain is denoted by Ω and the boundaries are Ω. The inflow boundary at the left in Figure is called Ωinflow. The walls and the obstacle are denoted by ΩW, even if the obstacle is not at the boundary of the computational domain. The normal vector is called n(x).

The complete macroscopic material flow model is obtained by inserting the velocity components (2.4) into the closure velocity (1.7). Then, the analogon to system (1.9) reads as follows (see (Göttlich et al., Citation2014)):

(2.8a) tρ+x(ρ(vdyn(ρ)+vstat(x)))=0(2.8a)
(2.8b) vdyn(ρ)=H(ρρmax)I(ρ)(2.8b)
(2.8c) I(ρ)=ϵ(ηρ)1+(ηρ)22(2.8c)
(2.8d) ρ(x,0)=ρ0(x),xR2(2.8d)
ρ(x,t)=0xΩinflow(2.8e)
(2.8f) vdyn(ρ)+vstat(x),n(x)=0,xΩW.(2.8f)

3.4. Pedestrian flow model

3.4.1. Microscopic model

In the following sections, the pedestrian model derived by Helbing (Helbing et al., Citation2000) is briefly reviewed and a corresponding macroscopic model is stated. We assume the pedestrians to be of circular shape with radius r and to act in the same way in each direction, meaning that the forces are rotationally invariant. We specify again the force terms F for the interaction and G for the desired velocity of pedestrians as well as the forces exerted by the walls. We set Fij to characterize the interaction force between pedestrian i and j in (1.1b). The latter is modeled as

F(xixj,vivj)=Fij=Aexp(2rdij)B+kh(2rdij)nij+κh(2rdij)Δvjittij

with h(y)=H(y)y and H the Heaviside function. The constants A,B,k are positive, whereas κ can be equal to zero if tangential force effects are neglected. The distance of pedestrians i and j is given by dij=∥xixj with xi and xj the centers of mass, nij=(xixj)/dij is the normalized vector pointing from pedestrian j to pedestrian i, tij=(nij(2),nij(1)) is the tangential direction and Δvjit=(vjvi)tij.

The interaction force Fiw between wall wW and pedestrian i is modeled as

(2.9) Fiw=Aexp(rdiw)B+kh(rdiw)niwκh(rdiw)(vitiw)tiw(2.9)

with diw being the distance of pedestrian i to wall w, niw the normalized normal vector of wall w and tiw the tangential vector of wall w. Combined with the component of the desired velocity

vdes(xi)=v0(xi)v(xi)τ,

where τ is the reaction time and v0(x) is the desired velocity depending on the pedestrians location, we set the exterior force as

G(xi,vi)=mvdes(xi)+FiW(xi,vi).

Compared to the material flow model, where the main ingredient is the friction of the conveyor belt, the exterior force for the pedestrian model is mainly driven by the desired velocity of pedestrians. Note that this leads to a different numerical treatment within the switching algorithm. Inserting these terms into the system (1.1), we have the scaled microscopic pedestrian model

(2.10a) dx idt=vi(2.10a)
(2.10b) mdv idt=mvides+1NjiFij+1NWFiW(2.10b)

with initial positions xi(0)=xi,0 and velocities vi(0)=vi,0.

3.4.2. Macroscopic model

For the macroscopic pedestrian model, we have to determine the parts of the velocity u(ρ,x)=f(ρ)(x)+g(x), see (1.7), as

f(ρ)=1mλFρ,g(x)=v0(x)+1mλWFW(x)

with

(2.11) Fρ(x)=F(xy)ρ(y)dy=Aexp2rxyB+kh(2rxy)xyxyρ(y)dy,(2.11)

v0(x) is the desired velocity depending on the pedestrians location and

WFW(x)=WAxprd(x)B+kh(rd(x))nW,

where h is defined before. The constants A,B,k and the radius of the pedestrians r are the same as in the microscopic model. Here, d(x) denotes the distance of x and the interacting wall.

The complete macroscopic pedestrian model then reads as

(2.12a) tρ+xρv0(x)+1mλFρ(x)+1mλWFW(x)=0(2.12a)
(2.12b) ρ(x,0)=ρ0(x),xR2(2.12b)
(2.12c) ρ(x,t)=0xΩinflow(2.12c)
(2.12d) u(ρ,x),n(x)=0,xΩW.(2.12d)

with Equation (2.12b) the initial condition, (2.12c) specifying the inflow condition and (2.12d) the boundary condition.

4. Numerical discretization

In this section, the numerical discretization of the microscopic (1.1) and the macroscopic model (1.9) are presented. The discretized models are then used to set up the hybrid switching method introduced in subsection 1.2.

We set dt the time step of the discretization. The discretized microscopic model reads

(3.1a) xi(t+dt)xi(t)dt=vi(t)(3.1a)
(3.1b) mvi(t+dt)vi(t)dt=F(xi(t)xj(t),vi(t)vj(t))+G(xi(t),vi(t))(3.1b)

together with the initial condition

xi(0)=xi,0,vi(0)=vi,0.

It is solved via a classical Runge-Kutta method of fourth order. If the specific application is known, a priori estimates can be performed for the force terms F and G. Then, the time step can be chosen appropriately and the need of an adaptation of the step size during the computation can be avoided.

For the discretization of the macroscopic model we denote by Δx1, Δx2 the space step sizes and Δt the time step size. The grid points are defined as

(3.2) xi(1)=iΔx1,i=1,,Nx1,xj(2)=jΔx2,j=1,,Nx2,tk=kΔt,k=1,,Nt.(3.2)

The space is subdivided into squares Si,j=xi12(1),xi+12(1)]×[xj12(2),xj+12(2) with grid constants λ(d)=ΔtΔxd for d=1,2. We apply a finite volume scheme, where the density is considered as a piecewise constant function

ρ(x,t)=ρi,jkRforxSi,j,k1,,Nt.

Due to (1.7), we have that the velocity parts f(ρ) and g(x) only depend on ρ or x, respectively. This allows for a separate numerical computation in terms of the numerical fluxes

(3.3a) Fi,j(1),+=Fi,j(1)(ρ,ρi,jk,ρi+1,jk,xi+12,j)+Gi,j(1)(ρi,jk,ρi+1,jk,xi+12,j)(3.3a)
(3.3b) Fi,j(1),=Fi,j(1)(ρ,ρi1,jk,ρi,jk,xi12,j)+Gi,j(1)(ρi1,jk,ρi,jk,xi12,j)(3.3b)
(3.3c) Fi,j(2),+=Fi,j(2)(ρ,ρ˜i,jk,ρ˜i,j+1k,xi,j+12)+Gi,j(2)(ρ˜i,jk,ρ˜i,j+1k,xi,j+12)(3.3c)
(3.3d) Fi,j(2),=Fi,j(2)(ρ,ρ˜i,j1k,ρ˜i,jk,xi,j12)+Gi,j(2)(ρ˜i,j1k,ρ˜i,jk,xi,j12),(3.3d)

where the density-dependent part is given by

Fi,j(1)ρ,ρi,jk,ρi+1,jk,xi+12,j=ρi,jf(1)(ρ)(xi+12,j)f(1)(ρ)(xi+12,j)0ρi+1,jf(1)(ρ)(xi+12,j)f(1)(ρ)(xi+12,j)0

and the position-dependent part is

Gi,j(1)ρi,jk,ρi+1,jk,xi+12,j=ρi,jg(1)(xi+12,j)g(1)(xi+12,j)0ρi+1,jg(1)(xi+12,j)g(1)(xi+12,j)0.

We remark that f and g depend on the application we have in mind. In vertical direction, the computation of the numerical fluxes Fi,j(2) and Gi,j(2) follows analogously.

A dimensional splitting method is used to reduce the original two-dimensional problem into the solution of one-dimensional problems only. The discretized system is then

(3.4a) ρ˜i,jk=ρi,jkλ(1)[Fi,j(1),+Fi,j(1),](i,j){1,,Nx1}×{1,...,Nx2}(3.4a)
(3.4b) ρi,jk+1=ρ˜i,jkλ(2)[Fi,j(2),+Fi,j(2),](i,j){1,...,Nx1}×{1,...,Nx2}(3.4b)
(3.4c) ρi,j(0)=ρi,j0 (i,j)1,...,Nx1×1,...,Nx2(3.4c)
(3.4d) u(ρ,xi,j),ni,j=0 (i,j)W(3.4d)

with W the set containing the grid points corresponding to the boundaries of the underlying domain. The step sizes have to be chosen such that the CFL condition

(3.5) ΔtΔxdmaxρρ(ρ(f(ρ)+g(x))1(3.5)

for d=1,2 is fulfilled.

4.1. Hybrid switching algorithms

The numerical discretizations are now used to present an implementation of the hybrid switching method, see subsection 1.2.

4.1.1. Microscopic to macroscopic representation

As we have seen, the given geometry is partitioned into grid cells for the numerical computation. Let us denote by xc and yc vectors containing the x- resp. y-coordinate of the grid cell centers. Corresponding to (1.13), the density in grid cell i can be calculated via

(3.6) ρi=j=1NDj(xc,i,yc,i))(3.6)

with Dj being the density corresponding to object j, see Equation (1.12). The variance σ0>0 has to be chosen such that the numerical support of the bell function is larger than the actual domain of one object, otherwise we obtain peaks for densely packed objects and not a uniform-density distribution. In doing so, the implementation of the microscopic to macroscopic direction is straightforward as expected.

4.1.2. Macroscopic to microscopic representation

The optimization problem (1.14) can be interpreted as a nonlinear least squares problem if the constraints (1.14c) and (1.14d) are omitted (cf. discussion in subsection 1.2) and treated in an additional routine. Therefore, the computation of the macro to micro switching direction can be split into the following steps:

  1. Find admissible start solution ρapp: The pseudocode to find an admissible start solution is specified in algorithm 1. The algorithm can be run several times to improve the configuration of the start solution since a random choice of object placement is used.

  2. Solve nonlinear least squares problem (1.14a)–(1.14b): The nonlinear least squares problem is solved with the MATLAB function lsqnonlin https://de.mathworks.com/help/optim/ug/lsqnonlin.html and requires the solution P of algorithm 1 as initialization. The numerical solution of the nonlinear least sqaures problem is denoted by Q.

  3. Solve problem including the constraints (1.14c)–(1.14d): The main idea of the so-called update algorithm 2 is to move the objects i with coordinates P(i) from the optimized solution Q(i) such that they do not overlap any more. This means in particular if object i interacts with object ji or with the wall, i.e. |S(i)S(j)|22r, ji or Q(i)Ωad, we set S(i)=(P(i)+S(i))/2 and check again for interactions until P(i)S(i) is less than a predefined tolerance δ. The final configuration satisfying (1.14c)–(1.14d) is denoted by S(i).

Algorithm 1 Find admissible start solution

Input: Density ρmac, mass m, radius r, # objects N, tolerance ϵ, admissible region Ωad

Output: Solution P containing the coordinates of the object centers

  • 1: Compute a hexagonal grid structure with grid point distance 2r and grid points gi: = (xi, yi)

  • 2: for = 1: # grid points do

  • 3: if gi ∉Ωad then

  • 4: Delete grid point gi

  • 5: end if

  • 6: end for

  • 7: for = 1: # remaining grid points do

  • 8: Determine corresponding density value ρi ρmac(xi, yi)

  • 9: if ρi < ϵ then

  • 10: Delete grid point i

  • 11: else

  • 12: Delete grid point i with probability (1 − ρi)

  • 13: end if

  • 14: end for

  • 15: if N > # remaining grid points then

  • 16: Put grid point with index argmaxi{ρi|gi has been deleted} until N is met

  • 17: else if N < # remaining grid points then

  • 18: Delete grid point with index argmini{ρi|gi not deleted} until N is met

  • 19: end if

  • 20: return Remaining grid points as matrix P corresponding to the placed objects centers

Figure shows a possible evaluation of the update algorithm including a figure for the macroscopic density that should be reproduced, see Figure , a figure for a possible start solution computed by algorithm 1, see Figure , a figure for the optimized solution applying the MATLAB algorithm lsqnonlin, see Figure , where we directly observe that the non-overlap condition is injured, and a figure for the final solution after applying the update algorithm 2, see Figure . Concluding, the latter is a combination of the start and optimized solution. We observe that in regions, where the density is high, the objects are placed as dense as possible, whereas in regions, where the density is far from the maximal density, objects get stuck.

Figure 3. Macroscopic to microscopic representation.

Figure 3. Macroscopic to microscopic representation.

Note that the runtime growths linearly in N for algorithm 1 and the solution of the optimization problem. The runtime for the update algorithm 2 growths cubically in N. However, the solution of the optimization problem using MATLAB takes several hours and dominates the performance of the update algorithm for the test cases we present in Section 4.

Algorithm 2 Update algorithm ensuring the non-overlapping condition

Input: Solution Q of least squares problem, start solution P, admissible region Ωad, tolerance δ

Output: Final solution S ensuring a placement of the objects without overlapping

  • 1: Initialize solution with P

  • 2: for = 1: N do

  • 3: for = 1: N do

  • 4: interaction = 0

  • 5: Place object i at optimized position: S(i) = Q(i)

  • 6: if s(i)Ωadthen

  • 7: interaction = 1

  • 8: end if

  • 9: for = 1: N do

  • 10: if |S(i) − S(j)|2 ≤ 2r, j ≠ i then

  • 11: interaction = 1

  • 12: end if

  • 13: end for

  • 14: if interaction = 1 then

  • 15: if |P (i) − S(i)| < δ then

  • 16: STOP, S(i) = P (i), go back to step 3

  • 17: end if

  • 18: S(i) = (P (i) + S(i))/2 and go back to step 6

  • 19: end if

  • 20: end for

  • 21: end for

  • 22: return Final solution S

5. Numerical results

The application examples in Section 2 are now analyzed from a numerical point of view. For each scenario, implementation details on the model are given and numerical examples are explained in detail.

5.1. Results for the material flow model

The numerical results of the switch are investigated for a setting as presented in Figure . This experimental setup has been originally introduced in Göttlich et al. (Citation2014), where the microscopic and macroscopic material flow models have been validated against real data. The idea is now to use the same data to test the performance of the switch.

As described in Section 3, the simulation of the microscopic model is done with a classical Runge-Kutta method of fourth order which is applied to the discretized microscopic model (3.1). The discretization of the force terms stated in Section 2.1 is straightforward. The parameters are characterized by the bottom viscous damping coefficient γb=0.5, the normal viscous coefficient γn=0.1, the viscous damping coefficient γt=0.16, the normal spring constant kn=200, the bottom friction coefficient μb=0.5, the mass m=0.01, the radius r=0.012, the gravitational constant g=9.81, the Coulomb friction coefficient μ=0.17, the time step size dt=0.005 and time horizon T=4. The number of parts is N=192.

Considering the macroscopic material flow Equations (2.8), we have to evaluate the numerical fluxes for the static velocity

g(xi+12,j)=vstat(xi+12,j).

and the dynamic velocity, see (2.4),

f(ρ,ρi,jk,xi+12,j)=H(ρi,jkρmax)I(ρ)(xi+12,j),

according to (3.3), where the first component of the interaction operator I (cf. (2.6)) is discretized as

I(1)(ρ)(xi+12,j)=p,qρp,qkcip,jq(1)1+p,qρp,qkcip,jq(1)2+p,qρp,qkcip,jq(2)2

with

cp,q(1)=Qp+12,qx1η(xτ)dτ,cp,q(2)=Qp,q+12x2η(xτ)dτ

and Qp,q=x1,p12,x1,p+12×x2,q12,x2,q+12 being a grid cell. The discretization of the second component with respect to the x2-direction is computed analogously. We refer to Göttlich et al. (Citation2014) for more details. We choose a Gaussian convolution kernel η of type

η(u)=1σ2πexp12σ|u|2,uR2.

As grid sizes of the macroscopic model, we have Δt=0.0025 and Δx1=Δx2=0.008. The final time horizon is again T=4 and the switch is evaluated at time tswitch=1.

To validate the results of the switching procedure from micro to macro, the evolution of parts including the switch of the system is compared to real data, cf. (Göttlich et al., Citation2014). We measure how many mass or parts leave the system behind the obstacle, i.e. the outflow over time. The corresponding diagram is shown in Figure .

Figure 4. Switch from micro to macro for the material flow problem.

Figure 4. Switch from micro to macro for the material flow problem.

The maximal outflow error, meaning the maximal difference of the outflow of the model including the switch and the real data outflow, is about 6%. The maximal outflow error of the macroscopic model without any switch is approximately 5% (see (Göttlich et al., Citation2014)), and thus indicates that the switch performs quite well.

The reverse situation, i.e. from macro to micro, is depicted in Figure . Here, the left picture shows the particle distribution resulting from the update algorithm 2. Even if the switch from the macroscopic to the microscopic representation is the more difficult direction, the maximal outflow error is now smaller compared to Figure . This is due to the higher accuracy of the microscopic model. The maximal outflow error, again compared to the real data outflow, is about 3.8%.

Figure 5. Switch from macro to micro for the material flow problem.

Figure 5. Switch from macro to micro for the material flow problem.

5.2. Results for the pedestrian flow model

We consider an experimental setting with a room which has to be evacuated. Figure shows the room geometry as well as the static velocity consisting of the desired velocity v0(x) and the wall forces WFW(x), see Figure .

Figure 6. Evacuation of a room with one exit.

Figure 6. Evacuation of a room with one exit.

For the numerical implementation, almost the same parameters as in Helbing et al. (Citation2000) are used. We choose the number of pedestrians as N=81, the mass m=80, the radius r=0.25, the desired velocity v0=1, the acceleration time τ=0.5, the constants A=2000,B=0.08 and the parameter k=1.2105. Since during the derivation, the tangential forces are neglected, we set κ=0 to directly compare the microscopic and macroscopic results. The final time horizon is T=50 and the time step to solve the Runge-Kutta scheme is dt=104.

The discretization of the force terms stated in Section 2.2 is straightforward, see (3.1) such that a classical Runge-Kutta method of fourth order is used again.

Corresponding to the discretization of the macroscopic Equation (3.4), the discretized version of the flux terms (3.3) is

f(1)(ρ,ρi,jk,xi+12,j)=p,qρp,qkcip,jq(1)

with

cp,q(1)=Qp+12,qAexp2rxi+12,jyB+kh(2rxi+12,jy)xi+12,jyxi+12,jydy

and Qp,q=x1,p12,x1,p+12×x2,q12,x2,q+12 being a grid cell. The function h is defined as before. For the external force term, it is

g(1)(xi+12,j)=v0,(1)(xi+12,j)+1mλWFW(1)(xi+12,j)

with

FW(xi+12,j)=Aexprd(xi+12,j)B+kh(rd(xi+12,j))nW

with d(xi+12,j) the distance of point xi+12,j to wall W.

We choose nearly the same parameters as in the microscopic case, i.e. only the parameters A=1,B=0.1 and k=27 have to be varied, to match the results of the pure microscopic simulation. As grid sizes, we have Δx1=Δx2=0.1 and Δt=0.001.

Similar to the switch for the material flow model, a switch is implemented for the pedestrian model at time tswitch=10. To compare the qualitative behavior of the models, the outflow at the door is measured. Since there is no real data available this time, the outflow of the model with switch is compared to the outflow without any switch, contrary to the material flow case.

Figure shows the density distribution from the microscopic to macroscopic representation and the outflow behavior over time. As we can observe, the outflow of the switched model is close to the simulation results obtained from the microscopic simulation only. The maximal outflow error is about 5.3%.

Figure 7. Switch from micro to macro for the pedestrian model.

Figure 7. Switch from micro to macro for the pedestrian model.

The results for the macro to micro switch can be found in Figure . Considering the outflow diagram, the results of the switched model are compared to the macroscopic simulation. The maximal outflow error is about 3.2%, which is within an acceptable range.

Figure 8. Switch from macro to micro for the pedestrian model.

Figure 8. Switch from macro to micro for the pedestrian model.

5.3. Computation times

Finally, we present the computation times for our switch implementation. All computations have been performed on a PC equipped with 16 GB Ram, Intel(R) Core(TM) i5-4690 [email protected] GHz. Tables and show the computation times for both switching directions (micro to macro and vice versa) and the two applications material and pedestrian flow. The same discretizations as introduced formerly are used. However, we remark that in the macro to micro direction the radius needs to be adapted in order to match the total mass (1.10).

Table 1. Computing times [sec] for the material flow model

Table 2. Computing times [sec] for the pedestrian model

The times for the three steps in the macro to micro direction are listed separately. As we can see, the most time-consuming part is the solution of the optimization problem (1.14) which takes several minutes up to almost one hour for N=200 objects, whereas the computation of the start solution (algorithm 1) as well as the update algorithm 2 takes only a couple of seconds.

The total computation time increases exponentially with the number of objects. Nevertheless, it might happen that an optimum is found quite fast, e.g. for N=150 pedestrians in Table . Note that the total computation times differ due to the different discretizations and geometries for the material and pedestrian flow models, cf. discussions in sub sections 4.1 and 4.2.

The computation time of the microscopic model (without any switch) increases quadratically in the number of objects N (Göttlich et al., Citation2014). Therefore, the simulation of the macroscopic model provides a less costly alternative and good results. A switch to the microscopic representation is for instance useful if the user is interested in a better resolution of the underlying dynamics, even if the optimization step takes some time.

6. Conclusion

We have presented a switching method that allows to change dynamics from a microscopic to a macroscopic scale and vice versa. The method has been applied to material and pedestrian flow models to demonstrate the good numerical performance. In particular, the comparison of the material flow switch with real data shows quite promising results. Further research might include automatized switching decisions dewpending on suitable measures or discretizations (Agarwal & El-Sayed, Citation2018) as well as stochastic perturbations (Zhang et al., Citation2017).

Additional information

Funding

This work was supported by the German Research Foundation (DFG) under Grant OptiPlant [GO 1920/7-1] and by the Ministry of Science, Research and the Arts Baden-Württemberg and the University of Mannheim [Internal Open Access Publishing Fund].

Notes on contributors

Simone Göttlich

The Scientific Computing Research Group belongs to the Department of Mathematics at the University of Mannheim. It was founded in 2011 and directed since then by Prof. Göttlich. The research focuses on the mathematical modeling, numerical simulation and optimization of dynamic processes with applications in manufacturing systems, traffic flow and pedestrian dynamics and power grids.

References

  • Agarwal, P., & El-Sayed, A. A. (2018). Non-standard finite difference and Chebyshev collocation methods for solving fractional diffusion equation. Physica A: Statistical Mechanics and Its Applications, 500, 40–49. doi:10.1016/j.physa.2018.02.014
  • Aggarwal, A., Colombo, R. M., & Goatin, P. (2015). Nonlocal systems of conservation laws in several space dimensions. SIAM Journal Numerical Analysis, 53, 963–983. doi:10.1137/140975255
  • Bellomo, N., Piccoli, B., & Tosin, A. (2012). Modeling crowd dynamics from a complex system viewpoint. Mathematical Models Methods Applications Sciences, 22, 1230004–1230029. doi:10.1142/S0218202512300049
  • Carrillo, J. A., D’Orsogna, M. R., & Panferov, V. (2009). Double milling in self-propelled swarms from kinetic theory. Kinetic and Related Models, 2, 363–378. doi:10.3934/krm
  • Cleary, P., & Sawley, M. (2002). DEM modelling of industrial granular flows: 3D case studies and the effect of particle shape on hopper discharge. Applied Mathematical Modelling, 26, 89–111. doi:10.1016/S0307-904X(01)00050-6
  • Colombo, R. M., Garavello, M., & Lécureux-Mercier, M. (2012). A class of nonlocal models for pedestrian traffic. Mathematical Models Methods Applications Sciences, 22, 1150023. doi:10.1142/S0218202511500230
  • Colombo, R. M., & Lécureux-Mercier, M. (2012). Nonlocal crowd dynamics models for several populations. Acta Mathematica Scientia, 32, 177–196. doi:10.1016/S0252-9602(12)60011-3
  • Cristiani, E., Piccoli, B., & Tosin, A. (2011). Multiscale modeling of granular flows with application to crowd dynamics. Multiscale Modelling and Simulation, 9, 155–182. doi:10.1137/100797515
  • Cristiani, E., Piccoli, B., & Tosin, A. (2014). Multiscale modeling of pedestrian dynamics, vol. 12 of MS&A. Modeling, Simulation and Applications. Cham: Springer.
  • Cundall, P. A., & Strack, O. D. L. (1979). A discrete numerical model for granular assemblies. Géotechnique, 29, 47–65. doi:10.1680/geot.1979.29.1.47
  • Degond, P., Ferreira, M. A., & Motsch, S. (2017). Damped Arrow-Hurwicz algorithm for sphere packing. Journal of Computational Physics, 332, 47–65. doi:10.1016/j.jcp.2016.11.047
  • Etikyala, R., Göttlich, S., Klar, A., & Tiwari, S. (2014). Particle methods for pedestrian flow models: From microscopic to nonlocal continuum models. Mathematical Models Methods Applications Sciences, 24, 2503–2523. doi:10.1142/S0218202514500274
  • Göttlich, S., Hoher, S., Schindler, P., Schleper, V., & Verl, A. (2014). Modeling, simulation and validation of material flow on conveyor belts. Applied Mathematical Modelling, 38, 3295–3313. doi:10.1016/j.apm.2013.11.039
  • Göttlich, S., Klar, A., & Tiwari, S. (2015). Complex material flow problems: A multi-scale model hierarchy and particle methods. Journal of Engineering Mathematics, 92, 15–29. doi:10.1007/s10665-014-9767-5
  • Göttlich, S., Knapp, S., & Schillen, P. (2017). A pedestrian flow model with stochastic velocities: Microscopic and macroscopic approaches. Retrieved from https://arxiv.org/pdf/1703.09134.pdf
  • Helbing, D., Farkas, I., & Vicsek, T. (2000). Simulating dynamical features of escape panic. Nature, 407, 487–490.
  • Herty, M., & Moutari, S. (2009). A macro-kinetic hybrid model for traffic flow on road networks. Computational Methods in Applied Mathematics, 9, 238–252. doi:10.2478/cmam-2009-0015
  • Moutari, S., & Rascle, M. (2007). A hybrid Lagrangian model based on the Aw-Rascle traffic flow model. SIAM Journal Applications Mathematical, 68, 413–436. doi:10.1137/060678415
  • Ruzhansky, M., Cho, Y., Agarwal, P., & Area, I. (2017). Advances in real and complex analysis with applications. Singapore: Trends in Mathematics, Springer.
  • Zhang, X., Agarwal, P., Liu, Z., Peng, H., You, F., & Zhu, Y. (2017). Existence and uniqueness of solutions for stochastic differential equations of fractional-order q>1 with finite delays. Advances in Difference Equation, 2017, 123. 18.