Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jorge Pérez Zerpa
libroResMat2
Commits
11e0cdd1
Commit
11e0cdd1
authored
Dec 18, 2021
by
Jorge Pérez Zerpa
Browse files
agrego ejemplo MF
parent
b10b8b88
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
octave/FEMTrusS.m
View file @
11e0cdd1
...
...
@@ -17,7 +17,8 @@ clear all, close all
% Applied loads and fixed degrees of freedom (supports)
%%
FMTrusSInput_ej1UT2
%FMTrusSInput_ej1UT2
FMTrusSInput_ej1Examen202112
%% 2- Previous calculations and stiffness matrix assembly
% Assembles the global stiffness matrix KG and computes the matrix for each element.
...
...
octave/FMTrusS.m
View file @
11e0cdd1
...
...
@@ -9,7 +9,8 @@ addpath( [ pwd '/sources'] );
%% 1- Input data
% Input parameters for geometry and material definition of all the trusses.
% Applied loads and fixed degrees of freedom (supports) are also set here.
FMTrusSInput_ej1UT2
#
FMTrusSInput_ej1UT2
FMTrusSInput_ej1Examen202112
%% 2- Pre-process
% Computation and storage of length, angle, E and A of all truss elements.
...
...
octave/deformed.png
View replaced file @
b10b8b88
View file @
11e0cdd1
22.8 KB
|
W:
|
H:
42.1 KB
|
W:
|
H:
2-up
Swipe
Onion skin
octave/normalforces.png
View replaced file @
b10b8b88
View file @
11e0cdd1
18.6 KB
|
W:
|
H:
33.8 KB
|
W:
|
H:
2-up
Swipe
Onion skin
octave/sources/FMTrusSInput_ej1Examen202112.m
0 → 100644
View file @
11e0cdd1
% section properties: vector with the cross-section areas
As
=
2e-4
;
% material properties: vector with young moduli values
Es
=
[
200e9
]
;
NodsCoord
=
[
...
0
1
;
1
/
sqrt
(
3
)
0
;
1
/
sqrt
(
3
)
+
1
1
;
1
0
]
;
% inode jnode material section
ElemConec
=
[
...
1
2
1
1
;
1
4
1
1
;
...
2
3
1
1
;
...
2
4
1
1
;
...
4
3
1
1
...
]
;
fixeddofs
=
[
1
2
5
6
]
;
NodalLoads
=
[
2
0
-
10e3
;
...
4
0
-
10e3
];
#
Deformed
scale
factor
scalefactor
=
1e3
;
#
row
vector
with
the
dofs
related
to
supports
which
are
replaced
by
virtual
forces
virtualforcessupports
=
[
]
;
#
row
vector
with
the
truss
elements
which
are
replaced
by
virtual
forces
virtualforceselements
=
[
4
]
;
#
degree
of
freedom
whose
displacement
must
be
determined
(
leave
empty
if
none
)
unkndispdof
=
4
;
% -----------------------------
octave/sources/FMTrusSPreprocess.m
View file @
11e0cdd1
% --- compute lengths and inclination of undeformed elements ---
Lengths
=
sqrt
(
sum
(
(
NodsCoord
(
ElemConec
(:,
2
),:)
-
...
NodsCoord
(
ElemConec
(:,
1
),:)
)
.^
2
,
2
)
)
;
NodsCoord
(
ElemConec
(:,
1
),:)
)
.^
2
,
2
)
)
Angles
=
atan2
(
(
NodsCoord
(
ElemConec
(:,
2
),
2
)
-
NodsCoord
(
ElemConec
(:,
1
),
2
)
)
,
...
(
NodsCoord
(
ElemConec
(:,
2
),
1
)
-
NodsCoord
(
ElemConec
(:,
1
),
1
)
)
)
;
(
NodsCoord
(
ElemConec
(:,
2
),
1
)
-
NodsCoord
(
ElemConec
(:,
1
),
1
)
)
)
Areas
=
As
(
ElemConec
(:,
4
)
)
;
Youngs
=
Es
(
ElemConec
(:,
3
)
)
;
...
...
@@ -24,16 +24,16 @@ nforceunknowns = nfixeddofs + nelems ;
#
assembles
the
vector
of
virtual
force
states
,
first
the
fixed
dofs
and
after
the
truss
elements
normal
forces
.
if
length
(
virtualforcessupports
)
>
0
virtualforces
=
[
find
(
fixeddofs
==
virtualforcessupports
)
...
virtualforceselements
+
nfixeddofs
]
;
virtualforceselements
+
nfixeddofs
]
;
else
virtualforces
=
[
virtualforceselements
+
nfixeddofs
]
;
virtualforces
=
[
virtualforceselements
+
nfixeddofs
]
;
end
#
row
vector
with
the
indexes
of
the
dofs
of
the
supports
left
in
the
isostatic
structure
isostaticsupports
=
1
:
nfixeddofs
;
if
length
(
virtualforcessupports
)
>
0
#
deletes
the
entries
corresponding
to
the
supports
which
are
replaced
by
virtual
forces
#
deletes
the
entries
corresponding
to
the
supports
which
are
replaced
by
virtual
forces
isostaticsupports
(
find
(
fixeddofs
==
virtualforcessupports
)
)
=
[]
;
end
...
...
@@ -60,14 +60,14 @@ for i=1:nelems
l
=
Lengths
(
i
)
;
ang
=
Angles
(
i
);
nodi
=
ElemConec
(
i
,
1
);
nodj
=
ElemConec
(
i
,
2
);
nodi
=
ElemConec
(
i
,
1
);
nodj
=
ElemConec
(
i
,
2
);
elemdofs
=
nodes2dofs
(
[
nodi
nodj
]
'
,
2
)
;
ca
=
cos
(
ang
);
sa
=
sin
(
ang
);
auxproj
=
[
-
ca
;
-
sa
;
ca
;
sa
]
;
Meq
(
elemdofs
,
i
+
nfixeddofs
)
=
-
auxproj
;
end
...
...
octave/sources/FMTrusSProcess.m
View file @
11e0cdd1
...
...
@@ -12,11 +12,11 @@ for j=1:hiperdegree
end
ForceIndepTerm
x
=
Meqred
\
ForceIndepTerm
x
=
Meqred
\
ForceIndepTerm
supportreactions
=
zeros
(
nfixeddofs
,
hiperdegree
+
1
)
;
supportreactions
(
isostaticsupports
,
:
)
=
x
(
1
:
length
(
isostaticsupports
)
,:)
supportreactions
(
isostaticsupports
,
:
)
=
x
(
1
:
length
(
isostaticsupports
)
,:)
if
length
(
virtualforcessupports
)
>
0
aux
=
find
(
fixeddofs
==
virtualforcessupports
)
;
for
j
=
1
:
hiperdegree
...
...
@@ -29,8 +29,8 @@ supportreactions
Ns
=
zeros
(
nelems
,
hiperdegree
+
1
)
;
%~ Ns( isostaticforceselem-length(isostaticsupports) , : ) = x( isostaticforceselem, : ) ;
Ns
(
isostaticforceselem
-
nfixeddofs
,
:
)
=
x
(
(
length
(
isostaticsupports
)
+
1
):
end
,
:
)
;
%~ Ns( isostaticforceselem-length(isostaticsupports) , : ) = x( isostaticforceselem, : ) ;
Ns
(
isostaticforceselem
-
nfixeddofs
,
:
)
=
x
(
(
length
(
isostaticsupports
)
+
1
):
end
,
:
)
;
if
length
(
virtualforceselements
)
>
0
for
i
=
1
:
length
(
virtualforceselements
)
Ns
(
virtualforceselements
,
i
+
1
)
=
1
;
...
...
@@ -43,6 +43,7 @@ Ns
Kf
=
zeros
(
hiperdegree
,
hiperdegree
)
;
Ff
=
zeros
(
hiperdegree
,
1
)
;
hiperdegree
for
i
=
1
:
hiperdegree
for
j
=
1
:
hiperdegree
Kf
(
i
,
j
)
=
sum
(
Ns
(:,
1
+
i
)
.*
Ns
(:,
1
+
j
)
.
/
(
Youngs
.*
Areas
)
.*
Lengths
)
;
...
...
@@ -51,11 +52,14 @@ for i=1:hiperdegree
Ff
(
i
)
=
-
sum
(
Ns
(:,
1
)
.*
Ns
(:,
1
+
i
)
.
/
(
Youngs
.*
Areas
)
.*
Lengths
)
;
end
X
=
Kf
\
Ff
Kf
Ff
X
=
Kf
\
Ff
ResultReactions
=
supportreactions
*
[
1
;
X
]
ResultNormalForces
=
Ns
*
[
1
;
X
]
ResultNormalForces
=
Ns
*
[
1
;
X
]
Rext
=
zeros
(
2
*
nnodes
,
1
)
;
Rext
(
fixeddofs
)
=
ResultReactions
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment