Hi ,
I got this message once I run my codes. How could I modify the codes so that I don't get this message anymore?
here is my codes;
D =12;
L=48;
P=1000;
nu=0.3;
function uh=Displacement_field(dispX,dispY,N)
uh=[dispX'*N; dispY'*N];
return
function [eldisp,stress]=exact_sol_cantilever(x,y,P,E,nu,D,L)
%-----------------------------------------------------------------------
% analytical solution:
% ux=Py/(6EI)*[(6L-3x)*x+(2+poisson)*(y^2-D^2/4)];
% uy=-P/(6EI)*[3*poisson*y^2*(L-x)+(4+5*poisson)*D^2*x/4+(3*L-x)*x^2];
%-----------------------------------------------------------------------
y=y-D/2;% move (0,0) to below left corner
I=D^3/12;
pei=P/(6*E*I);
ux=pei*y*((6*L-3*x)*x+(2+nu)*(y*y-D*D/4));
uy=-pei*(3*nu*y*y*(L-x)+(4+5*nu)*D*D*x/4+(3*L-x)*x*x);
dux=pei*6*(L-x)*y; % element strain
dvy=-pei*6*nu*y*(L-x);
dxy=pei*6*(1+nu)*(y*y-D*D/4); % shearing strain: duy+dvx
sigXX=P*(L-x)*y/I;
sigYY=0;
sigXY=P*(y*y-D*D/4)/2/I;
eldisp=[ux;uy];
estrain=[dux;dvy;dxy];
stress=[sigXX;sigYY;sigXY];
U_analysis=eldisp;
return
[ue,estress0]=exact_sol_cantilever(pt(1),pt(2),P,E,nu,D,L);
uh=Displacement_field(dispX,dispY,dNdx);
error = ue-uh
Is it because of the looping? I'm starting the nodes from -ve value.
|