im_out = alphaShape2im(shp,center_coord,im_size,scaling) creates a binary image with size im_size that represents a given alphaShape "shp". "alphaShape2im" maps the center voxel(s) to the reference center coordinate "center_coord". Each voxel represents an isotropic volume which can be scaled with a factor "scaling"; higher scaling factors correspond to higher resolutions.

This FEX submission contains some tools I find to be handy supplements to bwpropfilt, bwareaopen, and other routines from the Image Processing Toolbox for analyzing objects in images. They include:1. BWLPROPFILTN, BWLAREAFILTN, BWLAREAOPENN: Extensions of bwpropfilt, bwareafilt and bwareaopen to accomodate N-dimensional images.2. BWLMASKPROPFILTN: A function to extract objects based on properties of their intersections with a user-supplied binary mask. Handles N-dimensional images.3. BWLALPHACLOSE: similar to bwconvhull, this will use an alpha shape to seal or reduce concavities in objects (2D and 3D images only).4. BWLDILATE, BWLERODE, BWLCLOSE, BWLOPEN: Extensions of imdilate,imerode,imclose,imopen, to accomodate N-dimensional label maps.All of these routines support both binary images and label maps.See the help() documentation for usage instructions and the Examples tab for demos.

See also http://www.dylan-muir.com/articles/alpha_hulls/Usage: [triHull, vbOutside, vbInside] = AlphaHull(mfPoints, fAlphaRadius , triDelaunay)This function computes the alpha shape / alpha hulls of a set of points; both the external hull as well as interior voids. The Matlab parfor construct is used by the function, so that this code will run quickly on a machine running several instances of the Matlab parallel computing toolbox.This algorithm is based on qhull and the delaunay tetrahedralisation of the set of points. It will return a hull triangulation, and ignore points connected only by a line.'mfPoints' is an Nx3 matrix, where each row defines a point in 3-space. AlphaHull will find the hull of the set of points in 'mfPoints'.'fAlphaRadius' is a scalar distance which defines the parameter alpha of the alpha hull. This distance is interpreted as the radius of a sphere that will "roll around" the surface, with the boundary of the sphere touching one to three of the points in 'mfPoints'. The triangles of the Delaunay tetrahedralisation where the spere can fit without intersecting any other points will form part of the alpha hull.The optional parameter 'triDelaunay' can be used to provide the Delaunary tetrahedralisation of the set of points, if it is known in advance.'triHull' will be a triangulation containing triangles that fall either on the alpha hull surface, or on the inside surface of an alpha void (a hole) within the point set. The boolean vectors 'vbOutside' and 'vbInside' define which rows of 'triHull' define "outside" and "inside" hulls. The surfaces returned by AlphaHull will be convex to the space parameter alpha.'triHull' will be a Tx3 matrix, where each row ['p1' 'p2' 'p3'] defines a triangle on an alpha surface. The indices 'pn' refer to rows in 'mfPoints', and so define triangles including three of the original points.* Caveats and room for improvement *The method for labelling "inside" and "outside" triangles is not ideal. It works by deciding whether the normal of a triangle, in the direction away from the rest of the point cloud, points in the direction of the point set centroid. A better technique might be to iterate along the surface, labelling triangles consistently as you go. If you improve on this, I'd love to hear about it.

ASHAPE is a simple wrapper for ASLIB, which implements several (optimized) subroutines to extract and display 2d alpha shapes and alpha patches from a set of x/y data pointsASLIB returns a structure, which contains all relevant parameters, data and results including graphics handles to plotted elementsfurthermore, ASLIB returns function handles to all of its computational and graphics subroutines, which can be used by a programmer to create more elaborate wrappers or guisthe latest version of ASLIB can always be attached to an existing set of parameters p by> p.f = aslib;or by simply re-running the data> p = ashape(p);for general instructions see:> help ashape> help aslibfor explanations of subroutines and a small glossary of terms see:> aslib -sfor explanations of fields see:> aslib -ffor explanations of options see:> aslib -olook at the accompanying published m-file for a few examples

ZoomPlotMATLAB Code for Interactive Magnification of Customized Regions.Version 1.3, 17-JAN-2022Email: iqiukp@outlook.com✨ Main featuresEasy application with just two lines of codeInteractive plottingSupport for image and figure classesSupport for multiple zoomed zonesCustom settings of parameters and themes⚠️ RequirementsR2014b and later releasesImage Processing Toolbox👉 How to useAdd BaseZoom.m file to MATLAB search path or current working directoryAfter completing the basic drawing, enter the following two lines of code in the command line window or your m-file:% add a zoomed zonezp = BaseZoom();zp.plot;if multiple zoomed zones are required, for example, 3 zoomed zones, the code are as follows:% add 3 zoomed zoneszp = BaseZoom();zp.plot;zp.plot;zp.plot;👉 Examples for image classMultiple types of image are supported for interactive magnification of customized regions in the ZoomPlot. 👉 Examples for figure classMultiple zoomed zones are supported for figure class. 👉 How to customize the theme of the sub-coordinate systemJust modify the properties of the BaseZoom class file. The default properties are: % theme of inserted axes (sub-axes) properties subAxesBox = 'on' subAxesinsertedLineWidth = 1.2 subAxesTickDirection = 'in' subAxesBackgroundColor = 'w' endFor example, remove the border of the sub-coordinate system and set the line width to 3: % theme of inserted axes (sub-axes) properties subAxesBox = 'off' subAxesinsertedLineWidth = 3 subAxesTickDirection = 'in' subAxesBackgroundColor = 'w' end 👉 How to customize the theme of the zoomed zoneJust modify the properties of the BaseZoom class file. The default properties are: % theme of the zoomed zone (figures) properties rectangleColor = 'k' rectangleFaceColor = 'none' rectangleFaceAlpha = 0 rectangleLineStyle = '-' rectangleLineWidth = 1.2 rectangleInteractionsAllowed = 'none' endFor example, set the line color to red and the line width to 2: % theme of the zoomed zone (figures) properties rectangleColor = 'r' rectangleFaceColor = 'none' rectangleFaceAlpha = 0 rectangleLineStyle = '-' rectangleLineWidth = 2 rectangleInteractionsAllowed = 'none' end 👉 How to customize the theme of the connected linesJust modify the properties of the BaseZoom class file. The default properties are: % theme of the connected lines (figures) properties % setting of lines between arrows figureConnectedLineStyle = ':' figureConnectedLineColor = 'k' figureConnectedLineWidth = 1.2 % setting of start arrow figureConnectedLineStartHeadStyle = 'ellipse' % shape of start arrow figureConnectedLineStartHeadLength = 3 figureConnectedLineStartHeadWidth = 3 % setting of end arrow figureConnectedLineEndHeadStyle = 'cback2' % shape of ending arrow figureConnectedLineEndHeadLength = 7 figureConnectedLineEndHeadWidth = 7 endFor example, set the shape of ending arrow to 'ellipse' and the line color to 'b': % theme of the connected lines (figures) properties % setting of lines between arrows figureConnectedLineStyle = ':' figureConnectedLineColor = 'r' figureConnectedLineWidth = 1.2 % setting of start arrow figureConnectedLineStartHeadStyle = 'ellipse' % shape of start arrow figureConnectedLineStartHeadLength = 3 figureConnectedLineStartHeadWidth = 3 % setting of end arrow figureConnectedLineEndHeadStyle = 'ellipse' % shape of ending arrow figureConnectedLineEndHeadLength = 7 figureConnectedLineEndHeadWidth = 7 end

