嘿,我正在编写这段代码以进行材料分析。我为材料的每一层生成了一个矩阵,我想将每个矩阵保存为自己的元素。我这样做的方法是将其保存到字典中。然后,我通过对字典的所有值求和来形成一个矩阵。现在,我针对三种不同的条件执行此操作,从而得到 3 个矩阵:A、B 和 D。我想创建所有这些矩阵,使其看起来像:
    | AB |
    | BD |
但是我无法让它正确打印,因为它总是说矩阵:然后是矩阵之一,例如A。它在第三行打印第二个矩阵B,其中A结束而不是在A旁边。我还需要在这个庞大的矩阵上执行未来的操作,所以我想知道最好的方法是什么。这是我的代码的一部分:
    Qbars = {}
    for i in plies:
    Qbar11 = Q11 * math.cos(float(thetas[j]))**4 + Q22        *math.sin(float(thetas[j]))**4 + \
        2 * (Q12 + 2 * Q66) * math.sin(float(thetas[j]))**2 * math.cos(float(thetas[j]))**2
        Qbar22 = Q11 * math.sin(float(thetas[j]))**4 + Q22 *math.cos(float(thetas[j]))**4 + \
        2 * (Q12 + 2 * Q66) * math.sin(float(thetas[j]))**2 * math.cos(float(thetas[j]))**2
        Qbar12 = (Q11 + Q22 - 4 * Q66) * math.sin(float(thetas[j]))**2 * \
        math.cos(float(thetas[j]))**2 + Q12 * (math.cos(float(thetas[j]))**4 + …Run Code Online (Sandbox Code Playgroud)