\section{User Interface – creating the model}
The functions presented in this section describe all of the tools needed to create the desired model. From creating component prototypes, through placing and copying them inside the simulation domain, creating aggregating components to hydraulically connecting cooling plates. The functions are arranged in alphabetical order.

\emph{\textbf{Caution!}
When generating a msh file and loading it into HMOD it is critical to assign unique physical IDs to all of the surfaces in the mesh generation software.}

\subsection{connectCoolingPlatesPipes.m}
\begin{matlabcode}
function connectCoolingPlatesPipes(args)
\end{matlabcode}
This function creates hydraulic connections between cooling plates.
Cooling plates are always connected from the outlet of the first
specified cooling plate to the inlet of the second cooling plate etc.

Input arguments:
\begin{itemize}
\item Required:
\begin{itemize}
\item \emph{‘cooling\_plates’} – vector of cooling plates, arranged in order from the first to last cooling plates we want to couple.
\end{itemize}
\end{itemize}

Example:
\newline
\begin{matlabcode}
connectCoolingPlatesPipes(‘cooling_plates’, [cooling_plate1, …
cooling_plate2, cooling_plate3]);
\end{matlabcode}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{copyInstanceInLocation.m}
\begin{matlabcode}
function instances = copyInstanceInLocation(args)
\end{matlabcode}
This function copies a component (not a prototype) in accordance with a specified
location matrix.

Input arguments:
\begin{itemize}
\item Required:
\begin{itemize}
\item \emph{‘instance’} – component (not prototype) which we want to replicate.
\item \emph{‘location\_matrix’} – matrix (n, 3) double, specifying the location of n repetitions of the prototype. Each row of the matrix corresponds to the [x,y,z] coordinates of the repetition (in meters).
\end{itemize}
\end{itemize}

Output:
\begin{itemize}
\item \emph{‘instances’} – array of specified components placed in accordance with the \emph{‘location\_matrix’}.
\end{itemize}

\newpage
Example:
\newline
\begin{matlabcode}
battery_islands = copyInstanceInLocation(‘instance’, battery_island, …
‘location_matrix’, [-0.4, 0, 0; -0.4, 0.5, 0]);
\end{matlabcode}

\begin{figure}[!h]
\centering
\includegraphics[width=1\textwidth]{graphics/cop_loc.eps}
\caption{Copy instance in location}
\label{fig:cop_locl}
\end{figure}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{copyInstanceInPattern.m}
\begin{matlabcode}
function instances = copyInstanceInPattern(args)
\end{matlabcode}
This function copies a component (not a prototype) in accordance with a specified pattern.

Input arguments:
\begin{itemize}
\item Required:
\begin{itemize}
\item \emph{‘instance’} – component (not prototype) which we want to replicate.
\item \emph{‘pattern\_type’} – string specifying the pattern type (\emph{‘grid’} or \emph{‘triangle’}).
\item \emph{‘pattern\_dimensions’} – vector (1, 5) or (1, 6) double specifying the dimensions of the pattern (in meters):
\begin{itemize}
\item for \emph{‘grid’}
\newline
[x, y, nx, ny, dx, dy] – creates grid pattern with left lower corner located at point [x, y]. Distance between repetitions along X and Y axis are defined by vector [dx, dy]. Number of repetitions along X and Y axis are defined by [nx, ny].
\item for \emph{‘triangle’}
\newline
[x, y, nx, ny, dx] – creates an equilateral triangle pattern with left lower corner located at point [x, y]. The distance between repetitions is defined by dx. Number of repetitions along X and Y axis are defined by [nx, ny] (nx >= ny).
\end{itemize}
\end{itemize}
\end{itemize}

Output:
\begin{itemize}
\item \emph{‘instances’} – array of specified components placed in accordance with the specified pattern dimensions.
\end{itemize}

Examples:
\newline
\begin{matlabcode}
battery_modules = copyInstanceInPattern(‘instance’, battery_module, …
‘pattern_type’, ‘grid’, ‘pattern_dimensions’, [0, 0, 4 , 3, 0.2, 0.5]);

battery_modules = copyInstanceInPattern(‘instance’, battery_module, …
‘pattern_type’, ‘triangle’, ‘pattern_dimensions’, [0, 0, 3 , 3, 0.5]);
\end{matlabcode}

\begin{figure}[!h]
\centering
\includegraphics[width=1\textwidth]{graphics/cop_pat.eps}
\caption{Copy instance in pattern}
\label{fig:cop_pat}
\end{figure}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{defineBattery.m}
\begin{matlabcode}
function battery = defineBattery(args)
\end{matlabcode}
This function creates a battery, which can (but does not have to)
consist of one or more battery islands and one or more heat components.

Input arguments:
\begin{itemize}
\item Optional:
\begin{itemize}
\item \emph{‘battery\_islands’} – vector of battery islands to be added to the battery.
\item \emph{‘heat\_components’} – vector of heat components to be added to the battery.
\item \emph{‘all\_contacts’} – Boolean variable (\emph{true} or \emph{false}), creates thermal contacts basing on all contacts in the battery.
\end{itemize}
\newpage
\item Other / dependent:
\begin{itemize}
\item \emph{‘conductivity’} – scalar double, defines thermal conductivity of all contacts (in \frac{W}{m*K}).
\item \emph{‘contacts\_thickness’} – scalar double, defines thickness of all contacts (in meters).
\end{itemize}
\end{itemize}

Output:
\begin{itemize}
\item \emph{‘battery’} – battery object with specified battery islands, heat components and contacts between them.
\end{itemize}

Example:
\newline
\begin{matlabcode}
battery1 = defineBattery(‘battery_islands’, [battery_islands1, …
battery_islands2], ‘all_contacts’, true, ‘conductivity’, 1, …
‘contacts_thickness’, 1e-3);
\end{matlabcode}

\subsection{defineBatteryIsland.m}
\begin{matlabcode}
function battery_island = defineBatteryIsland(args)
\end{matlabcode}
This function creates a battery island, which can (but does not have to)
consist of one or more battery modules, one or more heat components and one
or more cooling plates.

Input arguments:
\begin{itemize}
\item Optional:
\begin{itemize}
\item \emph{‘battery\_modules’} – vector of battery modules to be added to the battery island.
\item \emph{‘heat\_components’} – vector of heat components to be added to the battery island.
\item \emph{‘cooling\_plates’} – vector of cooling plates to be added to the battery island.
\item \emph{‘all\_contacts’} – Boolean value (\emph{true} or \emph{false}), creates thermal contacts basing on all contacts in the battery island.
\end{itemize}
\item Other / dependent:
\begin{itemize}
\item \emph{‘conductivity’} – scalar double, defines thermal conductivity of all contacts (in \frac{W}{mK}).
\item \emph{‘contacts\_thickness’} – scalar double, defines thickness of all contacts (in meters).
\end{itemize}
\end{itemize}

Output:
\begin{itemize}
\item \emph{‘battery\_island’} – battery island object with specified battery modules, heat components, cooling plates and contacts between them.
\end{itemize}

\clearpage
Examples:
\newline
\begin{matlabcode}
battery_island1 = defineBatteryIsland(‘battery_modules’, bm1, …
‘heat_components’, heat_component_array1);

battery_island2 = defineBatteryIsland(‘battery_modules’, [bm1, bm2], …
‘all_contacts’, ‘cooling_plates’, cp1, true, ‘conductivity’, 1, …
‘contacts_thickness’, 1e-3);
\end{matlabcode}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{defineBatteryModule.m}
\begin{matlabcode}
function battery_module = defineBatteryModule(args)
\end{matlabcode}

This function creates a battery module, which can (but does not have to)
consist of one or more cell caskets, one or more heat components and one
or more cooling plates.

Input arguments:
\begin{itemize}
\item Optional:
\begin{itemize}
\item \emph{‘cell\_caskets’} – vector of cell caskets to be added to the battery module.
\item \emph{‘heat\_components’} – vector of heat components to be added to the battery module.
\item \emph{‘cooling\_plates’} – vector of cooling plates to be added to the battery module.
\item \emph{‘all\_contacts’} – Boolean variable (\emph{true} or \emph{false}), creates thermal contacts basing on all contacts in the battery module.
\end{itemize}
\item Other / dependent:
\begin{itemize}
\item \emph{‘conductivity’} -scalar double, defines thermal conductivity of all contacts (in \frac{W}{m*K}).
\item \emph{‘contacts\_thickness’} – scalar double, defines thickness of all contacts (in meters).
\end{itemize}
\end{itemize}

