Forum Discussion
SilverStat
Feb 24, 2023Copper Contributor
Iterating a lambda function over an array
Hello, I have added what I hope is a simplified version of the problem I am having here. Take this pair of matrices: The function I need is expected to behave as follows: Suppose I am inte...
PeterBartholomew1
Feb 25, 2023Silver Contributor
This goes for the problem somewhat at a single hit and could possibly benefit from a little more modularisation using Lambda functions.
=LET(
nodeTable, TAKE(WRAPROWS(TOROW(stiffnessTable), 30), , 4),
elementIndex, SEQUENCE(ROWS(nodeTable)),
MAKEARRAY( 10, 10,
LAMBDA(rowIndex, columnIndex,
LET(
rowFreedom, BYROW(nodeTable, LAMBDA(nodeList, XMATCH(rowIndex, nodeList))),
colFreedom, BYROW(nodeTable, LAMBDA(nodeList, XMATCH(columnIndex, nodeList))),
unfiltered, HSTACK(elementIndex, rowFreedom, colFreedom),
criterion, BYROW(IFNA(unfiltered, 0), LAMBDA(f, AND(f))),
returnValue, IF(
criterion,
INDEX(stiffnessTable, 6 * (elementIndex - 1) + rowFreedom + 1, colFreedom)
),
SUM(returnValue)
)
)
)
)It uses a calculated index applied to the entire list of stiffness matrices. By the way, how do you plan to invert the matrix equations?