Write a (:,2) to a (:,6) matrix, depending on the value in (:,2) matrix.
Show older comments
Hi We are working on our bachelor as construction engineer, where we must build a static and dynamic beam analyzing system tool in MATLAB.
We want to define our system in the NE–matrix where each beam element is described in each row, where each node is numbered in column two and tree.
Each node from the NE-matrix (columns 2 and 3) must be written by 3 degrees of freedom (DOF), in a DOF-matrix. The matrix should be built in such a way, that the first node of the element is written in the first 3 columns, and the second node is written in the last 3 columns, a total of 6 columns.
This way we can describe each beam element in the rows, where the columns describes the degrees of freedom for the beam.
The node-DOF should be like this:
% DOF nr. 1 2 3 4 5 6 7 8 9 10 11 12
Node nr. 1 2 3 4
And so on…
The NE-matrix can be very big, so we want a system that can generate itself. The 3 DOF for each number must be “bounded”, because it can be a truss system, where another beam element is defined by an already used node.
The NE-Matrix simplified:
Node 1 Node 2
Beam element 1 1 2
Beam element 2 2 3
Beam element 3 2 4
Beam element 4 3 5
%
%To the DOF-matrix:
%
| *Node 1* | *Node 2* |
Dof 1 Dof 2 Dof 3 Dof 1 Dof 2 Dof 3
Beam 1 1 2 3 4 5 6
Beam 2 4 5 6 7 8 9
Beam 3 4 5 6 10 11 12
Beam 4 7 8 9 13 14 15
end
Do you know how to write it in MATLAB?
Tanks. Per
4 Comments
Azzi Abdelmalek
on 2 May 2014
Is there any relation between the value of NE and DOF?
dpb
on 2 May 2014
I don't follow -- as you've described it, it doesn't seem that DOF is really dependent at all upon NE but are instead simply linear sequences?
Try again on how NE(1,2) gets from the '1' in the location to '1:3' and even more particularly w/ NE(2,2). The numeric values you've given seem to be independent of the values in NE; if so it looks like it's simply a tridiagonal construct.
dpb
on 3 May 2014
Well, I'm a NE, not structural, and maybe I'm dense but how does
The node-DOF should be like this:
% DOF nr. 1 2 3 4 5 6 7 8 9 10 11 12
Node nr. 1 2 3 4
translate to
%To the DOF-matrix:
%
| *Node 1* | *Node 2* |
Dof 1 Dof 2 Dof 3 Dof 1 Dof 2 Dof 3
Beam 1 1 2 3 4 5 6
Maybe if you were to use something other than sequential numbers the pattern could be discerned, but I don't yet see it from the description/example so far, sorry...
Per
on 3 May 2014
Accepted Answer
More Answers (0)
Categories
Find more on Sparse Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