Output:
\begin{itemize}
\item \emph{‘battery\_module’} – battery module object with specified cell caskets, heat components, cooling plates and contacts between them.
\end{itemize}

Examples:
\newline
\begin{matlabcode}
bm1 = defineBatteryModule(‘cell_caskets’, cell_caskets1, …
‘heat_components’, heat_component_array1);

bm2 = defineBatteryModule(‘cell_caskets’, …
[cell_caskets1, cell_caskets1], ‘cooling_plates’, cooing_plate11, …
‘all_contacts’, true, ‘conductivity’, 1, ‘contacts_thickness’, 1e-3);
\end{matlabcode}

\clearpage
%%%%%%%%%%%%%%%%%%%%
\subsection{defineCellCasket.m}
\begin{matlabcode}
function cell_casket = defineCellCasket(args)
\end{matlabcode}
This function creates a cell casket, which can (but does not have to)
consist of one or more cells and one or more heat components.

Input arguments:
\begin{itemize}
\item Optional:
\begin{itemize}
\item \emph{‘cells’} – vector of cells to be added to the cell casket.
\item \emph{‘heat\_components’} – vector of heat components to be added to the cell casket.
\item \emph{‘all\_contacts’} – Boolean variable (\emph{true} or \emph{false}), creates thermal contacts basing on all contacts in the cell casket.
\end{itemize}
\item Other / dependent:
\begin{itemize}
\item \emph{‘conductivity’} – scalar double, defines thermal conductivity of all contacts (in \frac{W}{m*K}).
\item \emph{contacts\_thickness’} – scalar double, defines thickness of all contacts (in meters).
\end{itemize}
\end{itemize}

Output:
\begin{itemize}
\item \emph{‘cell\_casket’} – cell casket object with specified cells, heat components and contacts between them.
\end{itemize}

Examples:
\newline
\begin{matlabcode}
cell_casket1 = defineCellCasket(‘cells’, cell_array1, …
‘heat_components’, heat_component_array1);

cell_casket2 = defineCellCasket(‘cells’, [cell_array1, cell_array2], …
‘all_contacts’, true, ‘conductivity’, 1, ‘contacts_thickness’, 1e-3);
\end{matlabcode}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{defineCellPrototype.m}
\begin{matlabcode}
function cell_prototype = defineCellPrototype(args)
\end{matlabcode}
This function creates a cell prototype (virtual cell with a specified geometry, material properties and mesh).

Input arguments:
\begin{itemize}
\item Required:
\begin{itemize}
\item \emph{‘data’} – string, path to .xlsx or .xls file containing the material properties of the cell.
\end{itemize}
\item One of the following required:
\begin{itemize}
\item \emph{‘load\_component’} – string, path to folder with previously saved cell prototype.
\item \emph{‘type’} – string specifying the type of the cell (\emph{‘prismatic’} or \emph{‘cylindric’}).
\item \emph{‘qscad\_shape’} – qs shape containing the geometry of the cell (created using qscad).
\item \emph{‘mesh\_path’} – string, path to .msh file containing previously created component mesh (does not require additionally specifying the geometry).
\end{itemize}
\item Optional:
\begin{itemize}
\item \emph{‘heat\_source’} – value of volumetric heat generated in the cell (in \frac{W}{m^3}), can be defined as a constant heat source value (scalar double) or as a time variable heat source (matrix (n, 2) double).
\item \emph{‘mesh\_size’} – scalar double (0 – inf), density of mesh generated inside the software (larger numbers correspond to small mesh, worse quality, 0 – dense mesh, good quality).
\item \emph{‘curv\_points’} – integer, number of points on curvature (per 2\pi radians) used while creating mesh inside the software (3-50).
\item \emph{‘number\_of\_modes’} – integer, number of modes generated on the cell when creating the solution vector (the higher the number of mode the more accurate the solution but the longer the computational time).
\end{itemize}
\item Other / dependent:
\begin{itemize}
\item \emph{‘mass’} – scalar double, mass of the cell (required as an argument if the density of the cell is not specified in the \emph{‘data’} file).
\item \emph{‘capacity’} – scalar double, cell capacity (in A*s), required as an argument if the capacity of the cell is not specified in the \emph{‘data’} file.
\item \emph{‘dimensions’} – vector (1, 6) or (1, 5) double, dimensions of the cell, required if defining geometry by specifying the cell \emph{‘type’}:
\begin{itemize}
\item for \emph{‘prismatic’}
\newline
[x, y, z, dx, dy, dz] – creates cuboid with left lower
corner located at point [x, y, z]. Dimensions along X, Y and Z axis are defined by vector [dx, dy, dz].
\item for \emph{‘cylindric’}
\newline
[x, y, z, r, h] – creates cylinder with center point located at point [x, y, z] and base on the XY plane. Parameter r – specifies the base radius and h – the height of the cylinder (along Z axis).
\end{itemize}
\end{itemize}
\end{itemize}

