Finite Element Analysis, Python, Sfepy, Motivation.
d=np.zeros(shape=(len(fdof),)) Q=np.zeros(shape=(len(fdof),)) pdof=bc[:,0].astype(int) dp=bc[:,1] fdof=np.delete(fdof, pdof, 0) s=np.linalg.lstsq(K[fdof,:][:,fdof], (F[fdof].T-np.dot(K[fdof,:][:,pdof],dp.T)).T, rcond=None)[0] d[pdof]=dp d[fdof]=s.reshape(-1,) # Q=np.dot(K,d).T-F return d And here