getting NaN as result
Mostrar comentarios más antiguos
Dear MATLAB helpers,
I'm trying to run a project for 2 month but I think the problem is bad scaling.
this is the code :
K=zeros(15);
for i=1:4
Ke=bar3e(Ex(i,:),Ey(i,:),Ez(i,:),[E Ep(i,1)]);
K=assem(Edof(i,:),K,Ke);
end
Also I attached bar3e function, assem and variables value such as E , it may help.
I will be thankful for any suggestion.
All the best
4 comentarios
per isakson
el 28 de Ag. de 2014
Editada: per isakson
el 28 de Ag. de 2014
Which are the steps needed to reproduce your problem?
>> [Ke]=bar3e(ex,ey,ez,ep)
Undefined function or variable 'ex'.
>> [K,f]=assem(edof,K,Ke,f,fe)
Undefined function or variable 'edof'.
Hessam
el 28 de Ag. de 2014
Fabio Freschi
el 28 de Ag. de 2014
Unfortunately I can't do some tests myself. Anyway, I have an idea. My guess is that you are trying to solve a FEM problem or similar and you are not applying constraints (or boundary conditions) to the stiffness matrix. To check if I am right, remove one row and one column from the stiffness matrix and rhs and solve the problem. This is equivalent to set an unknown to 0. For example:
% this is the unknown we want to fix to 0
ifix = 1;
% tis is not very efficient but simple!
K(ifix,:) = []; % remove row
K(:,ifix) = []; % remove col
f(ifix) = []; % rhs
% solve. The solution might be meaningless, but the system is now
% constrained and you should not have singularities anymore
x = K\f;
If this works you can try to apply meaningful boundary conditions to your system.
Let us know!
Fabio
Hessam
el 29 de Ag. de 2014
Respuestas (0)
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!