Skip to content

Commit

Permalink
Merge pull request #13 from CALFEM/develop
Browse files Browse the repository at this point in the history
Minor beam / bar update and manual update.
  • Loading branch information
jonaslindemann authored Jan 9, 2023
2 parents f74f262 + d408aad commit 0631b7f
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 20 deletions.
Binary file modified calfem-3.6-manual-bar-beam.pdf
Binary file not shown.
Binary file modified calfem-3.6-manual-full.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion fem/bar1e.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
%
% eq = [qx] distributed load (local direction)
%
% OUTPUT: Ke : beam stiffness matrix (2 x 2)
% OUTPUT: Ke : bar stiffness matrix (2 x 2)
%
% fe : element load vector (2 x 1)
%-------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions fem/bar2gs.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
function [es,QX,edi,eci]=bar2gs(ex,ey,ep,ed)
function [es,QX,edi,eci]=bar2gs(ex,ey,ep,ed,n)
% [es,QX]=bar2gs(ex,ey,ep,ed)
% [es,QX,edi]=bar2gs(ex,ey,ep,ed,n)
% [es,QX,edi,eci]=bar2gs(ex,ey,ep,ed,n)
%-------------------------------------------------------------------------
% PURPOSE
% Calculate section forces in a two dimensional bar element (bar2e).
% Calculate section forces in a two dimensional bar element (bar2ge).
%
% INPUT: ex = [x1 x2] element node coordinates
% ey = [y1 y2]
Expand Down
7 changes: 4 additions & 3 deletions fem/bar2s.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
%
% n: number of evaluation points ( default=2 )
%
% OUTPUT: es = [N1;
% N2 ] section forces, local directions
% OUTPUT: es = [N1 ; section forces, local directions
% N2 ;
% ...]
%
% edi = [ u1 ; element displacements, local directions,
% u2 ; in n points along the bar, dim(es)= n x 1
% ...]
%
% eci = [ x1 ; local x-coordinates of the evaluation
% eci = [ x1 ; local x-coordinates of the evaluation
% x2 ; points, (x1=0 and xn=L)
% ...]
% -------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions fem/bar3s.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
%
%-------------------------------------------------------------

% LAST MODIFIED: O. Dahlblom 2021-09-01
% LAST MODIFIED: O. Dahlblom 2022-11-21
% Copyright (c) Division of Structural Mechanics and
% Division of Solid Mechanics.
% Lund University
Expand All @@ -53,7 +53,7 @@

dx=ex(2)-ex(1);
dy=ey(2)-ey(1);
dy=ez(2)-ez(1);
dz=ez(2)-ez(1);
L=sqrt(dx*dx+dy*dy+dz*dz);
% b=[ ex(2)-ex(1); ey(2)-ey(1); ez(2)-ez(1) ];
% L=sqrt(b'*b);
Expand Down
3 changes: 2 additions & 1 deletion fem/beam1ws.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
% [es,edi,eci]=beam1ws(ex,ep,ed,eq,n)
%---------------------------------------------------------------------
% PURPOSE
% Compute section forces in two dimensional beam element (beam2e).
% Compute section forces in one dimensional beam element
% on elastic foundation (beam1we).
%
% INPUT: ex = [x1 x2] element node coordinates
%
Expand Down
18 changes: 9 additions & 9 deletions fem/beam2gxs.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@
d2v=[zero zero -k^2*cos(k.*X) -k^2*sin(k.*X)]*C2a;
d3v=[zero zero k^3*sin(k.*X) -k^3*cos(k.*X)]*C2a;
if DEI~=0;
v=v+qY*L^4/(2*DEI)*((1+cos(kL))/(kL^3*sin(kL))*(-1+cos(k.*X))+sin(k.*X)/kL^3+X.*(-1+X./L)/(kL^2*L))
dv=dv+qY*L^3/(2*DEI)*((1+cos(kL))/(kL^2*sin(kL))*(-sin(k.*X))+cos(k.*X)/kL^2+(-1+2*X./L)/kL^2)
d2v=d2v+qY*L^2/(2*DEI)*((1+cos(kL))/(kL*sin(kL))*(-cos(k.*X))-sin(k.*X)/kL+2/(kL^2))
d3v=d3v+qY*L/(2*DEI)*((1+cos(kL))/sin(kL)*(sin(k.*X))-cos(k.*X))
v=v+qY*L^4/(2*DEI)*((1+cos(kL))/(kL^3*sin(kL))*(-1+cos(k.*X))+sin(k.*X)/kL^3+X.*(-1+X./L)/(kL^2*L));
dv=dv+qY*L^3/(2*DEI)*((1+cos(kL))/(kL^2*sin(kL))*(-sin(k.*X))+cos(k.*X)/kL^2+(-1+2*X./L)/kL^2);
d2v=d2v+qY*L^2/(2*DEI)*((1+cos(kL))/(kL*sin(kL))*(-cos(k.*X))-sin(k.*X)/kL+2/(kL^2));
d3v=d3v+qY*L/(2*DEI)*((1+cos(kL))/sin(kL)*(sin(k.*X))-cos(k.*X));
end;
elseif QX>eps*DEI/L^2
k=sqrt(QX/DEI);
Expand All @@ -125,10 +125,10 @@
d2v=[zero zero k^2*cosh(k.*X) k^2*sinh(k.*X)]*C2a;
d3v=[zero zero k^3*sinh(k.*X) k^3*cosh(k.*X)]*C2a;
if DEI~=0;
v=v+qY*L^4/(2*DEI)*((1+cosh(kL))/(kL^3*sinh(kL))*(-1+cosh(k.*X))-sinh(k.*X)/kL^3+X.*(1-X./L)/(kL^2*L))
dv=dv+qY*L^3/(2*DEI)*((1+cosh(kL))/(kL^2*sinh(kL))*(sinh(k.*X))-cosh(k.*X)/kL^2+(1-2*X./L)/kL^2)
d2v=d2v+qY*L^2/(2*DEI)*((1+cosh(kL))/(kL*sinh(kL))*(cosh(k.*X))-sinh(k.*X)/kL-2/(kL^2))
d3v=d3v+qY*L/(2*DEI)*((1+cosh(kL))/sinh(kL)*(sinh(k.*X))-cosh(k.*X))
v=v+qY*L^4/(2*DEI)*((1+cosh(kL))/(kL^3*sinh(kL))*(-1+cosh(k.*X))-sinh(k.*X)/kL^3+X.*(1-X./L)/(kL^2*L));
dv=dv+qY*L^3/(2*DEI)*((1+cosh(kL))/(kL^2*sinh(kL))*(sinh(k.*X))-cosh(k.*X)/kL^2+(1-2*X./L)/kL^2);
d2v=d2v+qY*L^2/(2*DEI)*((1+cosh(kL))/(kL*sinh(kL))*(cosh(k.*X))-sinh(k.*X)/kL-2/(kL^2));
d3v=d3v+qY*L/(2*DEI)*((1+cosh(kL))/sinh(kL)*(sinh(k.*X))-cosh(k.*X));
end;
else
C2=[1 0 0 0;
Expand All @@ -153,6 +153,6 @@
N=QX+dv.*V;
es=[N V M];
edi=[u v];
eci=X
eci=X;
%--------------------------------- end -------------------------------------

6 changes: 4 additions & 2 deletions fem/beam2ws.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
%
% eq = [qX qY] distributed loads, local directions
%
% n : number of evaluation points ( default=2 )
%
% OUTPUT: es = [ N1 V1 M1 ; section forces, local directions, in
% N2 V2 M2 ; n points along the beam, dim(es)= n x 3
% .........]
Expand All @@ -36,7 +38,7 @@
%
% -------------------------------------------------------------------------

% LAST MODIFIED: O Dahlblom 2022-05-30
% LAST MODIFIED: O Dahlblom 2022-09-30
% Copyright (c) Division of Structural Mechanics and
% Division of Solid Mechanics.
% Lund University
Expand Down Expand Up @@ -68,7 +70,7 @@
0 0 0 nxY nyY 0;
0 0 0 0 0 1];

edl=G*ed'
edl=G*ed';

a1=[edl(1); edl(4)];
C1=[1 0;-1/L 1/L];
Expand Down

0 comments on commit 0631b7f

Please sign in to comment.