This tool generates mesh for 2D mesoscale geometries. It can be used especially for mesoscale analysis of concrete and asphalt composites. The elements are divided into three sets. One set named "Aggregate" in the elements set consists of cst elements for the aggregate particles. The other set is named "Matrix" consist of cst elements for the matrix material. A third set "ITZ" consists of cst elements for the interface layer between aggregate and matrix if the ITZ_thickness variable is equal more than zero. If it is zero, the there will be no third set "ITZ" and rigid interface between aggregate and matrix and the interface is assumed rigid between them. The mesh is plotted in matlab and saved in Abaqus input (*.inp) file.Important Note: This tool requires MESH2D mesh generator (tested with version 3.1.0.1). The user should download it put it in the same folder or inside the folder of this tool. The link for MESH 2D is: https://www.mathworks.com/matlabcentral/fileexchange/25555-mesh2d-delaunay-based-unstructured-mesh-generationThree example files are provided for the mesh of notched beam "Example_Beam.m", cylinder "Example_Cylinder.m", and cube "Example_Cube.m" assuming rigid bond between aggregate and matrix. Another three for notched beam "Example_Beam_ITZ.m", cylinder "Example_Cylinder_ITZ.m", and cube "Example_Cube_ITZ.m" with ITZ layer.1-function Classes=Particles_Generation(x,y,z,Classes_diameters,Alpha,m,Particle_ratio)Generates aggregates according to Fuller's curve.2-function Plot_Sieve(Classes,x,y,z,Classes_diameters,Alpha,Particle_ratio)Plots generated sieve curve.3-function Ellipsoids=Particles_Distribution(Classes,x,y,z,er)Generates aggregate with ellipsoids shapes4-function Plot_Ellipsoids(Ellipsoids,x,y,z)Plots ellipsoids5-function Ellipses=Ellipsoids_to_Ellipses(Ellipsoids,dist,r_min)Converts ellipsoids to ellipses. used for 2D analysis6-function Plot_Ellipses(Ellipses,x,z)Plots ellipses7-[V, S, face, face_index]=Discretization(Ellipses,x,z,l_seg,N_min,poly_seg,ITZ_thickness)Convert ellipses and outside polygon to segments8-Plot_Segments(V,S)Plot segments9-[Nodes,Triangles,Indices]=Mesh(V,S,face,face_index)Generates mesh10-Plot_Mesh(Nodes,Triangles,Indices)Plots mesh11-Abaqus_2D_Mesoscale_Mesh(Nodes,Triangles,Indices,Filename)Converts mesh to Abaqus input file where the variables defined as:input:x,y,z: as vectors defining the specimen dimension. x and z are vectors defining a polygon section in xz plane and y=[ymin ymax] is boundaries of the extrusion of the polygonClasses_diameters: Particles classes diameters vector (descendingly)Alpha: Fuller's curve exponent [0.45-0.5].m: Particles shape distribution factor. m=1 for spheres and m>>1 for elongated ellipsoid shapes.Particle_ratio: Particles ratio of the total volume including the smaller particles not simulated in the analysis. ranges [0.6-0.9] for portland cement concrete and about 0.9 for asphalt concrete.er: Spacing factor between particles to avoid contact [0.05-0.1].dist: Cutting distance for converting ellipsoids to ellipses.r_min: Minimum ellipse radius involved when ellipsoids are converted to ellipses.l_seg: Segments lengths for outside polygon discretization.N_min: Min number of segments for aggregate polygon discretization.poly_seg: Segments lengths for aggregate polygon discretization.ITZ_thickness: TZ layer thickness. If it is set to 0, no ITZ will be generated and rigid bond is assumed. Filename: Full path of the input file containing the folder, name of the file and extension such as: 'D:\Example.inp'.Note: The mesh is imported in Abaqus using the following steps :(1-File___2-Import___3-Model__4-(*.inp) File)references[1] Unger, Jörg F., and Stefan Eckardt. "Multiscale modeling of concrete." Archives of Computational Methods in Engineering18.3 (2011): 341.

