Numerical model preparation - Data-Acquisition-and-Processing-Lab/ECTsim GitHub Wiki

addElement

Adds an element with a given name to a numerical model ('Sensor' cell array). The element must exist in the 'Elements' cell array to be included in the final model and simulation. This function ensures that no element sharing grid points with any other element is added.

Usage: [model] = addElement(model, 'el_name', permittivity, varargin);

  • model - Structure with a numerical model description.
  • el_name - Name of the element.
  • permittivity - Relative permittivity value (>=1).
  • varargin - Optional parameters including conductivity and potential values applied if boundary conditions are set on this element; excitation potential if the potential is switched on the electrode.

combineElements

Performs an operation (addition, subtraction, or multiplication) on two regions.

Usage: [Index] = combineElements(Index, Index2, operations);

  • Index - First region indices.
  • Index2 - Second region indices.
  • operations - Defined as sum, difference, or product of the two regions.
  • returns - Vector of indices resulting from the operation on two regions.

defineWorkspace

Initiates work on a model. Input arguments describe the size of the area in which the model will be constructed. Values for width and height should be provided in mm. This function creates global variables:

  • Elements - A cell array that stores all created simple and complex elements.
  • Sensor - A cell array that stores elements making up the final sensor model.
  • nargin - 2 for 2D, 3 for 3D.

Usage: [model] = defineWorkspace(width, height, depth);

  • model - Structure with a numerical model description.
  • width - Workspace width.
  • height - Workspace height.
  • depth - Workspace depth (optional for 3D).

makeTomograph

Optionally prepares the entire body of a cylindrical sensor quickly.

Usage: [model] = makeTomograph(model, radius, height, wallWidth, insulationWidth, numElectrodes, ringPositions, ringRadius, electrodeHeight, electrodeWidthDeg, electrodeThickness, const);

  • model - Structure with numerical model definition (post-defineWorkspace and defineMesh).
  • radius - Inner radius of the cylindrical sensor.
  • height - Height of the cylindrical sensor.
  • wallWidth - Thickness of the cylinder wall.
  • insulationWidth - Thickness of inner insulation.
  • numElectrodes - Number of electrodes.
  • ringPositions - Z-position of the center of electrode rings.
  • ringRadius - Radius of electrode rings.
  • electrodeHeight - Height of the electrodes.
  • electrodeWidthDeg - Angular width of a single electrode.
  • electrodeThickness - Thickness of electrodes.
  • const - A structure containing lists of electrical permittivities and conductivities of the materials used in the sensor construction.

newComplexElement

Creates a new complex element by combining existing elements. The new element is added to the 'Elements' cell array in the numerical model.

Usage: [model] = newComplexElement(model, name, formula);

  • model - Structure with model description.
  • name - Name of the element to be created.
  • formula - Operation on elements represented as 'el1+el2', 'el1-el2', or 'el1&el2'.

newSimpleElement

Creates a new solid geometry element and adds it to the 'Elements' cell array in the numerical model. This function checks whether the name has already been used and selects the appropriate function for calculating the geometry.

Usage: [model] = newSimpleElement(model, shape, name, coord, angle, dimensions, bounding_angle1, bounding_angle2, ring_width);

Example: [model] = newSimpleElement(model, 'cylinder', 'test_element1', [0, 0, 0], [0, 45, 15], [50, 50, 50], 0, 270, 25);

  • model - Structure with a numerical model description.
  • shape - Shape of the element, options include: 'ellipse', 'rectangle', 'ellipsoid', 'cuboid', and 'cylinder'.
  • name - Name of the new element.
  • coord - Coordinates of the center of the shape, matching the dimensionality of the model.
  • angle - Rotation angle of the element.
  • dimensions - Dimensions of the object along the x, y, and z axes (for 3D objects).
  • bounding_angle1 - Start angle for an ellipse segment; default is 0.
  • bounding_angle2 - End angle for an ellipse segment; default is 360.
  • ring_width - Width of a created ring; default creates a solid interior.

prepareMaps

Prepares three essential maps for discretizing the mesh.

Usage: [model] = prepareMaps(model);

  • model - Structure with a numerical model description.
  • List of prepared maps:
    • model.eps_map - Map of relative permittivity (epsilon).
    • model.sigma_map - Map of conductivity (sigma).
    • model.patternImage - Map of elements in the model.

readFormula

Extracts names of elements and symbols of operations from an algebraic expression. This function is primarily used by newComplexElement.

Usage: [components, operations] = readFormula(formula);

  • formula - Algebraic expression, e.g., from newComplexElement.
  • components - Names of the elements in the formula.
  • operations - Operational symbols used in the formula.

specifyFOV

Determines the indices of the area of interest inside the sensor. These indices are subsequently used by functions to present data and in upscaleModel during nonlinear reconstruction.

Usage: [model] = specifyFOV(model, name);

  • model - Structure with a numerical model description.
  • name - Name of the element to be saved as the Field of View (FOV).