<<

Mathematical and Computational Applications

Article Efficient Methods to Calculate Partial for a Higher Resolution Finite Method for Diffusion-Reaction Systems in Biological Modeling

Abigail Bowers, Jared Bunn and Myles Kim * Department of Applied , Florida Polytechnic University, Lakeland, FL 33805, USA; abowers@floridapoly.edu (A.B.); jbunn@floridapoly.edu (J.B.) * Correspondence: mkim@floridapoly.edu

 Received: 14 November 2019; Accepted: 20 December 2019; Published: 23 December 2019 

Abstract: Computational models for multicellular biological systems, in both in vitro and in vivo environments, require solving systems of differential to incorporate molecular transport and their reactions such as release, uptake, or decay. Examples can be found from drugs, growth nutrients, and signaling factors. The systems of differential equations frequently fall into the category of the diffusion-reaction system due to the nature of the spatial and temporal change. Due to the complexity of equations and complexity of the modeled systems, an analytical solution for the systems of the differential equations is not possible. Therefore, numerical calculation schemes are required and have been used for multicellular biological systems such as bacterial population dynamics or cancer cell dynamics. Finite volume methods in conjunction with agent-based models have been popular choices to simulate such reaction-diffusion systems. In such implementations, the reaction occurs within each finite volume and finite interact with one another following the law of diffusion. The characteristic of the reaction can be determined by the agents in the finite volume. In the case of cancer cell growth dynamics, it is observed that cell behavior can be different by a matter of a few cell size because of the chemical . Therefore, in the modeling of such systems, the spatial resolution must be comparable to the cell size. Such spatial resolution poses an extra challenge in the development and execution of the computational model due to the agents sitting over multiple finite volumes. In this article, a few computational methods for cell surface-based reaction for the finite volume method will be introduced and tested for their performance in terms of accuracy and computation speed.

Keywords: partial sphere surface areas; finite volume method; diffusion reaction ; mathematical model for biology

1. Introduction Agent-based models (also called single-cell based models or individual-based models) have been widely popular in various fields as tools to build computational models. They have been adopted in biological system modeling [1–3], fluid dynamics simulation [4,5], ecosystem modeling [6,7], human organizational simulation [8,9], business simulation [10], etc. In agent-based modeling, a system is modeled as a collection of autonomous self-decision-making entities called agents. Each agent individually assesses its situation and makes decisions on the basis of a set of rules. These rules can be designed to make internal decisions altering the fate of an agent or can be written to define interactions among spatially neighboring agents. The rule set can also be identical to each agent or can be designed differently for different groups of agents. Agent-based models were proven to be an effective modeling