Aggregate packing generator with fibers used for the simulation of aggregate and fibers in composites. It can be used especially for meso-scale analysis of fiber-reinforced concrete. The algorithm takes into account fibers diameter for ovelap checking with particles and other fibers. Example files are provided for the simulation of aggregate in notched beam "Example_Beam.m" ,cylinder "Example_Cylinder.m", and cube "Example_Cube.m".1-function Classes=Particles_Generation(x,y,z,Classes_diameters,Alpha,m,Particle_ratio)Generates aggregates according to Fuller's curve.2-function Plot_Sieve(Classes,x,y,z,Classes_diameters,Alpha,Particle_ratio)Plots generated sieve curve.3-function Ellipsoids=Particles_Distribution(Classes,x,y,z,er)Generates aggregate with ellipsoids shapes4-function Plot_Ellipsoids(Ellipsoids,x,y,z)Plots ellipsoids5-function Ellipses=Ellipsoids_to_Ellipses(Ellipsoids,dist,r_min)Converts ellipsoids to ellipses. used for 2D analysis6-function Plot_Ellipses(Ellipses,x,z)Plots ellipses7-function [Nodes_Fibers, Fibers]=Generate_Fiber(x,y,z,L,N,DFiber,Orientation,Ndiv,Ellipsoids)Generate fibers8-function Plot_Fiber(x,y,z,Nodes_Fibers,Fibers,DFiber)Plots fibers9-function Plot_Ellipsoids_Fiber(Ellipsoids,x,y,z,Nodes_Fibers,Fibers,DFiber)Plot ellipsoids with fiberswhere the variables defined as:input:x,y,z: as vectors defining the specimen dimension. x and z are vectors defining a polygon section in xz plane and y=[ymin ymax] is boundaries of the extrusion of the polygonClasses_diameters: Particles classes diameters vector (descendingly)Alpha: Fuller's curve exponent [0.45-0.5].m: Particles shape distribution factor. m=1 for spheres and m>>1 for elongated ellipsoid shapes.Particle_ratio: Particles ratio of the total volume including the smaller particles not simulated in the analysis. ranges [0.6-0.9] for portland cement concrete and about 0.9 for asphalt concrete.er: Spacing factor between particles to avoid contact [0.05-0.1].dist: Cutting distance for converting ellipsoids to ellipses.r_min: Minimum ellipse radius involved when ellipsoids are converted to ellipses.L: Length of fibersN: Number of fibersDFiber: Diameter of fibersOrientation: can be either:--For aligned fibers Orientation=[l m n] where l,m, and n are the direction cosines of the fibers orientation in x,y, and z directions, respectively.- For random fibers Orientation=[] (empty)Ndiv: Number of fiber mesh divisionsOutput:Classes: A variable containing generated particles and not yet packed into specimenEllipsoids: (N*9) array. each column represent:(:,1): radius of ellipsoids at direction 1(:,2): radius of ellipsoids at direction 2(:,3): radius of ellipsoids at direction 3(:,4): x-cooridante of centroid(:,5): y-coordinate of centroid(:,6): z-coordinate of centroid(:,7): Inclination angle 1(:,8): Inclination angle 2(:,9): Inclination angle 3Ellipses: (N*5) array. each column represent:(:,1): radius of ellipses at direction 1(:,2): radius of ellipses at direction 2(:,3): x-cooridante of centroid(:,4): y-coordinate of centroid(:,5): Inclination angleNodes_Fibers: ((Ndiv+1)*N,3) matrix of fibers nodes coordinates.Fibers: (N,2) matrix of the two nodes indices connecting each fiber segment.references[1] Unger, Jörg F., and Stefan Eckardt. "Multiscale modeling of concrete." Archives of Computational Methods in Engineering18.3 (2011): 341.[2] Fang, Qin, and Jinhua Zhang. "Three-dimensional modelling of steel fiber reinforced concrete material under intense dynamic loading." Construction and Building Materials 44 (2013): 118-132.

Extracts 2d boundary coordinates from a set of x/y data points based on ashape package in http://www.mathworks.cn/matlabcentral/fileexchange/6760-ashape-a-pedestrian-alpha-shape-extractor.

Aggregate packing generator with fibers used for the simulation of aggregate and fibers in composites. It can be used especially for meso-scale analysis of fiber-reinforced concrete. Example files are provided for the simulation of aggregate in notched beam "Example_Beam.m" and cylinder "Example_Cylinder.m"1-function Classes=Particles_Generation(x,y,z,Classes_diameters,Alpha,m,Particle_ratio)Generates aggregates according to Fuller's curve.2-function Plot_Sieve(Classes,x,y,z,Classes_diameters,Alpha,Particle_ratio)Plots generated sieve curve.3-function Ellipsoids=Particles_Distribution(Classes,x,y,z,er)Generates aggregate with ellipsoids shapes4-function Plot_Ellipsoids(Ellipsoids,x,y,z)Plots ellipsoids5-function Ellipses=Ellipsoids_to_Ellipses(Ellipsoids,dist,r_min)Converts ellipsoids to ellipses. used for 2D analysis6-function Plot_Ellipses(Ellipses,x,z)Plots ellipses7-function [Nodes_Fibers, Fibers]=Generate_Fiber(x,y,z,L,N,Orientation,Ndiv,Ellipsoids);Generate fibers8-function Plot_Fiber(x,y,z,Nodes_Fibers,Fibers)Plots fibers9-function Plot_Ellipsoids_Fiber(Ellipsoids,x,y,z,Nodes_Fibers,Fibers)Plot ellipsoids with fiberswhere the variables defined as:input:x,y,z: as vectors defining the specimen dimension. x and z are vectors defining a polygon section in xz plane and y=[ymin ymax] is boundaries of the extrusion of the polygonClasses_diameters: Particles classes diameters vector (descendingly)Alpha: Fuller's curve exponent [0.45-0.5].m: Particles shape distribution factor. m=1 for spheres and m>>1 for elongated ellipsoid shapes.Particle_ratio: Particles ratio of the total volume including the smaller particles not simulated in the analysis. ranges [0.6-0.9] for portland cement concrete and about 0.9 for asphalt concrete.er: Spacing factor between particles to avoid contact [0.05-0.1].dist: Cutting distance for converting ellipsoids to ellipses.r_min: Minimum ellipse radius involved when ellipsoids are converted to ellipses.L: Length of fibersN: Number of fibersOrientation: can be either:--For aligned fibers Orientation=[l m n] where l,m, and n are the direction cosines of the fibers orientation in x,y, and z directions, respectively.- For random fibers Orientation=[] (empty)Ndiv: Number of fiber mesh divisionsOutput:Classes: A variable containing generated particles and not yet packed into specimenEllipsoids: (N*9) array. each column represent:(:,1): radius of ellipsoids at direction 1(:,2): radius of ellipsoids at direction 2(:,3): radius of ellipsoids at direction 3(:,4): x-cooridante of centroid(:,5): y-coordinate of centroid(:,6): z-coordinate of centroid(:,7): Inclination angle 1(:,8): Inclination angle 2(:,9): Inclination angle 3Ellipses: (N*5) array. each column represent:(:,1): radius of ellipses at direction 1(:,2): radius of ellipses at direction 2(:,3): x-cooridante of centroid(:,4): y-coordinate of centroid(:,5): Inclination angleNodes_Fibers: ((Ndiv+1)*N,3) matrix of fibers nodes coordinates.Fibers: (N,2) matrix of the two nodes indices connecting each fiber segment.references[1] Unger, Jörg F., and Stefan Eckardt. "Multiscale modeling of concrete." Archives of Computational Methods in Engineering18.3 (2011): 341.[2] Fang, Qin, and Jinhua Zhang. "Three-dimensional modelling of steel fiber reinforced concrete material under intense dynamic loading." Construction and Building Materials 44 (2013): 118-132.