Output:
\begin{itemize}
\item \emph{‘cell\_prototype’} – cell prototype (virtual object) with a specified geometry, material properties and mesh.
\end{itemize}

Examples:
\newline
\begin{matlabcode}
cell_prototype1 = defineCellPrototype(‘type’,’prismatic’,’dimensions’, …
[0, 0, 0, 0.4, 0.2, 0.15], ‘mesh_size’, 0.6, ‘curv_points’, 12, …
‘data’, ‘data/cell_data.xlsx’);

cell_prototype2 = defineCellPrototype(‘mesh_path’, …
‘meshes/cell_mesh.msh’, ‘data’, ‘data/cell_data.xlsx’, …
‘heat_source’, 10000);
\end{matlabcode}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{defineCoolingPlatePrototype.m}
\begin{matlabcode}
function cooling_plate_prototype = defineCoolingPlatePrototype(args)
\end{matlabcode}
This function creates a cooling plate prototype (virtual cooling plate with a specified geometry, material properties and mesh).

Input arguments:
\begin{itemize}
\item Required:
\begin{itemize}
\item \emph{‘pipe\_radius’} – scalar double, specifies the cooling pipe radius (in meters).
\item \emph{‘pipe\_mass\_flow\_rate’} – scalar or vector (n, 2) double, specifies the cooling fluid mass flow rate in time (in \frac{kg}{s}). If a scalar value is entered, the mass flow rate is defined as constant in time. Otherwise the first column of the entered vector corresponds to time and the second – to the value of mass flow rate. Between the specified points the values are interpolated linearly.
\item \emph{‘pipe\_inlet\_temperature’} – scalar or vector (n, 2) double, specifies the cooling fluid temperature at the inlet (in ^\circ C). If a scalar value is entered, the temperature is defined as constant in time. Otherwise the first column of the entered vector corresponds to time and the second – to the value of fluid inlet temperature. Between the specified points the values are interpolated linearly.
\item \emph{‘cooling\_plate\_data’} – string, path to .xlsx or .xls file containing the material properties of the cooling plate.
\item \emph{‘coolant\_data’} – string, path to .xlsx or .xls file containing the material properties of the cooling fluid.
\end{itemize}
\item One of the following required:
\begin{itemize}
\item \emph{‘load\_component’} – string, path to folder with saved previously created cooling plate prototype.
\item \emph{‘qscad\_shape’} – qs shape containing the geometry of the cooling plate (created using qscad).
\item \emph{‘mesh\_path’} – string, path to .msh file containing previously created component mesh (does not require additionally specifying the geometry).
\end{itemize}
\item Optional:
\begin{itemize}
\item \emph{‘pipe\_discretization’} – integer, number of control points created in the cooling fluid pipe.
\item \emph{‘mesh\_size’} – scalar double (0 – inf), density of mesh generated inside the software (larger numbers correspond to small mesh, worse quality, 0 – dense mesh, good quality).
\item \emph{‘curv\_points’} – integer, number of points on curvature (per 2\pi radians) used while creating mesh inside the software (3-50).
\item \emph{‘number\_of\_modes’} – integer, number of modes generated on the cell when creating the solution vector (the higher the number of modes the more accurate the solution but the longer the computational time).
\item \emph{‘predefined\_alpha’} – scalar double, value of heat transfer coefficient (in \frac{W}{m^2*K}) in forced convection (through cooling fluid walls). If it is not known it will be calculated internally.
\item \emph{‘pipe\_wall\_ids’} – integer vector of wall ids corresponding to the pipe walls (if not given as an argument, walls will have to be chosen interactively).
\item \emph{‘pipe\_inlet\_ids’} – integer vector of curve ids corresponding to the pipe inlet (if not given as an argument, curves will have to be chosen interactively).
\item \emph{‘pipe\_outlet\_ids’} – integer vector of curve ids corresponding to the pipe outlet (if not given as an argument, curves will have to be chosen interactively).
\end{itemize}
\item Other / dependent:
\begin{itemize}
\item \emph{‘mass’} – scalar double, mass of the cooling plate in kg (required as an argument if the density is not specified in the \emph{‘cooling\_plate\_data’} file).
\end{itemize}
\end{itemize}

