mbsimflexiblebody 4.0.0 MBSim Flexible Body Module

trafo33RCM.h
1 /* Copyright (C) 2004-2015 MBSim Development Team
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 *
17 * Contact: thorsten.schindler@mytum.de
18 */
19
20 #ifndef TRAFO33RCM_H_
21 #define TRAFO33RCM_H_
22
23 #include <mbsim/functions/function.h>
24 #include "mbsimFlexibleBody/pointer.h"
25
26 namespace MBSimFlexibleBody {
27
28 /***
29 * \brief computation of FiniteElement1s33RCM position coordinates (cp-angles and bending)
30 * \author Thorsten Schindler
31 * \date 2009-04-24 initial commit (Thorsten Schindler)
32 */
33 class PositionFunction : public MBSim::Function<fmatvec::Vec(fmatvec::Vec)> {
34 public:
43 PositionFunction(RevCardanPtr angle_,double l0_,const fmatvec::Vec& pL_,const fmatvec::Vec& pR_,
44 double cL1_,double cR1_,double cL2_,double cR2_,const fmatvec::RowVec& rRrLmH_);
45
49 ~PositionFunction() override;
50
51 /* INHERITED INTERFACE */
52 fmatvec::Vec operator()(const fmatvec::Vec& pos) override;
53 /***************************************************/
54
55 private:
59 RevCardanPtr angle;
60
64 double l0;
65
69 fmatvec::Vec pL, pR;
70
74 double cL1, cR1, cL2, cR2;
75
79 fmatvec::RowVec rRrLmH;
80 };
81
87 class PositionJacobian : public MBSim::Function<fmatvec::SqrMat(fmatvec::Vec)> {
88 public:
96 PositionJacobian(RevCardanPtr angle_,double l0_,const fmatvec::RowVec &rRrLmH_,const fmatvec::Mat &pSbE_);
97
101 ~PositionJacobian() override;
102
103 /* INHERITED INTERFACE */
104 fmatvec::SqrMat operator()(const fmatvec::Vec &pos) override;
105 /***************************************************/
106
107 private:
111 RevCardanPtr angle;
112
116 double l0;
117
121 fmatvec::RowVec rRrLmH;
122
126 fmatvec::Mat pSbE;
127 };
128 /*******************************************************************/
129
135 class Trafo33RCM {
136 public:
140 Trafo33RCM(RevCardanPtr angle_,double l0_);
141
145 virtual ~Trafo33RCM();
146
147 /* GETTER / SETTER */
148 const fmatvec::SqrMat& getJIG() const;
149 const fmatvec::SqrMat& getJIGt() const;
150 const fmatvec::Vec& getpS() const;
151 const fmatvec::Vec& getpSt() const;
152 const fmatvec::Vec& gettS() const;
153 const fmatvec::Vec& getnS() const;
154 const fmatvec::Vec& getbS() const;
155 const fmatvec::RowVec& getnSH() const;
156 const fmatvec::RowVec& getbSH() const;
157 const fmatvec::Vec& getntilS() const;
158 const fmatvec::Vec& getbtilS() const;
159 const fmatvec::RowVec& getntilSH() const;
160 const fmatvec::RowVec& getbtilSH() const;
161 const fmatvec::Vec& gettSt() const;
162 const fmatvec::Vec& getnSt() const;
163 const fmatvec::Vec& getbSt() const;
164 const fmatvec::RowVec& gettStH() const;
165 const fmatvec::RowVec& getnStH() const;
166 const fmatvec::RowVec& getbStH() const;
167 const fmatvec::RowVec& getntilStH() const;
168 const fmatvec::RowVec& getbtilStH() const;
169 const fmatvec::SqrMat& gettSpS() const;
170 const fmatvec::SqrMat& getnSpS() const;
171 const fmatvec::SqrMat& getbSpS() const;
172 const fmatvec::SqrMat& getntilSpS() const;
173 const fmatvec::SqrMat& getbtilSpS() const;
174 const fmatvec::SqrMat& gettSpSt() const;
175 const fmatvec::SqrMat& getnSpSt() const;
176 const fmatvec::SqrMat& getbSpSt() const;
177 const fmatvec::SqrMat& getntilSpSt() const;
178 const fmatvec::SqrMat& getbtilSpSt() const;
179
180 const fmatvec::Vec& getqIt() const;
181 const double& getepstil() const;
182 const double& getepstilt() const;
183 const fmatvec::Vec& getrS() const;
184 const fmatvec::Vec& getrSt() const;
185 const double& getk0() const;
186 const double& getk0t() const;
187 const fmatvec::Vec& getbe() const;
188 const fmatvec::Vec& getbet() const;
189
190 const double& getxintil() const;
191 const double& getxibtil() const;
192 const double& getetantil() const;
193 const double& getetabtil() const;
194 const double& getxintilt() const;
195 const double& getxibtilt() const;
196 const double& getetantilt() const;
197 const double& getetabtilt() const;
198 const fmatvec::SqrMat& getV() const;
199 /***************************************************/
200
205 void computeqI(const fmatvec::Vec& qG);
206
211 void computeJIG(const fmatvec::Vec& qG);
212
218 void computezI(const fmatvec::Vec& qG,const fmatvec::Vec& qGt);
219
225 void computeCOSYt(const fmatvec::Vec& qG,const fmatvec::Vec& qGt);
226
232 void computeTrafo(const fmatvec::Vec& qG,const fmatvec::Vec& qGt);
233
234 private:
238 RevCardanPtr angle;
239
243 double l0, l0h2, l0h3, l0h4, l0h5;
244 double xstar, xstarh2, xstarh3;
245
249 double epstil, k0;
250 fmatvec::Vec rS, pS;
251
255 fmatvec::Vec rRrLp;
256 fmatvec::RowVec rRrLmH;
257
261 fmatvec::Vec be;
262
266 fmatvec::Vec tS, nS, bS, ntilS, btilS;
267 fmatvec::RowVec nSH, bSH, ntilSH, btilSH;
268 fmatvec::SqrMat tSpS, nSpS, bSpS, ntilSpS, btilSpS;
269 double xibtil, xintil, etabtil, etantil;
270
274 fmatvec::Mat SMRHS_Jac;
275
279 fmatvec::SqrMat V;
280
284 fmatvec::Mat drRdrLp, drRdrLm, pSbE;
285
289 fmatvec::Mat SMRHS, nSbE, bSbE, ntilSbE, btilSbE;
290 fmatvec::RowVec xibtilbE, xintilbE, etabtilbE, etantilbE;
291
295 fmatvec::Mat beqG, tSqG, nSqG, bSqG, ntilSqG, btilSqG;
296 fmatvec::RowVec xintilqG, xibtilqG, etantilqG, etabtilqG;
297
301 fmatvec::SqrMat JIG, JIGt;
302
306 double k0t, epstilt;
307 fmatvec::Vec qIt, rSt, bet, pSt, tSt, nSt, bSt;
308 fmatvec::RowVec tStH, nStH, bStH, ntilStH, btilStH;
309 fmatvec::SqrMat tSpSt, nSpSt, bSpSt, ntilSpSt, btilSpSt;
310 double xibtilt, xintilt, etabtilt, etantilt;
311
316 void computeprelim(const fmatvec::Vec& qG);
317
322 fmatvec::Vec computes0(const fmatvec::Vec& qG);
323
328 void computebe(const fmatvec::Vec& qG);
329
333 void computeCOSY();
334
339 void computerSepstk0(const fmatvec::Vec& qG);
340
344 void computedrRdrL();
345
349 void computeV();
350
354 void computebeqG();
355
359 void computeCOSYqG();
360
364 void computeCOSYt();
365
370 void computeJIGt(const fmatvec::Vec& qGt);
371 };
372
373 inline const fmatvec::SqrMat& Trafo33RCM::getJIG() const { return JIG; }
374 inline const fmatvec::SqrMat& Trafo33RCM::getJIGt() const { return JIGt; }
375 inline const fmatvec::Vec& Trafo33RCM::getpS() const { return pS; }
376 inline const fmatvec::Vec& Trafo33RCM::getpSt() const { return pSt; }
377 inline const fmatvec::Vec& Trafo33RCM::gettS() const { return tS; }
378 inline const fmatvec::Vec& Trafo33RCM::getnS() const { return nS; }
379 inline const fmatvec::Vec& Trafo33RCM::getbS() const { return bS; }
380 inline const fmatvec::RowVec& Trafo33RCM::getnSH() const { return nSH; }
381 inline const fmatvec::RowVec& Trafo33RCM::getbSH() const { return bSH; }
382 inline const fmatvec::Vec& Trafo33RCM::getntilS() const { return ntilS; }
383 inline const fmatvec::Vec& Trafo33RCM::getbtilS() const { return btilS; }
384 inline const fmatvec::RowVec& Trafo33RCM::getntilSH() const { return ntilSH; }
385 inline const fmatvec::RowVec& Trafo33RCM::getbtilSH() const { return btilSH; }
386 inline const fmatvec::Vec& Trafo33RCM::gettSt() const { return tSt; }
387 inline const fmatvec::Vec& Trafo33RCM::getnSt() const { return nSt; }
388 inline const fmatvec::Vec& Trafo33RCM::getbSt() const { return bSt; }
389 inline const fmatvec::RowVec& Trafo33RCM::gettStH() const { return tStH; }
390 inline const fmatvec::RowVec& Trafo33RCM::getnStH() const { return nStH; }
391 inline const fmatvec::RowVec& Trafo33RCM::getbStH() const { return bStH; }
392 inline const fmatvec::RowVec& Trafo33RCM::getntilStH() const { return ntilStH; }
393 inline const fmatvec::RowVec& Trafo33RCM::getbtilStH() const { return btilStH; }
394 inline const fmatvec::SqrMat& Trafo33RCM::gettSpS() const { return tSpS; }
395 inline const fmatvec::SqrMat& Trafo33RCM::getnSpS() const { return nSpS; }
396 inline const fmatvec::SqrMat& Trafo33RCM::getbSpS() const { return bSpS; }
397 inline const fmatvec::SqrMat& Trafo33RCM::getntilSpS() const { return ntilSpS; }
398 inline const fmatvec::SqrMat& Trafo33RCM::getbtilSpS() const { return btilSpS; }
399 inline const fmatvec::SqrMat& Trafo33RCM::gettSpSt() const { return tSpSt; }
400 inline const fmatvec::SqrMat& Trafo33RCM::getnSpSt() const { return nSpSt; }
401 inline const fmatvec::SqrMat& Trafo33RCM::getbSpSt() const { return bSpSt; }
402 inline const fmatvec::SqrMat& Trafo33RCM::getntilSpSt() const { return ntilSpSt; }
403 inline const fmatvec::SqrMat& Trafo33RCM::getbtilSpSt() const { return btilSpSt; }
404 inline const fmatvec::Vec& Trafo33RCM::getqIt() const { return qIt; }
405 inline const double& Trafo33RCM::getepstil() const { return epstil; }
406 inline const double& Trafo33RCM::getepstilt() const { return epstilt; }
407 inline const fmatvec::Vec& Trafo33RCM::getrS() const { return rS; }
408 inline const fmatvec::Vec& Trafo33RCM::getrSt() const { return rSt; }
409 inline const double& Trafo33RCM::getk0() const { return k0; }
410 inline const double& Trafo33RCM::getk0t() const { return k0t; }
411 inline const fmatvec::Vec& Trafo33RCM::getbe() const { return be; }
412 inline const fmatvec::Vec& Trafo33RCM::getbet() const { return bet; }
413 inline const double& Trafo33RCM::getxintil() const { return xintil; }
414 inline const double& Trafo33RCM::getxibtil() const { return xibtil; }
415 inline const double& Trafo33RCM::getetantil() const { return etantil; }
416 inline const double& Trafo33RCM::getetabtil() const { return etabtil; }
417 inline const double& Trafo33RCM::getxintilt() const { return xintilt; }
418 inline const double& Trafo33RCM::getxibtilt() const { return xibtilt; }
419 inline const double& Trafo33RCM::getetantilt() const { return etantilt; }
420 inline const double& Trafo33RCM::getetabtilt() const { return etabtilt; }
421 inline const fmatvec::SqrMat& Trafo33RCM::getV() const { return V; }
422 /*******************************************************************/
423
424 }
425
426 #endif /*TRAFO33RCM_H_*/
427
MBSimFlexibleBody::PositionJacobian
computation of FiniteElement1s33RCM position JACOBIAN (cp-angles and bending)
Definition: trafo33RCM.h:87
MBSimFlexibleBody::Trafo33RCM::computezI
void computezI(const fmatvec::Vec &qG, const fmatvec::Vec &qGt)
compute the internal state
Definition: trafo33RCM.cc:393
MBSimFlexibleBody::Trafo33RCM::~Trafo33RCM
virtual ~Trafo33RCM()
destructor
MBSimFlexibleBody::Trafo33RCM::tS
fmatvec::Vec tS
COSY definitions.
Definition: trafo33RCM.h:266
MBSimFlexibleBody::PositionJacobian::~PositionJacobian
~PositionJacobian() override
destructor
MBSimFlexibleBody::PositionFunction::cL1
double cL1
global bending parameters
Definition: trafo33RCM.h:74
MBSimFlexibleBody::Trafo33RCM::computeJIG
void computeJIG(const fmatvec::Vec &qG)
compute the Jacobian of the trafo
Definition: trafo33RCM.cc:371
MBSimFlexibleBody::PositionJacobian::pSbE
fmatvec::Mat pSbE
differentiated centre angles with respect to bending coordinates
Definition: trafo33RCM.h:126
MBSimFlexibleBody::Trafo33RCM::computebe
void computebe(const fmatvec::Vec &qG)
compute the angle and bending positions
Definition: trafo33RCM.cc:226
MBSimFlexibleBody::PositionJacobian::rRrLmH
fmatvec::RowVec rRrLmH
transpose of difference of right and left beam position
Definition: trafo33RCM.h:121
MBSimFlexibleBody::Trafo33RCM::SMRHS_Jac
fmatvec::Mat SMRHS_Jac
system matrix and right hand side for computebe()
Definition: trafo33RCM.h:274
MBSimFlexibleBody::PositionJacobian::angle
RevCardanPtr angle
reversed Cardan-Object
Definition: trafo33RCM.h:111
MBSimFlexibleBody::Trafo33RCM::computerSepstk0
void computerSepstk0(const fmatvec::Vec &qG)
compute the CP, prolongation and torsion
Definition: trafo33RCM.cc:273
MBSimFlexibleBody::Trafo33RCM::computeCOSYqG
void computeCOSYqG()
compute the derivative of COSY with respect to qG
Definition: trafo33RCM.cc:356
MBSimFlexibleBody::Trafo33RCM::computeCOSYt
void computeCOSYt()
compute the derivative of COSY with respect to time
MBSimFlexibleBody::Trafo33RCM::be
fmatvec::Vec be
bending coordinates
Definition: trafo33RCM.h:261
MBSimFlexibleBody::Trafo33RCM::Trafo33RCM
Trafo33RCM(RevCardanPtr angle_, double l0_)
constructor
Definition: trafo33RCM.cc:126
MBSimFlexibleBody::Trafo33RCM::computebeqG
void computebeqG()
compute the derivative of bE with respect to qG
Definition: trafo33RCM.cc:320
MBSimFlexibleBody::Trafo33RCM::drRdrLp
fmatvec::Mat drRdrLp
delta matrices for computebe()
Definition: trafo33RCM.h:284
MBSimFlexibleBody::PositionFunction::rRrLmH
fmatvec::RowVec rRrLmH
transpose of difference of right and left beam position
Definition: trafo33RCM.h:79
MBSimFlexibleBody::Trafo33RCM::computeJIGt
void computeJIGt(const fmatvec::Vec &qGt)
compute the derivative of JIG with respect to time
Definition: trafo33RCM.cc:431
MBSimFlexibleBody::Trafo33RCM::rRrLp
fmatvec::Vec rRrLp
sum of right and left translational vector as well as transpose of the difference
Definition: trafo33RCM.h:255
MBSimFlexibleBody::PositionFunction::angle
RevCardanPtr angle
reversed Cardan-Object
Definition: trafo33RCM.h:59
MBSimFlexibleBody::Trafo33RCM::l0
double l0
length of FiniteElement1s33RCM and powers
Definition: trafo33RCM.h:243
MBSimFlexibleBody::PositionJacobian::l0
double l0
length of FiniteElement1s33RCM
Definition: trafo33RCM.h:116
MBSimFlexibleBody::Trafo33RCM
transformation of coordinates for FiniteElement1s33RCM
Definition: trafo33RCM.h:135
MBSimFlexibleBody::Trafo33RCM::computeqI
void computeqI(const fmatvec::Vec &qG)
compute the internal coordinates
Definition: trafo33RCM.cc:283
MBSimFlexibleBody::Trafo33RCM::V
fmatvec::SqrMat V
derivative of coefficients of bending polynomials w with respect to bending coordinates
Definition: trafo33RCM.h:279
MBSimFlexibleBody::PositionFunction::pL
fmatvec::Vec pL
angles of COG of rigid left-right connection
Definition: trafo33RCM.h:69
MBSimFlexibleBody::Trafo33RCM::JIG
fmatvec::SqrMat JIG
Jacobian and differentiated Jacobian.
Definition: trafo33RCM.h:301
MBSim::Function
MBSimFlexibleBody::PositionJacobian::PositionJacobian
PositionJacobian(RevCardanPtr angle_, double l0_, const fmatvec::RowVec &rRrLmH_, const fmatvec::Mat &pSbE_)
constructor
Definition: trafo33RCM.cc:67
MBSimFlexibleBody::Trafo33RCM::epstil
double epstil
internal coordinates of the FiniteElement1s33RCM
Definition: trafo33RCM.h:249
MBSimFlexibleBody::Trafo33RCM::computeprelim
void computeprelim(const fmatvec::Vec &qG)
computes preliminaries
Definition: trafo33RCM.cc:177
MBSimFlexibleBody::PositionFunction::~PositionFunction
~PositionFunction() override
destructor
MBSimFlexibleBody::PositionFunction::l0
double l0
length of FiniteElement1s33RCM
Definition: trafo33RCM.h:64
MBSimFlexibleBody::Trafo33RCM::SMRHS
fmatvec::Mat SMRHS
COSY definitions for computebe()
Definition: trafo33RCM.h:289
MBSimFlexibleBody::Trafo33RCM::computeTrafo
void computeTrafo(const fmatvec::Vec &qG, const fmatvec::Vec &qGt)
compute the internal coordinates and velocities as well as JIGt
Definition: trafo33RCM.cc:513
MBSimFlexibleBody::Trafo33RCM::k0t
double k0t
derivative of k0, epstilt, qI, rS, be and COSY with respect to time
Definition: trafo33RCM.h:306
MBSimFlexibleBody::PositionFunction
Definition: trafo33RCM.h:33
MBSimFlexibleBody::Trafo33RCM::computeCOSY
void computeCOSY()
compute the COSY
Definition: trafo33RCM.cc:248
MBSimFlexibleBody::Trafo33RCM::angle
RevCardanPtr angle
reversed Cardan-Object
Definition: trafo33RCM.h:238
MBSimFlexibleBody::Trafo33RCM::computedrRdrL
void computedrRdrL()
compute delta matrix for right and left beam end
Definition: trafo33RCM.cc:290
MBSimFlexibleBody::Trafo33RCM::beqG
fmatvec::Mat beqG
derivative of be and COSY with respect to qG
Definition: trafo33RCM.h:295
MBSimFlexibleBody::Trafo33RCM::computes0
fmatvec::Vec computes0(const fmatvec::Vec &qG)
compute the initial value for computebe()
Definition: trafo33RCM.cc:181
MBSimFlexibleBody::PositionFunction::PositionFunction
PositionFunction(RevCardanPtr angle_, double l0_, const fmatvec::Vec &pL_, const fmatvec::Vec &pR_, double cL1_, double cR1_, double cL2_, double cR2_, const fmatvec::RowVec &rRrLmH_)
constructor
Definition: trafo33RCM.cc:34
MBSimFlexibleBody::Trafo33RCM::computeV
void computeV()
compute the derivative of coefficients of bending polynomials w with respect to bending coordinates
Definition: trafo33RCM.cc:298