This potential flow simulator simulates the flow past bodies of arbitrary shape including airfoils. With this simulator, we can do the following tasks, * Compute and plot the Velocity Vector Plot of the flow past the selected body.* Compute and plot the Pressure Distribution in terms of both Cp ( pressure coefficient ) and 1-Cp.* Compute and plot the cL Vs alpha Curve of the selected body.* Export the pressure distribution and the cL-Alpha data at various angles of attack as Ms.Excel file.* Capture the images that are generated in the simulator (Profile and mesh details of the body, Vector plot, Cp distribution and cL - alpha Curve ) as .jpg files.Features* Automatic name generation for exporting the data and capturing the images to avoid the confusions that are very common in any Scientific Computing.* Total of 9 Arbitrary bodies coordinates files are included in the simulator as default. You can also generate your own coordinates file of any shape and associate with the simulator.* Total of 1550 Airfoils coordinates files are provided with the simulator ( All are checked for compatibility so that the simulator can read without any problem ).* One can view the pressure distribution for range of angles attack dynamically and interactively* The Menu lists the available data files very dynamically. Even if the data files are added, removed or renamed when the simulator is open ( before running the simulation ), the simulator detects it and updates the list.* Well Customization is made possible through the Options menu* Extensive Help is also included for better utilization.* All of these are kept in a attractive and user friendly Graphical User Interface.

This script explores asteroid shape models derived from public data sources. It illustrates methods to download discrete shape models from the web, explores the surface triangulation methods convexhull, boundary, and alphashape to find the surface area and volume, writes an stl file useful for 3d-printing, voxelizes the interior of an asteroid mesh, and computes the inertial tensor and gravitational field of an asteroid, assuming constant mass density. The methods developed here can be applied to other mesh and point-cloud data sets. The script may interest students and educators in physics, astronomy, and engineering. "Try this" explorations and follow-on projects are suggested. This script downloads and uses of the codes Anton Semechko (2020)[2] and Sven (2020)[3].

Aggregate 2D packing generator used for the simulation of aggregate in composites. It can be used especially for meso-scale analysis of concrete and asphalt composites .Example files are provided for the simulation of aggregate in notched beam section "Example_Beam.m" and cylinder section "Example_Cylinder.m"1-function Classes=Particles_Generation(x,y,Classes_diameters,Alpha,m,Particle_ratio)Generates aggregates according to Fuller's curve.2-Plot_Sieve(Classes,x,y,Classes_diameters,Alpha,Particle_ratio)Plots generated sieve curve.3-Ellipses=Particles_Distribution(Classes,x,y,er)Generates aggregate with ellipses shapes4-function Plot_Ellipses(Ellipses,x,y)Plots ellipseswhere the variables defined as:input:x,y: as vectors defining the specimen dimension. x and y are vectors defining a polygon section.Classes_diameters: Particles classes diameters vector (descendingly)Alpha: Fuller's curve exponent [0.45-0.5].m: Particles shape distribution factor. m=1 for circles and m>>1 for elongated ellipses shapes.Particle_ratio: Particles ratio of the total area including the smaller particles not simulated in the analysis. ranges [0.6-0.9] for portland cement concrete and about 0.9 for asphalt concrete.er: Spacing factor between particles to avoid contact [0.05-0.1].Output:Classes: A variable containing generated particles and not yet packed into specimenEllipses: (N*5) array. each column represent:(:,1): radius of ellipses at direction 1(:,2): radius of ellipses at direction 2(:,3): x-cooridante of centroid(:,4): y-coordinate of centroid(:,5): Inclination angleImportant Notes:1-the function overlap.m should detect intersection between two ellipses but it does not work correctly. The ellipses are still seperated using the bounding box overlap check. 2-particle_diameter.m equation is derived based on ellipsoids not ellipses in Unger paper[1]. references[1] Unger, Jörg F., and Stefan Eckardt. "Multiscale modeling of concrete." Archives of Computational Methods in Engineering18.3 (2011): 341.[2] Choi, Y-K., et al. "Continuous collision detection for two moving elliptic disks." IEEE Transactions on Robotics 22.2 (2006): 213-224.