Output:
\begin{itemize}
\item \emph{‘cooling\_plate’} – cooling plate prototype (virtual object) with a specified geometry, material properties and mesh.
\end{itemize}

Examples:
\begin{matlabcode}
cp1 = defineCoolingPlatePrototype(‘mesh_path’, …
‘meshes/cooling_plate1.msh’, ‘cooling_plate_data’, …
‘data/aluminium.xlsx’, ‘coolant_data’,’data/water.xlsx’, …
‘pipe_radius’, 0.03, ‘pipe_mass_flow_rate’, 0.05, …
‘pipe_inlet_temperature’, 15, ‘predefined_alpha’, 2500);

cp2 = defineCoolingPlatePrototype(‘mesh_path’, …
‘meshes/cooling_plate2.msh’, ‘cooling_plate_data’, …
‘data/aluminium.xlsx’,’coolant_data’,’data/water.xlsx’, …
‘pipe_wall_ids’, [1,3,4,7], ‘pipe_inlet_ids’, [3,17], …
‘pipe_outlet_ids’, [13,4], ‘pipe_radius’, 0.02, …
‘pipe_mass_flow_rate’, 0.05, ‘pipe_inlet_temperature’, 15);
\end{matlabcode}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{defineHeatComponentPrototype.m}
\begin{matlabcode}
function heat_component_prototype = defineHeatComponentPrototype(args)
\end{matlabcode}
This function creates a heat component prototype (virtual heat component with a specified geometry, material properties and mesh).

Input arguments:
\begin{itemize}
\item Required:
\begin{itemize}
\item \emph{‘heat\_component\_data’} – string, path to .xlsx or .xls file containing the material properties of the heat component.
\end{itemize}
\item One of the following required:
\begin{itemize}
\item \emph{‘load\_component’} – string, path to folder with saved previously created heat component prototype.
\item \emph{‘shape’} – string specifying the shape of the heat component (\emph{‘box’} or \emph{‘cylinder’}).
\item \emph{‘qscad\_shape’} – qs shape containing the geometry of the heat component (created using qscad).
\item \emph{‘mesh\_path’} – string, path to .msh file containing previously created component mesh.
\end{itemize}
\item Optional:
\begin{itemize}
\item \emph{‘mesh\_size’} – scalar (0 – inf), density of mesh generated inside the software (larger numbers correspond to small mesh, worse quality, 0 – dense mesh, good quality).
\item \emph{‘curv\_points’} – integer, number of points on curvature (per 2\pi radians) used while creating mesh inside the software (3-50).
\item \emph{‘number\_of\_modes’} – integer, number of modes generated on the heat component when creating the solution vector (the higher the number of modes the more accurate the solution but the longer the computational time).
\end{itemize}
\item Other / dependent:
\begin{itemize}
\item \emph{‘mass’} – scalar double, mass of the heat component in kg (required as an argument if the density of the component is not specified in the \emph{‘heat\_component\_data’} file).
\item \emph{‘dimensions’} – vector (1, 6) or (1, 5) double, dimensions of heat component, required if using \emph{‘shape’} for creating the heat component geometry:
\begin{itemize}
\item for \emph{‘box’}
\newline
[x, y, z, dx, dy, dz] – creates cuboid with left lower corner located at point [x, y, z]. Dimensions along X, Y and Z axis are defined by vector [dx, dy, dz].
\item for \emph{‘cylinder’}
\newline
[x, y, z, r, h] – creates cylinder with center point located at point [x, y, z] and base on the XY plane. Parameter r – specifies the base radius and h – the height (along Z axis).
\end{itemize}
\end{itemize}
\end{itemize}

