Manipulating IMAT Objects


As mentioned in previous sections, IMAT objects can interact with each other and be manipulated to create new data sets. This section summarizes the various types of interactions and manipulations. The figure below is a graphical representation of how the different IMAT objects can be used with each other. IMAT uses curly brace {}subscripting to manipulate one IMAT object with another. Use cases and examples for each of the IMAT data objects are provided below.

 

imat_fn

Coordinate traces (imat_ctrace) are used to extract a subset of functions (imat_fn) based on their response and/or reference coordinates. One simple example of this usage is shown below. See more details and examples here.

>> f

f =

3x1 IMAT Function with the following attributes:
Record Name       FunctionType     AbscissaSpacing  NumberElements
----------------- ---------------- ---------------- --------------
1_(1X+,1X-)       Frequency Respon Even             1601
2_(1X+,2X-)       Frequency Respon Even             1601
3_(1X+,3X-)       Frequency Respon Even             1601

>> res = imat_ctrace('3x-','1x-');
>> g = f{res}

g =

2x1 IMAT Function with the following attributes:
Row Col Record Name      FunctionType     AbscissaSpacing  NumberElements
--- --- ---------------- ---------------- ---------------- --------------
1_(1X+,3X-)       Frequency Respon Even             1601
2_(1X+,1X-)       Frequency Respon Even             1601

>>

Groups (imat_group) can be used in a similar manner to extract functions whose response nodes match the nodes in the group using {} subscripting like shown above.

Filters (imat_filt) are used to extract a subset of functions based on the function attributes. One simple example of this usage is shown below. See more details and examples here.

>> f

f =

3x1 IMAT Function with the following attributes:
Record Name       FunctionType     AbscissaSpacing  NumberElements
----------------- ---------------- ---------------- --------------
1_(1X+,1X-)       Frequency Respon Even             1601
2_(1X+,2X-)       Frequency Respon Even             1601
3_(1X+,3X-)       Frequency Respon Even             1601

>> filt = imat_filt('ResponseNode','=',3)
filt =
...for objects of type 'imat_fn'
ResponseNode == 3

>> g = f{filt}           % Extract the function(s) whose ResponseNode is equal to 3

g =

IMAT Function with the following attributes:
Record Name      FunctionType     AbscissaSpacing  NumberElements
---------------- ---------------- ---------------- --------------
1_(1X+,3X-)      Frequency Respon Even             1601

>>

imat_shp

Coordinate traces (imat_ctrace) are used to extract the shape coefficients matching the DOF in the coordinate trace. The example below shows how to extract DOF 3X+ and 2Z+ from the shapes. See more details and examples here.

>> s=imat_shp(3,'Frequency',1:3);
>> s.shape=1:9

s =

3x1 IMAT Shape with the following attributes:
Row Frequency           Damping             NumberNodes
--- ------------------- ------------------- -------------------
1   1                   0                   3
1   2                   0                   3
1   3                   0                   3

>> list(s(1))
Shape 1 - 1.000000 Hz, 0.000000 %Cr damping
ID Line 1:
      Node       Disp-X       Disp-Y       Disp-Z
-------------------------------------------------
         1            1            2            3
         2            4            5            6
         3            7            6            9

>> coef = s{imat_ctrace('3x','2z')}           % The rows are the shape coefficients, and the columns are the shapes

coef =
     7     7     7
     6     6     6

Filters (imat_filt) are used to extract a subset of shapes based on the shape attributes. One simple example of this usage is shown below. See more details and examples here.

>> s=imat_shp(3,'Frequency',1:3);

s =

3x1 IMAT Shape with the following attributes:
Row Frequency           Damping             NumberNodes
--- ------------------- ------------------- -------------------
1   1                   0                   0
1   2                   0                   0
1   3                   0                   0


>> filt = imat_filt(imat_shp,'Frequency','>=',2)
filt =
...for objects of type 'imat_shp'
Frequency >= 2

>> t = s{filt}           % Extract the shapes whose frequency is greater than or equal to 2

t =

3x1 IMAT Shape with the following attributes:
Row Frequency           Damping             NumberNodes
--- ------------------- ------------------- -------------------
1   2                   0                   0
1   3                   0                   0


Groups (imat_group) can be used in a similar manner to partition shapes using {} subscripting like shown above, as well as by using the imat_shp/partition method.

imat_result

Coordinate traces (imat_ctrace) can be used to subscript into results that have the DataLocation type of Data At Nodes. Coordinate traces do not work with other Data Location types. One simple example is shown below. See more details and examples here.

>> r = imat_result(1);
>> r.data.data = 1:6
r =
1x1 IMAT_RESULT
Row  Name  DataLocation   ModelType  ResultType
---  ----  -------------  ---------  ------------
  1        Data At Nodes  Unknown    User defined

>> r.data
ans =
Data At Nodes:  3DOF global translation vector
================================================
      Node       Dir      SEID              Data
------------------------------------------------
        1         1         0                 1
        1         2         0                 2
        1         3         0                 3
        2         1         0                 4
        2         2         0                 5
        2         3         0                 6
------------------------------------------------
Number of Values: 6     Number of Nodes: 2
================================================

>> r.data(imat_ctrace('2x'))           % Extract the shape coefficient 2X+ into a new imat_result_dan object
ans =
Data At Nodes:  Unknown
================================================
      Node       Dir      SEID              Data
------------------------------------------------
        2         1         0                 4
------------------------------------------------
Number of Values: 1     Number of Nodes: 1
================================================

>>

Coordinate traces (imat_ctrace) and groups (imat_group) can also be used to partition results using the imat_result/partition method. See more details and examples here.

imat_fem

Groups (imat_group) can be used extract a subset of a FEM (imat_fem) based on the intersection of the group and FEM nodes and/or elements. You can use them by subscripting or by using the imat_fem/partition method.

 


Previous

Next