This tool generates mesh for 3D mesoscale geometries. It can be used especially for mesoscale analysis of concrete and asphalt composites. The elements are divided into three sets. One set named "Aggregate" in the elements set consists of cst elements for the aggregate particles. The other set is named "Matrix" consist of cst elements for the matrix material. A third set "ITZ" consists of cst elements for the interface layer between aggregate and matrix if the ITZ_thickness variable is equal more than zero. If it is zero, the there will be no third set "ITZ" and rigid interface between aggregate and matrix and the interface is assumed rigid between them. The mesh is plotted in matlab and saved in Abaqus input (*.inp) file.Important Note: This tool requires JIGSAW mesh generator [2-6] (in the jigsaw-matlab-dev branch). The user should download it put it in the same folder of this tool. The link for JIGSAW is: https://github.com/dengwirda/jigsaw-matlab/tree/devIn order for JIGSAW to work it need to be compiled using "compile.m" which requires installing Cmake and Visual Studio with Cmake tools.One example file is provided for the mesh of cube "Example_Cube.m" assuming rigid bond between aggregate and matrix.1-function Classes=Particles_Generation(x,y,z,Classes_diameters,Alpha,m,Particle_ratio)Generates aggregates according to Fuller's curve.2-function Plot_Sieve(Classes,x,y,z,Classes_diameters,Alpha,Particle_ratio)Plots generated sieve curve.3-function Ellipsoids=Particles_Distribution(Classes,x,y,z,er)Generates aggregate with ellipsoids shapes4-function Plot_Ellipsoids(Ellipsoids,x,y,z)Plots ellipsoids5-[V,F,face,face_index]=Triangulation(Ellipsoids,x,y,z,N,ITZ_thickness);Convert ellipsoids into triangles6-[Nodes,Tetra,Indices]=Mesh(V,F,face,face_index,hfun_hmax);Generates mesh7-Plot_Mesh(Nodes,Tetra,Indices,Materials);Plots mesh8-Abaqus_3D_Mesoscale_Mesh(Nodes,Tetra,Indices,Filename);Converts mesh to Abaqus input file where the variables defined as:input:x,y,z: as vectors defining the specimen dimension. x and z are vectors defining a polygon section in xz plane and y=[ymin ymax] is boundaries of the extrusion of the polygonClasses_diameters: Particles classes diameters vector (descendingly)Alpha: Fuller's curve exponent [0.45-0.5].m: Particles shape distribution factor. m=1 for spheres and m>>1 for elongated ellipsoid shapes.Particle_ratio: Particles ratio of the total volume including the smaller particles not simulated in the analysis. ranges [0.6-0.9] for portland cement concrete and about 0.9 for asphalt concrete.er: Spacing factor between particles to avoid contact [0.05-0.1].N: Number of icosahedron subdivisions for triangulationITZ_thickness: TZ layer thickness. If it is set to 0, no ITZ will be generated and rigid bond is assumed. hfun_hmax: Mesh HFUN limit. Decrease it to produce more refined mesh wih better quality.Materials: A vector for materials indices to show in the plot where: 1 is matrix, 2 is aggregate, and 3 is ITZ.Filename: Full path of the input file containing the folder, name of the file and extension such as: 'D:\Example.inp'.Note: The mesh is imported in Abaqus using the following steps :(1-File___2-Import___3-Model__4-(*.inp) File)references[1] Unger, Jörg F., and Stefan Eckardt. "Multiscale modeling of concrete." Archives of Computational Methods in Engineering18.3 (2011): 341.[2] Darren Engwirda: Generalised primal-dual grids for unstructured co-volume schemes, J. Comp. Phys., 375, pp. 155-176, https://doi.org/10.1016/j.jcp.2018.07.025, 2018.[3] Darren Engwirda, Conforming Restricted Delaunay Mesh Generation for Piecewise Smooth Complexes, Procedia Engineering, 163, pp. 84-96, https://doi.org/10.1016/j.proeng.2016.11.024, 2016.[4] Darren Engwirda, Voronoi-based Point-placement for Three-dimensional Delaunay-refinement, Procedia Engineering, 124, pp. 330-342, http://dx.doi.org/10.1016/j.proeng.2015.10.143, 2015.[5] Darren Engwirda, David Ivers, Off-centre Steiner points for Delaunay-refinement on curved surfaces, Computer-Aided Design, 72, pp. 157-171, http://dx.doi.org/10.1016/j.cad.2015.10.007, 2016.[6] Darren Engwirda, Locally-optimal Delaunay-refinement and optimisation-based mesh generation, Ph.D. Thesis, School of Mathematics and Statistics, The University of Sydney, http://hdl.handle.net/2123/13148, 2014.

Aggregate packing generator used for the simulation of aggregate in composites. It can be used especially for meso-scale analysis of concrete and asphalt composites .Example files are provided for the simulation of aggregate in notched beam "Example_Beam.m" and cylinder "Example_Cylinder.m"1-function Classes=Particles_Generation(x,y,z,Classes_diameters,Alpha,m,Particle_ratio)Generates aggregates according to Fuller's curve.2-function Plot_Sieve(Classes,x,y,z,Classes_diameters,Alpha,Particle_ratio)Plots generated sieve curve.3-function Ellipsoids=Particles_Distribution(Classes,x,y,z,er)Generates aggregate with ellipsoids shapes4-function Plot_Ellipsoids(Ellipsoids,x,y,z)Plots ellipsoids5-function Ellipses=Ellipsoids_to_Ellipses(Ellipsoids,dist,r_min)Converts ellipsoids to ellipses. used for 2D analysis6-function Plot_Ellipses(Ellipses,x,z)Plots ellipseswhere the variables defined as:input:x,y,z: as vectors defining the specimen dimension. x and z are vectors defining a polygon section in xz plane and y=[ymin ymax] is boundaries of the extrusion of the polygonClasses_diameters: Particles classes diameters vector (descendingly)Alpha: Fuller's curve exponent [0.45-0.5].m: Particles shape distribution factor. m=1 for spheres and m>>1 for elongated ellipsoid shapes.Particle_ratio: Particles ratio of the total volume including the smaller particles not simulated in the analysis. ranges [0.6-0.9] for portland cement concrete and about 0.9 for asphalt concrete.er: Spacing factor between particles to avoid contact [0.05-0.1].dist: Cutting distance for converting ellipsoids to ellipses.r_min: Minimum ellipse radius involved when ellipsoids are converted to ellipses.Output:Classes: A variable containing generated particles and not yet packed into specimenEllipsoids: (N*9) array. each column represent:(:,1): radius of ellipsoids at direction 1(:,2): radius of ellipsoids at direction 2(:,3): radius of ellipsoids at direction 3(:,4): x-cooridante of centroid(:,5): y-coordinate of centroid(:,6): z-coordinate of centroid(:,7): Inclination angle 1(:,8): Inclination angle 2(:,9): Inclination angle 3Ellipses: (N*5) array. each column represent:(:,1): radius of ellipses at direction 1(:,2): radius of ellipses at direction 2(:,3): x-cooridante of centroid(:,4): y-coordinate of centroid(:,5): Inclination anglereferences[1] Unger, Jörg F., and Stefan Eckardt. "Multiscale modeling of concrete." Archives of Computational Methods in Engineering18.3 (2011): 341.