Output:
\begin{itemize}
\item \emph{heat\_component’} – heat component prototype (virtual object) with a specified geometry, material properties and mesh.
\end{itemize}

Examples:
\newline
\begin{matlabcode}
heat_component_prototype1 = defineHeatComponentPrototype(‘shape’,…
‘cylinder’, ‘dimensions’,[0,0,0,0.1,0.1], ‘heat_component_data’, …
‘/data/plastic_data.xlsx’);

heat_component_prototype2 = defineHeatComponentPrototype(‘mesh_path’, …
‘/meshes/hc2.msh’, ‘heat_component_data’, …
‘/data/plastic_data.xlsx’, ‘number_of_modes’, 30);
\end{matlabcode}

 

\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{instantiateInLocation.m}
\begin{matlabcode}
function instances = instantiateInLocation(args)
\end{matlabcode}
This function places the virtual prototype inside the simulation domain in
accordance with a specified location matrix.

Input arguments:
\begin{itemize}
\item Required:
\begin{itemize}
\item \emph{‘prototype’} – name of prototype which we want to replicate and place inside the simulation domain.
\item \emph{‘location\_matrix’} – matrix (n, 3) double specifying the location of n repetitions of the prototype. Each row of the matrix corresponds to the [x, y, z] coordinates of the repetition (in meters).
\end{itemize}
\end{itemize}

Output:
\begin{itemize}
\item \emph{‘instances’} – array of specified components (non-virtual) placed in the simulation domain in accordance with the \emph{‘location\_matrix’}.
\end{itemize}

Example:
\newline
\begin{matlabcode}
cells = instantiateInLocation(‘prototype’, cell_prototype, …
‘location_matrix’, [-0.42, 0.02, 0; -0.42, 0.235, 0]);
\end{matlabcode}

\begin{figure}[!h]
\centering
\includegraphics[width=1\textwidth]{graphics/inst_loc.eps}
\caption{Instantiate in location}
\label{fig:inst_loc}
\end{figure}

\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{instantiteInPattern.m}
\begin{matlabcode}
function instances = instantiateInPattern(args)
\end{matlabcode}
This function places the virtual prototype inside the simulation domain in
accordance with a specified pattern.

Input arguments:
\begin{itemize}
\item Required:
\begin{itemize}
\item \emph{‘prototype’} – name of prototype which we want to replicate and place inside the simulation domain.
\item \emph{‘pattern\_type’} – string specifying the pattern type (\emph{‘grid’} or \emph{‘triangle’}).
\item \emph{‘pattern\_dimensions’} – vector (1, 6) or (1, 5) double specifying the dimensions of the pattern (in meters):
\begin{itemize}
\item for \emph{‘grid’}
\newline
[x, y, nx, ny, dx, dy] – creates grid pattern with left lower corner located at point [x, y]. Distance between repetitions along X and Y axis are defined by vector [dx, dy]. Number of repetitions along X and Y axis are defined by [nx, ny].
\item for \emph{‘triangle’}
\newline
[x, y, nx, ny, dx] – creates an equilateral triangle pattern with left lower corner located at point [x, y]. The distance between repetitions is defined by dx. Number of repetitions along X and Y axis are defined by [nx, ny] (nx >= ny).
\end{itemize}
\end{itemize}
\end{itemize}

Output:
\begin{itemize}
\item \emph{‘instances’} – array of specified components (non-virtual) placed in accordance with the pattern dimensions.
\end{itemize}

Examples:
\newline
\begin{matlabcode}
cells1 = instantiateInPattern(‘prototype’, cell_prototype, …
‘pattern_type’, ‘grid’, ‘pattern_dimensions’, [0, 0, 4 , 3, 0.2, 0.5]);

cells2 = instantiateInPattern(‘prototype’, cell_prototype, …
‘pattern_type’, ‘triangle’, ‘pattern_dimensions’, [0, 0, 3 , 2, 0.5]);
\end{matlabcode}

\clearpage
\begin{figure}[!h]
\centering
\includegraphics[width=1\textwidth]{graphics/inst_pat.eps}
\caption{Instantiate in pattern}
\label{fig:inst_pat}
\end{figure}

[/latexpage]