首页 > 解决方案 > 尝试使用具有未知值(未定义)的变量进行计算

问题描述

例如

   A=[array([[45225.35307609, 31425.35307609,     0.        ],
            [31425.35307609, 45225.35307609,     0.        ],
            [    0.        ,     0.        , 35609.38317306]]),
     array([[[ 22612.67653804,  15712.67653804, -16220.37580976],
             [ 15712.67653804,  22612.67653804, -16220.37580976],
             [-16220.37580976, -16220.37580976,  17804.69158653]]])] 

    exmax=unknown value variable #undefined maybe a better description?
    eymax=unknown value variable 
    exymax=unknown value variable 
    emax=np.array([[exmax],[eymax],[exymax]])

    N = np.dot(A,emax) #(where emax is a 3,1 array set up with three unknown variables)

#N must also equal 
N=np.array([[Nx],[0],[0]]) #where Nx is also undefined

我想将 N 值设置为另一个包含类似未定义变量 np.array([[Nx],[0],[0]]) 的值,然后计算 emax 的值。A 列表的每个元素也应乘以 emax 以给出这些 N 值的列表。我不知道 emax 的值,因为我不知道组成它的三个变量的值。我需要能够将 emax 矩阵乘以 A 矩阵的未知值设置为等于 N。而 N 也等于 np.array(([Nx],[0],[0]])。最终我需要能够计算 exmax、eymax、exymax,得到我的 emax 矩阵,同时能够计算 N 中的 NX。在这种非常特殊的情况下,

#N would be
np.array([[Nx],[0],[0]])=np.array([[45225exmax+31425eymax], [31425exmax + 45225eymax], [35609exymax]]) #for the first element in the A list. 

这意味着我可以计算 emax 和 Nx。

标签: pythonarraysvariablesundefined

解决方案


推荐阅读