Function polygonplot plots a kind of radial plot whose shape is a N-polygon, depending on the size of the data. It have also provide users the functionality of plotting a shaded error area if the dimension of the data is highly enough. Input parameters: - data: Data matrix. * Mean case: [N x nlines], with N corresponding to the number of points of each line (number of polygon sides) and nlines corresponding to the number of lines to plot. * Error bar case: [N x nlines x M], with M corresponding to the number of observations. Use NaN to ignore the value, in case that lines have different number of observation among themselves. - opt_axes: (Optional) Struct with the axes options. * opt_axes.Ticks: Vector that contains the axis ticks. * opt_axes.Background: Background color of the tick labels. * opt_axes.Labels: {1 x N} cell-vector with the axes labels - opt_lines:(Optional) Struct with the lines options. * opt_lines.LineWidth: Width of the means. * opt_lines.LineStyle: Line style of the means. * opt_lines.Marker: Marker of the means. * opt_lines.Color: [nlines x 3] matrix with RGB colors. * opt_lines.Labels: Boolean. If true, text labels of each point are plotted. * opt_lines.Legend: {1 x nlines} cell-matrix with the legend of each line. - opt_area: (Optional) Struct with the shaded area options. * opt_area.err: Type of error to plot: if 'std', one standard deviation; if 'sem', standard error mean; if 'var', one variance; if 'c95', 95 confidence interval. * opt_area.FaceAlpha: Alpha transparency constant. * opt_area.Color: [nlines x 3] matrix with RGB colors. ----------------------------------------------------------------------- Example of use: d_ex = [2 3; 1 0; 0.1 3; -1 7; -0.2 0.9]; data = cat(3,d_ex-0.5,d_ex,d_ex+0.7); polygonplot(data);

rod2d handle object is used for computation of planar Cosserat rod, i.e. extensible and shearable rod, which is based on the analytical solution given in [1]. The initial shape of the rod can be a straight line or a circular arc. The rod can be loaded by endpoint force and endpoint bending moment. The rod is specified once load (force F and its direction alpha) and integration parameters k and C are set. Calculation of k and C, (and maybe F and alpha) depends on boundary conditions. The user must, therefore, write function, which allows the calculation of unknown parameters. Once all the parameters are set, rod2d automatically compute coordinates of the rod, distribution of rotation angle, tangent angle, curvature, strains, internal forces and moment and rod length in user-specified arc-length coordinates. Rod2d contains several utilities for calculation of nonlinear equations (isolve1, isolve2), printing the results (info) and plotting the results ( contour, graph, plot , plotPhasePortrait). As an example package included a complete calculation for cantilever rod (bifurcation diagram, load-deflection diagram, follower load).All data stored in rod2d object are dimensionless. With rod2dProp object one can compute dimensionless rod properties (slenderness, stiffness ratio, force and moment units) from given physical data.Calculation with elliptic function is based on the elfun18 library [2] which is included in the package for convenience. The package also contains the draw19 library [3] which contains some plot utilities.The manual can be downloaded fromhttps://www.researchgate.net/publication/337839963_rod2d_manual_ver_1_01[1] M.Batista, A closed-form solution for Reissner planar finite-strain beam using Jacobi elliptic functions, International Journal of Solids and Structures 87 (2016) 153–166[2] draw2d (https://www.mathworks.com/matlabcentral/fileexchange/71745-draw19),[3] elfun18 https://www.mathworks.com/matlabcentral/fileexchange/65915-elfun18

The main features include:1) Intruder shape input: Image or data points(a) A random B/W image can be used as an input for intruder shape (use .png formate). Remember to save the images in the current directory The size of the intruder is entered manually by defining the extreme intruder-endpoints in xand y direction.(b) Shape discretization can be chosen from a pool of five different options (1/n,n=[1,2,3,4,8]) . The base shape discretization depends on the base image resolution (in pixels). (c) Additional data points can be for used improving the image processing algorithms' estimate for the intruder shape eg: add [0.008,-0.0125,0.008,-0.0125,0.1,0.1,-.1,-.1] for wheel1.png(d) In case of algorithms fails to choose the correct outward normal direction, discretize again after pressing the flip-normal button. 2) Two sets of motions can be modeled:1) Free locomotion (Choice between Explicit & implicit time integration technique)2) Constrained locomotion (Only Explicit time integration technique)3) Leading edge hypothesis is set to be always on 4) Macro inertial effects = F=\alpha \rho*A*(Vn)^2 can be switched on as per requirements wher \alpha is scaling coefficient, \rho is material density, A is subsurface area, Vn is normal velocity of subsurface5) Animation PaneFollowing set of options are available for better visualization 1) Start/Stop animation 2) Changing the force/velocity arrows: Define scaling limits before starting the animation and use the slider to change scale during animation ) 3) Changing graph limits: Two modes are available- a) Automatic and 2) Manual. In manual mode only x-axis limits are defined, the y-axis limits are set automatically for maintaining the aspect ratio of the figure.Please cite our paper: Modeling of the interaction of rigid wheels with dry granular media, Agarwal et al, Journal of Terramechanics (2019) in case you use this app for your research work.

I add the fifth parameter, alpha, to let user choice of transparency level.[14/06/2017]: the function should return the handle to give control for fill shape.

