Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.919170e-17.

5 次查看(过去 30 天)
I need help, when I run I get the error message in the title.
E=210e9; %in Pascal
t=5; %in mm
v=0.3; %poissons dimensionless
C=(E/(1-(v.^2)))*[1 v 0; v 1 0; 0 0 ((1-v)/2)];
ix1=0;
iy1=0;
jx1=500;
jy1=0;
mx1=250;
my1=125;
%solve beta and gamma values
bi1=jy1-my1;
bj1=my1-iy1;
bm1=iy1-jy1;
gi1=mx1-jx1;
gj1=ix1-mx1;
gm1=jx1-ix1;
%find area in mm^2 using (1/2)b*h
A1= 0.5*125*500;
B1=(1/(2*A1))*[bi1, 0, bj1, 0, bm1, 0;
0, gi1, 0, gj1, 0, gm1;
gi1 bi1 gj1 bj1 gm1 bm1];
Bt1=B1.'; %transpose of B
k1=(t*A1)*(Bt1)*(C)*(B1) %stiffness matrix
F=[(40000*sind(30)); -(40000*cosd(30)); 0; 0] %force on the node
k1_d=k1(3:6,3:6) %adjust matrix for boundary conditions and correct size
d=k1_d\F %solve displacement
  2 个评论
Rik
Rik 2023-4-30
It is not an error, it is a warning that you might not be able to trust the result. If the condition is very small, there is a high chance of variability in the result. That is not a Matlab issue but is caused by the underlying mathematics.
John D'Errico
John D'Errico 2023-4-30
The matrix k_1d has rank 3. It was formed as a product of rank 3 matrices, but it has size 4x4.
You CANNOT solve for the displacement. What you are doing, or exactly what the equations mean is impossible to know, so I cannot diagnose what you have done wrong. If I had to guess, it is that you are mssing a boundary condition in some form.
Essentially, there is a fundamental problem in the equations you have formulated, so that no solution will be possible as you have written it. What you did wrong, we cannot know at this point.

请先登录,再进行评论。

回答(1 个)

Neeraj
Neeraj 2023-5-16
Hello,
I understand that you are getting the warning: Matrix is close to singular or badly scaled. Results may be inaccurate.
The warning message is clear and it occurs for the line
d=k1_d\F %solve displacement
This occurs because k1_d is ill-conditioned and there is no inverse of it. This is equivalent to division by zero. There is no ‘help’ for this case, but the inputs do not allow this operation.

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by