KerMor  0.9
Model order reduction for nonlinear dynamical systems and nonlinear approximation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Truss.m
Go to the documentation of this file.
1 namespace models{
2 namespace beam{
3 
4 
5 /* (Autoinserted by mtoc++)
6  * This source code has been filtered by the mtoc++ executable,
7  * which generates code that can be processed by the doxygen documentation tool.
8  *
9  * On the other hand, it can neither be interpreted by MATLAB, nor can it be compiled with a C++ compiler.
10  * Except for the comments, the function bodies of your M-file functions are untouched.
11  * Consequently, the FILTER_SOURCE_FILES doxygen switch (default in our Doxyfile.template) will produce
12  * attached source files that are highly readable by humans.
13  *
14  * Additionally, links in the doxygen generated documentation to the source code of functions and class members refer to
15  * the correct locations in the source code browser.
16  * However, the line numbers most likely do not correspond to the line numbers in the original MATLAB source files.
17  */
18 
19 class Truss
39  public: /* ( Constant ) */
40 
41  static const PlotSplitFactor = 5;
42 
43 
44  public: /* ( Constant ) */
45 
46  Truss(models.BaseFullModel model,material,pointsidx) {
47  this = this@models.beam.StructureElement(model, material, pointsidx);
48  this.initialize;
49  }
50 
51 
52  function globIdx = getGlobalIndices() {
53  data = this.Model.data;
54  p = this.PointsIdx;
55  index_0_glob = 7*data.knot_index(p(1))-6 : 7*data.knot_index(p(1))-4;
56  index_l_glob = 7*data.knot_index(p(2))-6 : 7*data.knot_index(p(2))-4;
57  globIdx = [index_0_glob index_l_glob];
58  }
69  function M = getLocalMassMatrix() {
70 
71  M = zeros(6);
72  M([1 4], [1 4]) = this.c(2) * [2 1; 1 2];
73 
74  M = this.TG * M * this.TG^t;
75  }
86  function K = getLocalStiffnessMatrix() {
87 
88  K = zeros(6);
89  K([1 4], [1 4]) = this.c(1) * [1 -1; -1 1];
90 
91  K = this.TG * K * this.TG^t;
92  }
103  function f = getLocalForceMatrix() {
104  q_lok = this.Material.rho * this.Material.A * this.T^t;
105  f = zeros(6, 3);
106  f([1 4],1) = 0.5 * this.Length;
107  f = this.TG * f * q_lok;
108  }
116  function [K , R ] = getLocalTangentials(u) {
117 
118  L = this.Length;
119  c = this.c;
120 
121  /* lokale Verschiebungen des Elements */
122  u_lok = this.TG^t * u;
123  /* lokale Ableitungen */
124  u_lok_prime = (u_lok(4:6) - u_lok(1:3)) / L;
125  /* Lokales Spannungsmaß */
126  E_11 = u_lok_prime(1) + 0.5 * (u_lok_prime^t * u_lok_prime);
127  S_x = L*c(1) * E_11;
128 
129  R = S_x * [-u_lok_prime - [1;0;0]; u_lok_prime + [1;0;0]];
130 
131  A1 = c(1) * (u_lok_prime + [1;0;0]) * (u_lok_prime + [1;0;0])^t;
132  A2 = S_x/L * eye(3);
133  B = A1 + A2;
134  K = [B -B; -B B];
135 
136  K = this.TG * K * this.TG^t;
137  R = this.TG * R;
138  }
150  function plot(p,u_elem,plot_options) {
151  s = 0 : this.Length/(4*this.PlotSplitFactor) : this.Length;
152 
153  u_p = plot_options.multiplier * (u_elem(2,:)" * s/this.Length + u_elem(1,:) " * (1 - s/this.Length));
154  /* Parametrisierung des Viertelkreises in lokalen Koords */
155  y = (this.Length/(2*this.PlotSplitFactor)) * sin( 2*pi*s / (this.Length/this.PlotSplitFactor) );
156  x = s;
157  z = 0*s;
158  /* Umrechnung in globale Koords und Verschiebung um globale Koords des
159  * lokalen Ursprungs KR(i).pc */
160  COR = this.T * [x; y; z];
161  plot3( p(this.PointsIdx(1), 1) + COR(1,:) + u_p(1,:), ...
162  p(this.PointsIdx(1), 2) + COR(2,:) + u_p(2,:), ...
163  p(this.PointsIdx(1), 3) + COR(3,:) + u_p(3,:), " k " );
164  }
165 
166 
167  private: /* ( Constant ) */
168 
169  function initialize() {
170  m = this.Model;
171  /* Längenberechnung */
172  dp = (m.Points(this.PointsIdx(2), :) - m.Points(this.PointsIdx(1), :));
173  l = norm(dp);
174  this.Length= l;
175 
176  /* Lokales Koordinatensystem */
177  e_x = dp^t / l;
178  e_y = [-e_x(2) e_x(1) 0]^t;
179  if norm(e_y) == 0
180  e_y = [0 e_x(3) -e_x(2)]^t;
181  end
182  e_z = [e_x(2)*e_y(3) - e_x(3)*e_y(2);
183  e_x(3)*e_y(1) - e_x(1)*e_y(3);
184  e_x(1)*e_y(2) - e_x(2)*e_y(1)];
185  e_y = e_y / norm(e_y);
186  e_z = e_z / norm(e_z);
187  this.T= [e_x e_y e_z];
188 
189  /* Transformationsmatrix: natürliche Koords -> glob. Koords
190  * Sortierung der Variablen:
191  * u0, v0, w0, u1, v1, w1
192  * 1 2 3 4 5 6 */
193  this.TG= zeros(6);
194  this.TG([1 2 3], [1 2 3]) = this.T; /* Verschiebung links */
195 
196  this.TG([4 5 6], [4 5 6]) = this.T; /* Verschiebung rechts */
197 
198 
199  /* Effektive Konstanten */
200  m = this.Material;
201  this.c(1) = m.E * m.A / l; /* c1 = E*A/L (Federhärte) */
202 
203  this.c(2) = m.rho * m.A * l / 6; /* c2 = rho*A*L/6 */
204 
205 
206 /* this.c_theta = material(9);
207  * this.kappa = material(10);
208  * this.alphaA = material(11); */
209  }
210 
211 
212 
213 };
214 }
215 }
216 
Model
The model that contains the structure element.
TG
c_theta = []; kappa = []; alphaA = []; The global transformation matrix (?)
The base class for any KerMor detailed model.
Definition: BaseFullModel.m:18
PointsIdx
Punkt-Index-Array.
function globIdx = getGlobalIndices()
Returns the global indices in the vector of DoFs for this element.
Definition: Truss.m:52
function f = getLocalForceMatrix()
Berechnet lokale Kraft eines Stabes.
Definition: Truss.m:103
Length
Indizes (lokal pro Knoten) in die die lokalen Matrizen assembliert werden Konvention: Freiheitsgrade ...
c
Effektive Stoffkonstanten.
Truss(models.BaseFullModel model, material, pointsidx)
Definition: Truss.m:46
Material:
Definition: Material.m:19
static const PlotSplitFactor
Definition: Truss.m:41
function M = getLocalMassMatrix()
Berechnet lokale Steifigkeits- und Massenmatrix eines Stabes c kodiert Stoffparameter: c1 = E*A/L (Fe...
Definition: Truss.m:69
function K = getLocalStiffnessMatrix()
Berechnet lokale Steifigkeitsmatrix eines Stabes c kodiert Stoffparameter: c1 = E*A/L (Federhärte) c2 ...
Definition: Truss.m:86
Truss:
Definition: Truss.m:19
function [ K , R ] = getLocalTangentials(u)
Berechnet lokale tangentiale Steifigkeits- und Massenmatrix eines Stabes c kodiert Stoffparameter: c1...
Definition: Truss.m:116
rho
Dichte des Stahls (kg/m³) (Konstruktor!)
Definition: Material.m:77
function plot(p, u_elem, plot_options)
Definition: Truss.m:150
T
Transformationsmatrix für das lokale Koordinatensystem.