% BetaVOL(x,R,1) plots the Beta shape.%% % 2D Example - C shape% t = linspace(0.6,5.7,500)';% x = 2*[cos(t),sin(t)] + rand(500,2);% subplot(221), Betavol(x,inf,1);% subplot(222), Betavol(x,1,1);% subplot(223), Betavol(x,0.5,1);% subplot(224), Betavol(x,0.2,1);

Fuzzy Control of Multilayer Backpropagation Neural Network with momentum and any number of input units, hidden layers and output units and any number of neurons in hidden layers.Fuzzy inference system is used as a solution to speed up convergence of the Multilayer Backpropogation Neural Network with Momentum. A Fuzzy controller is used to tune the learning rate parameter automatically based on a heuristic solution and depending on the shape of the error surface.The central idea behind the fuzzy control of backpropagation is the implementation of heuristics in the form of fuzzy if then rules. Which is done using the error and change in error as variables and further associating them with classes based on value of the error surface.Several membership functions for the fuzzy controller are implemented which classify the error and change in error accordingly to tune the update to the learning rate parameter for the next iteration leading to fast convergence.Implementation is based on the concepts presented in the following papers:[1]. Fuzzy control of backpropagationPayman Arabshahi, Jai J Choi, RJ Marks, Thomas P CaudellIEEE International Conference on Fuzzy Systems 1992, Pages 967-972[2]. Fuzzy parameter adaptation in neural systemsJai J Choi, Payman Arabshahi, RJ Marks, TP CaudellInternational Joint Conference on Neural Networks 1992,Pages 232-238[3]. Fuzzy parameter adaptation in optimization: Some neural net training examplesPayman Arabshahi, Jai J Choi, Robert J Marks, Thomas P CaudellIEEE Computational Science and Engineering Vol. 3, Issue 1, Pages 57-65,1996Make sure that the program converges before evaluating it using the test function which is the same as that of MLBPN.Can be used as a tutorial example for FIS in Backpropagation for convergence speed up. You can also try this by disabling the update to the learning rate parameter alpha by deltaAlpha by setting DISABLEFIS = 0; At this point it will just become the backpropagation algorithm.Momentum parameter is also implemented to speed up convergence of the backpropagation algorithm and should be used carefully with FIS or seperately for comparison.There are a total of four m-files: FuzzyControl_of_MLBPN_Train.m is used for building and training the multilayer network on a desired input pattern and incorporates the implementation of Fuzzy Inference System for control of MLBPN for fast convergence.MLBPN_Test.m is used for testing the trained neural network. DefinePattern2.m is used to provide patterns for training the net.SGN.m is used internally for sign evaluation.The code provides you the ability to modify the forward and back propagation stages individually as well as the Fuzzy Control mechanism to allow for fast convergence on complicated training data.

Piecewise linear feasible regionFinds the piecewise linear feasible region from a set of constraints functions (inequalities) derived within the actual problem domain. y 'sign' f1(x) y 'sign' f2(x) : y 'sign' fn(x)where 'sign' can be any inequality sign '<'|'<='|'>'|'>=' and f(x) is the constraints function which is either constant, linear or possibly nonlinearDescriptionThe algorithm makes no assumptions on the specified constraints functions which can be either constant, linear or possibly nonlinear. The constraints functions are initially represented by anonymous functions which will be converted into piecewise linear functions within the specified interval xmin<=x<=xmax for the independent variable.The resolution of the discrete grid is controlled by (dx).It works out the feasible region by first sorting the sampled functions followed by detection of their intersections which will be injected into the discrete x-grid so that they can be included in the final feasible region boundary. The final feasible region is then found by scanning along the discrete x-grid for valid (non-conflicting) constraints.The output is ultimately a closed piecewise linear boundary B representing the feasible region to be used in solving 2-dimensional optimization problems.Possibly multiple feasible regions is not handled which could yield unexpected results.Dependencies:Package: feasrgnUsage example:import feasrgn.*cfcn = {'y','>', @(x) .65*(x-1).^2-3; ... 'y','<=',@(x) -1.25*x.^2+6; ... 'y','>=', @(x) .8*(x+1.25).^3-1.025*(x+.5); ... 'y','>', @(x) .5*ones(size(x)); ... 'y','<=',@(x) 3.5*ones(size(x)); ... 'y','<=',@(x) -3*x+2; ... 'y','<=',@(x) 3-.5*x };opts = struct('xmin',-3,'xmax',3,'dx',0.05); % also possible to set opts={}frgn = feasrgn(cfcn,opts);% Plot% (All options can be modified via the handle object obj)figure;obj = feasrgnplot(frgn,... 'LineStyle','none',... 'LineWidth',2,... 'FillColor',[0 .45 .85],... 'FaceAlpha',.9,... 'NodeLabel','S',... 'NodeShape','o',... 'NodeSize',5,... 'NodeColor',[0 0 .75],... 'NodeFontSize',8,... 'DisplayNodes',true,... 'DisplayNodeValues',true,... 'DisplayQueryPoint',false,... 'NodeValueFormat','(%.2f; %.2f)',... 'DisplayConstraints',true,... 'DisplayLegend',true,... 'DisplayInnerPoints',true,... 'UPointCount',30,... 'VPointCount',20);% Change some plot style properties (any change will directly affect the output)obj.nodeshape = 's';obj.nodelabel = 'P';...% Test if query point q is inside the feasible region boundaryq = [1;2];if obj.isPtInside( q ) % codeend% Generated inner boundary points% (Resolution can be controlled by obj.upointcount and obj.vpointcount)frgn.Gxfrgn.GyThe inner points can be used to evaluate the objective function in the actual optimization problem.

Proximity graphs have edges which depend on the position of the vertices in some metric space. This toolbox contains many of the known and less known proximity graphs: - K Nearest Neighbors;- K Nearest Center of Gravity; - Delaunay; - Gabriel; - Infinite Strip Band; - Relative Neighborhood; - Sphere of Influence; - Alpha Shape; - Epsilon-Ball; - Lune-based Beta Skeleton;- Circle-based Beta Skeleton;- Minimum Spanning Tree;- Gamma-Observable Neighborhood. It also contain some functions to get mutual, symmetrized and reverse graphs, and to transform list of neighbors to adjacency matrices and vice-versa.

