Get "Matrix is is singular to working precision" when attempting a global stiffness matrix with four nodes

3 次查看(过去 30 天)
% initialise Globgal Stiffness Matrix Using Zeros In A 4X4 Grid
K = zeros(4);
% define Stiffness Constants [lbf/in]
k1 = 1000;
k2 = 2000;
k3 = 3000;
% define Applied Forces [lbf]
f2 = -500;
f4 = 1000;
% set-Up Structural Matrix In A 2X2 Grid
% between Nodes 1 & 2
ks = k1*[1 -1;-1 1];
K(1:2,1:2) = K(1:2,1:2) + ks;
% between Nodes 2 & 3
ks = k2*[1 -1;-1 1];
K(2:3,2:3) = K(2:3,2:3) + ks;
% between Nodes 3 & 4
ks = k3*[1 -1;-1 1];
K(3:4,3:4) = K(3:4,3:4) + ks;
% columnise Forces
f = [0;f2;0
I understand I haven't initialised f3 yet but I am not too sure how. My main issue is regarding the error I get when I run it. That being: "Matrix is singular to working precision". This is a four node spring assembly and I am required to find the global stiffness matrix and subsequently the displacement of the springs from node 1.
;f4];
Unrecognized function or variable 'f3'.
% columnise Displacement
d = zeros(4,1)
% initialise Range Variable
range = (2:4)
% solve
d(range) = k(range,range)\f(range)

采纳的回答

David Goodmanson
David Goodmanson 2023-2-22
编辑:David Goodmanson 2023-2-22
Hi Declan,
I am not sure how you are getting the error message. Running the code with k changed to K
d(range) = K(range,range)\f(range)
gives
d =
0
0.5000
1.0000
1.3333
which is correct. You can keep f3 = 0 since f represents external forces and there is no external force on node 3.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Assembly 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by