Math. Comput. Appl. 2020, 25, 2; doi:10.3390/mca25010002 www.mdpi.com/journal/mca Math. Comput. Appl. 2020, 25, 2 2 of 13 approach for complex heterogeneous systems. Though all rules are usually written for small scale, agent level or local interaction level, agent-based models are capable of showing population level emerging characteristics that are often unpredictable from the local rule sets. Due to these reasons, cancerMath. biology Comput. Appl. is one 2020 of, 25 those, x FOR PEER areas REVIEW where agent-based models have been successful [3,52, 11of 13]. In a biological system, cells interact with one another in various ways, through physical interaction and/or throughcan be chemical designed signaling. differently Cellsfor different uptake groups of agents. from Agent the surrounding-based models medium,were proven and to moleculesbe an may comeeffective from modeling nearby cellsapproach because for they complex synthesize heterogeneous and secrete systems. molecules. Though Due all to rules the are diff usive usually nature of thewritten molecules for small in media, scale, the agent mathematical level or local model interaction for the level, biological agent-base cellsd models that consume are capable and ofsecrete moleculesshowing in mediapopulation would level be emerging a diffusion-reaction characteristics equation that are andoften finite unpredictable volume methodsfrom the local rule popular sets. Due to these reasons, cancer biology is one of those areas where agent-based models have been choice for the numerical implementation [11,12]. successful [3,5,11. In a biological system, cells interact with one another in various ways, through It has been experimentally observed that cancer cells’ fates can be different by a matter of one or physical interaction and/or through chemical signaling. Cells uptake molecules from the surrounding two cellmedium, lengths and due molecules to the spatial may come nutrient from nearby concentration cells because change they [13 synthesize]. Thus, aand computational secrete molecules. model for cancerDue cells to the with diffusive physiology nature includingof the molecules consumption in media, andthe mathematical secretion of moleculesmodel for the will biological require cells a spatial resolutionthat consume of single and cell secrete length. molecules Uptake of in molecules media would by cells be a may diffusion involve-reaction receptors equation on the and cell finite surface and endocytosisvolume methods process. are a Ifpopular a 3D finite choice volume for the numeric implementational implementation is designed [11,12]. with a cell surface reaction, one cell lengthIt has been spatial experimentally resolution, and observed cellsrepresented that cancer cells by’ fates can (agents), be different then by a a snapshot matter of aroundone or one cell wouldtwo cell be lengths like Figure due to1 .the The spatial cell innutrient Figure concentration1 overlaps with change eight [13 finite]. Thus, volumes. a computational The contribution model of thisfor cell cancer to the cells whole with diphysiolffusion-reactionogy including system consumption needs toand be secretion divided of into molecules eight parts will require proportional a spatial resolution of single cell length. Uptake of molecules by cells may involve receptors on the cell to the cell in each finite volume that the cell overlaps; S , S , , S in Figure1. In a surface and endocytosis process. If a 3D finite volume implementation is designed1 2 ··· with8 a cell surface diffusion-reaction equation like Equation (1), the reaction coefficient, λ, would depend, as a of reaction, one cell length spatial resolution, and cells represented by spheres (agents), then a snapshot spatialaround variables, one cell on would the values be like of FigureSi’s from 1. The all cell cells in inFigure the system. 1 overlaps Thus, with it eight is important finite volumes. to calculate The the precisecontribution values of ofSi ’sthis to cell capture to the the whole correct diffusion rate- ofreaction reaction. system needs to be divided into eight parts

proportional to the cell surface area in each finite volume that the cell overlaps; 푆1, 푆2, ⋯, 푆8 in ∂c Figure 1. In a diffusion-reaction equation like =EquationD 2c + (1),λ cthe reaction coefficient, 휆, would depend, (1) ∂t ∇ as a function of spatial variables, on the values of 푆푖’s from all cells in the system. Thus, it is important to calculate the precise values of 푆 ’s to capture the correctr rate of reaction. S =푖 x q dA (2) R 휕푐2 ( )2 ( )2 r = x퐷∇2a푐 + 휆푐 y b (1) 휕푡− − − −

Figure 1. Schematic diagram of an agent-based model for 3D cell proliferation (left) and a spherical Figure 1. Schematic diagram of an agent-based model for 3D cell proliferation (left) and a spherical right agentagent representing representing a cell a cell overlapping overlapping with with surroundingsurrounding finite finite volumes volumes (right ( ). There). There are more are more than than 46004600 agents agents in the in the snapshot snapshot of of a simulationa simulation ((leftleft).). A A small small zoomed zoomed-in-in view view of a of cell a cellwith with surrounding surrounding finitefinite volumes volumes (rectangular (rectangular boxes) boxes) is is shown shown inin the middle. AA further further zoomed zoomed-in-in view view of the of cell the is cell is displayeddisplayed on theon the right. right. When When thethe agent’s diameter diameter is smaller is smaller than thanthe edge the of edge the rectangular of the rectangular box, the box, the agentagent cancan overlapoverlap with up up to to eight eight finite finite volumes. volumes. 푆1,S 푆12,,S …2,, ...and, and 푆8 areS8 aresurface surface areas areas that overlap that overlap eighteight finite finite volumes. volumes.

Math. Comput. Appl. 2020, 25, 2 3 of 13

Analytic formulas are not readily available for the calculation of these areas even when all geometric specifications are given. An attempt to calculate these surface areas, S ’s, can be made by q i using the function f (x, y) = r2 (x a)2 (y b)2, which results in a double as in Equation − − − − (2). This integral, however, is possible analytically only when the domain R is extremely simple in polar coordinates. Therefore, numerical calculation methods need to be deployed. Diffusions in biological contexts are usually fast. The stability of numerical schemes for a fast diffusion requires small time stepping. Furthermore, typical cancer cell simulations consider thousands of cells and use durations of days and weeks of their lives [3,5]. Considering all these, we need to find an efficient numerical method to calculate the cell surface area in finite volumes for thousands of cells repeatedly for the duration of simulation not to burden the overall numerical simulation. In this article, we suggest three different computational methods and test them for their performance in terms of the accuracy and the computational speed. The first one is a surface area calculation based on the . The second and the third methods are two different Monte Carlo methods. All these three methods are improved by using a linear system of equations for Si, i = 1, 2, ... , 8.

2. Methods Here, we suggest three different computational methods and test their performance in terms of accuracy and computation speed. The goal of each method is to calculate the values of S for 1 i 8. i ≤ ≤ In general, it is not possible to calculate those values analytically unless they fall into special cases such as when they are all identical. However, the sum of S1, S2, S3, and S4 can be calculated analytically because it is a that can be obtained by rotating an arc on a circle around an axis. The same can be computed for S5, S6, S7, and S8. The sum of S1, S2, S3, and S4, and the sum of S5, S6, S7, and S8 are also areas of two that we can get by cutting the sphere with a . It only requires knowing the of the sphere and the from the center of the sphere to the plane that cuts through it. If the distance between the center and the plane is d and the sphere radius is R, then r Z R 2 2 2 t S + S2 + S3 + S = 2π √R t 1 + dt = 2πR(R d) (3) 1 4 − R2 t2 − d − and Z r d t2 S + S + S + S = 2π √R2 t2 1 + dt = 2πR(d + R). (4) 5 6 7 8 2 2 R − R t − − Here, we assume that S1 + S2 + S3 + S4 is the area of the smaller cut. There are two sets of similar calculations that can be done. They are the set of S1 + S4 + S5 + S8 and S2 + S3 + S6 + S7, and the set of S1 + S2 + S5 + S6 and S3 + S4 + S7 + S8. These can be analytically calculated when the radius and the center of sphere are known. It appears that there is no other analytical closed form equation other than these. By collecting these, we can form a linear system of equations,   S1 + S2 + S3 + S4 = σ1   S + S + S + S = σ  5 6 7 8 2   S1 + S4 + S5 + S8 = σ3  . (5)  S2 + S3 + S6 + S7 = σ4    S1 + S2 + S5 + S6 = σ5   S3 + S4 + S7 + S8 = σ6

Here, the values of σi are knowable. This linear system, however, is redundant. A version without redundancy will be Math. Comput. Appl. 2020, 25, 2 4 of 13

  S1 + S2 + S3 + S4 = σ1   S + S + S + S = σ  5 6 7 8 2 . (6)   S1 + S4 + S5 + S8 = σ3   S1 + S2 + S5 + S6 = σ5 Since we have eight variables in four equations, we need to have more equations to find the solution. To add more equations, we will use numerical methods. In fact, we will calculate some of the Si values as additional equations. We will deploy numerical methods for this. One method is just a numerical calculation of the surface area using triangulation. The surface area calculations using triangulation are easier and simpler for areas that belong to the smaller piece when the sphere is cut by a plane. For example, S1, S2, S3, and S4 in Figure1 make the smaller cut, and they can be seen as function graphs from a same function (of x and y) with different domains on the horizontal plane (xy plane). The surface for S5 in Figure1, however, may not be seen as a function graph with a domain on a plane. This makes the calculation for S5 difficult. We can solve S5 by adding more equations to Equation (6). The other two methods are Monte Carlo methods. We will generate points on the sphere. One method will generate sample points from a uniform distribution on a sphere and the other method will design a set of points that are almost uniform on a sphere. Monte Carlo methods will count points that fall onto the region for Si and calculate Si by measuring the proportion of those points. In fact, Monte Carlo methods do not necessarily need to use Equation (6). However, we choose to use Equation (6) as well for the purpose of comparison and to improve the computation speed. Details of three methods are described in the following three subsections.

2.1. Surface Area Calculation Using Triangulation

We will use the settings in Figure1 to explain this method. It is assumed that S1, S2, S3, and S4 in the configuration presented make the smaller piece when the sphere is cut by a horizontal plane. It is also assumed that the sphere center is in the fifth octant where the surface of S5 belongs. As was mentioned earlier, the surfaces of S1, S2, S3, and S4 are function graphs with the same function formula but with different domains on the horizontal plane. Thus, the surface area calculations can be done by triangulating domains and approximating the surface with . Approximated values for Si for 1 i 4 will replace the first equation in Equation (6). S will be calculated by the same method and ≤ ≤ 8 inserted to Equation (6). Then, the new system equation is   S1 = s1   S = s  2 2   S3 = s3   S = s  4 4 . (7)   S8 = s8   S5 + S6 + S7 + S8 = σ2   + + + =  S1 S4 S5 S8 σ3   S1 + S2 + S5 + S6 = σ5

This equation is consistent and has a unique solution. Bringing the first five equations to the seventh equation, S5 can be solved. Applying the first five equations and the S5 value to the last equation, we get S6. The sixth equation can be solved for the last unknown S7. We can avoid the calculation of S5. While the method is explained based on the setting depicted in Figure1, in general, any situation can be like Figure1 with a maximum of two reflections in the respective planes. If S1, S2, S3, and S4 make the bigger piece, the sphere can be reflected with respect to the horizontal cutting surface. Then, the surface above the horizontal cutting plane will be the smaller piece. If S8 belongs to the bigger piece than S5, the reflection with respect to the vertical plane between S5 and S8 will switch the roles of S5 and S8. Reflections do not complicate the algorithm too much and it is not computationally Math. Comput. Appl. 2020, 25, 2 5 of 13

costly. Furthermore, the S8 calculation can be computed with the domain on the horizontal domain after a simple linear transformation. If the linear transformation, (x, y, z) (z, x, y) , is applied to 7→ − − the sphere, the region in the eighth octant comes up to the third octant (Figure2). Thus, S1, S2, S3, S4, and S8, all can be calculated as graphs of functions of x and y, which we found convenient. We discovered that the triangulation of the domains is one of the computationally expensive parts inMath. the Comput. algorithm. Appl. 2020, To25, x makeFOR PEER the REVIEW algorithm more efficient, we adopted a measure5 of to 13 reduce the burden of domain triangulation. Once we identify a desired resolution for the triangulation in terms of the number of vertices, a triangulation of a is generated using the mesh generation package distmesh [14]. The union of the domains for S1, S2, S3, or S4 as function graphs is a disk. The pre-generated triangulation vertices can be scaled and translated to be used for the domain of S1, S2, S3, or S4 together. For each domain, we identify vertices that are on the domain (with an appropriate margin along the straight- borders) and add vertices with similar spacings along the straight-line borders. A triangulation is generated based on this collection of vertices using the

Delaunay triangulation (Figure3). Math. FigureComput. 2. Appl. A linear 2020, transformation,25, x FOR PEER REVIEW (푥, 푦, 푧) ↦ (푧, −푥, −푦), converts 푆8 to 푆3 without changing the size5 of 13 and . The sphere on the left becomes the sphere on the right after the linear transformation. All

circles are intersections with 푥푦, 푦푧, 푥푧 planes. Note that the surface for 푆8 on the left is in the eighth octant. The same size and shape surface is in the third octant of the sphere on the right after the linear transformation.

We discovered that the triangulation of the domains is one of the computationally expensive parts in the algorithm. To make the algorithm more efficient, we adopted a measure to reduce the burden of domain triangulation. Once we identify a desired resolution for the triangulation in terms of the number of vertices, a triangulation of a disk is generated using the mesh generation package

distmeshFigure [14 2.]. A The linear union transformation, of the domains (푥, 푦, 푧 )for↦ (푆푧1, ,− 푆푥2, −, 푦푆)3,, convertsor 푆4 as 푆 8function to 푆3 without graphs changing is a disk. the The size pre- Figure 2. A linear transformation, (x, y, z) (z, x, y) , converts S8 to S3 without changing the size generatedand shape. triangulation The sphere vertices on the leftcan becomes be scaled7→ the and sphere− translated− on the right to be after used the for linear the transformation. domain of 푆 , All푆 , 푆 , and shape. The sphere on the left becomes the sphere on the right after the linear transformation.1 2 3 or 푆4circles together. are intersections For each domain, with 푥푦, we푦푧, identify푥푧 planes. vertices Note that that the are surface on thefor 푆domain8 on the (withleft is inan the appropriate eighth Allmargin circlesoctant. along are The intersections the same straight size and-line with shape borders)xy surface, yz, andxz is inplanes. add the vertices third Note octant with that of similarthe the sphere surface spacings on the for rightalongS8 afteron the the the straight leftlinear is -line inthe eighthborders. octant.transformation. A The triangulation same size is and generated shape surface based is on in the this third collection octant of of verticesthe sphere using on the the right Delaunay after the lineartriangulation transformation. (Figure 3). We discovered that the triangulation of the domains is one of the computationally expensive parts in the algorithm. To make the algorithm more efficient, we adopted a measure to reduce the burden of domain triangulation. Once we identify a desired resolution for the triangulation in terms of the number of vertices, a triangulation of a disk is generated using the mesh generation package

distmesh [14]. The union of the domains for 푆1, 푆2, 푆3, or 푆4 as function graphs is a disk. The pre- generated triangulation vertices can be scaled and translated to be used for the domain of 푆1, 푆2, 푆3, or 푆4 together. For each domain, we identify vertices that are on the domain (with an appropriate margin along the straight-line borders) and add vertices with similar spacings along the straight-line borders. A triangulation is generated based on this collection of vertices using the Delaunay triangulation (Figure 3).

Figure 3. The triangulation for the domain of 푆 . Panel (A) shows the pre-generated triangulation of Figure 3. The triangulation for the domain of S11. Panel (A) shows the pre-generated triangulation a disk with a desired resolution. In panel (B), vertices in the domain for 푆1 are identified and of a disk with a desired resolution. In panel (B), vertices in the domain for S1 are identified and collected. In this process, those vertices that are too close to the inner border lines are excluded. Panel collected. In this process, those vertices that are too close to the inner border lines are excluded. Panel (C) shows newly added vertices on the inner border lines (red dots) with a similar spatial resolution. (C) shows newly added vertices on the inner border lines (red dots) with a similar spatial resolution. The triangulation based on the black and red vertices is done in panel (D). The value of 푆1 is The triangulationcalculated using based this on triangulation. the black and red vertices is done in panel (D). The value of S1 is calculated using this triangulation. 2.2. Monte Carlo Using Sample Points from a Uniform Distribution on Spheres

Figure 3. The triangulation for the domain of 푆1. Panel (A) shows the pre-generated triangulation of

a disk with a desired resolution. In panel (B), vertices in the domain for 푆1 are identified and collected. In this process, those vertices that are too close to the inner border lines are excluded. Panel (C) shows newly added vertices on the inner border lines (red dots) with a similar spatial resolution.

The triangulation based on the black and red vertices is done in panel (D). The value of 푆1 is calculated using this triangulation.

2.2. Monte Carlo Using Sample Points from a Uniform Distribution on Spheres

Math. Comput. Appl. 2020, 25, 2 6 of 13 Math. Comput. Appl. 2020, 25, x FOR PEER REVIEW 6 of 13

2.2. MonteThere Carlo are several Using Sample different Points algorithms from a Uniform that generate Distribution uniformly on Spheres distributed sample points on spheres [15–19]. We used normally distributed random vectors to generate uniformly distributed There are several different algorithms that generate uniformly distributed sample points on sample points on spheres [20,21]. When three-dimensional vectors, 푿 = (푥1, 푥2, 푥3), are generated spheres [15–19]. We used normally distributed random vectors to generate uniformly distributed with all 푥푖 values from 푁(0,1) , the standard distribution, the collection of 푿/|푿| are sample points on spheres [20,21]. When three-dimensional vectors, X = (x1, x2, x3),2 are generated2 uniformly distributed on the unit 2-sphere as vertices (points). Here, |푿| = √푥1 + 푥2 + 푥3 . A set of with all x values from N(0, 1), the standard normal distribution, the collection of X/ X are uniformly these randomi points will be generated. For any sphere representingq a cell, these random| | points will distributedbe scaled and on translated the unit 2-sphere to fit on as the vertices surface (points). of a cell Here,-representingX = x 2sphere.+ x2 + Fivex2. A areas, set of 푆 these, 푆 , random푆 , 푆 , 푆 | | 1 2 3 1 2 3 4 8 pointsin Figure will 1, be for generated. example, Forwillany be approximately sphere representing calculated a cell, using these a random Monte Carlo points method, will be scaled that is, and by translatedcounting points to fit on on the the surface corresponding of a cell-representing regions. The sphere. remaining Five areas, three valuesS1, S2, willS3, S be4, S calculated8 in Figure by1, forEquation example, (7). will be approximately calculated using a Monte Carlo method, that is, by counting points on the corresponding regions. The remaining three values will be calculated by Equation (7). 2.3. Monte Carlo Using the Icosahedron-Based Vertices on Spheres 2.3. Monte Carlo Using the Icosahedron-Based Vertices on Spheres The method in the previous section was to generate dense enough random samples that convergeThe method to the uniform in the previous distributi sectionon over was the to generatesphere and dense classify enough those random points samples using the that regions converge in toeight the uniformoctants. Since distribution the sample over thepoints sphere are andrandomly classify generated, those points the using uniformity the regions may in vary, eight and octants. the Sincecomputational the sample performance points are randomlymay fluctuate. generated, In this the section, uniformity we will may introduce vary, and another the computational method that performanceuses almost uniform may fluctuate. vertices In distributed this section, on we the will sphere. introduce We anothergenerate method almost that uniform uses almostvertices uniform on the verticessphere using distributed icosahedral on the sphere.triangulation We generate [22]. A almost regular uniform icosahedron vertices has on twelve the sphere vertices, using thirty icosahedral edges, triangulationand twenty faces. [22]. AEach regular face icosahedronis an equilateral has twelve triangl vertices,e. A regular thirty icosahedron edges, and twentycan be faces.embedded Each facein a issphere an equilateral in a way .that all vertices A regular are icosahedron on the surface can of be sphere. embedded These in twelve a sphere vertices in a way are that vertices all vertices of the arezeroth on the-generation surface of almost sphere. uniform These twelvevertices vertices on the sphere. are vertices The offirst the-generation zeroth-generation almost uniform almost uniformvertices verticeson the sphere on the sphere.are built The based first-generation on the zeroth almost-generation uniform by vertices finding on the spheremidpoint are of built each based edge on and the zeroth-generationprojecting (from the by findingcenter of the the midpoint sphere) of those each midpoints edge and projecting on the sphere (from surface. the center These of the projected sphere) thosepoints midpoints are the new on the vertex sphere addition. surface. These Since projected there are points thirty are edges the newon vertexthe icosahedron, addition. Since the there first- aregeneration thirty edges almost on uniform the icosahedron, vertices consist the first-generation of forty-two vertices. almost uniform To make vertices the second consist-generation, of forty-two it is vertices.required Toto maketriangulate the second-generation, those forty-two vertices it is required, and the to triangulateprojections thoseof each forty-two edge midpoint vertices, onto and thethe projectionssphere surface of each are edge added midpoint as new onto vert theices sphere. Any generationsurface are added can be as found new vertices. iteratively Any based generation on the canprevious be found generation. iteratively Figure based 4 onshows the previous the triangulation generation. based Figure on4 showsthe almost the triangulation uniform icosahedron based on- thebased almost vertices. uniform icosahedron-based vertices.

FigureFigure 4.4. Icosahedron-basedIcosahedron-based vertices on a sphere. The zeroth, first,first, andand fourth-generationfourth-generation vertices areare shownshown withwith triangulation.triangulation.

AsAs the the generation generation number number increases, increases, the the number number of total of total vertices vertices increases. increases. If Vi, E Ifi ,푉 and푖 , 퐸F푖 ,i denote and 퐹푖 thedenote number the number of vertices, of vertices, edges, and edges, faces, and respectively, faces, respectively, of the ith-generation, of the 푖th-generation, we have weV0 =have12, E푉0 = 1230, F퐸00 == 2030., It퐹0 is= also20. obvious It is also that obviousVi+1 =thatVi +푉푖+E1i and= 푉푖 F+i+퐸1푖 =and4F i.퐹 Since푖+1 = the4퐹푖. EulerSince characteristic the of a zeroof a genus surface zero is 2,surfaceEi+1 = isV 2,i +퐸푖E+i1+=4 F푉푖i +2퐸.푖 Thus,+ 4퐹푖 − we2. can Thus, only we choose can only the choose number the of number vertices of from vertices the ∞ − sequencefrom the ofsequenceV ∞ =of V{푉푖}=푖=12,1 = V{푉0==42,12,V푉1 ==42162,, 푉2V= 162= 642,, 푉3 =V 642= 2562,, 푉4 = 2562V =, 푉10,5 = 242,10,242... ., … We}. willWe { i}i=1 { 0 1 2 3 4 5 } pickwill pick a vertex a vertex set fromset from a generation a generation and and use use them them as as random random sample sample points points for for the the MonteMonte CarloCarlo method. Figure 5 compares vertices on a matching region from the random 40,962 sample points from

Math. Comput. Appl. 2020, 25, 2 7 of 13

Math. Comput. Appl. 2020, 25, x FOR PEER REVIEW 7 of 13 method. Figure5 compares vertices on a matching region from the random 40,962 sample points thefrom uniform the uniform distribution distribution in Section in Section 0 and 0vertices and vertices from fromthe sixth the- sixth-generationgeneration icosahedral icosahedral vertices. vertices. The verticesThe vertices collected collected from from random random sample sample points points show show stochasticity stochasticity,, whereas whereas the the points points from from the icosahedronicosahedron-based-based vertices are spaced regularly.

Figure 5. CComparisonomparison of of points points on on a a matching region region that are collected from 40,962 random sample points from from the the uniform uniform distribution distribution (red, (red, leftleft) described) described in 0 inand 0 andfrom from40,962 40,962 vertices vertices in the insixth the- generationsixth-generation icosahedron icosahedron-based-based vertices vertices (blue, right (blue,). Theright dots). in The the dotsregion in on the the region sphere on and the the sphere front viewsand the are front shown. views There are shown.are 1086 There red dots are 1086and 1015 red dotsblue anddots. 1015 blue dots.

2.4. Implementations Implementations for for Comparison Comparison We willwill comparecompare the the three three methods methods in diinff differenterent spatial spatial resolutions resolutions in terms in terms of computational of computational speed speedand accuracy. and accuracy. A set of A randomly set of randomly generated generated one hundred one cellshundred (spheres) cells is (spheres) used to test is used the performance to test the performanceof three methods. of three The methods. number of The vertices number in the of icosahedron-basedvertices in the icosahedron vertex set-based is fixed vertex at each set generation. is fixed at eachThe icosahedron-basedgeneration. The icosahedron vertices from-based the first-generationvertices from the to first the- eighth-generationgeneration to the areeighth used.-generation To make arefair used. comparisons, To make sets fair of comparisons, sample points sets from of thesample uniform points distribution from the uniform on the surface distribution of the onsphere the surfaceare generated of the sphere (middle are column generated in Table (middle1) following column in the Table number 1) following of vertices the innumber icosahedron-based of vertices in icosahedronmethods. The-based vertices methods. in the The sets vertices of sample in the points sets of from sample the uniformpoints from distribution the uniform are distribution incremental arebecause incremental the icosahedron-based because the icosahedron vertices are-based incremental. vertices are For incremental. example, 162 For vertices example, in case162 vertices number in 2 casecontain number 42 vertices 2 contain in case 42 vertices number in 1. case While number the icosahedron-based 1. While the icosahedron vertices-based and sample vertices point and verticessample pointfrom thevertices uniform from distribution the uniform are distribution on the surface are on of the a sphere, surface the of verticesa sphere, used the vertices for the triangulation used for the triangulationmethod are on method a disk are and on used a disk to and triangulate used to triangulate areas on a sphere,areas on but a sphere, not the but whole, not the half-sphere whole, half at- spheremost. Thus, at most. we consider Thus, we a considerhalf number a half of vertices number in of the vertices triangulation in the triangulation method to be method equivalent to be to, equivalentin terms of to, the in number terms of of the vertices, number the of Montevertices, Carlo the Monte methods Carlo with methods double with vertices. double The vertices. cases used The casesfor the used comparison for the comparison with the number with the of verticesnumber areof vertices listed in are Table listed1. There in Table are only1. There six cases are only for thesix casestriangulation for the triang methodulation whereas method there whereas are eight there cases are for eight the cases other for two the methods. other two We methods. did not We include did ntheot twoinclude cases the that two correspond cases that tocorrespond cases 7 and to 8cases of the 7 otherand 8 twoof the methods other two because methods the triangulation because the triangulationmethod takes method too long takes to compute too long at thoseto compute resolutions. at those Instead resolutions. of including Instead those of including cases, we those will use cases, the weresult will from use thethe triangulationresult from the with triangulation 333,065 vertices, with 333,065 which correspond vertices, which to case correspond number 8, to as case the accuracynumber reference (true values). It is the eight hundred area calculations (8 pieces 100 cells). The average× 8, as the accuracy reference (true values). It is the eight hundred area calculations× (8 pieces 100 cells).percentage The average errors will percentage be calculated errors using will thebe calculated result from using the triangulation the result from with the 333,065 triangulation vertices aswith the 333,065true values. vertices In fact, as the the true triangulation values. In methodfact, the is triangulation a numerical calculationmethod is a of numerical the integral calculation in Equation of the (2). integralThus, it isin certainEquation that (2). the Thus, values it is from certain the that triangular the values method from converge the triangula to ther method true value. converge to the true value.Cells represented by spheres can be anywhere in the computational domain. Monte Carlo methods may perform differently not only depending on the sample point used but also depending on the center location and the radius of the sphereTable due 1. to The the number fact that of thosevertices. eight pieces cut by the finite volumes around the sphere will be different and random. The set of one hundred randomly generated cells Case Number Triangulation Uniform Distribution Icosahedron-Based (spheres) that we use for the test has a few conditions. Since we set the of each finite volume 1 21 42 42 by 7 µm 7 µm 7 µm, each cell radius is limited between 5 and 7 µm. So, a cell can overlap with × 2× 82 162 162 a maximum of eight finite volumes, as shown in in Figure1. Therefore, generating random spheres having centers around3 the origin and320 overlapping only with642 a maximum of eight642 finite volumes around the origin will be enough4 to represent1243 random cells in the2562 whole computational2562 domain. Tests done by using these randomly5 generated5120 spheres will also eliminate10,242 the necessity to10,242 consider other sample points from the uniform6 distribution20,504 on a sphere. Three40,962 methods will be used40,962 to calculate five areas 7 N/A 163,842 163,842 8 N/A 655,362 655,362

Math. Comput. Appl. 2020, 25, 2 8 of 13

(S1, S2, S3, S4, and S8 for a cell in Figure1) of each cell and the remaining three areas will be solved through system equations such as Equation (7). The time to perform all calculations for one hundred Math. Comput. Appl. 2020, 25, x FOR PEER REVIEW 8 of 13 spheres is measured for the computation speed. The hundred-cell calculation is repeated thirty times and theCells average represented over thirty by spheres repetitions can isbe presented. anywhere The in the basic computational flowchart for domain. the computation Monte Carlo is in ® methodsFigure6 and may MATLAB perform differentlyis used for not programming. only depending on the sample point used but also depending on the center location and the radius of the sphere due to the fact that those eight pieces cut by the Table 1. The number of vertices. finite volumes around the sphere will be different and random. The set of one hundred randomly generated Casecells Number(spheres) that Triangulation we use for the test Uniform has a few Distribution conditions. Since Icosahedron-Based we set the dimension of each finite volume1 by 7 μm × 7 μm 21 × 7 μm, each cell radius 42 is limited between 5 42and 7 μm. So, a cell can overlap with a maximum of eight finite volumes, as shown in in Figure 1. Therefore, generating 2 82 162 162 random spheres having centers around the origin and overlapping only with a maximum of eight 3 320 642 642 finite volumes around the origin will be enough to represent random cells in the whole computational domain. Tests done4 by using these 1243 randomly generated 2562 spheres will also eliminate 2562 the necessity to consider other sample5 points from 5120 the uniform distribution 10,242 on a sphere. Three 10,242methods will be used to calculate five areas6 (푆1, 푆2, 푆3, 20,504푆4, and 푆8 for a cell in 40,962 Figure 1) of each cell and 40,962 the remaining three areas will be solved7 through system N/A equations such 163,842 as Equation (7). The 163,842 time to perform all calculations for one hundred spheres is measured for the computation speed. The hundred-cell 8 N/A 655,362 655,362 calculation is repeated thirty times and the average over thirty repetitions is presented. The basic flowchart for the computation is in Figure 6 and MATLAB® is used for programming.

Figure 6. FlowFlow chart for computations inin threethree methods. methods. This This flow flow chart chart describes describes the the basic basic structure structure of ofthe the computations computations performed performed by by three three methods. methods. There There are are two two parts parts that that are are method method specific. specific. They They are areindicated indicated with with thickened thickened boxes. boxes. A A set set of of pre-generated pre-generated 100 100 cells cells is is commonly commonly used.used. Each method computedcomputed eight areasareas ofof everyevery cell—acell—a total total of of 800 800 area area calculations. calculations. These These calculations calculations are are repeated repeated 30 30times times to measureto measure the the average average computation computation time. time.

3. Results Figure 7 shows the average percentage error and the average computation time of all three methods with up to eight cases as listed in Table 1. The blue lines in each graph show the average percentage error and the red graphs are the average calculation time. All methods show increasing computational time as the error decreases. The patterns of increment and decrement are approximately exponential. The exponential increment and decrement are expected since the number of vertices in the icosahedron-based vertex generation approximately goes up by four-fold from one

Math. Comput. Appl. 2020, 25, 2 9 of 13

3. Results Figure7 shows the average percentage error and the average computation time of all three methods with up to eight cases as listed in Table1. The blue lines in each graph show the average percentage error and the red graphs are the average calculation time. All methods show increasing computational time as the error decreases. The patterns of increment and decrement are approximately exponential. The exponential increment and decrement are expected since the number of vertices in the icosahedron-based vertex generation approximately goes up by four-fold from one generation to the next generation, while other methods followed the number of vertices in the icosahedron-based method. The triangulation method always showed better accuracy for equivalent vertices counts. The worst error is about 13% whereas the other methods recorded higher than 17% error. The lowest average error for the triangulation method was 0.015% but the other two methods could not achieve that low-level error even with a larger number of vertices. While the triangulation method achieved the best accuracy, it took much longer to produce more accurate results. Monte Carlo methods finished calculations in about 3 s in case number 8, whereas the triangulation method took approximately 350 s in case number 6. In the algorithm of the triangulation method, the triangulation of the domain depicted by D in Figure3 is done by the Delaunay algorithm. This turned out to be computationally expensive. Comparing two Monte Carlo methods, the icosahedron-based method was superior to the sampling from a uniform distribution. Since the vertices themselves in the icosahedron-based method are almost uniform, the icosahedron-based method achieved better average accuracy than the Monte Carlo method using sample points from a uniform distribution. The stochasticity in the sample points presumably contributed to the bigger average error even though two methods use the same number of vertices. Interestingly, the computation time was also slightly but consistently longer in the case of the sample points method. Figure8 has the computational time against the average percentage error in the common logarithm scale for the three methods. The data points are from Figure7. All plots show approximately decreasing linear graphs. Stochasticity of the sample points in the Monte Carlo method negatively impacts the convergence rate, resulting in the graph being more deviated from a linear graph than the other two methods in this log scale. These graphs show the performance of the three methods more clearly and allow us to compare them. According to these graphs, at the average error of 0.1% or higher, the icosahedron-based method provides quick ways to perform calculations. However, this may not be true at a lower average error level. The trend shown along the graph of the icosahedron-based method suggests this. If there were one or two more points to the left of the current graph (red), the shape of the graph suggests that it will cross the blue plot. This means that the icosahedron-based method can be more costly than the triangulation method for the same average accuracy. Adding two more data points on the red graph requires the ninth and tenth-generation icosahedron-based vertices. We did not include those generation vertices because generating those vertices was extremely computationally costly. Judging by the patterns of graphs in Figure8, using the ninth-generation or the tenth-generation vertices will be a not efficient method to adopt for finite volume simulations. Math. Comput. Appl. 2020, 25, 2 10 of 13 Math. Comput. Appl. 2020, 25, x FOR PEER REVIEW 10 of 13

Figure 7. AverageAverage percent percent error error and and average average calculation calculation time time from from three three methods. methods. The blue The blueplots plotswith withdiamond diamond markers markers are the are average the average percent percent error errorwhich which follows follows the vertical the vertical axis on axis the on left the side. left Each side. Eachdata point data point is the is average the average over over 800 800area area calculations calculations for for 100 100 cells. cells. The The values values from from the the triangulation triangulation method with 333,064 vertices on the disk domain are used asas thethe exactexact values.values. The red plots with asterisks are the average calculation time that uses the axisaxis onon thethe rightright side.side. The average t timeime is calculated from 30 repetitions ofof the 800 area calculations forfor 100100 cells. The horizontal axes are all case numbers which are listed in Table1 1..

Figure 8 has the computational time against the average percentage error in the common logarithm scale for the three methods. The data points are from Figure 7. All plots show approximately decreasing linear graphs. Stochasticity of the sample points in the Monte Carlo method negatively impacts the convergence rate, resulting in the graph being more deviated from a linear graph than the other two methods in this log scale. These graphs show the performance of the three methods more clearly and allow us to compare them. According to these graphs, at the average error of 0.1% or higher, the icosahedron-based method provides quick ways to perform calculations.

Math. Comput. Appl. 2020, 25, x FOR PEER REVIEW 11 of 13

However, this may not be true at a lower average error level. The trend shown along the graph of the icosahedron-based method suggests this. If there were one or two more points to the left end of the current graph (red), the shape of the graph suggests that it will cross the blue plot. This means that the icosahedron-based method can be more costly than the triangulation method for the same average accuracy. Adding two more data points on the red graph requires the ninth and tenth-generation icosahedron-based vertices. We did not include those generation vertices because generating those vertices was extremely computationally costly. Judging by the patterns of graphs in Figure 8, using theMath. ninth Comput.-generation Appl. 2020 ,or25 ,the 2 tenth-generation vertices will be a not efficient method to adopt for11 finite of 13 volume simulations.

FigureFigure 8. TheThe average average computation computation time time (T ) ( vs.푇) thevs. average the average percent percent error (E error) in the (퐸 common) in the logarithm common logarithmscale. The scale. method The 1 ismethod the calculation 1 is the basedcalcula ontion triangulation. based on triangulation. The method 2The is themethod Monte 2 Carlois the methodMonte Carlousing method sample pointsusing sample from a uniformpoints from distribution a uniform on distribution a sphere. The on methoda sphere. 3 The is the method Monte 3 Carlo is the methodMonte Carlousing method the icosahedron-based using the icosahedron vertices.-based The data vertices. points The are data from points Figure are7. from Figure 7. 4. Discussion 4. Discussion In this article, we have shown that the quasi-Monte Carlo method using the icosahedron-based In this article, we have shown that the quasi-Monte Carlo method using the icosahedron-based almost uniform vertices on spheres can be a well-balanced method to calculate areas on a sphere almost uniform vertices on spheres can be a well-balanced method to calculate areas on a sphere intersecting with rectangular finite volumes. The quasi-Monte Carlo method has been reported to be a intersecting with rectangular finite volumes. The quasi-Monte Carlo method has been reported to be more efficient tool in various contexts [23,24]. We also showed that the triangulation method, in which a more efficient tool in various contexts [23,24]. We also showed that the triangulation method, in the partial sphere surfaces need to be a graph of a two-variable function, can be used in conjunction which the partial sphere surfaces need to be a graph of a two-variable function, can be used in with a linear system of equations to calculate the area on a sphere intersecting with rectangular finite conjunction with a linear system of equations to calculate the area on a sphere intersecting with volumes. In all methods discussed in this article, we utilized pre-generated vertices for efficiency and rectangular finite volumes. In all methods discussed in this article, we utilized pre-generated vertices avoided the full generation of vertices for each sphere. Generating uniformly distributed vertices, for efficiency and avoided the full generation of vertices for each sphere. Generating uniformly especially with neighborhood relation, is computationally expensive. We tested three methods to distributed vertices, especially with neighborhood relation, is computationally expensive. We tested capture the cell surface reaction contribution in a finite volume implementation. The icosahedron-based three methods to capture the cell surface reaction contribution in a finite volume implementation. method would be our choice because it is capable of obtaining good accuracy in a short time. Moreover, The icosahedron-based method would be our choice because it is capable of obtaining good accuracy the coding is simple to produce. These three methods are compared by point-wise comparison. Yet, in a short time. Moreover, the coding is simple to produce. These three methods are compared by the total (global) reaction rate remains the same across these methods because each cell’s reaction rate point-wise comparison. Yet, the total (global) reaction rate remains the same across these methods contribution is proportional to the cell surface area (sphere area) and the cell surface was kept to be because each cell’s reaction rate contribution is proportional to the cell surface area (sphere area) and the exact value through the linear system of equations. The impact of these different methods on the the cell surface was kept to be the exact value through the linear system of equations. The impact of diffusion-reaction system in the whole domain and in the long term was not within the scope of this these different methods on the diffusion-reaction system in the whole domain and in the long term article and we intend to address this in future work. was not within the scope of this article and we intend to address this in future work. There is another potential advantage of icosahedron-based methods. Reactions on the cell surface There is another potential advantage of icosahedron-based methods. Reactions on the cell include the reaction through cell surface receptors. When surface receptor locations are equally likely surface include the reaction through cell surface receptors. When surface receptor locations are on the cell surface, the cell area in each finite volume can be used as the reaction contribution from the

cell to the finite volume. It is, however, known that cell surface receptors can move around and be localized on the cell surface [25,26]. The icosahedron-based method is capable of tracing any region on the surface and measuring the area. Therefore, the icosahedron-based method will be suitable in cases where unequally distributed or localized surface receptors need to be considered. The icosahedron-based vertices are generated by adding the projection of the midpoint at each edge of the previous generation. This is why almost uniformity is maintained. It is also why the number of vertices increases only by four-fold from the previous generation, whereas the number of Math. Comput. Appl. 2020, 25, 2 12 of 13 sample points from a uniform distribution can be arbitrary. There is a variation we may introduce to make icosahedron-based vertices other than those fixed numbers by the generation. Instead of putting the midpoint on each edge, two trisection points can be added on each edge. This will generate a different sequence of numbers for the vertex counts. Or, we can even proceed by mixing bisection generation and trisection generation. Trisection, however, appears to affect the uniformity a bit more.

Author Contributions: Conceptualization, M.K.; methodology, A.B., J.B., and M.K.; software, A.B. and M.K.; validation, A.B., J.B., and M.K.; writing—original draft preparation, A.B., J.B., and M.K.; writing—review and editing, A.B, J.B., and M.K.; visualization, M.K. All authors have read and agreed to the published version of the manuscript. Acknowledgments: The abstract was presented as a platform in Platform: Computational Methods and Bioinformatics, Biophysical Journal. Conflicts of Interest: The authors declare no conflict of interest. Data Availability: The data used to support the findings of this study are available from the corresponding author upon request.

References

1. Rejniak, K.A. Homeostatic Imbalance in Epithelial Ducts and Its Role in Carcinogenesis. Scientifica 2012, 2012, 132978. [CrossRef][PubMed] 2. Kim, M.J.; Reed, D.; Rejniak, K.A. The formation of tight tumor clusters affects the efficacy of cell cycle inhibitors: A hybrid model study. J. Theor. Biol. 2014, 352, 31–50. [CrossRef][PubMed] 3. Kim, E.; Rebecca, V.; Fedorenko, I.V.; Messina, J.L.; Mathew, R.; Maria-Engler, S.S.; Basanta, D.; Smalley, K.S.M.; Anderson, A.R.A. Senescent fibroblasts in melanoma initiation and progression: An integrated theoretical, experimental, and clinical approach. Cancer Res. 2013, 73, 6874–6885. [CrossRef][PubMed] 4. Müller, M.; Charypar, D.; Gross, M. Particle-Based Fluid Simulation for Interactive Applications. Available online: https://matthias-research.github.io/pages/publications/sca03.pdf (accessed on 23 December 2019). 5. Auer, S. Realtime particle-based fluid simulation. Ph.D. Thesis, Technische Universität München, München, Germany, 2009. 6. Goedhart, P.W.; Lof, M.E.; Bianchi, F.J.J.A.; Baveco, H.J.M.; van der Werf, W. Modelling mobile agent-based ecosystem services using kernel-weighted predictors. Methods Ecol. Evol. 2018, 9, 1241–1249. [CrossRef] 7. McLane, A.J.; Semeniuk, C.; McDermid, G.J.; Marceau, D.J. The role of agent-based models in wildlife ecology and management. Ecol. Model. 2011, 222, 1544–1556. [CrossRef] 8. Kennedy, W.G. Modelling Human Behaviour in Agent-Based Models. In Agent-Based Models of Geographical Systems; Springer: Dordrecht, The Netherlands, 2012; pp. 167–179. 9. Bonabeau, E. Agent-based modeling: Methods and techniques for simulating human systems. Proc. Natl. Acad. Sci. USA 2002, 99, 7280–7287. [CrossRef][PubMed] 10. North, M.J.; Macal, C.M. Managing Business Complexity: Discovering Strategic Solutions with Agent-Based Modeling and Simulation; Oxford University Press: New York, NY, USA, 2007. 11. Ghaffarizadeh, A.; Friedman, S.H.; MacKlin, P. BioFVM: An efficient, parallelized diffusive transport solver for 3-D biological simulations. Bioinformatics 2015, 32, 1256–1258. [CrossRef][PubMed] 12. Kim, M.J.; Baek, S.; Jung, S.H.; Cho, K.H. Dynamical characteristics of bacteria clustering by self-generated attractants. Comput. Biol. Chem. 2007, 31, 328–334. [CrossRef][PubMed] 13. Kim, B.J.; Forbes, N.S. Single-cell analysis demonstrates how nutrient deprivation creates apoptotic and quiescent cell populations in tumor cylindroids. Biotechnol. Bioeng. 2008, 101, 797–810. [CrossRef][PubMed] 14. Persson, P.-O.; Strang, G. A Simple Mesh Generator in MATLAB. SIAM Rev. 2004, 46, 329–345. [CrossRef] 15. Hicks, J.S.; Wheeling, R.F. An efficient method for generating uniformly distributed points on the surface of an n-dimensional sphere. Commun. ACM 1959, 2, 17–19. [CrossRef] 16. Muller, M.E. A note on a method for generating points uniformly on n-dimensional spheres. Commun. ACM 1959, 2, 19–20. [CrossRef] 17. Tashiro, Y. On methods for generating uniform random points on the surface of a sphere. Ann. Inst. Stat. Math. 1977, 29, 295–300. [CrossRef] Math. Comput. Appl. 2020, 25, 2 13 of 13

18. Sibuya, M. A method for generating uniformly distributed points on N-dimensional spheres. Ann. Inst. Stat. Math. 1962, 14, 81–85. [CrossRef] 19. Harman, R.; Lacko, V. On decompositional algorithms for uniform sampling from n-spheres and n-balls. J. Multivar. Anal. 2010, 1, 2297–2304. [CrossRef] 20. Poland, J. Three Different Algorithms for Generating Uniformly Distributed Random Points on the N-Sphere. Available online: https://pdfs.semanticscholar.org/467c/634bc770002ad3d85ccfe05c31e981508669. pdf (accessed on 21 December 2019). 21. Knuth, D.E. The Art of Computer Programming. Volume 2: Seminumerical Algorithms; Addison-Wesley: Boston, MA, USA, 1997. 22. Baumgardner, J.R.; Frederickson, P.O. Icosahedral Discretization of the Two-Sphere. SIAM J. Numer. Anal. 1985, 22, 1107–1115. [CrossRef] 23. Caflisch, R.E. Monte Carlo and quasi-Monte Carlo methods. Acta Numer. 1998, 7, 1–49. [CrossRef] 24. Schürer, R. A comparison between (quasi-)Monte Carlo and cubature rule based methods for solving high-dimensional integration problems. Math. Comput. Simul. 2003, 62, 509–517. [CrossRef] 25. Hislop, J.N.; Von Zastrow, M. Analysis of GPCR localization and trafficking. Methods Mol. Biol. 2011, 746, 425–440. [PubMed] 26. Steagall, R.J.; Yao, F.; Shaikh, S.R.; Abdel-Rahman, A.A. Estrogen receptor α activation enhances its cell surface localization and improves myocardial redox status in ovariectomized rats. Life Sci. 2017, 182, 41–49. [CrossRef][PubMed]

© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).