This library includes functions for plotting fuzzy rose diagrams in Matlab. Fuzzy rose diagrams are a compact visual representation to show vectors of fuzzy numbers. Each component of the vector is represented as a petal on a circular diagram. The size of each petal is proportional to the size of the corresponding value and the shape of the petal indicates the range of uncertainty. For more details see the following paper.A. R. Buck and J. M. Keller, "Visualizing uncertainty with fuzzy rose diagrams," in 2014 IEEE Symposium on Computational Intelligence for Engineering Solutions (CIES), Orlando, FL, 2014, pp. 30-36.Fuzzy numbers are represented in this library as the union of many alpha cuts. By default, 1000 linearly spaced values are used, representing the left and right endpoints of each alpha cut. This results in a 1000x2 matrix for each fuzzy number. Vectors of fuzzy numbers are created by concatenating in the second dimension. A vector of M fuzzy numbers with N alpha cuts is therefore represented as an Nx(2xM) matrix. Functions are provided for generating standard fuzzy numbers (crisp, interval, triangular, and trapezoidal).Basic functionality is also provided for plotting fuzzy weighted graphs. Circular fuzzy rose plots are used for graph nodes with fuzzy weights and rectilinear plots are used to show fuzzy weights on graph edges. Examples are provided to generate random fuzzy weighted graphs.

RANDRAWEFFICIENT RANDOM VARIATES GENERATOR (from over 50 distributions):Alpha, Anglit, Antilognormal,Arcsin,Bernoulli, Bessel, Beta, Binomial, Bradford, Burr, Cauchy, Chi, Chi-Square (Non-Central), Chi-Square (Central), Cobb-Douglas, Cosine, Double-Exponential, Erlang, Exponential, Extreme-Value, F (Central), F (Non-Central), Fisher-Tippett, Fisk, Frechet, Furry, Gamma, Generalized Inverse Gaussian, Generalized Hyperbolic, Geometric, Gompertz, Gumbel, Half-Cosine, Hyperbolic Secant, Hypergeometric, Inverse Gaussian, Laplace, Logistic, Lognormal, Lomax, Lorentz, Maxwell,Nakagami, Negative Binomial, Normal, Normal-Inverse-Gaussian (NIG),Pareto, Pareto2, Pascal, Planck, Poisson, Quadratic, Rademacher, Rayleigh,Rice, Semicircle, Skellam, Student's-t, Triangular, Truncated Normal, Tukey-Lambda, U-shape, Uniform (continuous), Von Mises, Wald, Weibull, Wigner Semicircle, Yule, Zeta, Zipf

variogramfit performs a least squares fit of various theoretical variograms to an experimental, isotropic variogram. The user can choose between various bounded (e.g. spherical) and unbounded (e.g. exponential) models. A nugget variance can be modelled as well, but higher nested models are not supported.The function works best with the function fminsearchbnd available on the FEX. You should download it from the File Exchange (File ID: #8277). If you don't have fminsearchbnd, variogramfit uses fminsearch. The problem with fminsearch is, that it might return negative variances or ranges.Supported bounded models:'blinear' -- bounded linear'circular' -- circular model'spherical' -- spherical model, =default'pentaspherical' -- pentaspherical modelSupported unbounded functions :'exponential' -- exponential model'gaussian' -- gaussian variogram'whittle' -- Whittle's elementary correlation (involves a modified Bessel function of the second kind).'stable' -- stable models sensu Wackernagel 1995). Same as gaussian, but with different exponents. Supply the exponent alpha (<2) as an additional pn,pv-pair 'stablealpha',alpha (default = 1.5).'matern' -- Matern model. Requires an additional pn,pv pair. 'nu',nu (shape parameter > 0, default = 1). Note that for particular values of nu the matern model reduces to other authorized variogram models. (nu = 0.5 : exponential model, nu = 1 : Whittles model, nu -> inf : Gaussian model)References:Wackernagel, H. (1995): Multivariate Geostatistics, Springer.Webster, R., Oliver, M. (2001): Geostatistics for Environmental Scientists. Wiley & Sons.Minsasny, B., McBratney, A. B. (2005): The Matérn function as general model for soil variograms. Geoderma, 3-4, 192-207.

This m-file returns the beta-binomial probability density function with parameters N, A and B at the values in X. Note: The density function is zero unless N, A and B are integers.The Beta-binomial distribution is used to model the number of successes in n binomial trials when the probability of success p is a Beta(a,b) random variable. The extreme flexibility of the shape of the Beta distribution means that it is often a very fair representation of the randomness of p.A variable with a Beta-binomial distribution is distributed as a binomial distribution with parameter p, where p is distribution with a beta distribution with parameters a (alpha) and b (beta). For n trials, it has probability density function: p(x) = n_C_x [B(x+a, n-x+b) / B(a,b)] where B(a,b) is a beta function and n_C_x is a binomial coefficient. (http://mathworld.wolfram.com/BetaBinomialDistribution.html) (http://en.wikipedia.org/wiki/Beta-binomial_model)The probability of success varies randomly, but in any one scenario that probability applies to all trials. For example, you might consider using the Beta-binomial distribution to model:--The number of life insurance policy holders who will die in any one year, where some external variable (e.g. highly contagious disease, extreme weather) moderates the probability of death of all individual to some degree.--The number of cars that crash in a race of n cars, where the predominant factor is not the skill of the individual driver, but the weather on the day.--The number of bottles of wine from a producer that are bad where the predominant factor is not how each bottle is treated, but something to do with the batch as a whole.The Beta-binomial is a two-dimensional multivariate Polya distribution, as the binomial and beta distributions are special cases of the multinomial and Dirichlet distributions, respectively.Syntax: function y = bbinopdf(x,n,a,b) Inputs:x - number of success n - number of trials a – Beta’s alpha parameterb - Beta‘s beta parameterOutput:y - beta-binomial probability value