MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
Wheel4 Class Reference

#include <module-wheel4.h>

Inheritance diagram for Wheel4:
Collaboration diagram for Wheel4:

Public Member Functions

 Wheel4 (unsigned uLabel, const DofOwner *pDO, DataManager *pDM, MBDynParser &HP)
 
virtual ~Wheel4 (void)
 
virtual void OutputPrepare (OutputHandler &OH)
 
virtual void Output (OutputHandler &OH) const
 
virtual void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
unsigned int iGetNumPrivData (void) const
 
unsigned int iGetPrivDataIdx (const char *s) const
 
doublereal dGetPrivData (unsigned int i) const
 
int iGetNumConnectedNodes (void) const
 
virtual void SetInitialValue (VectorHandler &XCurr)
 
void GetConnectedNodes (std::vector< const Node * > &connectedNodes) const
 
void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph)
 
virtual unsigned int iGetNumDof (void) const
 
virtual DofOrder::Order GetDofType (unsigned int i) const
 
virtual DofOrder::Order GetEqType (unsigned int i) const
 
std::ostream & Restart (std::ostream &out) const
 
virtual unsigned int iGetInitialNumDof (void) const
 
virtual void InitialWorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
VariableSubMatrixHandlerInitialAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
SubVectorHandlerInitialAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr)
 
void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
void CalculateR_e ()
 
doublereal CapLoop (doublereal Xuncapped) const
 
- Public Member Functions inherited from Elem
 Elem (unsigned int uL, flag fOut)
 
virtual ~Elem (void)
 
virtual std::ostream & DescribeDof (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeDof (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual std::ostream & DescribeEq (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeEq (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual void AssMats (VariableSubMatrixHandler &WorkMatA, VariableSubMatrixHandler &WorkMatB, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual bool bInverseDynamics (void) const
 
void SetInverseDynamicsFlags (unsigned uIDF)
 
unsigned GetInverseDynamicsFlags (void) const
 
bool bIsErgonomy (void) const
 
bool bIsRightHandSide (void) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr, const VectorHandler &XPrimePrimeCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
 
virtual int GetNumConnectedNodes (void) const
 
- Public Member Functions inherited from WithLabel
 WithLabel (unsigned int uL=0, const std::string &sN="")
 
virtual ~WithLabel (void)
 
void PutLabel (unsigned int uL)
 
void PutName (const std::string &sN)
 
unsigned int GetLabel (void) const
 
const std::string & GetName (void) const
 
- Public Member Functions inherited from SimulationEntity
 SimulationEntity (void)
 
virtual ~SimulationEntity (void)
 
virtual bool bIsValidIndex (unsigned int i) const
 
virtual HintParseHint (DataManager *pDM, const char *s) const
 
virtual void BeforePredict (VectorHandler &, VectorHandler &, VectorHandler &, VectorHandler &) const
 
virtual void Update (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void DerivativesUpdate (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void Update (const VectorHandler &XCurr, InverseDynamics::Order iOrder)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP, const VectorHandler &XPP)
 
virtual std::ostream & OutputAppend (std::ostream &out) const
 
virtual void ReadInitialState (MBDynParser &HP)
 
- Public Member Functions inherited from ToBeOutput
 ToBeOutput (flag fOut=fDefaultOut)
 
virtual ~ToBeOutput (void)
 
virtual void Output (OutputHandler &OH, const VectorHandler &X, const VectorHandler &XP) const
 
virtual flag fToBeOutput (void) const
 
virtual bool bToBeOutput (void) const
 
virtual void SetOutputFlag (flag f=flag(1))
 
- Public Member Functions inherited from UserDefinedElem
 UserDefinedElem (unsigned uLabel, const DofOwner *pDO)
 
virtual ~UserDefinedElem (void)
 
bool NeedsAirProperties (void) const
 
void NeedsAirProperties (bool yesno)
 
virtual Elem::Type GetElemType (void) const
 
virtual AerodynamicElem::Type GetAerodynamicElemType (void) const
 
- Public Member Functions inherited from InitialAssemblyElem
 InitialAssemblyElem (unsigned int uL, flag fOut)
 
virtual ~InitialAssemblyElem (void)
 
- Public Member Functions inherited from SubjectToInitialAssembly
 SubjectToInitialAssembly (void)
 
virtual ~SubjectToInitialAssembly (void)
 
- Public Member Functions inherited from AerodynamicElem
 AerodynamicElem (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~AerodynamicElem (void)
 
virtual const InducedVelocitypGetInducedVelocity (void) const
 
- Public Member Functions inherited from ElemWithDofs
 ElemWithDofs (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~ElemWithDofs (void)
 
- Public Member Functions inherited from DofOwnerOwner
 DofOwnerOwner (const DofOwner *pDO)
 
virtual ~DofOwnerOwner ()
 
virtual const DofOwnerpGetDofOwner (void) const
 
virtual integer iGetFirstIndex (void) const
 
- Public Member Functions inherited from AirPropOwner
 AirPropOwner (void)
 
virtual ~AirPropOwner (void)
 
virtual void PutAirProperties (const AirProperties *pAP)
 
virtual flag fGetAirVelocity (Vec3 &Velocity, const Vec3 &X) const
 
virtual doublereal dGetAirDensity (const Vec3 &X) const
 
virtual doublereal dGetAirPressure (const Vec3 &X) const
 
virtual doublereal dGetAirTemperature (const Vec3 &X) const
 
virtual doublereal dGetSoundSpeed (const Vec3 &X) const
 
virtual bool GetAirProps (const Vec3 &X, doublereal &rho, doublereal &c, doublereal &p, doublereal &T) const
 
- Public Member Functions inherited from ElemGravityOwner
 ElemGravityOwner (unsigned int uL, flag fOut)
 
virtual ~ElemGravityOwner (void)
 
virtual doublereal dGetM (void) const
 
Vec3 GetS (void) const
 
Mat3x3 GetJ (void) const
 
Vec3 GetB (void) const
 
Vec3 GetG (void) const
 
- Public Member Functions inherited from GravityOwner
 GravityOwner (void)
 
virtual ~GravityOwner (void)
 
void PutGravity (const Gravity *pG)
 
virtual bool bGetGravity (const Vec3 &X, Vec3 &Acc) const
 

Private Member Functions

doublereal sec (doublereal x) const
 
int sign (const doublereal x)
 

Private Attributes

doublereal dXx
 
doublereal dXy
 
doublereal dVx
 
doublereal dVy
 
doublereal dVPx
 
doublereal dVPy
 
doublereal dXPx
 
doublereal dXPy
 
StructNodepWheel
 
ElempWheelB
 
ElempWheelE
 
StructNodepRing
 
ElempRingB
 
StructNodepPatch
 
Vec3 WheelAxle
 
StructNodepGround
 
bool bSlip
 
bool bLoadedRadius
 
DriveCallerpMuX0
 
DriveCallerpMuY0
 
DriveCallerpTr
 
DriveCallerpMzr
 
doublereal rRatio
 
doublereal Krz
 
DriveCallerpKpa
 
doublereal dKpa
 
Vec3 Kpatv
 
DriveCallerpCpa
 
doublereal dCpa
 
Vec3 Cpatv
 
DriveCallerpRoad
 
doublereal dRoad
 
doublereal dRoadAhead
 
doublereal dRoadBehind
 
doublereal dRoadInitial
 
doublereal dRoadPrev
 
doublereal dRoadPrevPrev
 
doublereal TRH
 
doublereal TRHA
 
doublereal TRHT
 
doublereal TRHTA
 
doublereal TRHC
 
doublereal TdLs
 
doublereal TdReDiv
 
doublereal TdR_e
 
doublereal RDA
 
doublereal RDB
 
doublereal RDL
 
int RDLC
 
Vec3 Xpa
 
Vec3 Xpar
 
Vec3 distM
 
doublereal ddistM
 
doublereal dEffRad
 
Vec3 EffRad
 
doublereal R_e
 
Vec3 XparPrev
 
Vec3 XpaPrev
 
Vec3 XparPrevPrev
 
Vec3 XpaPrevPrev
 
Vec3 Kpa
 
Vec3 Cpa
 
Vec3 XpaBC
 
Vec3 VpaBC
 
Vec3 RpaBC
 
Vec3 WpaBC
 
Vec3 Vpa
 
Vec3 Vpar
 
Vec3 VparWheel
 
Vec3 VpaPrev
 
Vec3 Fint
 
Vec3 Fint_old
 
Vec3 Fint_ring
 
Vec3 Fpatch
 
Vec3 Mint
 
doublereal Mpa
 
doublereal tr
 
doublereal S_ht
 
doublereal S_hf
 
doublereal M_zr
 
doublereal dt
 
bool bSwift
 
doublereal curTime
 
doublereal oldTime
 
bool bFirstAC
 
bool bFirstAP
 
DriveOwner tdc
 
Vec3 zZero
 
Vec3 pcRing
 
Vec3 pcRingPrev
 
Vec3 RingRad
 
Vec3 RingRadPrev
 
Vec3 VpcRingPrev
 
Vec3 VpcRing
 
Vec3 VpcRingPrevPrev
 
Vec3 Xring
 
Vec3 Vwheel
 
Vec3 fwd
 
Vec3 fwdRing
 
Vec3 fwdRingFlat
 
Vec3 lat
 
Vec3 latRing
 
Vec3 latRingFlat
 
Vec3 n
 
Vec3 nPrev
 
Vec3 fwdRingPrev
 
doublereal dRoadVel
 
Vec3 Xparp
 
Vec3 Vparp
 
doublereal Fn
 
doublereal Fcent
 
doublereal dCt
 
Vec3 Fr
 
bool boolFn
 
Vec3 i
 
Vec3 j
 
Vec3 k
 
doublereal dLs
 
doublereal dPls
 
doublereal dR_a1
 
doublereal dR_a2
 
doublereal dLsProj
 
doublereal dXxProj
 
doublereal dXxProjPrev
 
doublereal dLsProjPrev
 
doublereal dt_maxF
 
doublereal dt_minF
 
doublereal dLsProjRatio
 
doublereal dtPrev
 
doublereal dt_maxH
 
doublereal dt_adjFactor
 
doublereal dt_fNow
 
doublereal dt_maxstep
 
doublereal dt_minstep
 
bool dt_On
 
doublereal dt_Res
 
doublereal dtMax
 
int dt_numAhead
 
int dt_minStepsCycle
 
doublereal dt_divF
 
doublereal dt_divF3
 
doublereal dt_divF4
 
std::vector< std::vector< int > > FintSignCk
 
Vec3 FintPrev
 
Vec3 FintPrevPrev
 
Vec3 XparpPrev
 
Vec3 XparpPrevPrev
 
doublereal dn
 
doublereal dvx
 
doublereal dvax
 
doublereal dvay
 
Vec3 va
 
doublereal dXxPrev
 
doublereal E
 
doublereal KE
 
doublereal PE
 
doublereal derivSign
 
bool latBool
 
bool fwdBool
 
Vec3 F
 
Vec3 M
 
Vec3 Mz
 
doublereal dR_0
 
doublereal deltaPrev
 
doublereal dSr
 
doublereal dSa
 
doublereal dAlpha
 
doublereal dAlpha_t
 
doublereal dAlpha_r
 
doublereal dMuX
 
doublereal dMuY
 
doublereal q_sy1
 
doublereal q_sy3
 
doublereal dvao
 
bool firstRes
 
doublereal dDebug
 

Additional Inherited Members

- Public Types inherited from Elem
enum  Type {
  UNKNOWN = -1, AIRPROPERTIES = 0, INDUCEDVELOCITY, AUTOMATICSTRUCTURAL,
  GRAVITY, BODY, JOINT, JOINT_REGULARIZATION,
  BEAM, PLATE, FORCE, INERTIA,
  ELECTRICBULK, ELECTRIC, THERMAL, HYDRAULIC,
  BULK, LOADABLE, DRIVEN, EXTERNAL,
  AEROMODAL, AERODYNAMIC, GENEL, SOCKETSTREAM_OUTPUT,
  RTAI_OUTPUT = SOCKETSTREAM_OUTPUT, LASTELEMTYPE
}
 
- Public Types inherited from SimulationEntity
typedef std::vector< Hint * > Hints
 
- Public Types inherited from ToBeOutput
enum  { OUTPUT = 0x1U, OUTPUT_MASK = 0xFU, OUTPUT_PRIVATE = 0x10U, OUTPUT_PRIVATE_MASK = ~OUTPUT_MASK }
 
- Public Types inherited from AerodynamicElem
enum  Type {
  UNKNOWN = -1, INDUCEDVELOCITY = 0, AEROMODAL, AERODYNAMICBODY,
  AERODYNAMICBEAM, AERODYNAMICEXTERNAL, AERODYNAMICEXTERNALMODAL, AERODYNAMICLOADABLE,
  AIRCRAFTINSTRUMENTS, GENERICFORCE, LASTAEROTYPE
}
 
- Protected Member Functions inherited from ElemGravityOwner
virtual Vec3 GetS_int (void) const
 
virtual Mat3x3 GetJ_int (void) const
 
virtual Vec3 GetB_int (void) const
 
virtual Vec3 GetG_int (void) const
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 
- Protected Attributes inherited from UserDefinedElem
bool needsAirProperties
 
- Protected Attributes inherited from AirPropOwner
const AirPropertiespAirProperties
 
- Protected Attributes inherited from GravityOwner
GravitypGravity
 

Detailed Description

Definition at line 46 of file module-wheel4.h.

Constructor & Destructor Documentation

Wheel4::Wheel4 ( unsigned  uLabel,
const DofOwner pDO,
DataManager pDM,
MBDynParser HP 
)

Definition at line 51 of file module-wheel4.cc.

References bFirstAC, bFirstAP, bLoadedRadius, Elem::BODY, bSlip, bSwift, Cpa, curTime, deltaPrev, Vec3::Dot(), dPls, dR_0, dR_a1, dR_a2, dRoad, dRoadInitial, dt, dt_divF, dt_divF3, dt_divF4, dt_maxF, dt_maxH, dt_maxstep, dt_minF, dt_minstep, dt_minStepsCycle, dt_On, dt_Res, dvao, dXxPrev, FintPrev, FintPrevPrev, FintSignCk, DataManager::fReadOutput(), MBDynParser::GetDriveCaller(), HighParser::GetInt(), WithLabel::GetLabel(), DataManager::GetLogFile(), HighParser::GetReal(), MBDynParser::GetVec3(), MBDynParser::GetVecRel(), StructDispNode::GetXCurr(), i, HighParser::IsArg(), HighParser::IsKeyWord(), j, k, Kpa, Krz, Elem::LOADABLE, MBDYN_EXCEPT_ARGS, Mpa, nPrev, pCpa, DataManager::pGetDrvHdl(), pKpa, pMuX0, pMuY0, pMzr, pRing, pRingB, pRoad, pTr, pWheel, pWheelB, q_sy1, q_sy3, RDA, RDB, RDL, DataManager::ReadElem(), DataManager::ReadNode(), rRatio, S_hf, S_ht, DriveOwner::Set(), ToBeOutput::SetOutputFlag(), grad::sqrt(), Node::STRUCTURAL, tdc, TdLs, TdR_e, TdReDiv, TRH, TRHA, TRHC, TRHT, TRHTA, Vpa, VpaBC, VpaPrev, WheelAxle, Xpa, XpaBC, XpaPrev, XparpPrev, XparpPrevPrev, XparPrev, XparPrevPrev, and zZero.

53 : Elem(uLabel, flag(0)),
55 firstRes(true)
56 {
57  // help
58  if (HP.IsKeyWord("help")) {
59  silent_cout(
60 " \n"
61 "Module: wheel4 \n"
62 "Author: Louis Gagnon <louis.gagnon.10@ulaval.ca> \n"
63 "Organization: Departement de genie mecanique \n"
64 " Universite Laval \n"
65 " http://www.gmc.ulaval.ca \n"
66 " Pierangelo Masarati <masarati@aero.polimi.it> \n"
67 " Marco Morandini <morandini@aero.polimi.it> \n"
68 "Organization: Dipartimento di Ingegneria Aerospaziale \n"
69 " Politecnico di Milano \n"
70 " http://www.aero.polimi.it \n"
71 " \n"
72 "L. Gagnon, M. J. Richard, P. Masarati, M. Morandini, and G. Dore. Multibody simulation of tires operating on an uneven road. In Multibody Dynamics 2011, 4-7 July 2011"
73  " And soon coming : L. Gagnon, M. J. Richard, P. Masarati, M. Morandini, and G. Dore. A Free Implicit Rigid Ring Tire Model"
74 " All rights reserved \n"
75 " Wheel4 requires the ginac libraries to be installed \n"
76 " \n"
77 "Nodes: \n"
78 " - Wheel \n"
79 " - Ring \n"
80 " \n"
81 " - Patch \n"
82 " \n"
83 "Note: \n"
84 " - The Ring and the Wheel structural nodes must be connected \n"
85 " by a 6 DoF viscoelastic element \n"
86 " \n"
87  << std::endl);
88 
89  if (!HP.IsArg()) {
90  /*
91  * Exit quietly if nothing else is provided
92  */
93  throw NoErr(MBDYN_EXCEPT_ARGS);
94  }
95  }
96 
97  i = Vec3(1.,0.,0.); // unit vector in x-dir
98  j = Vec3(0.,1.,0.); // unit vector in y-dir
99  k = Vec3(0.,0.,1.); // unit vector in z-dir
100 
101  // read wheel node
102  pWheel = pDM->ReadNode<StructNode, StructDispNode, Node::STRUCTURAL>(HP); // input 1, wheel node (or ring node if using swift)
103  pWheelB = pDM->ReadElem<Body, Elem::BODY>(HP); // input, wheel body
104 
105  // read wheel axle
106  ReferenceFrame RF = ReferenceFrame(pWheel); //makes reference frame from wheel node
107  WheelAxle = HP.GetVecRel(RF); //converts value to RF reference frame // input
108  doublereal dWheelAxle = WheelAxle.Dot();
109  if (dWheelAxle < std::numeric_limits<doublereal>::epsilon()) {
110  silent_cerr("Wheel4(" << GetLabel() << "): "
111  "wheel axle is too small "
112  "for numeric limits" << std::endl);
114  }
115  WheelAxle /= sqrt(dWheelAxle);
116 
117  // wheel geometry
118  dR_0 = HP.GetReal(); // Rigid ring radius, (in MF calculations, a home-made effective radius is used)
119  zZero = Vec3(1.,1.,0.); // this permits the multiplication of the contact patch displacement vectors by zero in the z direction, to allow for ground controlled position
120 
121  // SWIFT
122  bSwift = false;
123  if (HP.IsKeyWord("swift")) {
124  bSwift = true;
125  pRing = pDM->ReadNode<StructNode, StructDispNode, Node::STRUCTURAL>(HP); // get ring node if swift
126  pRingB = pDM->ReadElem<Body, Elem::BODY>(HP); // get ring body
127 
128  Xpa = pRing->GetXCurr() - k*0.98*dR_0;
129  XpaPrev=Xpa;
130 
131  XparPrev=XparPrevPrev=XparpPrev=XparpPrevPrev=FintPrev=FintPrevPrev=Vec3(0.,0.,0.); // simply for proper initialization
132 
133 
134  dRoad = dRoadInitial = Xpa(3); //getting z component of initial elevation
135 // dRoadPrev = XpaPrev(3); // not necessary
136  Kpa = HP.GetVec3();
137  pKpa = HP.GetDriveCaller(); //time variant driver for Kpa
138  Cpa = HP.GetVec3();
139  pCpa = HP.GetDriveCaller(); //time variant driver for Cpa
140  Vpa = HP.GetVec3(); //velocity of patch in wheel ref frame
141  VpaPrev = Vpa;
142  VpaBC=Vpa;//
143  XpaBC=Xpa; //
144  Mpa = HP.GetReal(); // mass of patch
145  dt = 0;
146  curTime = 0;
147  tdc.Set(new TimeDriveCaller(pDM->pGetDrvHdl()));
148  pRoad = HP.GetDriveCaller(); //road profile driver, makes a function "f(x)"
149  dPls = HP.GetReal(); // patch contact-length to elleptical cam tandem base parameter (Zegelaar eq. 4.15) dPls = l_s/(2a)
150  dR_a1 = HP.GetReal(); // r_a1 contact length parameter from Besselink eq. 4.85
151  dR_a2 = HP.GetReal(); // r_a2 contact length parameter from Besselink eq. 4.85
152  rRatio = HP.GetReal(); // ratio btwn portion of ring in contact with patch and the total ring
153  Krz = HP.GetReal(); // vertical wheel-ring stiffness
154  nPrev = k;
155  dXxPrev = 0;
156  deltaPrev = 0;
157  bFirstAP=true;
158  bFirstAC=false;
159  }
160 
161  bLoadedRadius = false;
162  if (HP.IsKeyWord("loadedRadius"))
163  {
164  bLoadedRadius = true;
165  }
166  // friction
167  bSlip = false;
168  if (HP.IsKeyWord("slip")) {
169  bSlip = true;
170 
171  /*
172  * Parametri di attrito
173  */
174  pMuX0 = HP.GetDriveCaller(); //makes a function "f(x)"
175  pMuY0 = HP.GetDriveCaller();
176  pTr = HP.GetDriveCaller();
177  pMzr = HP.GetDriveCaller();
178  S_ht = HP.GetReal();
179  S_hf = HP.GetReal();
180  q_sy1 = HP.GetReal(); // should be between 0.01 and 0.02 usually...
181  q_sy3 = HP.GetReal(); //
182  dvao = HP.GetReal(); // velocity for rolling resistance velocity influence factor (reference velocity)
183 
184  TRH = 0.; //prevents division by zero at null x-velocity at the price of losing validity for velocities above -TRH*1.1 and below TRH*1.1
185  TRHA = 0.; //buffer used to prevent division by zero
186  TRHT = 0.; //prevents divison by zero for computation of the angle of the car (and wheels)
187  TRHTA = 0.; //buffer used on angle zero division prevention
188  TRHC = 0.; //cap on kappa
189 
190  if (HP.IsKeyWord("threshold")) {
191  TRH = HP.GetReal();
192  TRHA = HP.GetReal();
193  TRHT = HP.GetReal();
194  TRHTA = HP.GetReal();
195  TRHC = HP.GetReal();
196  TdLs = HP.GetReal();
197  TdReDiv = HP.GetReal();
198  TdR_e = HP.GetReal();
199  dt_On = HP.GetReal();
200  dt_maxH = HP.GetReal();
201 // dt_numAhead = HP.GetInt();
202  dt_Res = HP.GetReal();
203  dt_maxstep = HP.GetReal();
204  dt_minstep = HP.GetReal();
205  dt_maxF = HP.GetReal(); // maximum divison of dt per timestep
206  dt_minF = HP.GetReal(); // minimum division of dt per timestep
207  dt_minStepsCycle = HP.GetInt(); // minimum number of steps wanted in a force cycle (approx., influences dt)
208  dt_divF = HP.GetReal(); // factor by which to divide the timestep if the force oscillates more than wanted (as determined by TminS)
209  dt_divF3 = HP.GetReal(); // 3 sign chg
210  dt_divF4 = HP.GetReal(); // 4 sign chg or more
211  RDA = HP.GetReal();
212  RDB = HP.GetReal();
213  RDL = HP.GetReal();
214 }
215 // if (HP.IsKeyWord("master")) {
216 // int numWheels = HP.GetInt();
217 // for(int iCnt = 1; iCnt <= numWheels; iCnt++) {
218 // // pWheelE = (Elem *)pDM->ReadElem(HP, Elem::LOADABLE); // input, wheel elem
219 //
220 // std::cout << "Wheel: " << HP.GetInt() << std::endl;
221 // }
222 // }
223 
224  }
225 
226  std::vector<int> row;
227  for (int jCnt = 0; jCnt < 3; jCnt++) {
228  row.push_back(0);
229  }
230  for(int iCnt = 0; iCnt < dt_minStepsCycle; iCnt++) {
231  FintSignCk.push_back(row);
232  }
233 
234 
236 
237  std::ostream& out = pDM->GetLogFile();
238  out << "wheel4: " << uLabel
239  << " " << pWheel->GetLabel() //node label
240  << " " << WheelAxle //wheel axle
241 // << " " << dRadius //wheel radius
242 // << " " << dInternalRadius //wheel internal radius
243  << std::endl;
244 }
doublereal dt_minF
flag fReadOutput(MBDynParser &HP, const T &t) const
Definition: dataman.h:1064
doublereal TRHA
doublereal dt_maxstep
bool bLoadedRadius
Definition: module-wheel4.h:79
doublereal dt
doublereal dt_Res
Vec3 XparpPrev
Vec3 VpaBC
long int flag
Definition: mbdyn.h:43
doublereal TRH
doublereal TdR_e
doublereal q_sy1
Vec3 zZero
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: body.h:270
Definition: matvec3.h:98
Vec3 XparPrevPrev
doublereal TdLs
virtual integer GetInt(integer iDefval=0)
Definition: parser.cc:1050
Vec3 nPrev
doublereal deltaPrev
Elem * ReadElem(MBDynParser &HP, Elem::Type type) const
Definition: dataman3.cc:2334
DriveOwner tdc
doublereal Dot(const Vec3 &v) const
Definition: matvec3.h:243
bool bSlip
Definition: module-wheel4.h:78
doublereal q_sy3
Elem * pWheelB
Definition: module-wheel4.h:58
DriveCaller * pRoad
Definition: module-wheel4.h:99
bool bFirstAP
Vec3 XparPrev
doublereal dt_maxH
doublereal RDL
Vec3 FintPrevPrev
DriveCaller * pMzr
Definition: module-wheel4.h:83
const DriveHandler * pGetDrvHdl(void) const
Definition: dataman.h:340
doublereal dt_divF4
DriveCaller * pMuY0
Definition: module-wheel4.h:81
doublereal dt_divF
doublereal dR_a1
Vec3 XparpPrevPrev
doublereal Krz
Definition: module-wheel4.h:88
Vec3 VpaPrev
doublereal curTime
Vec3 Kpa
Vec3 XpaBC
doublereal dRoad
Vec3 Vpa
bool bFirstAC
doublereal dt_divF3
doublereal TdReDiv
bool firstRes
Vec3 Cpa
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
doublereal TRHC
doublereal S_hf
std::vector< std::vector< int > > FintSignCk
unsigned int uLabel
Definition: withlab.h:44
doublereal TRHTA
bool bSwift
doublereal dvao
doublereal dRoadInitial
DriveCaller * pMuX0
Definition: module-wheel4.h:80
doublereal dXxPrev
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
doublereal rRatio
Definition: module-wheel4.h:87
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
bool dt_On
Definition: except.h:79
Vec3 WheelAxle
Definition: module-wheel4.h:70
Vec3 GetVecRel(const ReferenceFrame &rf)
Definition: mbpar.cc:1584
doublereal dPls
doublereal RDB
virtual bool IsArg(void)
Definition: parser.cc:807
doublereal dR_0
std::ostream & GetLogFile(void) const
Definition: dataman.h:326
StructNode * pRing
Definition: module-wheel4.h:62
void Set(const DriveCaller *pDC)
Definition: drive.cc:647
Elem * pRingB
Definition: module-wheel4.h:63
UserDefinedElem(unsigned uLabel, const DofOwner *pDO)
Definition: userelem.cc:152
doublereal dt_maxF
DriveCaller * pKpa
Definition: module-wheel4.h:91
DriveCaller * GetDriveCaller(bool bDeferred=false)
Definition: mbpar.cc:2033
doublereal Mpa
virtual void SetOutputFlag(flag f=flag(1))
Definition: output.cc:896
Vec3 Xpa
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
double doublereal
Definition: colamd.c:52
int dt_minStepsCycle
unsigned int GetLabel(void) const
Definition: withlab.cc:62
Node * ReadNode(MBDynParser &HP, Node::Type type) const
Definition: dataman3.cc:2309
Vec3 FintPrev
virtual Vec3 GetVec3(void)
Definition: mbpar.cc:2220
doublereal dt_minstep
DriveCaller * pTr
Definition: module-wheel4.h:82
Vec3 XpaPrev
doublereal RDA
doublereal dR_a2
StructNode * pWheel
Definition: module-wheel4.h:57
doublereal S_ht
DriveCaller * pCpa
Definition: module-wheel4.h:94
virtual doublereal GetReal(const doublereal &dDefval=0.0)
Definition: parser.cc:1056
doublereal TRHT

Here is the call graph for this function:

Wheel4::~Wheel4 ( void  )
virtual

Definition at line 246 of file module-wheel4.cc.

References NO_OP.

247 {
248  NO_OP;
249 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

void Wheel4::AfterConvergence ( const VectorHandler X,
const VectorHandler XP 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 1697 of file module-wheel4.cc.

References bFirstAC, CalculateR_e(), dAlpha, dEffRad, SimulationEntity::dGetPrivData(), distM, Vec3::Dot(), dSa, E, EffRad, StructDispNode::GetXCurr(), KE, M_PI, Mpa, PE, grad::pow(), pRingB, pWheel, pWheelB, grad::sqrt(), Vpa, and Xring.

1700 {
1701  bFirstAC = true;
1702 
1703  // calculations done before output,
1704 
1705  // loaded radius (between wheel center and contact center),
1706  EffRad = Xring-pWheel->GetXCurr()+distM; // vector dist btwn wheel center and patch
1707  dEffRad = sqrt(EffRad.Dot()); // loaded radius as defined in Pac2006 p. 464 TODO: adjust Jacobian accordingly
1708  // Vec3 nEffRad = -EffRad/dEffRad;
1709  // ,loaded radius (between wheel center and contact center)
1710 
1711  KE = pWheelB->dGetPrivData(1) + pRingB->dGetPrivData(1) + (pow(Vpa(1),2)+pow(Vpa(2),2))*Mpa/2;
1713  E = KE + PE;
1714  CalculateR_e();
1715 
1716  dSa = 180./M_PI*dAlpha;
1717 
1718  // ,calculations done before output
1719 }
doublereal dEffRad
#define M_PI
Definition: gradienttest.cc:67
GradientExpression< BinaryExpr< FuncPow, LhsExpr, RhsExpr > > pow(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
Definition: gradient.h:2961
doublereal Dot(const Vec3 &v) const
Definition: matvec3.h:243
doublereal dSa
Elem * pWheelB
Definition: module-wheel4.h:58
Vec3 EffRad
doublereal KE
Vec3 Vpa
bool bFirstAC
Vec3 Xring
Vec3 distM
void CalculateR_e()
doublereal E
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual doublereal dGetPrivData(unsigned int i) const
Definition: simentity.cc:149
doublereal PE
Elem * pRingB
Definition: module-wheel4.h:63
doublereal dAlpha
doublereal Mpa
StructNode * pWheel
Definition: module-wheel4.h:57

Here is the call graph for this function:

void Wheel4::AfterPredict ( VectorHandler X,
VectorHandler XP 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 1755 of file module-wheel4.cc.

References bFirstAP.

1756 {
1757  bFirstAP = true;
1758 }
bool bFirstAP
VariableSubMatrixHandler & Wheel4::AssJac ( VariableSubMatrixHandler WorkMat,
doublereal  dCoef,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Implements Elem.

Definition at line 692 of file module-wheel4.cc.

References boolFn, copysign(), Cpatv, Vec3::Cross(), grad::Cross(), dAlpha, dAlpha_r, dAlpha_t, derivSign, DriveCaller::dGet(), FullSubMatrixHandler::dGetCoef(), DriveCaller::dGetP(), distM, dMuX, dMuY, Vec3::Dot(), grad::Dot(), dR_0, dSr, dvax, Fint_old, Fint_ring, Fn, fwd, fwdBool, fwdRing, fwdRingFlat, StructNode::GetRCurr(), StructNode::GetWCurr(), StructNode::GetWRef(), i, DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), StructDispNode::iGetFirstPositionIndex(), FullSubMatrixHandler::iGetNumCols(), j, k, Kpatv, lat, latBool, latRing, latRingFlat, Mpa, n, pMuX0, pMuY0, pMzr, grad::pow(), pRing, pTr, FullSubMatrixHandler::PutCoef(), FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), pWheel, FullSubMatrixHandler::ResizeReset(), sec(), VariableSubMatrixHandler::SetFull(), grad::sqrt(), tr, TRH, va, Vpar, WheelAxle, and Xpar.

696 {
697  FullSubMatrixHandler& WM = WorkMat.SetFull();
698  WM.ResizeReset(10, 16);
699 
700  // attributing rows and columns of the Jacobian matrix,
701 
702  integer iFirstIndex = iGetFirstIndex();
703  integer iRingFirstPosIndex = pRing->iGetFirstPositionIndex();
704  integer iWheelFirstPosIndex = pWheel->iGetFirstPositionIndex();
705  integer iRingFirstMomIndex = pRing->iGetFirstMomentumIndex();
706  // integer iWheelFirstMomIndex = pWheel->iGetFirstMomentumIndex();
707 
708  // patch x dir,
709  WM.PutRowIndex(1, iFirstIndex + 1);
710  WM.PutColIndex(1, iFirstIndex + 1);
711  WM.PutRowIndex(2, iFirstIndex + 2);
712  WM.PutColIndex(2, iFirstIndex + 2);
713  // patch y dir,
714  WM.PutRowIndex(3, iFirstIndex + 3);
715  WM.PutColIndex(3, iFirstIndex + 3);
716  WM.PutRowIndex(4, iFirstIndex + 4);
717  WM.PutColIndex(4, iFirstIndex + 4);
718 
719  WM.PutRowIndex(5, iRingFirstMomIndex+1); // ring x
720  WM.PutRowIndex(6, iRingFirstMomIndex+2); // ring y
721  WM.PutRowIndex(7, iRingFirstMomIndex+3); // ring z
722  WM.PutRowIndex(8, iRingFirstMomIndex+4); // ring Mom x
723  WM.PutRowIndex(9, iRingFirstMomIndex+5); // ring Mom y
724  WM.PutRowIndex(10, iRingFirstMomIndex+6); // ring Mom z
725 
726  WM.PutColIndex(5, iRingFirstPosIndex+1); // ring x
727  WM.PutColIndex(6, iRingFirstPosIndex+2); // ring y
728  WM.PutColIndex(7, iRingFirstPosIndex+3); // ring z
729  WM.PutColIndex(8, iRingFirstPosIndex+4); // ring ang x
730  WM.PutColIndex(9, iRingFirstPosIndex+5); // ring ang y
731  WM.PutColIndex(10, iRingFirstPosIndex+6); // ring ang z
732  WM.PutColIndex(11, iWheelFirstPosIndex+1); // wheel x
733  WM.PutColIndex(12, iWheelFirstPosIndex+2); // wheel y
734  WM.PutColIndex(13, iWheelFirstPosIndex+3); // wheel z
735  WM.PutColIndex(14, iWheelFirstPosIndex+4); // wheel ang x
736  WM.PutColIndex(15, iWheelFirstPosIndex+5); // wheel ang y
737  WM.PutColIndex(16, iWheelFirstPosIndex+6); // wheel ang z
738 
739  // ,attributing rows and columns of the Jacobian matrix
740 
741 
742  // contributions of Fint from patch pos to patch Jacobian,
743 
744 
745  Vec3 dFnewdFintx = i*(fwdRingFlat(1)) + j*(fwdRingFlat(2));
746  Vec3 dFnewdFinty = i*(latRingFlat(1)) + j*(latRingFlat(2));
747  Vec3 dFnewdFintz = k;
748 
749  doublereal dFintxdVx = fwdRingFlat.Dot(i)*Cpatv(1);
750  doublereal dFintxdXx = fwdRingFlat.Dot(i)*Kpatv(1);
751  doublereal dFintxdVy = fwdRingFlat.Dot(j)*Cpatv(1);
752  doublereal dFintxdXy = fwdRingFlat.Dot(j)*Kpatv(1);
753  doublereal dFintxdVz = 0;
754  doublereal dFintxdXz = 0;
755  doublereal dFintydVy = latRingFlat.Dot(j)*Cpatv(2);
756  doublereal dFintydXy = latRingFlat.Dot(j)*Kpatv(2);
757  doublereal dFintydVx = latRingFlat.Dot(i)*Cpatv(2);
758  doublereal dFintydXx = latRingFlat.Dot(i)*Kpatv(2);
759  doublereal dFintydVz = 0;
760  doublereal dFintydXz = 0;
761  doublereal dFintzdVy = 0; // note that this one and the following 5 derivatives are defined to clarify the code since in reality the patch has no DoF in the z dir.
762  doublereal dFintzdXy = 0;
763  doublereal dFintzdVx = 0;
764  doublereal dFintzdXx = 0;
765  doublereal dFintzdVz = Cpatv(3);
766  doublereal dFintzdXz = Kpatv(3);
767 
768  Vec3 dFnewdVx = dFnewdFintx*dFintxdVx+dFnewdFinty*dFintydVx+dFnewdFintz*dFintzdVx;
769  Vec3 dFnewdXx = dFnewdFintx*dFintxdXx+dFnewdFinty*dFintydXx+dFnewdFintz*dFintzdXx;
770  Vec3 dFnewdVy = dFnewdFintx*dFintxdVy+dFnewdFinty*dFintydVy+dFnewdFintz*dFintzdVy;
771  Vec3 dFnewdXy = dFnewdFintx*dFintxdXy+dFnewdFinty*dFintydXy+dFnewdFintz*dFintzdXy;
772  Vec3 dFnewdVz = dFnewdFintx*dFintxdVz+dFnewdFinty*dFintydVz+dFnewdFintz*dFintzdVz;
773  Vec3 dFnewdXz = dFnewdFintx*dFintxdXz+dFnewdFinty*dFintydXz+dFnewdFintz*dFintzdXz;
774 
775  // TODO add threshold conditions if want close to zero velocities to work
776  Vec3 dFdVx = -fwd*pMuX0->dGetP(dSr)*Fn/abs(dvax)*fwd.Dot(fwdRing); // TODO: CHECK THESE these four are negative of what they physically are... for consistency with previous derivs based on Fint seen from unrotated ring
777  Vec3 dFdVy = -fwd*pMuX0->dGetP(dSr)*Fn/abs(dvax)*fwd.Dot(latRing);
780 
781  // x dir,
782  WM.PutCoef(1, 1, Mpa - dCoef*(-dFnewdVx(1)+dFdVx(1))); // -(dr_1/dVxprime+dCoef*dr_1/dVx) acting in x-dir, complete
783  WM.PutCoef(1, 2, -dCoef*(-dFnewdXx(1)+dFdXx(1))); // -(dr_1/dXxprime+dCoef*dr_1/dXx) acting in x-dir, complete
784  WM.PutCoef(2, 1, -dCoef); // -(dr_2/dVxprime+dCoef*dr_2/dVx) acting in x-dir, complete
785  WM.PutCoef(2, 2, 1.); // -(dr_2/dXxprime+dCoef*dr_2/dXx) acting in x-dir, complete
786  WM.PutCoef(1, 3, dCoef*(dFnewdVy(1)-dFdVy(1))); // -(-(dr_7/dVyprime+dCoef*dr_7/dVy) acting in y-dir, complete) taken from ring contrib
787  WM.PutCoef(1, 4, dCoef*(dFnewdXy(1)-dFdXy(1))); // -(-(dr_7/dXyprime+dCoef*dr_7/dXy) acting in y-dir, complete) taken from ring contrib
788  // y dir,
789  WM.PutCoef(3, 3, Mpa - dCoef*(-dFnewdVy(2)+dFdVy(2))); // -(dr_3/dVyprime+dCoef*dr_3/dVy) acting in y-dir, complete
790  WM.PutCoef(3, 4, dCoef*(dFnewdXy(2)-dFdXy(2))); // -(dr_3/dXyprime+dCoef*dr_3/dXy) acting in y-dir, complete
791  WM.PutCoef(4, 3, -dCoef); // -(dr_4/dVyprime+dCoef*dr_4/dVy) acting in y-dir, complete
792  WM.PutCoef(4, 4, 1.); // -(dr_4/dXyprime+dCoef*dr_4/dXy) acting in y-dir, complete
793  WM.PutCoef(3, 1, dCoef*(dFnewdVx(2)-dFdVx(2))); // -(-(dr_8/dVxprime+dCoef*dr_8/dVx)) taken from ring contrib
794  WM.PutCoef(3, 2, dCoef*(dFnewdXx(2)-dFdXx(2))); // -(-(dr_8/dXxprime+dCoef*dr_8/dXx)) taken from ring contrib
795 
796  // ,contributions of Fint from patch pos to patch Jacobian
797 
798  // contributions of Fint from patch pos to ring Jacobian,
799  Vec3 dFrintdFnewx = -(n.Cross(WheelAxle));
800  Vec3 dFrintdFnewy = j;
801  Vec3 dFrintdFnewz = n;
802  Vec3 dFrintdVx = dFrintdFnewx*dFnewdVx(1)+dFrintdFnewy*dFnewdVx(2)+dFrintdFnewz*dFnewdVx(3);
803  Vec3 dFrintdVy = dFrintdFnewx*dFnewdVy(1)+dFrintdFnewy*dFnewdVy(2)+dFrintdFnewz*dFnewdVy(3);
804  Vec3 dFrintdVz = dFrintdFnewx*dFnewdVz(1)+dFrintdFnewy*dFnewdVz(2)+dFrintdFnewz*dFnewdVz(3);
805  Vec3 dFrintdXx = dFrintdFnewx*dFnewdXx(1)+dFrintdFnewy*dFnewdXx(2)+dFrintdFnewz*dFnewdXx(3);
806  Vec3 dFrintdXy = dFrintdFnewx*dFnewdXy(1)+dFrintdFnewy*dFnewdXy(2)+dFrintdFnewz*dFnewdXy(3);
807  Vec3 dFrintdXz = dFrintdFnewx*dFnewdXz(1)+dFrintdFnewy*dFnewdXz(2)+dFrintdFnewz*dFnewdXz(3);
808 
809 
810 
811  WM.PutCoef(5, 1, -dCoef*(dFrintdVx(1))); // -(dr_5/dVxprime+dCoef*dr_5/dVx) acting in x-dir, complete
812  WM.PutCoef(5, 2, -dCoef*(dFrintdXx(1))); // -(dr_5/dXxprime+dCoef*dr_5/dXx) acting in x-dir, complete
813  WM.PutCoef(5, 3, -dCoef*(dFrintdVy(1))); // -(dr_5/dVyprime+dCoef*dr_5/dVy) acting in y-dir, complete
814  WM.PutCoef(5, 4, -dCoef*(dFrintdXy(1))); // -(dr_5/dXyprime+dCoef*dr_5/dXy) acting in y-dir, complete
815  WM.PutCoef(6, 1, -dCoef*(dFrintdVx(2))); // -(dr_6/dVxprime+dCoef*dr_8/dVx)
816  WM.PutCoef(6, 2, -dCoef*(dFrintdXx(2))); // -(dr_6/dXxprime+dCoef*dr_8/dXx)
817  WM.PutCoef(6, 3, -dCoef*(dFrintdVy(2))); // -(dr_6/dVyprime+dCoef*dr_8/dVy)
818  WM.PutCoef(6, 4, -dCoef*(dFrintdXy(2))); // -(dr_6/dXyprime+dCoef*dr_8/dXy)
819  WM.PutCoef(7, 1, -dCoef*(dFrintdVx(3))); // -(dr_7/dVxprime+dCoef*dr_7/dVx) acting in x-dir, complete
820  WM.PutCoef(7, 2, -dCoef*(dFrintdXx(3))); // -(dr_7/dXxprime+dCoef*dr_7/dXx) acting in x-dir, complete
821  WM.PutCoef(7, 3, -dCoef*(dFrintdVy(3))); // -(dr_7/dVyprime+dCoef*dr_7/dVy) acting in y-dir, complete
822  WM.PutCoef(7, 4, -dCoef*(dFrintdXy(3))); // -(dr_7/dXyprime+dCoef*dr_7/dXy) acting in y-dir, complete
823 
824 
825 
826 
827  // ,contributions of Fint from patch pos to the ring Jacobian
828 
829 
830 
831 
832 
833  // contributions of the ring position & rot mat to the jacobian of the patch,
834 
835  WM.PutCoef(1, 5, -(dFnewdVx(1)+dCoef*dFnewdXx(1))); // -(dr_1/dXx,ring,prime+dCoef*dr_1/dXx,ring) acting in x-dir, complete
836  WM.PutCoef(1, 6, -(dFnewdVy(1)+dCoef*dFnewdXy(1))); // -(dr_1/dXy,ring,prime+dCoef*dr_1/dXy,ring) acting in x-dir, complete
837  WM.PutCoef(3, 6, -(dFnewdVy(2)+dCoef*dFnewdXy(2))); // -(dr_3/dXy,ring,prime+dCoef*dr_3/dXy,ring) acting in y-dir, complete
838  WM.PutCoef(3, 5, -(dFnewdVx(2)+dCoef*dFnewdXx(2))); // -(dr_3/dXx,ring,prime+dCoef*dr_3/dXx,ring) acting in y-dir, complete
839 
840  doublereal dFintz_dZ = -Kpatv(3);
841  doublereal dFintz_dZp = -Cpatv(3);
842  doublereal dFxpatch_dZ = -(fwd*dMuX*dFintz_dZ).Dot(i)-(lat*dMuY*dFintz_dZ).Dot(i);
843  doublereal dFxpatch_dZp = -(fwd*dMuX*dFintz_dZp).Dot(i)-(lat*dMuY*dFintz_dZp).Dot(i);
844  doublereal dFypatch_dZ = -(fwd*dMuX*dFintz_dZ).Dot(j)-(lat*dMuY*dFintz_dZ).Dot(j);
845  doublereal dFypatch_dZp = -(fwd*dMuX*dFintz_dZp).Dot(j)-(lat*dMuY*dFintz_dZp).Dot(j);
846  WM.PutCoef(1, 7, -dFxpatch_dZp - dCoef * dFxpatch_dZ); // influence on the MF forces caused by the variation of the normal force
847  WM.PutCoef(3, 7, -dFypatch_dZp - dCoef * dFypatch_dZ); // influence on the MF forces caused by the variation of the normal force
848 
849 
850 // TODO move some of these vectors out of the loop to accelerate the calculation!!
851  Vec3 RvrCrossn = (pRing->GetRCurr()*WheelAxle).Cross(n);
852  Vec3 dfwdR_dRvx = (i.Cross(n))/sqrt(RvrCrossn.Dot())-RvrCrossn*pow(RvrCrossn.Dot(),-3/2)*((i.Cross(n)).Dot(RvrCrossn)); // d(fwd)/d(Rv)x
853  Vec3 dfwdR_dRvy = (j.Cross(n))/sqrt(RvrCrossn.Dot())-RvrCrossn*pow(RvrCrossn.Dot(),-3/2)*((j.Cross(n)).Dot(RvrCrossn)); // d(fwd)/d(Rv)y
854  Vec3 dfwdR_dRvz = (k.Cross(n))/sqrt(RvrCrossn.Dot())-RvrCrossn*pow(RvrCrossn.Dot(),-3/2)*((k.Cross(n)).Dot(RvrCrossn)); // d(fwd)/d(Rv)z
855  Vec3 RvrCrossk = (pRing->GetRCurr()*WheelAxle).Cross(k);
856  Vec3 dfwdRFlat_dRvx = (i.Cross(k))/sqrt(RvrCrossk.Dot())-RvrCrossk*pow(RvrCrossk.Dot(),-3/2)*((i.Cross(k)).Dot(RvrCrossk)); // d(fwd)/d(Rv)x
857  Vec3 dfwdRFlat_dRvy = (j.Cross(k))/sqrt(RvrCrossk.Dot())-RvrCrossk*pow(RvrCrossk.Dot(),-3/2)*((j.Cross(k)).Dot(RvrCrossk)); // d(fwd)/d(Rv)y
858  Vec3 dfwdRFlat_dRvz = (k.Cross(k))/sqrt(RvrCrossk.Dot())-RvrCrossk*pow(RvrCrossk.Dot(),-3/2)*((k.Cross(k)).Dot(RvrCrossk)); // d(fwd)/d(Rv)z
859  Vec3 dR1_dRvr = Vec3((dfwdRFlat_dRvx.Dot(Xpar)+fwdRingFlat.Dot(-((n.Cross(dfwdR_dRvx)).Cross(fwdRing)+(n.Cross(fwdRing)).Cross(dfwdR_dRvx))*dR_0))*Kpatv(1)+dfwdRFlat_dRvx.Dot(Vpar)*Cpatv(1),(dfwdRFlat_dRvy.Dot(Xpar)+fwdRingFlat.Dot(-((n.Cross(dfwdR_dRvy)).Cross(fwdRing)+(n.Cross(fwdRing)).Cross(dfwdR_dRvy))*dR_0))*Kpatv(1)+dfwdRFlat_dRvy.Dot(Vpar)*Cpatv(1),(dfwdRFlat_dRvz.Dot(Xpar)+fwdRingFlat.Dot(-((n.Cross(dfwdR_dRvz)).Cross(fwdRing)+(n.Cross(fwdRing)).Cross(dfwdR_dRvz))*dR_0))*Kpatv(1)+dfwdRFlat_dRvz.Dot(Vpar)*Cpatv(1));
860  Vec3 dR3_dRvr = Vec3(((k.Cross(dfwdRFlat_dRvx)).Dot(Xpar)+(latRingFlat).Dot(-((n.Cross(dfwdR_dRvx)).Cross(fwdRing)+(n.Cross(fwdRing)).Cross(dfwdR_dRvx))*dR_0))*Kpatv(2)+(k.Cross(dfwdRFlat_dRvx)).Dot(Vpar)*Cpatv(2),((k.Cross(dfwdRFlat_dRvy)).Dot(Xpar)+latRingFlat.Dot(-((n.Cross(dfwdR_dRvy)).Cross(fwdRing)+(n.Cross(fwdRing)).Cross(dfwdR_dRvy))*dR_0))*Kpatv(2)+(k.Cross(dfwdRFlat_dRvy)).Dot(Vpar)*Cpatv(2),((k.Cross(dfwdRFlat_dRvz)).Dot(Xpar)+latRingFlat.Dot(-((n.Cross(dfwdR_dRvz)).Cross(fwdRing)+(n.Cross(fwdRing)).Cross(dfwdR_dRvz))*dR_0))*Kpatv(2)+(k.Cross(dfwdRFlat_dRvz)).Dot(Vpar)*Cpatv(2));
861  // NOTE: latRingFlat = k X fwdRingFlat = i(-fwdRingFlat(2)) + j(fwdRingFlat(1)), negative sign is there for clarity even though it is then canceled in the Gr equations
862  Vec3 dR1new_dRvr = -Vec3(dfwdRFlat_dRvx(1)*Fint_old(1)+fwdRingFlat(1)*dR1_dRvr(1)-dfwdRFlat_dRvx(2)*Fint_old(2)+latRingFlat(1)*dR3_dRvr(1),dfwdRFlat_dRvy(1)*Fint_old(1)+fwdRingFlat(1)*dR1_dRvr(2)-dfwdRFlat_dRvy(2)*Fint_old(2)+latRingFlat(1)*dR3_dRvr(2),dfwdRFlat_dRvz(1)*Fint_old(1)+fwdRingFlat(1)*dR1_dRvr(3)-dfwdRFlat_dRvz(2)*Fint_old(2)+latRingFlat(1)*dR3_dRvr(3));
863  Vec3 dR3new_dRvr = -Vec3(dfwdRFlat_dRvx(2)*Fint_old(1)+fwdRingFlat(2)*dR1_dRvr(1)+dfwdRFlat_dRvx(1)*Fint_old(2)+latRingFlat(2)*dR3_dRvr(1),dfwdRFlat_dRvy(2)*Fint_old(1)+fwdRingFlat(2)*dR1_dRvr(2)+dfwdRFlat_dRvy(1)*Fint_old(2)+latRingFlat(2)*dR3_dRvr(2),dfwdRFlat_dRvz(2)*Fint_old(1)+fwdRingFlat(2)*dR1_dRvr(3)+dfwdRFlat_dRvz(1)*Fint_old(2)+latRingFlat(2)*dR3_dRvr(3));
864  Vec3 Rvr = (pRing->GetRCurr()*WheelAxle);
865  Vec3 Gr1r = -dR1new_dRvr.Cross(Rvr)*dCoef; // dCoef*((-dr/dRv)((Rv)X)
866  Vec3 Gr3r = -dR3new_dRvr.Cross(Rvr)*dCoef; // dCoef*((-dr/dRv)((Rv)X)
867 
868 
869  WM.PutCoef(1, 8, -Gr1r(1)); // x-comp of ring Rot Mat contrib on x dir of patch
870  WM.PutCoef(1, 9, -Gr1r(2)); // y-comp of ring Rot Mat contrib on x dir of patch
871  WM.PutCoef(1, 10, -Gr1r(3)); // z-comp of ring Rot Mat contrib on x dir of patch
872  WM.PutCoef(3, 8, -Gr3r(1)); // x-comp of ring Rot Mat contrib on y dir of patch
873  WM.PutCoef(3, 9, -Gr3r(2)); // y-comp of ring Rot Mat contrib on y dir of patch
874  WM.PutCoef(3, 10, -Gr3r(3)); // z-comp of ring Rot Mat contrib on y dir of patch
875  // ,contributions of the ring position & rot mat to the jacobian of the patch
876 
877 
878  // contributions of ring rot mat to the ring Jacobian,
879 
880  Vec3 dR5_dRvr = Vec3(-(((n.Cross(dfwdR_dRvx)).Cross(fwdRing)+(n.Cross(fwdRing)).Cross(dfwdR_dRvx))*dR_0)(3)*Kpatv(3),-(((n.Cross(dfwdR_dRvy)).Cross(fwdRing)+(n.Cross(fwdRing)).Cross(dfwdR_dRvy))*dR_0)(3)*Kpatv(3),-(((n.Cross(dfwdR_dRvz)).Cross(fwdRing)+(n.Cross(fwdRing)).Cross(dfwdR_dRvz))*dR_0)(3)*Kpatv(3));
881  Vec3 dR5new_dRvr = dR5_dRvr;
882  Vec3 dRr5_dRvr = Vec3((n*(dR5new_dRvr(1))-(n.Cross(WheelAxle))*(dR1new_dRvr(1))).Dot(i),dR1new_dRvr(2),(n*(dR5new_dRvr(3))-(n.Cross(WheelAxle))*(dR1new_dRvr(3))).Dot(i)); // adjusted for inclination of slope in new equation (ignores projection correction, ie: only good for straqight line or very small steer)
883 //std::cout << "This should never be something other than 0: " << (n*(dR5new_dRvr(2))-(n.Cross(WheelAxle))*(dR1new_dRvr(2))).Dot(j) << std::endl;
884  Vec3 dRr6_dRvr = dR3new_dRvr; // adjusted for inclination of slope in new equation (ignores steer projection correction, ie: only good for straight line or very small steer)
885  Vec3 dRr7_dRvr = Vec3((n*(dR5new_dRvr(1))-(n.Cross(WheelAxle))*(dR1new_dRvr(1))).Dot(k),dR5new_dRvr(2),(n*(dR5new_dRvr(3))-(n.Cross(WheelAxle))*(dR1new_dRvr(3))).Dot(k)); // adjusted for inclination of slope in new equation (ignores projection correction, ie: only good for straqight line or very small steer)
886 
887 
888  Vec3 Gr5r = -dRr5_dRvr.Cross(Rvr)*dCoef; // dCoef*((-dr/dRv)((Rv)X)
889  Vec3 Gr6r = -dRr6_dRvr.Cross(Rvr)*dCoef; // dCoef*((-dr/dRv)((Rv)X)
890  Vec3 Gr7r = -dRr7_dRvr.Cross(Rvr)*dCoef; // dCoef*((-dr/dRv)((Rv)X)
891 
892 // std::cout << "dR5_dRvr: " << dR5_dRvr << std::endl;
893 // std::cout << "Gr7r: " << Gr7r << std::endl;
894 
895  WM.PutCoef(5, 8, Gr5r(1)); // x-comp of ring Rot Mat contrib on x dir of ring
896  WM.PutCoef(5, 9, Gr5r(2)); // y-comp of ring Rot Mat contrib on x dir of ring
897  WM.PutCoef(5, 10, Gr5r(3)); // z-comp of ring Rot Mat contrib on x dir of ring
898  WM.PutCoef(6, 8, Gr6r(1)); // x-comp of ring Rot Mat contrib on y dir of ring
899  WM.PutCoef(6, 9, Gr6r(2)); // y-comp of ring Rot Mat contrib on y dir of ring
900  WM.PutCoef(6, 10, Gr6r(3)); // z-comp of ring Rot Mat contrib on y dir of ring
901  WM.PutCoef(7, 8, Gr7r(1)); // x-comp of ring Rot Mat contrib on z dir of ring
902  WM.PutCoef(7, 9, Gr7r(2)); // y-comp of ring Rot Mat contrib on z dir of ring
903  WM.PutCoef(7, 10, Gr7r(3)); // z-comp of ring Rot Mat contrib on z dir of ring
904 
905  Vec3 dcrcr_dRvx = ((n.Cross(dfwdR_dRvx)).Cross(fwdRing)+(n.Cross(fwdRing)).Cross(dfwdR_dRvx))*dR_0;
906  Vec3 dcrcr_dRvy = ((n.Cross(dfwdR_dRvy)).Cross(fwdRing)+(n.Cross(fwdRing)).Cross(dfwdR_dRvy))*dR_0;
907  Vec3 dcrcr_dRvz = ((n.Cross(dfwdR_dRvz)).Cross(fwdRing)+(n.Cross(fwdRing)).Cross(dfwdR_dRvz))*dR_0;
908  Vec3 ddistM_dRvx = dcrcr_dRvx-n.Cross(WheelAxle)*(dfwdRFlat_dRvx(1)*Xpar(1)-fwdRingFlat(1)*dcrcr_dRvx(1)+(n.Cross(dcrcr_dRvx)).Dot(i)*Xpar(2)-latRingFlat(1)*(dfwdRFlat_dRvx(2)))-n*(dcrcr_dRvx(3))+j*(dfwdRFlat_dRvx(2)*Xpar(1)-fwdRingFlat(2)*dcrcr_dRvx(1)+(n.Cross(dcrcr_dRvx)).Dot(j)*Xpar(2)-latRingFlat(2)*(dfwdRFlat_dRvx(2)));
909  Vec3 ddistM_dRvy = dcrcr_dRvy-n.Cross(WheelAxle)*(dfwdRFlat_dRvy(1)*Xpar(1)-fwdRingFlat(1)*dcrcr_dRvy(1)+(n.Cross(dcrcr_dRvy)).Dot(i)*Xpar(2)-latRingFlat(1)*(dfwdRFlat_dRvy(2)))-n*(dcrcr_dRvy(3))+j*(dfwdRFlat_dRvy(2)*Xpar(1)-fwdRingFlat(2)*dcrcr_dRvy(1)+(n.Cross(dcrcr_dRvy)).Dot(j)*Xpar(2)-latRingFlat(2)*(dfwdRFlat_dRvy(2)));
910  Vec3 ddistM_dRvz = dcrcr_dRvz-n.Cross(WheelAxle)*(dfwdRFlat_dRvz(1)*Xpar(1)-fwdRingFlat(1)*dcrcr_dRvz(1)+(n.Cross(dcrcr_dRvz)).Dot(i)*Xpar(2)-latRingFlat(1)*(dfwdRFlat_dRvz(2)))-n*(dcrcr_dRvz(3))+j*(dfwdRFlat_dRvz(2)*Xpar(1)-fwdRingFlat(2)*dcrcr_dRvz(1)+(n.Cross(dcrcr_dRvz)).Dot(j)*Xpar(2)-latRingFlat(2)*(dfwdRFlat_dRvz(2)));
911 
912 
913 
914  Vec3 dMsa_dRvrx = n*boolFn*(-pTr->dGet(dAlpha_t)*(dR5_dRvr(1)*Fint_ring(2)+Fn*dRr6_dRvr(1))+pMzr->dGet(dAlpha_r)*dR5_dRvr(1));
915  Vec3 dMsa_dRvry = n*boolFn*(-pTr->dGet(dAlpha_t)*(dR5_dRvr(2)*Fint_ring(2)+Fn*dRr6_dRvr(2))+pMzr->dGet(dAlpha_r)*dR5_dRvr(2));
916  Vec3 dMsa_dRvrz = n*boolFn*(-pTr->dGet(dAlpha_t)*(dR5_dRvr(3)*Fint_ring(2)+Fn*dRr6_dRvr(3))+pMzr->dGet(dAlpha_r)*dR5_dRvr(3));
917 
918  Vec3 dRrM_dRvrx = distM.Cross(Vec3(dRr5_dRvr(1), dRr6_dRvr(1), dRr7_dRvr(1)))+ddistM_dRvx.Cross(Fint_ring) + dMsa_dRvrx;
919  Vec3 dRrM_dRvry = distM.Cross(Vec3(dRr5_dRvr(2), dRr6_dRvr(2), dRr7_dRvr(2)))+ddistM_dRvy.Cross(Fint_ring) + dMsa_dRvry;
920  Vec3 dRrM_dRvrz = distM.Cross(Vec3(dRr5_dRvr(3), dRr6_dRvr(3), dRr7_dRvr(3)))+ddistM_dRvz.Cross(Fint_ring) + dMsa_dRvrz;
921 
922  Vec3 dRr8_dRvr = Vec3(dRrM_dRvrx(1),dRrM_dRvry(1),dRrM_dRvrz(1));
923  Vec3 dRr9_dRvr = Vec3(dRrM_dRvrx(2),dRrM_dRvry(2),dRrM_dRvrz(2));
924  Vec3 dRr10_dRvr = Vec3(dRrM_dRvrx(3),dRrM_dRvry(3),dRrM_dRvrz(3));
925 
926  Vec3 Gr8r = -dRr8_dRvr.Cross(Rvr)*dCoef; // dCoef*((-dr/dRv)((Rv)X)
927  Vec3 Gr9r = -dRr9_dRvr.Cross(Rvr)*dCoef; // dCoef*((-dr/dRv)((Rv)X)
928  Vec3 Gr10r = -dRr10_dRvr.Cross(Rvr)*dCoef; // dCoef*((-dr/dRv)((Rv)X)
929 
930 
931  WM.PutCoef(8, 8, Gr8r(1) ); // x-comp of ring Rot Mat contrib on x mom of ring
932  WM.PutCoef(8, 9, Gr8r(2) ); // y-comp of ring Rot Mat contrib on x mom of ring
933  WM.PutCoef(8, 10, Gr8r(3) ); // z-comp of ring Rot Mat contrib on x mom of ring
934  WM.PutCoef(9, 8, Gr9r(1) ); // x-comp of ring Rot Mat contrib on y mom of ring
935  WM.PutCoef(9, 9, Gr9r(2) ); // y-comp of ring Rot Mat contrib on y mom of ring
936  WM.PutCoef(9, 10, Gr9r(3) ); // z-comp of ring Rot Mat contrib on y mom of ring
937  WM.PutCoef(10, 8, Gr10r(1) ); // x-comp of ring Rot Mat contrib on z mom of ring
938  WM.PutCoef(10, 9, Gr10r(2) ); // y-comp of ring Rot Mat contrib on z mom of ring
939  WM.PutCoef(10, 10, Gr10r(3) ); // z-comp of ring Rot Mat contrib on z mom of ring
940 
941  // ,contributions of ring rot mat to the ring Jacobian
942 
943 
944  // contributions of ring and patch positions to ring Momentum jacobian,
945 
946  Vec3 dM_dXx = distM.Cross(Vec3(dFrintdXx(1),dFrintdXx(2),dFrintdXx(3)))+(-n.Cross(WheelAxle)*fwdRingFlat(1)+j*fwdRingFlat(2)).Cross(Fint_ring)+n*boolFn*(-pTr->dGet(dAlpha_t)*dFnewdXx(3)*Fint_ring(2)-tr*dFrintdXx(2)+pMzr->dGet(dAlpha_r)*dFnewdXx(3));
947  Vec3 dM_dXy = distM.Cross(Vec3(dFrintdXy(1),dFrintdXy(2),dFrintdXy(3)))+(-n.Cross(WheelAxle)*latRingFlat(1)+j*latRingFlat(2)).Cross(Fint_ring)+n*boolFn*(-pTr->dGet(dAlpha_t)*dFnewdXy(3)*Fint_ring(2)-tr*dFrintdXy(2)+pMzr->dGet(dAlpha_r)*dFnewdXy(3));
948  Vec3 dM_dXz = distM.Cross(Vec3(dFrintdXz(1),dFrintdXz(2),dFrintdXz(3)))+n.Cross(Fint_ring)+n*boolFn*(-pTr->dGet(dAlpha_t)*dFnewdXz(3)*Fint_ring(2)-tr*dFrintdXz(2)+pMzr->dGet(dAlpha_r)*dFnewdXz(3));
949  Vec3 dM_dVx = distM.Cross(Vec3(dFrintdVx(1),dFrintdVx(2),dFrintdVx(3)))+n*boolFn*(-pTr->dGet(dAlpha_t)*dFnewdVx(3)*Fint_ring(2)-tr*dFrintdVx(2)+pMzr->dGet(dAlpha_r)*dFnewdVx(3));
950  Vec3 dM_dVy = distM.Cross(Vec3(dFrintdVy(1),dFrintdVy(2),dFrintdVy(3)))+n*boolFn*(-pTr->dGet(dAlpha_t)*dFnewdVy(3)*Fint_ring(2)-tr*dFrintdVy(2)+pMzr->dGet(dAlpha_r)*dFnewdVy(3));
951  Vec3 dM_dVz = distM.Cross(Vec3(dFrintdVz(1),dFrintdVz(2),dFrintdVz(3)))+n*boolFn*(-pTr->dGet(dAlpha_t)*dFnewdVz(3)*Fint_ring(2)-tr*dFrintdVz(2)+pMzr->dGet(dAlpha_r)*dFnewdVz(3));
952  Vec3 dM_dXrx = -dM_dXx; // because ring pos is present in exactly the same way as patch pos but negative
953  Vec3 dM_dXrxp = -dM_dVx; // because ring pos is present in exactly the same way as patch pos but negative
954  Vec3 dM_dXry = -dM_dXy; // because ring pos is present in exactly the same way as patch pos but negative
955  Vec3 dM_dXryp = -dM_dVy; // because ring pos is present in exactly the same way as patch pos but negative
956  Vec3 dM_dXrz = -dM_dXz;
957  Vec3 dM_dXrzp = -dM_dVz;
958 
959  WM.PutCoef(8, 1, -dCoef*dM_dVx(1));
960  WM.PutCoef(8, 2, -dCoef*dM_dXx(1));
961  WM.PutCoef(8, 3, -dCoef*dM_dVy(1));
962  WM.PutCoef(8, 4, -dCoef*dM_dXy(1));
963  WM.PutCoef(8, 5, -dCoef*dM_dXrx(1)-dM_dXrxp(1));
964  WM.PutCoef(8, 6, -dCoef*dM_dXry(1)-dM_dXryp(1));
965  WM.PutCoef(8, 7, -dCoef*dM_dXrz(1)-dM_dXrzp(1));
966  WM.PutCoef(9, 1, -dCoef*dM_dVx(2));
967  WM.PutCoef(9, 2, -dCoef*dM_dXx(2));
968  WM.PutCoef(9, 3, -dCoef*dM_dVy(2));
969  WM.PutCoef(9, 4, -dCoef*dM_dXy(2));
970  WM.PutCoef(9, 5, -dCoef*dM_dXrx(2)-dM_dXrxp(2));
971  WM.PutCoef(9, 6, -dCoef*dM_dXry(2)-dM_dXryp(2));
972  WM.PutCoef(9, 7, -dCoef*dM_dXrz(2)-dM_dXrzp(2));
973  WM.PutCoef(10, 1, -dCoef*dM_dVx(3));
974  WM.PutCoef(10, 2, -dCoef*dM_dXx(3));
975  WM.PutCoef(10, 3, -dCoef*dM_dVy(3));
976  WM.PutCoef(10, 4, -dCoef*dM_dXy(3));
977  WM.PutCoef(10, 5, -dCoef*dM_dXrx(3)-dM_dXrxp(3));
978  WM.PutCoef(10, 6, -dCoef*dM_dXry(3)-dM_dXryp(3));
979  WM.PutCoef(10, 7, -dCoef*dM_dXrz(3)-dM_dXrzp(3));
980 
981 
982  // ,contributions of ring and patch positions to ring Momentum jacobian
983 
984  // contributions of ring pos to the ring Jacobian,
985 
986  WM.PutCoef(5, 5, dFrintdVx(1) + dCoef*dFrintdXx(1));
987  WM.PutCoef(5, 6, dFrintdVy(1) + dCoef*dFrintdXy(1));
988  WM.PutCoef(5, 7, dFrintdVz(1) + dCoef*dFrintdXz(1));
989 // WM.PutCoef(5, 7, 0.); // contribution of z distance to x and y viscoelastic forces is null
990 
991  WM.PutCoef(6, 5, dFrintdVx(2) + dCoef*dFrintdXx(2));
992  WM.PutCoef(6, 6, dFrintdVy(2) + dCoef*dFrintdXy(2));
993  WM.PutCoef(6, 7, dFrintdVz(2) + dCoef*dFrintdXz(2));
994 // WM.PutCoef(6, 7, 0.); // contribution of z distance to x and y viscoelastic forces is null
995 
996  WM.PutCoef(7, 5, dFrintdVx(3) + dCoef*dFrintdXx(3));
997  WM.PutCoef(7, 6, dFrintdVy(3) + dCoef*dFrintdXy(3));
998  WM.PutCoef(7, 7, dFrintdVz(3) + dCoef*dFrintdXz(3));
999 
1000  // ,contributions of ring pos to the ring Jacobian
1001 
1002 
1003 
1004  // contributions of wheel position velocity, angular velocity, and rotation matrix to jac of patch,
1005 
1006 
1007  // block to see where we are on the derivative and react accordingly
1008 // derivSign=-1 ensures the proper sign of the derivative if we are the the left side of the y-axis because we have an absolute value function to derive! This applies to both derivatives of lat and long slips
1009 // derivSign=1 ensures the proper sign of the derivative if we are the the right side of the y-axis because we have an absolute value function to derive! This applies to both derivatives of lat and long slips
1010 derivSign = copysign(1, dvax);
1011 
1012 if (std::abs(dvax) < TRH ) // max linear values of dAlpha and dSr estimated from the plots of the functions using data from Vincenzo
1013 {
1014 // std::cout << "JacOFF, " << " dvax: " << dvax << " dAlpha: " << dAlpha << " dSr: " << dSr << std::endl;
1015  // returns a null Jacobian for the wheel contribution for velocities too close to zero or past uppermost point of the curve
1016  // TODO: check if lateral slip could be considered even when vel near zero...
1017  // TODO make condition for on/off distinguish between lateral contribs and long contribs?
1018 }
1019 else
1020 {
1021 // std::cout << "JacON" << std::endl;
1022 
1023 
1024 
1025  doublereal Cmf = Fn*pMuX0->dGetP(dSr); // slope of MF long forces using deriv of force w.r.t. slip
1026  doublereal Cmf_a = Fn*pMuY0->dGetP(dAlpha); // slope of MF lat forces using deriv of force w.r.t. slip
1027  latBool = 1; // cancels the on/off switch because slope is calculated properly by ginac function
1028  fwdBool = 1;
1029 
1030 
1031  // TODO: add contribution of the rotation matrix? ie: dependence of Fint on Rring (so add 3 columns to Jacobian? Or is the rotation matrix assumed to be fixed over the iteration as pointed out by Marco if I understood correctly...?)
1032  Vec3 wheelW = pWheel->GetWCurr();
1033  Vec3 refW = pWheel->GetWRef();
1034  doublereal dAtan_dAlpha = 1/(1+pow((lat.Dot(va))/(fwd.Dot(va)),2)); // this deriv is actually d(atan(dvay/dvax)/d(dvay/dvax)
1035  doublereal dr1_dWx = derivSign*(-fwd.Dot(i.Cross(n*dR_0)))/(fwd.Dot(va))*fwd(1)*(-Cmf)*fwdBool; // dr_1/dWx,wheel contrib of long slip MF on x-dir of patch
1036  doublereal dr1_dWy = derivSign*(-fwd.Dot(j.Cross(n*dR_0)))/(fwd.Dot(va))*fwd(1)*(-Cmf)*fwdBool; // dr_1/dWy,wheel contrib of long slip MF on x-dir of patch
1037  doublereal dr1_dWz = derivSign*(-fwd.Dot(k.Cross(n*dR_0)))/(fwd.Dot(va))*fwd(1)*(-Cmf)*fwdBool; // dr_1/dWz,wheel contrib of long slip MF on x-dir of patch
1038  doublereal dr1_dXxp = derivSign*((fwd.Dot(i))/(fwd.Dot(va))+(fwd.Dot(va)-fwd.Dot(wheelW.Cross(n*(dR_0))))*(fwd.Dot(i))/pow((fwd.Dot(va)),2)*(-1))*fwd(1)*(-Cmf)*fwdBool; // dr_1/dXx,prime,wheel contrib of long slip MF on x-dir of patch
1039  dr1_dXxp += derivSign*dAtan_dAlpha*((lat.Dot(i))/(fwd.Dot(va))+(lat.Dot(va))/pow((fwd.Dot(va)),2)*(-1)*(fwd.Dot(i)))*(-Cmf_a)*lat(1)*latBool; // dr_1/dXx,prime,wheel contrib of lat slip MF on x-dir of patch
1040  doublereal dr1_dXyp = derivSign*((fwd.Dot(j))/(fwd.Dot(va))+(fwd.Dot(va)-fwd.Dot(wheelW.Cross(n*(dR_0))))*(fwd.Dot(j))/pow((fwd.Dot(va)),2)*(-1))*fwd(1)*(-Cmf)*fwdBool; // dr_1/dXy,prime,wheel contrib of long slip MF on x-dir of patch
1041  dr1_dXyp += derivSign*dAtan_dAlpha*((lat.Dot(j))/(fwd.Dot(va))+(lat.Dot(va))/pow((fwd.Dot(va)),2)*(-1)*(fwd.Dot(j)))*(-Cmf_a)*lat(1)*latBool; // dr_1/dXy,prime,wheel contrib of lat slip MF on x-dir of patch
1042  doublereal dr1_dXzp = derivSign*((fwd.Dot(k))/(fwd.Dot(va))+(fwd.Dot(va)-fwd.Dot(wheelW.Cross(n*(dR_0))))*(fwd.Dot(k))/pow((fwd.Dot(va)),2)*(-1))*fwd(1)*(-Cmf)*fwdBool; // dr_1/dXz,prime,wheel contrib of long slip MF on x-dir of patch
1043  dr1_dXzp += derivSign*dAtan_dAlpha*((lat.Dot(k))/(fwd.Dot(va))+(lat.Dot(va))/pow((fwd.Dot(va)),2)*(-1)*(fwd.Dot(k)))*(-Cmf_a)*lat(1)*latBool; // dr_1/dXz,prime,wheel contrib of lat slip MF on x-dir of patch
1044 
1045 
1046  Vec3 dr1_dW(dr1_dWx,dr1_dWy,dr1_dWz);
1047  Vec3 dr1_dgdot(dr1_dW + refW.Cross(dr1_dW) * dCoef);
1048  Vec3 n_dr1_dXp = Vec3(dr1_dXxp,dr1_dXyp,dr1_dXzp)*(-1); // vec of Jac contribs from wheel local x,y,z forces to global x force on patch
1049 
1050  WM.PutCoef(1, 11, n_dr1_dXp(1)); // -dr_1/dXx,prime,wheel from J = -(dr_1/dXx,prime+dCoef*dr_1/dXx), acting in x-dir, complete
1051  WM.PutCoef(1, 12, n_dr1_dXp(2)); // -dr_1/dXy,prime,wheel from J = -(dr_1/dXy,prime+dCoef*dr_1/dXy), acting in x-dir, complete
1052  WM.PutCoef(1, 13, n_dr1_dXp(3)); // -dr_1/dXz,prime,wheel from J = -(dr_1/dXz,prime+dCoef*dr_1/dXz), acting in x-dir, complete
1053 
1054 
1055  Vec3 RvwCrossn = (pWheel->GetRCurr()*WheelAxle).Cross(n);
1056  Vec3 dfwdx_dRv = (i.Cross(n))/sqrt(RvwCrossn.Dot())-RvwCrossn*pow(RvwCrossn.Dot(),-3/2)*((i.Cross(n)).Dot(RvwCrossn)); // d(fwd)/d(Rv), x-comp
1057  Vec3 dfwdy_dRv = (j.Cross(n))/sqrt(RvwCrossn.Dot())-RvwCrossn*pow(RvwCrossn.Dot(),-3/2)*((j.Cross(n)).Dot(RvwCrossn)); // d(fwd)/d(Rv), y-comp
1058  Vec3 dfwdz_dRv = (k.Cross(n))/sqrt(RvwCrossn.Dot())-RvwCrossn*pow(RvwCrossn.Dot(),-3/2)*((k.Cross(n)).Dot(RvwCrossn)); // d(fwd)/d(Rv), z-comp
1059  Vec3 dR1_dRv = Vec3(derivSign*fwd(1)*(-Cmf)*((dfwdx_dRv.Dot(va)-dfwdx_dRv.Dot(wheelW.Cross(n*dR_0)))/(fwd.Dot(va))+(fwd.Dot(va)-fwd.Dot(wheelW.Cross(n*dR_0)))/pow((fwd.Dot(va)),2)*(-1)*(dfwdx_dRv.Dot(va))), derivSign*fwd(1)*(-Cmf)*((dfwdy_dRv.Dot(va)-dfwdy_dRv.Dot(wheelW.Cross(n*dR_0)))/(fwd.Dot(va))+(fwd.Dot(va)-fwd.Dot(wheelW.Cross(n*dR_0)))/pow((fwd.Dot(va)),2)*(-1)*(dfwdy_dRv.Dot(va))), derivSign*fwd(1)*(-Cmf)*((dfwdz_dRv.Dot(va)-dfwdz_dRv.Dot(wheelW.Cross(n*dR_0)))/(fwd.Dot(va))+(fwd.Dot(va)-fwd.Dot(wheelW.Cross(n*dR_0)))/pow((fwd.Dot(va)),2)*(-1)*(dfwdz_dRv.Dot(va)))); //longitudinal slip forces contrib vector to x-dir of patch
1060 // dR1_dRv += Vec3(derivSign*lat(1)*(-Cmf_a)*dAtan_dAlpha*(((n.Cross(dfwdx_dRv)).Dot(va))/(fwd.Dot(va))+(lat.Dot(va))/pow((fwd.Dot(va)),2)*(-1)*(dfwdx_dRv.Dot(va))), 0, 0); // lateral slip contrib vector to x-dir of patch
1061  dR1_dRv += Vec3(derivSign*lat(1)*(-Cmf_a)*dAtan_dAlpha*(((n.Cross(dfwdx_dRv)).Dot(va))/(fwd.Dot(va))+(lat.Dot(va))/pow((fwd.Dot(va)),2)*(-1)*(dfwdx_dRv.Dot(va))), derivSign*lat(1)*(-Cmf_a)*dAtan_dAlpha*(((n.Cross(dfwdy_dRv)).Dot(va))/(fwd.Dot(va))+(lat.Dot(va))/pow((fwd.Dot(va)),2)*(-1)*(dfwdy_dRv.Dot(va))), derivSign*lat(1)*(-Cmf_a)*dAtan_dAlpha*(((n.Cross(dfwdz_dRv)).Dot(va))/(fwd.Dot(va))+(lat.Dot(va))/pow((fwd.Dot(va)),2)*(-1)*(dfwdz_dRv.Dot(va)))); // lateral slip contrib vector to x-dir of patch
1062  Vec3 dR3_dRv = Vec3(derivSign*fwd(2)*(-Cmf)*((dfwdx_dRv.Dot(va)-dfwdx_dRv.Dot(wheelW.Cross(n*dR_0)))/(fwd.Dot(va))+(fwd.Dot(va)-fwd.Dot(wheelW.Cross(n*dR_0)))/pow((fwd.Dot(va)),2)*(-1)*(dfwdx_dRv.Dot(va))), derivSign*fwd(2)*(-Cmf)*((dfwdy_dRv.Dot(va)-dfwdy_dRv.Dot(wheelW.Cross(n*dR_0)))/(fwd.Dot(va))+(fwd.Dot(va)-fwd.Dot(wheelW.Cross(n*dR_0)))/pow((fwd.Dot(va)),2)*(-1)*(dfwdy_dRv.Dot(va))), derivSign*fwd(2)*(-Cmf)*((dfwdz_dRv.Dot(va)-dfwdz_dRv.Dot(wheelW.Cross(n*dR_0)))/(fwd.Dot(va))+(fwd.Dot(va)-fwd.Dot(wheelW.Cross(n*dR_0)))/pow((fwd.Dot(va)),2)*(-1)*(dfwdz_dRv.Dot(va)))); //longitudinal slip forces contrib vector to y-dir of patch
1063  dR3_dRv += Vec3(derivSign*lat(2)*(-Cmf_a)*dAtan_dAlpha*(((n.Cross(dfwdx_dRv)).Dot(va))/(fwd.Dot(va))+(lat.Dot(va))/pow((fwd.Dot(va)),2)*(-1)*(dfwdx_dRv.Dot(va))), derivSign*lat(2)*(-Cmf_a)*dAtan_dAlpha*(((n.Cross(dfwdy_dRv)).Dot(va))/(fwd.Dot(va))+(lat.Dot(va))/pow((fwd.Dot(va)),2)*(-1)*(dfwdy_dRv.Dot(va))), derivSign*lat(2)*(-Cmf_a)*dAtan_dAlpha*(((n.Cross(dfwdz_dRv)).Dot(va))/(fwd.Dot(va))+(lat.Dot(va))/pow((fwd.Dot(va)),2)*(-1)*(dfwdz_dRv.Dot(va)))); // lateral slip contrib vector to y-dir of patch
1064  Vec3 Rv = (pWheel->GetRCurr()*WheelAxle);
1065  Vec3 Gr1 = -dR1_dRv.Cross(Rv)*dCoef; // dCoef*((-dr/dRv)((Rv)X) // 29.08.2012
1066  Vec3 Gr3 = -dR3_dRv.Cross(Rv)*dCoef; // dCoef*((-dr/dRv)((Rv)X) // simplified on 29.08.2012 as well as all Gr equations
1067 
1068 
1069 
1070  WM.PutCoef(1, 14, -dr1_dgdot(1)-Gr1(1)); // x-comp of {refW X (dr_1/dW,wheel)} + Rot Mat contrib on x dir of patch (formula changed)
1071  WM.PutCoef(1, 15, -dr1_dgdot(2)-Gr1(2)); // y-comp of {refW X (dr_1/dW,wheel)} + Rot Mat contrib on x dir of patch
1072  WM.PutCoef(1, 16, -dr1_dgdot(3)-Gr1(3)); // z-comp of {refW X (dr_1/dW,wheel)} + Rot Mat contrib on x dir of patch
1073 
1074 
1075  doublereal dr3_dWx = derivSign*(fwd.Dot(i.Cross(n*dR_0)))/(fwd.Dot(va))*fwd(2)*Cmf*fwdBool; // dr_3/dWx,wheel on y-dir of patch
1076  doublereal dr3_dWy = derivSign*(fwd.Dot(j.Cross(n*dR_0)))/(fwd.Dot(va))*fwd(2)*Cmf*fwdBool; // dr_3/dWy,wheel on y-dir of patch
1077  doublereal dr3_dWz = derivSign*(fwd.Dot(k.Cross(n*dR_0)))/(fwd.Dot(va))*fwd(2)*Cmf*fwdBool; // dr_3/dWz,wheel on y-dir of patch
1078  doublereal dr3_dXxp = derivSign*((fwd.Dot(i))/(fwd.Dot(va))-(fwd.Dot(va)-fwd.Dot(wheelW.Cross(n*(dR_0))))*(fwd.Dot(i))/pow((fwd.Dot(va)),2))*fwd(2)*(-Cmf)*fwdBool; // dr_3/dXx,prime,wheel contrib of long slip MF on y-dir of patch
1079  dr3_dXxp += derivSign*dAtan_dAlpha*((lat.Dot(i))/(fwd.Dot(va))-(lat.Dot(va))/pow((fwd.Dot(va)),2)*(fwd.Dot(i)))*(-Cmf_a)*lat(2)*latBool; // dr_3/dXx,prime,wheel contrib of lat slip MF on y-dir of patch
1080  doublereal dr3_dXyp = derivSign*((fwd.Dot(j))/(fwd.Dot(va))-(fwd.Dot(va)-fwd.Dot(wheelW.Cross(n*(dR_0))))*(fwd.Dot(j))/pow((fwd.Dot(va)),2))*fwd(2)*(-Cmf)*fwdBool; // dr_3/dXy,prime,wheel contrib of long slip MF on y-dir of patch
1081  dr3_dXyp += derivSign*dAtan_dAlpha*((lat.Dot(j))/(fwd.Dot(va))-(lat.Dot(va))/pow((fwd.Dot(va)),2)*(fwd.Dot(j)))*(-Cmf_a)*lat(2)*latBool; // dr_3/dXy,prime,wheel contrib of lat slip MF on y-dir of patch
1082  doublereal dr3_dXzp = derivSign*((fwd.Dot(k))/(fwd.Dot(va))-(fwd.Dot(va)-fwd.Dot(wheelW.Cross(n*(dR_0))))*(fwd.Dot(k))/pow((fwd.Dot(va)),2))*fwd(2)*(-Cmf)*fwdBool; // dr_3/dXz,prime,wheel contrib of long slip MF on y-dir of patch
1083  dr3_dXzp += derivSign*dAtan_dAlpha*((lat.Dot(k))/(fwd.Dot(va))-(lat.Dot(va))/pow((fwd.Dot(va)),2)*(fwd.Dot(k)))*(-Cmf_a)*lat(2)*latBool; // dr_3/dXz,prime,wheel contrib of lat slip MF on y-dir of patch
1084 
1085 
1086  Vec3 dr3_dW(dr3_dWx,dr3_dWy,dr3_dWz);
1087  Vec3 dr3_dgdot(dr3_dW + refW.Cross(dr3_dW) * dCoef);
1088  Vec3 n_dr3_dXp = Vec3(dr3_dXxp,dr3_dXyp,dr3_dXzp)*(-1); // vec of Jac contribs from wheel local x,y,z forces to global y force on patch
1089 
1090  WM.PutCoef(3, 11, n_dr3_dXp(1)); // -dr_3/dXx,prime,wheel from J = -(dr_3/dXx,prime+dCoef*dr_3/dXx), acting in y-dir, complete
1091  WM.PutCoef(3, 12, n_dr3_dXp(2)); // -dr_3/dXy,prime,wheel from J = -(dr_3/dXy,prime+dCoef*dr_3/dXy), acting in y-dir, complete
1092  WM.PutCoef(3, 13, n_dr3_dXp(3)); // -dr_3/dXz,prime,wheel from J = -(dr_3/dXz,prime+dCoef*dr_3/dXz), acting in y-dir, complete
1093  WM.PutCoef(3, 14, -dr3_dgdot(1)-Gr3(1)); // x-comp of {refW X (dr_1/dW,wheel)} + Rot Mat contrib on y dir of patch
1094  WM.PutCoef(3, 15, -dr3_dgdot(2)-Gr3(2)); // y-comp of {refW X (dr_1/dW,wheel)} + Rot Mat contrib on y dir of patch
1095  WM.PutCoef(3, 16, -dr3_dgdot(3)-Gr3(3)); // z-comp of {refW X (dr_1/dW,wheel)} + Rot Mat contrib on y dir of patch
1096 
1097 
1098 // NOTE: the wheel variables have no direct influence on the residual of the ring, thus r5-r10 are null for columns 11-16
1099 
1100 
1101 // ,contributions of wheel position velocity, angular velocity, and rotation matrix to jac of patch
1102 
1103 
1104  // contributions of wheel velocity and rot matrix to Jac of moment on ring,
1105 
1106  //TODO: sub the following in the code above where it occurs in the long form
1107  Vec3 dAlpha_dVw = (n.Cross(fwd))/(fwd.Dot(va))-fwd*(lat.Dot(va))/pow(fwd.Dot(va),2); // this deriv is d(dvay/dvax)/d(va x,y,z)
1108  Vec3 dM_dAlpha = n*boolFn*(-pTr->dGetP(dAlpha_t)*pow(sec(dAlpha),2)*dAtan_dAlpha*Fn*Fint_ring(2)+pMzr->dGetP(dAlpha_r)*pow(sec(dAlpha),2)*dAtan_dAlpha*Fn); // this deriv is d(Mz,vector)/d(dvay/dvax)
1109  Vec3 dM_dVwx = dM_dAlpha*dAlpha_dVw(1);
1110  Vec3 dM_dVwy = dM_dAlpha*dAlpha_dVw(2);
1111  Vec3 dM_dVwz = dM_dAlpha*dAlpha_dVw(3); // TODO could replace by a matrix...
1112 
1113  WM.PutCoef(8, 11, -dM_dVwx(1)); // -dr_8/dXx,prime,wheel from J = -(dr_8/dXx,prime+dCoef*dr_8/dXx)
1114  WM.PutCoef(8, 12, -dM_dVwy(1)); // -dr_8/dXy,prime,wheel from J = -(dr_8/dXy,prime+dCoef*dr_8/dXy)
1115  WM.PutCoef(8, 13, -dM_dVwz(1)); // -dr_8/dXz,prime,wheel from J = -(dr_8/dXz,prime+dCoef*dr_8/dXz)
1116  WM.PutCoef(9, 11, -dM_dVwx(2)); // -dr_9/dXx,prime,wheel from J = -(dr_9/dXx,prime+dCoef*dr_9/dXx)
1117  WM.PutCoef(9, 12, -dM_dVwy(2)); // -dr_9/dXy,prime,wheel from J = -(dr_9/dXy,prime+dCoef*dr_9/dXy)
1118  WM.PutCoef(9, 13, -dM_dVwz(2)); // -dr_9/dXz,prime,wheel from J = -(dr_9/dXz,prime+dCoef*dr_9/dXz)
1119  WM.PutCoef(10, 11, -dM_dVwx(3)); // -dr_10/dXx,prime,wheel from J = -(dr_10/dXx,prime+dCoef*dr_10/dXx)
1120  WM.PutCoef(10, 12, -dM_dVwy(3)); // -dr_10/dXy,prime,wheel from J = -(dr_10/dXy,prime+dCoef*dr_10/dXy)
1121  WM.PutCoef(10, 13, -dM_dVwz(3)); // -dr_10/dXz,prime,wheel from J = -(dr_10/dXz,prime+dCoef*dr_10/dXz)
1122 
1123 
1124  Vec3 dAlpha_dRv = Vec3((va.Dot(n.Cross(dfwdx_dRv)))/(fwd.Dot(va))-va.Dot(dfwdx_dRv)*(lat.Dot(va))/pow(va.Dot(fwd),2),(va.Dot(n.Cross(dfwdy_dRv)))/(fwd.Dot(va))-va.Dot(dfwdy_dRv)*(lat.Dot(va))/pow(va.Dot(fwd),2),(va.Dot(n.Cross(dfwdz_dRv)))/(fwd.Dot(va))-va.Dot(dfwdz_dRv)*(lat.Dot(va))/pow(va.Dot(fwd),2)); // this deriv is d(dvay/dvax)/d(Rv x,y,z)
1125  Vec3 dM_dRvx = dM_dAlpha*dAlpha_dRv(1);
1126  Vec3 dM_dRvy = dM_dAlpha*dAlpha_dRv(2);
1127  Vec3 dM_dRvz = dM_dAlpha*dAlpha_dRv(3); // TODO could replace by a matrix...
1128  Vec3 dR8_dRv = Vec3(dM_dRvx(1),dM_dRvy(1),dM_dRvz(1));
1129  Vec3 dR9_dRv = Vec3(dM_dRvx(2),dM_dRvy(2),dM_dRvz(2));
1130  Vec3 dR10_dRv = Vec3(dM_dRvx(3),dM_dRvy(3),dM_dRvz(3));
1131 
1132 
1133  Vec3 Gr8 = -dR8_dRv.Cross(Rv)*dCoef; // dCoef*((-dr/dRv)((Rv)X)
1134  Vec3 Gr9 = -dR9_dRv.Cross(Rv)*dCoef; // dCoef*((-dr/dRv)((Rv)X)
1135  Vec3 Gr10 = -dR10_dRv.Cross(Rv)*dCoef; // dCoef*((-dr/dRv)((Rv)X)
1136 
1137 
1138  WM.PutCoef(8, 14, Gr8(1)); // Wheel rot mat contrib on x moment on ring
1139  WM.PutCoef(8, 15, Gr8(2)); // Wheel rot mat contrib on x moment on ring
1140  WM.PutCoef(8, 16, Gr8(3)); // Wheel rot mat contrib on x moment on ring
1141  WM.PutCoef(9, 14, Gr9(1)); // Wheel rot mat contrib on y moment on ring
1142  WM.PutCoef(9, 15, Gr9(2)); // Wheel rot mat contrib on y moment on ring
1143  WM.PutCoef(9, 16, Gr9(3)); // Wheel rot mat contrib on y moment on ring
1144  WM.PutCoef(10, 14, Gr10(1)); // Wheel rot mat contrib on z moment on ring
1145  WM.PutCoef(10, 15, Gr10(2)); // Wheel rot mat contrib on z moment on ring
1146  WM.PutCoef(10, 16, Gr10(3)); // Wheel rot mat contrib on z moment on ring
1147 
1148 
1149  // ,contributions of wheel velocity and rot matrix to Jac of moment on ring
1150 
1151 
1152  // contributions of ring rot matrix to Jac of moment on ring,
1153 
1154 
1155 
1156  // ,contributions of ring rot matrix to Jac of moment on ring
1157 
1158 }
1159  for (int i=1; i <= WM.iGetNumCols(); i++) {
1160  WM.PutCoef(1, i, WM.dGetCoef(1, i) / Kpatv(1));
1161  WM.PutCoef(3, i, WM.dGetCoef(3, i) / Kpatv(2));
1162  }
1163  return WorkMat;
1164 }
doublereal dvax
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
Vec3 Xpar
doublereal tr
integer iGetNumCols(void) const
Definition: submat.h:240
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
doublereal TRH
GradientExpression< BinaryExpr< FuncPow, LhsExpr, RhsExpr > > pow(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
Definition: gradient.h:2961
Definition: matvec3.h:98
doublereal dAlpha_r
bool fwdBool
bool latBool
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
doublereal Dot(const Vec3 &v) const
Definition: matvec3.h:243
doublereal dMuX
Vec3 latRing
Vec3 fwd
Vec3 Cpatv
Definition: module-wheel4.h:96
DriveCaller * pMzr
Definition: module-wheel4.h:83
void PutCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:672
virtual const Vec3 & GetWRef(void) const
Definition: strnode.h:1024
DriveCaller * pMuY0
Definition: module-wheel4.h:81
doublereal derivSign
bool boolFn
Vec3 Fint_old
doublereal dSr
Vec3 Kpatv
Definition: module-wheel4.h:93
virtual doublereal dGetP(const doublereal &dVar) const
Definition: drive.cc:499
doublereal dMuY
const doublereal & dGetCoef(integer iRow, integer iCol) const
Definition: submat.h:705
Vec3 lat
doublereal copysign(doublereal x, doublereal y)
Definition: gradient.h:97
Vec3 distM
doublereal dAlpha_t
virtual integer iGetFirstMomentumIndex(void) const =0
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
DotTraits< VectorExprLhs, VectorExprRhs, N_rows, N_rows >::ExpressionType Dot(const VectorExpression< VectorExprLhs, N_rows > &u, const VectorExpression< VectorExprRhs, N_rows > &v)
Definition: matvec.h:3133
doublereal Fn
DriveCaller * pMuX0
Definition: module-wheel4.h:80
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
VectorExpression< VectorCrossExpr< VectorLhsExpr, VectorRhsExpr >, 3 > Cross(const VectorExpression< VectorLhsExpr, 3 > &u, const VectorExpression< VectorRhsExpr, 3 > &v)
Definition: matvec.h:3248
Vec3 fwdRingFlat
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
virtual doublereal dGet(const doublereal &dVar) const =0
Vec3 WheelAxle
Definition: module-wheel4.h:70
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
doublereal dR_0
doublereal sec(doublereal x) const
StructNode * pRing
Definition: module-wheel4.h:62
doublereal dAlpha
Vec3 Vpar
Vec3 Fint_ring
Vec3 latRingFlat
doublereal Mpa
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
Vec3 fwdRing
DriveCaller * pTr
Definition: module-wheel4.h:82
StructNode * pWheel
Definition: module-wheel4.h:57

Here is the call graph for this function:

SubVectorHandler & Wheel4::AssRes ( SubVectorHandler WorkVec,
doublereal  dCoef,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Implements Elem.

Definition at line 1170 of file module-wheel4.cc.

References VectorHandler::Add(), grad::atan2(), bFirstAC, bFirstAP, bLoadedRadius, boolFn, CalculateR_e(), CapLoop(), copysign(), Cpa, Cpatv, Vec3::Cross(), grad::Cross(), curTime, dAlpha, dAlpha_r, dAlpha_t, dCpa, dCt, dDebug, ddistM, dEffRad, deltaPrev, DriveOwner::dGet(), DriveCaller::dGet(), SimulationEntity::dGetPrivData(), distM, dKpa, dLs, dLsProj, dLsProjPrev, dMuX, dMuY, dn, Vec3::Dot(), dPls, dR_0, dR_a1, dR_a2, dRoad, dRoadAhead, dRoadBehind, dRoadInitial, dRoadPrev, dRoadPrevPrev, dSr, dt, dt_adjFactor, dt_divF, dt_divF3, dt_divF4, dt_fNow, dt_maxF, dt_maxH, dt_maxstep, dt_minF, dt_minstep, dt_minStepsCycle, dt_numAhead, dt_On, dt_Res, dtMax, dvao, dvax, dvay, dVPx, dVPy, dVx, dvx, dVy, dXPx, dXPy, dXx, dXxPrev, dXxProj, dXxProjPrev, dXy, Vec3::EBEMult(), F, grad::fabs(), Fcent, Fint, Fint_old, Fint_ring, FintPrev, FintPrevPrev, FintSignCk, firstRes, Fn, Fpatch, Fr, fwd, fwdRing, fwdRingFlat, fwdRingPrev, WithLabel::GetLabel(), StructNode::GetRCurr(), StructDispNode::GetVCurr(), StructNode::GetWCurr(), StructDispNode::GetXCurr(), i, DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), j, k, Kpa, Kpatv, Krz, lat, latRing, latRingFlat, grad::log(), M, M_zr, MBDYN_EXCEPT_ARGS, Mpa, Mz, n, nPrev, oldTime, pCpa, pcRing, pcRingPrev, pKpa, pMuX0, pMuY0, pMzr, grad::pow(), pRing, pRingB, pRoad, pTr, VectorHandler::PutCoef(), SubVectorHandler::PutRowIndex(), pWheel, q_sy1, q_sy3, R_e, RDA, RDB, RDL, VectorHandler::ResizeReset(), RingRad, RingRadPrev, rRatio, S_hf, S_ht, SetInitialValue(), sign(), grad::sqrt(), grad::tan(), tdc, TdLs, tr, TRH, TRHA, TRHC, va, Vpa, VpaPrev, Vpar, Vparp, VparWheel, VpcRing, VpcRingPrev, VpcRingPrevPrev, WheelAxle, WorkSpaceDim(), Xpa, XpaPrev, XpaPrevPrev, Xpar, Xparp, XparpPrev, XparpPrevPrev, XparPrev, XparPrevPrev, and Xring.

1174 {
1175 
1176 
1177  if (bFirstAC) {
1178  oldTime = curTime; // in if to avoid changing oldTime when only time step length changed
1180  dRoadPrev = dRoad;
1181  dXxProjPrev = dXxProj;
1182  dLsProjPrev = dLsProj;
1183 // dtPrev = dt;
1184  pcRingPrev = pcRing;
1186  VpcRingPrev = VpcRing;
1187  RingRadPrev = RingRad;
1188  nPrev = n;
1189  fwdRingPrev = fwdRing;
1191  FintPrev = Fint;
1193  XparpPrev = Xparp;
1195  XparPrev = Xpar;
1196  XpaPrevPrev = XpaPrev;
1197  XpaPrev = Xpa;
1198  dXxPrev = dXx; // where dXx is the position degree of freedom of the patch in the x-dir
1199  deltaPrev = dR_0 - dEffRad;
1200  if (deltaPrev < 0.)
1201  {
1202  deltaPrev = 0.;
1203 // std::cout << "Note for wheel: " << GetLabel() << ", the tire deflection is negative (ie: the road and tire should have lost contact in reality but the model forced it." << std::endl;
1204  }
1205 
1206 // std::cout << "bFirstAC" << std::endl;
1207  }
1208  bFirstAC = false;
1209 
1210  if (bFirstAP) {
1211  curTime = tdc.dGet();
1212  dt = curTime - oldTime;
1213  // variable normal direction,
1214  // using previous timestep data
1215  dLs = dR_a1*dR_0*(deltaPrev/dR_0 + dR_a2*sqrt(deltaPrev/dR_0)) * dPls; // multiplied by dPls as stated in Schmeitz. Remainder of equation from from Besslink eq. 4.85 (also shown in Pac2006 eq A3.10) NOTE: Besselink uses "vertical" deflection, but I use the actual deflection in the normal direction because Besselink only considers flat road while I consider unevennesses
1216  if (dLs < TdLs) dLs = TdLs;
1217 // RDLC = 0;
1218 // if (RDL != 0) RDLC = (dXxPrev - RDB)/RDL; // this was changed to a more "proper" coding technique
1219  while (dXxProj >= RDL) dXxProj-=RDL;
1220 
1221  if (dXxPrev < RDA)
1222  {
1223  dXxProj = 0.;
1225  dLsProj = dLs;
1226  }
1227  else if (dXxPrev >= RDA && dXxPrev < RDB)
1228  {
1229 //16.08.2012 dXxProj = pcRingPrev(1)-(nPrev.Cross(pRing->GetRPrev()*WheelAxle).Dot(i))*XparPrev(1) - dXxPrev; // projected sloped x-pos of the patch
1230 //16.08.2012 dXxProj = pcRingPrev(1)+(fwdRingPrev.Dot(i))*XparPrev(1) - dXxPrev; // projected sloped x-pos of the patch
1231  dXxProj = 0; // projected sloped x-pos of the patch
1232 // dLsProj = -(nPrev.Cross(pRing->GetRPrev()*WheelAxle).Dot(i))*dLs;
1233  dLsProj = (fwdRingPrev.Dot(i))*dLs;
1234  dRoadAhead = dRoadInitial + ((dXxPrev-RDA)/(RDB-RDA))*(pRoad->dGet(dXxProj+dLsProj)-dRoadInitial); // projected sloped distance in the absolute x-plane
1235  dRoadBehind = dRoadInitial + ((dXxPrev-RDA)/(RDB-RDA))*(pRoad->dGet(dXxProj-dLsProj)-dRoadInitial); // more or less precise smoothing, only for initial stabilization of the vehicle
1236  }
1237  else if (dXxPrev >= RDB)
1238  {
1239 // dXxProj = pcRingPrev(1)-(nPrev.Cross(pRing->GetRPrev()*WheelAxle).Dot(i))*XparPrev(1) - RDB - RDL*RDLC; // projected sloped x-pos of the patch
1240 //16.08.2012 dXxProj = pcRingPrev(1)-(nPrev.Cross(pRing->GetRPrev()*WheelAxle).Dot(i))*XparPrev(1) - RDB; // projected sloped x-pos of the patch
1241 //16.08.2012 dXxProj = pcRingPrev(1)+(fwdRingPrev.Dot(i))*XparPrev(1) - RDB; // projected sloped x-pos of the patch
1242  dXxProj = dXxPrev - RDB; // projected sloped x-pos of the patch
1243 // dLsProj = -(nPrev.Cross(pRing->GetRPrev()*WheelAxle).Dot(i))*dLs;
1244  dLsProj = (fwdRingPrev.Dot(i))*dLs;
1245  doublereal dXxProjAhead = dXxProj+dLsProj;
1246  doublereal dXxProjBehind = dXxProj-dLsProj;
1247  dXxProj = CapLoop(dXxProj);
1248  dXxProjAhead = CapLoop(dXxProjAhead);
1249  dXxProjBehind = CapLoop(dXxProjBehind);
1250  dRoadAhead = pRoad->dGet(dXxProjAhead);
1251  dRoadBehind = pRoad->dGet(dXxProjBehind);
1252  }
1253  dRoad = (dRoadAhead+dRoadBehind)/2.; // road height in the absolute ref frame
1254 
1255  n = (Vec3(dLsProj*2,0,dRoadAhead-dRoadBehind)).Cross(WheelAxle); // reads road file and applies a two-point follower in order to get the normal...
1256  dn = n.Dot();
1257 // std::cerr << dn << " " << dXxPrev << std::endl; //TODO: check dRoad influence on patch position/ normal / why patch moves forward when encountering a bump?
1258  n /= sqrt(dn);
1259  if (fabs(n(3)) < std::numeric_limits<doublereal>::epsilon()) {
1260  silent_cerr("Wheel4(" << GetLabel() << "): "
1261  "a road segment is vertical, "
1262  "wheel4 cannot properly deal with such a road" << std::endl);
1264  }
1265  // ,variable normal direction
1266 
1267 
1269  if (dt_On)
1270  {
1271  doublereal dt_RDA = 0.5;
1272  if (dXxPrev >= RDB)
1273  {
1274  // std::cout << curTime << "LOOP\n";
1275 
1276  doublereal dDebug2; //TEMP TODO DELETE
1277  dDebug2 = -std::numeric_limits<doublereal>::max();
1278 
1279  // are those two really needed? yes only if the vertical oscillations of the wheels and all the other members movements have lower frequencies...
1280  //doublereal dtMaxWheel = 1/(ang vel wheel *2);
1281  // doublereal dtMaxRing =
1282 
1283  doublereal dt_distAhead = 0;
1284  for (int iCnt = 0; iCnt <= ceil(log(dt_maxstep/dt_minstep)/log(dt_maxF)); iCnt++)
1285  {
1286  dt_distAhead += (dXxProj-dXxProjPrev)/pow(dt_maxF,iCnt);
1287  }
1288  dt_numAhead = ceil(dt_distAhead/dt_Res);
1289  // std::cout << "dt: " << dt << " dt_distAhead: " << dt_distAhead << std::endl;
1290 
1291  dt_fNow = 1e-9; // initializing to the minimum value that the current timestep should be divided by
1292  // dLsProjRatio = -(nPrev.Cross(pRing->GetRPrev()*WheelAxle).Dot(i));
1293  for (int iCnt = 1; iCnt <= dt_numAhead; iCnt++) {
1294 
1295  doublereal dt_maxHeight = -std::numeric_limits<doublereal>::max();
1296  doublereal dt_minHeight = std::numeric_limits<doublereal>::max();
1297  doublereal dt_dXxProj_dLsNow = dXxProj+(iCnt-1)*dt_Res - 0.35*dR_0*dPls ; // Besselink, p. 131, half contact patch length never really goes above 0.35*dR_0
1298  while (dt_dXxProj_dLsNow <= 2*dXxProj-dXxProjPrev+iCnt*dt_Res + 0.35*dR_0*dPls)
1299  {
1300  dt_maxHeight = fmax( dt_maxHeight, pRoad->dGet(CapLoop(dt_dXxProj_dLsNow)) );
1301  dt_minHeight = fmin( dt_minHeight, pRoad->dGet(CapLoop(dt_dXxProj_dLsNow)) );
1302  dt_dXxProj_dLsNow += dt_Res;
1303  }
1304  // doublereal dt_stepHeight = dt_maxHeight - dt_minHeight;
1305  doublereal dt_stepHeight = fmax( dt_maxHeight - dt_minHeight ,1e-15);
1306 
1307  dt_adjFactor = dt_stepHeight/dt_maxH; // factor by which the current time step is too big for the bump to come in iCnt times the previous step distance
1308 
1309  dDebug2 = fmax( dDebug2, dt_adjFactor );
1310 
1311  // int dt_nStepsNow = fmax(0,ceil(log(dt_adjFactor)/log(dt_maxF))); // this float max could be an integer function instead
1312  int dt_nStepsNow = fmax(0,ceil(log(dt_maxstep/dt_minstep)/log(dt_maxF))); // this float max could be an integer function instead
1313  doublereal dt_distReqd = 0;
1314  // while (dt_distReqd < iCnt*dt_Res)
1315  // {
1316  for (int jCnt = 1; jCnt <= dt_nStepsNow; jCnt++)
1317  {
1318  dt_distReqd += (dXxProj-dXxProjPrev)/pow(dt_maxF,jCnt);
1319  }
1320  // }
1321  doublereal dt_fNowTmp; // "currently searched ahead position" adjustment factor (divider) wanted on timestep
1322  if (dt_distReqd <= dXxProjPrev+iCnt*dt_Res - 0.35*dR_0*dPls - dXxProj - (dXxProj-dXxProjPrev) && dt_adjFactor > 1.)
1323  {
1324  dt_fNowTmp = 1.;
1325  // std::cout << "if 1" << std::endl;
1326 
1327  } else if ( dt_adjFactor > 1.)
1328  {
1329  doublereal dt_stepInflRatio;
1330  for (int iCnt = 1; iCnt <= dt_numAhead; iCnt++) { // this loop checks if a smaller timestep guarantees a smaller bump
1331  dt_maxHeight = -std::numeric_limits<doublereal>::max();
1332  dt_minHeight = std::numeric_limits<doublereal>::max();
1333  dt_dXxProj_dLsNow = dXxProj+(iCnt-1)*dt_Res - 0.35*dR_0*dPls ; // Besselink, p. 131, half contact patch length never really goes above 0.35*dR_0
1334  while (dt_dXxProj_dLsNow <= dXxProj+(dXxProj-dXxProjPrev)/dt_adjFactor+iCnt*dt_Res + 0.35*dR_0*dPls)
1335  {
1336  dt_maxHeight = fmax( dt_maxHeight, pRoad->dGet(CapLoop(dt_dXxProj_dLsNow)) );
1337  dt_minHeight = fmin( dt_minHeight, pRoad->dGet(CapLoop(dt_dXxProj_dLsNow)) );
1338  dt_dXxProj_dLsNow += dt_Res;
1339  }
1340  dt_stepInflRatio = (dt_maxHeight - dt_minHeight)/dt_stepHeight; // this dt_stepHeight is the one calculated previously
1341  }
1342  if ( dt_stepInflRatio <= 1/dt_adjFactor )
1343  {
1344  dt_fNowTmp = fmin(pow(dt_adjFactor,1./dt_nStepsNow),dt_maxF);
1345  } else
1346  {
1347  dt_fNowTmp = dt_maxF;
1348  }
1349  // std::cout << "if 2" << std::endl;
1350  } else
1351  {
1352  dt_fNowTmp = fmax(dt_minF,dt_adjFactor);
1353 
1354  }
1355 
1356  // dt_fNowTmp = fmin(pow(dt_adjFactor,1./iCnt),dt_maxF); // allowing a maximum instant timestep change factor of dt_maxF
1357  dt_fNow = fmax(dt_fNow,dt_fNowTmp);
1358 
1359  }
1360  dDebug = dDebug2;
1361  }
1362  else if (dXxPrev <= dt_RDA) // dt_RDA: TOTO: make user input to control initially kept small timestep
1363  {
1364  doublereal dt_stepHeight = (pRoad->dGet(dXxProj)-dRoadInitial)*(XpaPrev(1)-XpaPrevPrev(1))/(RDB-RDA); // rough estimate of step height at each timestep for the initial buffer zone
1365  dt_adjFactor = fmax(dt_stepHeight/dt_maxH,1e-9); // factor by which the current time step is too big for the bump to come
1366  dt_fNow = fmin(dt_adjFactor,dt_maxF); // allowing a maximum instant timestep change factor of dt_maxF
1367  doublereal dt_RDAmin = 0.9999;
1368  dt_fNow = fmax(dt_fNow,dt_RDAmin); //
1369  // dt_fNow = 1;
1370  }
1371  else
1372  {
1373  doublereal dt_stepHeight = (pRoad->dGet(dXxProj)-dRoadInitial)*(XpaPrev(1)-XpaPrevPrev(1))/(RDB-RDA); // rough estimate of step height at each timestep for the initial buffer zone
1374  dt_adjFactor = fmax(dt_stepHeight/dt_maxH,1e-9); // factor by which the current time step is too big for the bump to come
1375  dt_fNow = fmin(dt_adjFactor,dt_maxF); // allowing a maximum instant timestep change factor of dt_maxF
1376  }
1377 
1378  if (dt_fNow < dt_minF) dt_fNow = dt_minF; // allow minimum factor by which to divide the current timestep to be dt_minF
1379 
1380 
1381  bool b_dtInc = 1; // if true the timestep is allowed to increase (if road profile also allows it)
1382  doublereal dt_divFT = dt_divF; // initializes the dividing factor for the force induced timestep change
1383 
1384  doublereal dt_minMag = 0.001;
1385  for (int iCnt = 1; iCnt <= 3; iCnt++) {
1386  for (int jCnt = 1; jCnt <dt_minStepsCycle; jCnt++) {
1387  FintSignCk[jCnt-1][iCnt-1] = FintSignCk[jCnt][iCnt-1];
1388  FintSignCk[jCnt-1][iCnt-1+3] = FintSignCk[jCnt][iCnt-1+3];
1389  }
1390  FintSignCk[dt_minStepsCycle-1][iCnt-1] = sign(FintPrev(iCnt)-FintPrevPrev(iCnt)); // sign check
1391  FintSignCk[dt_minStepsCycle-1][iCnt-1+3] = fabs(FintPrev(iCnt)-FintPrevPrev(iCnt)); // magnitude check
1392  int signChg = 0;
1393  for (int jCnt = 2; jCnt <dt_minStepsCycle; jCnt++) {
1394  if ( FintSignCk[jCnt-2][iCnt-1] != FintSignCk[jCnt-1][iCnt-1] && fabs( FintSignCk[jCnt-2][iCnt-1+3] - FintSignCk[jCnt-1][iCnt-1+3] ) >= dt_minMag ) {
1395  signChg++;
1396  }
1397  }
1398  if (signChg >=2) b_dtInc = 0;
1399  if (signChg ==3) dt_divFT = dt_divF3;
1400  if (signChg >=4) dt_divFT = dt_divF4;
1401  }
1402 
1403 
1404 
1405  if (b_dtInc)
1406  {
1407  dtMax = dt/dt_fNow;
1408  // std::cout << "step allowed to increase, time: " << curTime << std::endl;
1409  } else
1410  {
1411  dtMax = dt/fmax(dt_fNow,dt_divFT); // reduce timestep if force cycle is underresolved
1412 
1413 
1414 
1415 
1416 
1417  }
1418  }
1419  else
1420  {
1421  dtMax = 0;
1422  }
1423 
1425 
1426 
1427  }
1428  bFirstAP = false;
1429 
1430 
1431 // std::cerr << curTime << " " << dt;
1432 
1433 
1434  dKpa = pKpa->dGet();
1435  Kpatv = Kpa*dKpa; // time variant Kpa
1436  dCpa = pCpa->dGet();
1437  Cpatv = Cpa*dCpa;
1438 
1439 // std::cout << "dt: " << dt << " curTIme: " << curTime << " n: " << n << " oldTime: " << oldTime << "\n";
1440 
1441  // resize residual
1442  integer iNumRows = 0;
1443  integer iNumCols = 0;
1444  WorkSpaceDim(&iNumRows, &iNumCols);
1445  WorkVec.ResizeReset(iNumRows);
1446  // integer iWheelFirstMomIndex = pWheel->iGetFirstMomentumIndex();
1447  integer iRingFirstMomIndex = pRing->iGetFirstMomentumIndex();
1448  // equations indexes
1449  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1450 // WorkVec.PutRowIndex(10 + iCnt, iWheelFirstMomIndex + iCnt); //local, global indices
1451  WorkVec.PutRowIndex(4 + iCnt, iRingFirstMomIndex + iCnt);
1452  }
1453 
1454 
1455  integer iFirstIndex = iGetFirstIndex();
1456 
1457  for (int iCnt = 1; iCnt <= 4; iCnt++) {
1458  WorkVec.PutRowIndex(iCnt, iFirstIndex + iCnt);
1459  }
1460 
1461 
1462  if (firstRes)
1463  {
1464  firstRes = false;
1465  SetInitialValue(const_cast <VectorHandler&>(XCurr));
1466  }
1467 
1468  // in x dir,
1469  dVPx = XPrimeCurr(iFirstIndex + 1);
1470  dXPx = XPrimeCurr(iFirstIndex + 2);
1471  dVx = XCurr(iFirstIndex + 1);
1472  dXx = XCurr(iFirstIndex + 2);
1473  // in y dir,
1474  dVPy = XPrimeCurr(iFirstIndex + 3);
1475  dXPy = XPrimeCurr(iFirstIndex + 4);
1476  dVy = XCurr(iFirstIndex + 3);
1477  dXy = XCurr(iFirstIndex + 4);
1478 
1479 
1480  // "forward" direction: axle cross normal to ground
1481  fwd = (pWheel->GetRCurr()*WheelAxle).Cross(n);
1482  doublereal d = fwd.Dot();
1483  if (d < std::numeric_limits<doublereal>::epsilon()) {
1484  silent_cerr("Wheel4(" << GetLabel() << "): "
1485  "wheel axle is (nearly) orthogonal "
1486  "to the ground" << std::endl);
1488  }
1489  fwd /= sqrt(d);
1490 
1491  // "lateral" direction: normal to ground cross forward
1492  lat = n.Cross(fwd); // cross product
1493 
1494 
1495  fwdRing = (pRing->GetRCurr()*WheelAxle).Cross(n); // expresses local axle of the ring into global ref frame and then does cross prod with normal to get forward direction
1496  doublereal dRing = fwdRing.Dot();
1497  if (dRing < std::numeric_limits<doublereal>::epsilon()) {
1498  silent_cerr("Wheel4(" << GetLabel() << "): "
1499  "ring axle is (nearly) orthogonal "
1500  "to the ground" << std::endl);
1502  }
1503  fwdRing /= sqrt(dRing);
1504  // "lateral" direction: normal to ground cross forward
1505  latRing = n.Cross(fwdRing); // cross product
1506 
1507 
1508 
1509 
1510  Xring = pRing->GetXCurr(); // absolute pos of ring axle
1511 //29.08.2012 RingRad = latRing.Cross(fwdRing)*dR_0;// * (1 + fabs(VpcRing(1)*0.0001) ); // ring radius vector
1512  RingRad = -n*dR_0;// * (1 + fabs(VpcRing(1)*0.0001) ); // ring radius vector
1513 //16.08.2012 VpcRing = (RingRad - RingRadPrev)/dt;
1514 
1515  pcRing = Xring + RingRad; // accounts for ring camber; position of ring "contact" point (NOT patch contact point!) absolute ref frame
1516  // we assume the contact point lies at the root of the normal
1517  // to the ground that passes through the center of the wheel
1518 
1519 
1520  if (curTime == 0.0) // initializes velocity and positions but gets position in z from the road driver
1521  {
1522  Vpa = VpaPrev;
1523  Xpa = XpaPrev;
1524  } else {
1525 // Vpa = Vec3(dVx,dVy,(dRoad-dRoadPrev)/dt); // this method calculated the patch speed explicitly and was changed for the "more implicit" method below
1526  Vpa = Vec3(dVx,dVy,(n(1))/(n(3))*-dVx); // TODO: jacobian for Vpa(3) ?
1527 // std::cout << curTime << "WheelMod " << GetLabel() << "using dt: " << (dRoad-dRoadPrev)/dt << " dVx: " << dVx << " --- " << Vpa(3) << std::endl;
1528  Xpa = Vec3(dXx,dXy,dRoad);
1529  }
1530  Vec3 XparOld = Xpa - pcRing; // patch rel. to ring, expressed in ABS ref frame
1531  Xpar = Xpa - pcRing; // patch rel. to ring, expressed in ABS ref frame
1532 // Xpar = Xpa - Xring + k*dR_0; // trying new nov 16 2011
1533 
1534  Vpar = Vpa - pRing->GetVCurr();// - VpcRing;// + VpcRing * (dR_0-ddistM) * 8*16*16 / ( fabs( (-( pRing->GetWCurr()).Cross(distM)).Dot(fwd) ) + 0.01 );// + VpcRing*15;// - VpcRing; // absolute ref frame
1535 // std::cout << VpcRing << std::endl;
1536 
1537 
1538 
1539 // The following "Flat" direction vectors are used to properly model the ring rotation for the purpose of calculating spring elements forces btw ring and patch without actually rotating in the direction of slope which is accomplished by the projection of the forces acting on the ring, ie: Xpar(1) is the force in x of unrotated tire regardless of the slope
1540  fwdRingFlat = (pRing->GetRCurr()*WheelAxle).Cross(k); // expresses local axle of the ring into global ref frame and then does cross prod with normal to get forward direction
1541  doublereal dRingFlat = fwdRingFlat.Dot();
1542  if (dRingFlat < std::numeric_limits<doublereal>::epsilon()) {
1543  silent_cerr("Wheel4(" << GetLabel() << "): "
1544  "ringFlat axle is (nearly) orthogonal "
1545  "to the ground" << std::endl);
1547  }
1548  fwdRingFlat /= sqrt(dRingFlat);
1549  // "lateral" direction: normal to ground cross forward
1550  latRingFlat = k.Cross(fwdRingFlat); // cross product
1551 
1552 // here the absolute relative position and velocity of the patch are projected along the local components of the ring direction in order to calculate the forces using the proper spring and damper properties
1553  Xparp = Vec3(fwdRingFlat.Dot(Xpar),latRingFlat.Dot(Xpar),Xpar(3)); // projected relative displacement vector RING REF FRAME (but not with road slope)
1554 // Vec3 XparpOld = Vec3(fwdRingFlat.Dot(XparOld),latRingFlat.Dot(XparOld),XparOld(3)); // projected relative displacement vector RING REF FRAME (but not with road slope)
1555  Vparp = Vec3(fwdRingFlat.Dot(Vpar),latRingFlat.Dot(Vpar),Vpar(3)); // projected relative displacement vector RING REF FRAME (but not with road slope)
1556 
1557 
1558  // the "NEW" Xpar, gives the real dist in the absolute frame (because Xpar is absolute but considered in a rotated frame that rotates with the ring) (but not with road slope)
1559 
1560 
1561 
1562 // distM = RingRad+n*Xparp(3)-n.Cross(WheelAxle)*Xparp(1)+j*Xparp(2); // vector distance btwn ring center and patch // TODO: correct jacobian if needed
1563 // distM = (RingRad + Xparp ) * sqrt(VpcRing.Dot()) * (dR_0-ddistM)*3200/(-( pRing->GetWCurr()).Cross(distM)); // vector distance btwn ring center and patch // TODO: correct jacobian if needed
1564 //16.08.2012 distM = (RingRad + Xparp); // vector distance btwn ring center and patch // TODO: correct jacobian if needed
1565  distM = (RingRad + Xpar); // vector distance btwn ring center and patch // TODO: correct jacobian if needed
1566  ddistM = sqrt(distM.Dot());
1567 
1568  if (ddistM < std::numeric_limits<doublereal>::epsilon()) {
1569  silent_cerr("Wheel4(" << GetLabel() << "): "
1570  "distance between patch and ring center is (nearly) zero, adjust your elements or initial distance "
1571  << std::endl);
1573  }
1574 
1575 // centripetal tire force due to velocity
1576 // std::cout << "Private data 3 :" << pRingB->dGetPrivData(3) << std::endl;
1577  doublereal Fcent_r = rRatio*(pRingB->dGetPrivData(3)+Mpa)*pow(fwdRing.Dot(pRing->GetWCurr().Cross(n)),2)*dR_0; // m*V^2/R using ring radius and V about ring center
1578 // doublereal Fcent_p = Mpa*pow(fwdRing.Dot(pRing->GetWCurr().Cross(-distM)+Vpar),2)/ddistM; // using patch to ring radius and V of patch // REMOVED because patch does not rotate, it only represents the local linear movement of the contact zone...
1579 // dCt = (Fcent_r+Fcent_p)/Krz + Fcent_p/Kpatv(3); // desired radial growth // adjusted after removing Fcent_p
1580  dCt = Fcent_r/Krz; // desired radial growth
1581  Fcent = Kpatv(3)*dCt; // force to apply on ring and patch in opposite dirs
1582 
1583  Fint = Vec3(Xparp.EBEMult(Kpatv))+Vec3(Vparp.EBEMult(Cpatv)) + k*Fcent; // rotated in the ring reference frame (but not with road slope) //TODO: jacobian for Fcent
1584  Fint_old = Fint; // Fint_old is the local forces expressed in the ring ref frame
1585  // the "NEW" Fint, AKA Fnew,
1586 // simpler below // Fint = i*( (fwdRingFlat*Fint(1) + latRingFlat*Fint(2)).Dot(i) ) + j*( (fwdRingFlat*Fint(1) + latRingFlat*Fint(2)).Dot(j) ) + k*(Fint(3)); // rotated back into absolute ref frame
1587  Fint = fwdRingFlat*Fint(1) + latRingFlat*Fint(2) + k*(Fint(3)); // rotated back into absolute ref frame
1588  Fint_ring = n*(Fint(3))+j*(Fint(2))-(n.Cross(WheelAxle))*Fint(1); // artificial contact patch rotation due to the slope of the ground
1589 
1590  // relative speed between wheel axle and ground
1591  va = pWheel->GetVCurr(); // ground assumed fixed
1592 
1593  // disabled because wrongfully assumed that Vpa is in ring ref frame but it is in absolute... VparWheel = fwdRing*Vpa(1)+latRing*Vpa(2)-va; // absolute ref frame.. should be in wheel ref frame
1594 // VparWheel = Vpa-va; // distorded absolute ref frame..
1595 // Vec3 veloM = n*Vparp(3)-n.Cross(WheelAxle)*Vparp(1)+j*Vparp(2);
1596 // Vec3 veloM = n*Vparp(3)-n.Cross(WheelAxle)*Vparp(1)+j*Vparp(2);
1597  VparWheel = pRing->GetVCurr()-va+Vpar;//veloM; changed...! // relative velocity between wheel and patch taking consideration of the x-y flat rotation of forces (ie: Vy will be the velocity in local y-dir of ring, etc.)
1598 
1599 
1600 
1601  // TODO: JACOBIAN,
1602 
1603 
1604 
1605  dvx = fwd.Dot( -(pRing->GetWCurr()).Cross(distM) - VparWheel ); // relative speed between center of wheel and patch in the forward direction; using fwd for projection because we are concerned with the angular velocity of the wheel and slip in the wheel's longitudinal direction...
1606 // * (1 + fabs(VpcRing(1)*0.01) ) /// (1 + fabs(Vparp(1)*0.05) /// fmax(0,(1-fabs(VpcRing(1))/10)) /// * (1 + 3.15 * (1 - pContrib) ) - VparWheel * pContrib
1607  dvax = fwd.Dot(va); // Calculated on wheel but force applied to contact patch. // axle velocity in the forward direction
1608 
1609 
1610  // Fn has been corrected to ensure it is either positive or null because without contact there are no forces! (Although once the truck suspension is modeled contact should always be present, or almost. This is a weakness of having the road profile force directly on the patch and not having the possibility of the wheel flying a little!)
1611  Fn = Fint(3); // not further influenced by slope because patch is never actually rotated
1612  if (Fn < 0)
1613  {
1614  Fn = 0; // TODO: change derivatives in jacobian of Fn accordingly! (and what to do about discontinuity at zero?: should not be much of an issue because the MF forces will be almost null close to zero...)
1615  boolFn = 0; // using a different var name to clarify code in Jacobian
1616  }
1617  else
1618  {
1619  boolFn=1;
1620  }
1621 
1622  // lateral speed of wheel center
1623  dvay = lat.Dot(va);
1624  // wheel center drift angle
1625  // NOTE: getting the angle relative to the fwd axis to properly treat angles > pi/2
1626  dAlpha = atan2(dvay, fabs(dvax)); // assumes that camber is small (ie velocities taken at wheel center)
1627 
1628 
1629 
1630 // slip ratio, attention, the definition can vary (ie: here divided by wheel center velocity but often uses patch velocity instead) slip ratio is dependent on contact patch velocity (ie: transient slips)
1631  if (std::abs(dvax) < TRH)
1632  {
1633  dSr = (dvax - dvx)/fabs(dvax+copysign(TRHA, dvax)); // copysign is used to either add or subtract the threshold added value depending on the sign of dvax in order to preserve its sign and thus have a more precise value of the ratio at that point
1634 // dSr = (dvax - dvxr + Vpar(1))/std::abs(dvax+copysign(TRHA, dvax));
1635  }
1636  else
1637  {
1638  dSr = (dvax -dvx)/fabs(dvax); // here and above, a more "SWIFT" definition of the slip should include the term + Vpar(1) in the numerator BUT, it seems somewhat wrong because the slip measured by MF experimental tests reads wheel rotational velocity and the drum or moving belt velocity, which is actually vel between ground and wheel... The idea to have patch velocity is interesting but somewhat unclear... (Should it be patch vel w.r.t. wheel?
1639  }
1640  if (std::abs(dSr) >= TRHC)
1641  {
1642  dSr = copysign(TRHC, dSr);
1643  }
1644 // dSr = 1. / pow((fabs(VpcRing.Dot(fwd))+1),3) * dSr;
1645 // std::cout << VpcRing << std::endl;
1646 
1647  // longitudinal friction coefficient
1648  dMuX = pMuX0->dGet(dSr);
1649  F = -fwd*dMuX*Fn; // absolute ref frame, initializing vec. F, force is negative for a positive slip ratio dSr
1650  dMuY = pMuY0->dGet(dAlpha);
1651  // force correction
1652  F -= lat*dMuY*Fn; // absolute ref frame
1653  Fpatch = F-Fint; // oct10.2011_pm, changed back after thorough check
1654  // TODO: jacobian
1655 
1656 
1657  // in x dir,
1658  WorkVec.PutCoef(1, (Fpatch(1)-Mpa*dVPx)/Kpatv(1)); // Fpatch(x,v) applied in absolute frame because patch IS in absolute frame
1659  WorkVec.PutCoef(2, dVx - dXPx); // V = Xprime
1660  // in y dir,
1661  WorkVec.PutCoef(3, (Fpatch(2)-Mpa*dVPy)/Kpatv(2)); // Fpatch(x,v)
1662  WorkVec.PutCoef(4, dVy - dXPy); // V = Xprime
1663 
1664  // using patch pos to simulate the eff. radius
1665  dAlpha_t = tan(dAlpha) + S_ht;
1666  dAlpha_r = tan(dAlpha) + S_hf;
1667  tr = pTr->dGet(dAlpha_t)*Fn; // pneumatic trail
1668  M_zr = pMzr->dGet(dAlpha_r)*Fn; // residual torque
1669 
1670 
1671  Fr = fwdRing*Fn*(q_sy1 + q_sy3*abs(dvax/dvao))*copysign(1,fwd.Dot(pWheel->GetWCurr().Cross(k))/dvax); // rolling resistance force, force change with velocity and standing waves portion are ignored, as in Pac2006, see swift params=0, note that Fr is considered to work in the direction of the ring because this is where most of the deformations occur, although there is pneumatic damping that will be in a direction between wheel and ring directions...
1672  //TODO: adjust JACOBIAN! for Fr
1673 
1674  Mz = n*( -tr*Fint_old(2) + M_zr ); // TODO update jacobian because (if was then updated) was using Fint_ring(2) (now using Fint_old because it is local)
1675  if (bLoadedRadius)
1676  {
1677  M = distM.Cross(Fint_ring+Fr) + Mz; // self-aligning torque is applied in the z-direction of the patch on the ring reference frame, thus in the n dir.
1678  }
1679  else
1680  {
1681  CalculateR_e();
1682 // std::cout << "Wheel: " << GetLabel() << "Re: " << R_e << " -latRing*(R_e - ddistM)*Fint_ring.Dot(fwdRing): " << -latRing*(R_e - ddistM)*Fint_ring.Dot(fwdRing) << std::endl;
1683  M = distM.Cross(Fint_ring+Fr) - latRing*(R_e - ddistM)*Fint_ring.Dot(fwdRing) + Mz; // (with brake lever arm adjusted for Fx [see pac2006 p. 469, eq. 9.236])
1684  }
1685  // moment assuming that the patch is always at the proper angular position, in 3D, because it has no inertia.
1686 
1687  WorkVec.Add(5, Fint_ring); // on ring
1688  WorkVec.Add(8, M); // on ring
1689 
1690 
1691 
1692 
1693  return WorkVec;
1694 }
doublereal dt_minF
doublereal dvax
doublereal TRHA
doublereal dt_maxstep
bool bLoadedRadius
Definition: module-wheel4.h:79
doublereal dt
Vec3 VpcRingPrev
doublereal dt_Res
doublereal dEffRad
Vec3 Xpar
doublereal tr
Vec3 fwdRingPrev
doublereal dn
Vec3 XparpPrev
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
doublereal dVPy
Definition: module-wheel4.h:52
doublereal TRH
GradientExpression< BinaryExpr< FuncPow, LhsExpr, RhsExpr > > pow(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
Definition: gradient.h:2961
doublereal q_sy1
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
Vec3 RingRad
doublereal dAlpha_r
Vec3 XparPrevPrev
doublereal TdLs
doublereal dXy
Definition: module-wheel4.h:52
Vec3 XpaPrevPrev
virtual void ResizeReset(integer)
Definition: vh.cc:55
Vec3 nPrev
doublereal dRoadPrev
Vec3 Vparp
doublereal deltaPrev
doublereal dRoadAhead
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
doublereal dLsProj
Vec3 VpcRing
DriveOwner tdc
doublereal Dot(const Vec3 &v) const
Definition: matvec3.h:243
doublereal dMuX
doublereal q_sy3
doublereal Fcent
Vec3 VparWheel
DriveCaller * pRoad
Definition: module-wheel4.h:99
bool bFirstAP
Vec3 Xparp
doublereal ddistM
Vec3 XparPrev
Vec3 pcRingPrev
doublereal dt_maxH
Vec3 latRing
doublereal RDL
Vec3 fwd
Vec3 FintPrevPrev
Vec3 Cpatv
Definition: module-wheel4.h:96
DriveCaller * pMzr
Definition: module-wheel4.h:83
doublereal dVPx
Definition: module-wheel4.h:52
Vec3 Fpatch
doublereal dtMax
doublereal dt_divF4
DriveCaller * pMuY0
Definition: module-wheel4.h:81
Vec3 EBEMult(const Vec3 &v) const
Definition: matvec3.h:227
doublereal dLsProjPrev
doublereal dt_divF
doublereal dR_a1
Vec3 XparpPrevPrev
doublereal Krz
Definition: module-wheel4.h:88
doublereal dXx
Definition: module-wheel4.h:52
bool boolFn
Vec3 VpcRingPrevPrev
Vec3 VpaPrev
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
Definition: gradient.h:2973
doublereal R_e
doublereal dVx
Definition: module-wheel4.h:52
Vec3 Fint_old
doublereal curTime
doublereal dSr
Vec3 Kpatv
Definition: module-wheel4.h:93
doublereal dMuY
Vec3 Kpa
doublereal dLs
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
Vec3 lat
doublereal dCt
doublereal dVy
Definition: module-wheel4.h:52
doublereal dRoad
Vec3 Vpa
bool bFirstAC
doublereal dt_divF3
doublereal oldTime
doublereal dXxProjPrev
doublereal dt_adjFactor
GradientExpression< UnaryExpr< FuncLog, Expr > > log(const GradientExpression< Expr > &u)
Definition: gradient.h:2976
bool firstRes
Vec3 Cpa
doublereal dKpa
Definition: module-wheel4.h:92
doublereal dXPy
Definition: module-wheel4.h:52
doublereal TRHC
doublereal copysign(doublereal x, doublereal y)
Definition: gradient.h:97
Vec3 Xring
Vec3 distM
doublereal dRoadBehind
doublereal dAlpha_t
Vec3 RingRadPrev
doublereal dCpa
Definition: module-wheel4.h:95
doublereal S_hf
void CalculateR_e()
std::vector< std::vector< int > > FintSignCk
doublereal M_zr
virtual integer iGetFirstMomentumIndex(void) const =0
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
doublereal dvao
doublereal Fn
int sign(const doublereal x)
doublereal CapLoop(doublereal Xuncapped) const
doublereal dRoadInitial
Vec3 pcRing
DriveCaller * pMuX0
Definition: module-wheel4.h:80
doublereal dXxPrev
int dt_numAhead
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
VectorExpression< VectorCrossExpr< VectorLhsExpr, VectorRhsExpr >, 3 > Cross(const VectorExpression< VectorLhsExpr, 3 > &u, const VectorExpression< VectorRhsExpr, 3 > &v)
Definition: matvec.h:3248
doublereal rRatio
Definition: module-wheel4.h:87
Vec3 fwdRingFlat
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
bool dt_On
doublereal dt_fNow
virtual doublereal dGetPrivData(unsigned int i) const
Definition: simentity.cc:149
virtual doublereal dGet(const doublereal &dVar) const =0
Vec3 WheelAxle
Definition: module-wheel4.h:70
doublereal dPls
doublereal RDB
doublereal dDebug
doublereal dR_0
StructNode * pRing
Definition: module-wheel4.h:62
doublereal dGet(const doublereal &dVar) const
Definition: drive.cc:664
Elem * pRingB
Definition: module-wheel4.h:63
doublereal dAlpha
Vec3 Vpar
doublereal dXxProj
Vec3 Fint_ring
doublereal dt_maxF
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
Vec3 latRingFlat
DriveCaller * pKpa
Definition: module-wheel4.h:91
doublereal Mpa
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
doublereal dXPx
Definition: module-wheel4.h:52
GradientExpression< BinaryExpr< FuncAtan2, LhsExpr, RhsExpr > > atan2(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
Definition: gradient.h:2962
Vec3 Xpa
double doublereal
Definition: colamd.c:52
doublereal dvx
virtual void SetInitialValue(VectorHandler &XCurr)
int dt_minStepsCycle
long int integer
Definition: colamd.c:51
doublereal dvay
GradientExpression< UnaryExpr< FuncTan, Expr > > tan(const GradientExpression< Expr > &u)
Definition: gradient.h:2979
unsigned int GetLabel(void) const
Definition: withlab.cc:62
Vec3 FintPrev
Vec3 fwdRing
Vec3 Fint
doublereal dt_minstep
DriveCaller * pTr
Definition: module-wheel4.h:82
Vec3 XpaPrev
doublereal dRoadPrevPrev
doublereal RDA
doublereal dR_a2
StructNode * pWheel
Definition: module-wheel4.h:57
doublereal S_ht
DriveCaller * pCpa
Definition: module-wheel4.h:94

Here is the call graph for this function:

void Wheel4::CalculateR_e ( )

Definition at line 1722 of file module-wheel4.cc.

References copysign(), Vec3::Cross(), Vec3::Dot(), dR_0, dvx, grad::fabs(), fwd, StructNode::GetWCurr(), lat, pWheel, R_e, TdR_e, and TdReDiv.

Referenced by AfterConvergence(), and AssRes().

1723 {
1724  doublereal R_e_divider = fwd.Dot(pWheel->GetWCurr().Cross(-lat.Cross(fwd)));
1725  if (fabs(R_e_divider) < TdReDiv)
1726  {
1727  R_e = dvx/copysign(TdReDiv,R_e_divider); // calculates the virtual R_e (effective radius) by equating the slip ratio formula to a formula like dSr = (dvax - WheelW*R_e) / dvax
1728  }
1729  else
1730  {
1731  R_e = dvx/R_e_divider; // calculates the virtual R_e (effective radius) by equating the slip ratio formula to a formula like dSr = (dvax - WheelW*R_e) / dvax
1732  }
1733  if ( fabs(R_e) > TdR_e * dR_0 ) R_e = copysign(TdR_e,R_e);
1734 }
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
doublereal TdR_e
doublereal Dot(const Vec3 &v) const
Definition: matvec3.h:243
Vec3 fwd
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
Definition: gradient.h:2973
doublereal R_e
Vec3 lat
doublereal TdReDiv
doublereal copysign(doublereal x, doublereal y)
Definition: gradient.h:97
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
doublereal dR_0
double doublereal
Definition: colamd.c:52
doublereal dvx
StructNode * pWheel
Definition: module-wheel4.h:57

Here is the call graph for this function:

doublereal Wheel4::CapLoop ( doublereal  Xuncapped) const

Definition at line 1737 of file module-wheel4.cc.

References RDL.

Referenced by AssRes().

1738 {
1739  while (Xuncapped > RDL) Xuncapped-=RDL;
1740  return Xuncapped;
1741 }
doublereal RDL
doublereal Wheel4::dGetPrivData ( unsigned int  i) const
virtual

Reimplemented from SimulationEntity.

Definition at line 1777 of file module-wheel4.cc.

References ASSERT, dtMax, and iGetNumPrivData().

1778 {
1779  ASSERT(i >= 1 && i <= iGetNumPrivData());
1780  return dtMax; // this should return the maximum timestep that this wheel is able to take (to be fed into the strategy:change cirective in the MBDyn input file)
1781 }
doublereal dtMax
unsigned int iGetNumPrivData(void) const
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

void Wheel4::GetConnectedNodes ( std::vector< const Node * > &  connectedNodes) const
virtual

Reimplemented from Elem.

Definition at line 1792 of file module-wheel4.cc.

References pRing, and pWheel.

1793 {
1794  // wheel + ring
1795  connectedNodes.resize(2);
1796 
1797  connectedNodes[0] = pWheel;
1798  connectedNodes[1] = pRing;
1799 }
StructNode * pRing
Definition: module-wheel4.h:62
StructNode * pWheel
Definition: module-wheel4.h:57
DofOrder::Order Wheel4::GetDofType ( unsigned int  i) const
virtual

Reimplemented from Elem.

Definition at line 1821 of file module-wheel4.cc.

References DofOrder::DIFFERENTIAL.

1822 {
1823  return DofOrder::DIFFERENTIAL;
1824 }
DofOrder::Order Wheel4::GetEqType ( unsigned int  i) const
virtual

Reimplemented from SimulationEntity.

Definition at line 1827 of file module-wheel4.cc.

References DofOrder::DIFFERENTIAL.

1828 {
1829  return DofOrder::DIFFERENTIAL;
1830 }
unsigned Wheel4::iGetInitialNumDof ( void  ) const
virtual

Implements SubjectToInitialAssembly.

Definition at line 1833 of file module-wheel4.cc.

1834 {
1835  return 0;
1836 }
int Wheel4::iGetNumConnectedNodes ( void  ) const

Definition at line 1785 of file module-wheel4.cc.

1786 {
1787  // wheel + ring
1788  return 2;
1789 }
unsigned int Wheel4::iGetNumDof ( void  ) const
virtual

Reimplemented from Elem.

Definition at line 1816 of file module-wheel4.cc.

1817 {
1818  return 4;
1819 }
unsigned int Wheel4::iGetNumPrivData ( void  ) const
virtual

Reimplemented from SimulationEntity.

Definition at line 1762 of file module-wheel4.cc.

Referenced by dGetPrivData().

1763 {
1764  return 1;
1765 }
unsigned int Wheel4::iGetPrivDataIdx ( const char *  s) const
virtual

Reimplemented from SimulationEntity.

Definition at line 1768 of file module-wheel4.cc.

References ASSERT.

1769 {
1770  ASSERT(s != NULL);
1771 
1772 // only using one option for now... to set timestep
1773  return 1;
1774 }
#define ASSERT(expression)
Definition: colamd.c:977
VariableSubMatrixHandler & Wheel4::InitialAssJac ( VariableSubMatrixHandler WorkMat,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 1846 of file module-wheel4.cc.

References ASSERT, and VariableSubMatrixHandler::SetNullMatrix().

1848 {
1849  // should not be called, since initial workspace is empty
1850  ASSERT(0);
1851 
1852  WorkMat.SetNullMatrix();
1853  return WorkMat;
1854 }
void SetNullMatrix(void)
Definition: submat.h:1159
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

SubVectorHandler & Wheel4::InitialAssRes ( SubVectorHandler WorkVec,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 1857 of file module-wheel4.cc.

References ASSERT, and VectorHandler::Resize().

1858 {
1859 
1860  // should not be called, since initial workspace is empty
1861  ASSERT(0);
1862 
1863  WorkVec.Resize(0);
1864  return WorkVec;
1865 }
#define ASSERT(expression)
Definition: colamd.c:977
virtual void Resize(integer iNewSize)=0

Here is the call graph for this function:

void Wheel4::InitialWorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
virtual

Implements SubjectToInitialAssembly.

Definition at line 1839 of file module-wheel4.cc.

1840 {
1841  *piNumRows = 0;
1842  *piNumCols = 0;
1843 }
void Wheel4::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 582 of file module-wheel4.cc.

References ToBeOutput::bToBeOutput(), dAlpha, dCt, dDebug, ddistM, distM, dLs, dMuX, dMuY, dRoad, dRoadAhead, dRoadBehind, dRoadPrev, dSa, dSr, dt, dvax, dvay, dvx, dXxProj, E, F, Fcent, Fint, Fint_ring, Fn, Fr, fwd, fwdRing, fwdRingFlat, OutputHandler::GetCurrentStep(), WithLabel::GetLabel(), KE, OutputHandler::LOADABLE, OutputHandler::Loadable(), M, M_PI, Mz, n, pcRing, PE, Vec3::pGetVec(), R_e, OutputHandler::UseNetCDF(), OutputHandler::UseText(), Vpa, Vpar, VparWheel, Xpa, Xpar, and Xparp.

583 {
584  if (bToBeOutput()) {
585 
586 #ifdef USE_NETCDF
588  Var_Fint->put_rec(Fint.pGetVec(), OH.GetCurrentStep());
589  Var_Xpar->put_rec(Xpar.pGetVec(), OH.GetCurrentStep());
590  Var_Xparp->put_rec(Xparp.pGetVec(), OH.GetCurrentStep());
591  Var_dXxProj->put_rec(&dXxProj, OH.GetCurrentStep());
592  Var_dRoad->put_rec(&dRoad, OH.GetCurrentStep());
593  Var_F->put_rec(F.pGetVec(), OH.GetCurrentStep());
594  Var_Fn->put_rec(&Fn, OH.GetCurrentStep());
595  Var_debug->put_rec(&dDebug, OH.GetCurrentStep());
596  Var_dSr->put_rec((&dSr), OH.GetCurrentStep());
597  Var_ddistM->put_rec((&ddistM), OH.GetCurrentStep());
598  Var_Fcent->put_rec((&Fcent), OH.GetCurrentStep());
599  Var_dLs->put_rec((&dLs), OH.GetCurrentStep());
600  Var_R_e->put_rec((&R_e), OH.GetCurrentStep());
601  Var_dSa->put_rec((&dSa), OH.GetCurrentStep());
602  Var_dvax->put_rec((&dvax), OH.GetCurrentStep());
603  Var_dvx->put_rec((&dvx), OH.GetCurrentStep());
604  Var_dvay->put_rec((&dvay), OH.GetCurrentStep());
605  Var_dMuY->put_rec((&dMuY), OH.GetCurrentStep());
606  Var_dMuX->put_rec((&dMuX), OH.GetCurrentStep());
607  Var_KE->put_rec((&KE), OH.GetCurrentStep());
608  Var_PE->put_rec((&PE), OH.GetCurrentStep());
609  Var_E->put_rec((&E), OH.GetCurrentStep());
610  Var_dRoadAhead->put_rec((&dRoadAhead), OH.GetCurrentStep());
611  Var_dRoadBehind->put_rec((&dRoadBehind), OH.GetCurrentStep());
612  Var_dCt->put_rec((&dCt), OH.GetCurrentStep());
613  Var_M->put_rec((M.pGetVec()), OH.GetCurrentStep());
614  Var_distM->put_rec((distM.pGetVec()), OH.GetCurrentStep());
615  Var_n->put_rec((n.pGetVec()), OH.GetCurrentStep());
616  Var_Xpa->put_rec((Xpa.pGetVec()), OH.GetCurrentStep());
617  Var_Vpa->put_rec((Vpa.pGetVec()), OH.GetCurrentStep());
618  Var_Vpar->put_rec((Vpar.pGetVec()), OH.GetCurrentStep());
619  Var_fwd->put_rec((fwd.pGetVec()), OH.GetCurrentStep());
620  Var_fwdRing->put_rec((fwdRing.pGetVec()), OH.GetCurrentStep());
621  Var_fwdRingFlat->put_rec((fwdRingFlat.pGetVec()), OH.GetCurrentStep());
622  Var_pcRing->put_rec((pcRing.pGetVec()), OH.GetCurrentStep());
623  Var_VparWheel->put_rec((VparWheel.pGetVec()), OH.GetCurrentStep());
624  Var_Fr->put_rec((Fr.pGetVec()), OH.GetCurrentStep());
625  Var_Mz->put_rec((Mz.pGetVec()), OH.GetCurrentStep());
626 
627  }
628 #endif /* USE_NETCDF */
629 
631 
632  std::ostream& out = OH.Loadable();
633 
634 
635 
636  out << std::setw(8) << GetLabel() // 1: label
637  << " " << dvax // 2: velocity of wheel in x-dir
638  << " " << dvay // 3: velocity of wheel in y-dir
639  << " " << dvx // 4: relative speed between center of wheel and contact point on tire in the forward direction
640  << " " << M // 5-7: moment
641  << " " << distM // 8-10: moment arm on ring
642  << " " << dSr // 11: slip ratio
643  << " " << 180./M_PI*dAlpha // 12: slip angle
644  << " " << dMuX // 13: longitudinal friction coefficient
645  << " " << dMuY // 14: lateral friction coefficient
646  << " " << dRoad // 15: road height
647  << " " << n // 16-18: road normal
648  << " " << Xpa // 19-21: pos of patch
649  << " " << Vpa // 22-24: vel of patch
650  << " " << Xpar // 25-27: rel pos of patch
651  << " " << Vpar // 28-30: rel vel of patch
652  << " " << -Fint // 31-33: force btwn ring and patch acting on patch
653  << " " << Fint_ring // 34-36: force btwn ring and patch acting on ring
654  << " " << fwd // 37-39: forward direction vector of the wheel
655  << " " << fwdRing // 40-42: forward direction vector of the ring
656  << " " << fwdRingFlat // 43-45: forward direction vector of the ring without the slope of the profile
657  << " " << pcRing // 46-48: point of contact on ring between ring and springs
658  << " " << Fn // 49: normal force for Pacejka's formulae
659  << " " << VparWheel // 50-52: relative vel btwn patch and wheel
660  << " " << KE // 53: wheel+ring+patch kin energy
661  << " " << PE // 54: wheel+ring pot energy (patch is not subject to gravity)
662  << " " << E // 55: wheel+ring+patch tot energy
663  << " " << R_e // 56: virtually calculated effective rolling radius
664  << " " << dLs // 57: half length of the tandem elliptical cam follower
665  << " " << ddistM // 58: home made loaded radius (distance between ring center and patch center)
666  << " " << Xparp // 59-61: distance between ring contact point and patch as seen from the ring in its own reference frame (not rotated with road slope)
667  << " " << Fcent // 62: Fcent, centrifugal force added to tire
668  << " " << Fr // 63-65: Rolling resistance force vector (only applied as a moment)
669  << " " << Mz // 66-68: Aligning moment
670  << " " << dXxProj // 69: center point x-value of the road profile (this is not actual position, but only position on the input road file
671  << " " << dRoadAhead // 70: front edge x-point of the tandem
672  << " " << dRoadBehind // 71: rear edge x-point of the tandem
673  << " " << dCt // 72: centrifugally induced virtual displacement of tire in the radial direction
674  << " " << (dRoad-dRoadPrev)/dt // 73 road-timestep calculated vertical velocity
675  << " " << dt; // 74 timestep
676 
677  out << std::endl;
678  }
679  }
680 }
doublereal dvax
doublereal dt
Vec3 Xpar
#define M_PI
Definition: gradienttest.cc:67
virtual bool bToBeOutput(void) const
Definition: output.cc:890
bool UseNetCDF(int out) const
Definition: output.cc:491
doublereal dRoadPrev
doublereal dRoadAhead
doublereal dMuX
doublereal dSa
doublereal Fcent
Vec3 VparWheel
Vec3 Xparp
doublereal ddistM
Vec3 fwd
doublereal R_e
doublereal dSr
doublereal dMuY
doublereal dLs
doublereal dCt
doublereal KE
doublereal dRoad
Vec3 Vpa
std::ostream & Loadable(void) const
Definition: output.h:506
long GetCurrentStep(void) const
Definition: output.h:116
Vec3 distM
doublereal dRoadBehind
doublereal Fn
Vec3 pcRing
doublereal E
Vec3 fwdRingFlat
doublereal PE
doublereal dDebug
const doublereal * pGetVec(void) const
Definition: matvec3.h:192
doublereal dAlpha
Vec3 Vpar
doublereal dXxProj
Vec3 Fint_ring
Vec3 Xpa
doublereal dvx
doublereal dvay
unsigned int GetLabel(void) const
Definition: withlab.cc:62
Vec3 fwdRing
Vec3 Fint
bool UseText(int out) const
Definition: output.cc:446

Here is the call graph for this function:

void Wheel4::OutputPrepare ( OutputHandler OH)
virtual

Reimplemented from ToBeOutput.

Definition at line 252 of file module-wheel4.cc.

References ASSERT, ToBeOutput::bToBeOutput(), buf, WithLabel::GetLabel(), OutputHandler::IsOpen(), OutputHandler::LOADABLE, MBDYN_EXCEPT_ARGS, OutputHandler::NETCDF, STRLENOF, and OutputHandler::UseNetCDF().

253 {
254  if (bToBeOutput()) {
255 #ifdef USE_NETCDF
258 
259  /* get a pointer to binary NetCDF file
260  * --> pDM->OutHdl.BinFile */
261  NcFile *pBinFile = OH.pGetBinFile();
262  char buf[BUFSIZ];
263 
264  int l = snprintf(buf, sizeof(buf), "loadable.wheel4.%lu",
265  (unsigned long)GetLabel());
266  if (l < 0 || l >= int(sizeof(buf) - STRLENOF(".dXxProj"))) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
267 
268 
269  // add var name separator
270  buf[l++] = '.';
271 
272  /* Add NetCDF (output) variables to the BinFile object
273  * and save the NcVar* pointer returned from add_var
274  * as handle for later write accesses.
275  * Define also variable attributes */
276 
277  strcpy(&buf[l], "Fint");
278  Var_Fint = pBinFile->add_var(buf, ncDouble,
279  OH.DimTime(), OH.DimV3());
280  if (Var_Fint == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
281  if (!Var_Fint->add_att("units", "N")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
282  if (!Var_Fint->add_att("type", "Vec3")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
283  if (!Var_Fint->add_att("description", "force btwn ring and patch acting on patch (X, Y, Z)")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
284 
285  strcpy(&buf[l], "Xpar");
286  Var_Xpar = pBinFile->add_var(buf, ncDouble,
287  OH.DimTime(), OH.DimV3());
288  if (Var_Xpar == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
289  if (!Var_Xpar->add_att("units", "m")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
290  if (!Var_Xpar->add_att("type", "Vec3")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
291  if (!Var_Xpar->add_att("description", "rel pos of patch (X, Y, Z)")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
292 
293  strcpy(&buf[l], "Xparp");
294  Var_Xparp = pBinFile->add_var(buf, ncDouble,
295  OH.DimTime(), OH.DimV3());
296  if (Var_Xparp == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
297  if (!Var_Xparp->add_att("units", "m")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
298  if (!Var_Xparp->add_att("type", "Vec3")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
299  if (!Var_Xparp->add_att("description", "rel pos of patch expressed in the ring non-rotating reference frame (X, Y, Z)")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
300 
301 
302  strcpy(&buf[l], "dXxProj");
303  Var_dXxProj = pBinFile->add_var(buf, ncDouble,
304  OH.DimTime(), OH.DimV1());
305  if (Var_dXxProj == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
306  if (!Var_dXxProj->add_att("units", "m")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
307  if (!Var_dXxProj->add_att("type", "doublereal")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
308  if (!Var_dXxProj->add_att("description", "patch center point x-value of the road profile (attention: this is not the same thing as the patch position")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
309 
310 // NetCDFPrepare(OutputHandler OH, char buf);
311 
312  strcpy(&buf[l], "dRoad");
313  Var_dRoad = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV1());
314  if (Var_dRoad == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
315  if (!Var_dRoad->add_att("units", "m")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
316  if (!Var_dRoad->add_att("type", "doublereal")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
317  if (!Var_dRoad->add_att("description", "road height")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
318 
319  strcpy(&buf[l], "F");
320  Var_F = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV3());
321  if (Var_F == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
322  if (!Var_F->add_att("units", "N")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
323  if (!Var_F->add_att("type", "Vec3")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
324  if (!Var_F->add_att("description", "Road-patch friction force expressed in absolute reference frame")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
325 
326  strcpy(&buf[l], "Fn");
327  Var_Fn = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV1());
328  if (Var_Fn == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
329  if (!Var_Fn->add_att("units", "N")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
330  if (!Var_Fn->add_att("type", "doublereal")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
331  if (!Var_Fn->add_att("description", "Normal force at the patch")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
332 
333  strcpy(&buf[l], "debug");
334  Var_debug = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV1());
335  if (Var_debug == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
336  if (!Var_debug->add_att("units", "x")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
337  if (!Var_debug->add_att("type", "doublereal")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
338  if (!Var_debug->add_att("description", "Debugging variable")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
339 
340  strcpy(&buf[l], "dSr");
341  Var_dSr = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV1());
342  if (Var_dSr == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
343  if (!Var_dSr->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
344  if (!Var_dSr->add_att("type", "doublereal")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
345  if (!Var_dSr->add_att("description", "dSr")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
346 
347  strcpy(&buf[l], "ddistM");
348  Var_ddistM = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV1());
349  if (Var_ddistM == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
350  if (!Var_ddistM->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
351  if (!Var_ddistM->add_att("type", "doublereal")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
352  if (!Var_ddistM->add_att("description", "ddistM")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
353 
354  strcpy(&buf[l], "Fcent");
355  Var_Fcent = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV1());
356  if (Var_Fcent == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
357  if (!Var_Fcent->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
358  if (!Var_Fcent->add_att("type", "doublereal")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
359  if (!Var_Fcent->add_att("description", "Fcent")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
360 
361  strcpy(&buf[l], "dLs");
362  Var_dLs = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV1());
363  if (Var_dLs == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
364  if (!Var_dLs->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
365  if (!Var_dLs->add_att("type", "doublereal")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
366  if (!Var_dLs->add_att("description", "dLs")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
367 
368  strcpy(&buf[l], "R_e");
369  Var_R_e = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV1());
370  if (Var_R_e == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
371  if (!Var_R_e->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
372  if (!Var_R_e->add_att("type", "doublereal")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
373  if (!Var_R_e->add_att("description", "R_e")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
374 
375  strcpy(&buf[l], "dSa");
376  Var_dSa = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV1());
377  if (Var_dSa == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
378  if (!Var_dSa->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
379  if (!Var_dSa->add_att("type", "doublereal")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
380  if (!Var_dSa->add_att("description", "dSa")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
381 
382  strcpy(&buf[l], "dvax");
383  Var_dvax = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV1());
384  if (Var_dvax == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
385  if (!Var_dvax->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
386  if (!Var_dvax->add_att("type", "doublereal")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
387  if (!Var_dvax->add_att("description", "dvax")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
388 
389  strcpy(&buf[l], "dvx");
390  Var_dvx = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV1());
391  if (Var_dvx == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
392  if (!Var_dvx->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
393  if (!Var_dvx->add_att("type", "doublereal")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
394  if (!Var_dvx->add_att("description", "dvx")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
395 
396  strcpy(&buf[l], "dvay");
397  Var_dvay = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV1());
398  if (Var_dvay == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
399  if (!Var_dvay->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
400  if (!Var_dvay->add_att("type", "doublereal")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
401  if (!Var_dvay->add_att("description", "dvay")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
402 
403  strcpy(&buf[l], "dMuY");
404  Var_dMuY = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV1());
405  if (Var_dMuY == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
406  if (!Var_dMuY->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
407  if (!Var_dMuY->add_att("type", "doublereal")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
408  if (!Var_dMuY->add_att("description", "dMuY")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
409 
410  strcpy(&buf[l], "dMuX");
411  Var_dMuX = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV1());
412  if (Var_dMuX == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
413  if (!Var_dMuX->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
414  if (!Var_dMuX->add_att("type", "doublereal")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
415  if (!Var_dMuX->add_att("description", "dMuX")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
416 
417  strcpy(&buf[l], "KE");
418  Var_KE = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV1());
419  if (Var_KE == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
420  if (!Var_KE->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
421  if (!Var_KE->add_att("type", "doublereal")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
422  if (!Var_KE->add_att("description", "KE")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
423 
424  strcpy(&buf[l], "PE");
425  Var_PE = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV1());
426  if (Var_PE == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
427  if (!Var_PE->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
428  if (!Var_PE->add_att("type", "doublereal")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
429  if (!Var_PE->add_att("description", "PE")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
430 
431  strcpy(&buf[l], "E");
432  Var_E = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV1());
433  if (Var_E == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
434  if (!Var_E->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
435  if (!Var_E->add_att("type", "doublereal")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
436  if (!Var_E->add_att("description", "E")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
437 
438  strcpy(&buf[l], "dRoadAhead");
439  Var_dRoadAhead = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV1());
440  if (Var_dRoadAhead == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
441  if (!Var_dRoadAhead->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
442  if (!Var_dRoadAhead->add_att("type", "doublereal")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
443  if (!Var_dRoadAhead->add_att("description", "dRoadAhead")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
444 
445  strcpy(&buf[l], "dRoadBehind");
446  Var_dRoadBehind = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV1());
447  if (Var_dRoadBehind == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
448  if (!Var_dRoadBehind->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
449  if (!Var_dRoadBehind->add_att("type", "doublereal")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
450  if (!Var_dRoadBehind->add_att("description", "dRoadBehind")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
451 
452  strcpy(&buf[l], "dCt");
453  Var_dCt = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV1());
454  if (Var_dCt == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
455  if (!Var_dCt->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
456  if (!Var_dCt->add_att("type", "doublereal")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
457  if (!Var_dCt->add_att("description", "dCt")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
458 
459  strcpy(&buf[l], "M");
460  Var_M = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV3());
461  if (Var_M == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
462  if (!Var_M->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
463  if (!Var_M->add_att("type", "Vec3")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
464  if (!Var_M->add_att("description", "M")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
465 
466  strcpy(&buf[l], "distM");
467  Var_distM = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV3());
468  if (Var_distM == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
469  if (!Var_distM->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
470  if (!Var_distM->add_att("type", "Vec3")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
471  if (!Var_distM->add_att("description", "distM")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
472 
473  strcpy(&buf[l], "n");
474  Var_n = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV3());
475  if (Var_n == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
476  if (!Var_n->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
477  if (!Var_n->add_att("type", "Vec3")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
478  if (!Var_n->add_att("description", "n")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
479 
480  strcpy(&buf[l], "Xpa");
481  Var_Xpa = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV3());
482  if (Var_Xpa == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
483  if (!Var_Xpa->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
484  if (!Var_Xpa->add_att("type", "Vec3")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
485  if (!Var_Xpa->add_att("description", "Xpa")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
486 
487  strcpy(&buf[l], "Vpa");
488  Var_Vpa = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV3());
489  if (Var_Vpa == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
490  if (!Var_Vpa->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
491  if (!Var_Vpa->add_att("type", "Vec3")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
492  if (!Var_Vpa->add_att("description", "Vpa")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
493 
494  strcpy(&buf[l], "Vpar");
495  Var_Vpar = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV3());
496  if (Var_Vpar == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
497  if (!Var_Vpar->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
498  if (!Var_Vpar->add_att("type", "Vec3")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
499  if (!Var_Vpar->add_att("description", "Vpar")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
500 
501  strcpy(&buf[l], "fwd");
502  Var_fwd = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV3());
503  if (Var_fwd == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
504  if (!Var_fwd->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
505  if (!Var_fwd->add_att("type", "Vec3")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
506  if (!Var_fwd->add_att("description", "fwd")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
507 
508  strcpy(&buf[l], "fwdRing");
509  Var_fwdRing = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV3());
510  if (Var_fwdRing == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
511  if (!Var_fwdRing->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
512  if (!Var_fwdRing->add_att("type", "Vec3")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
513  if (!Var_fwdRing->add_att("description", "fwdRing")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
514 
515  strcpy(&buf[l], "fwdRingFlat");
516  Var_fwdRingFlat = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV3());
517  if (Var_fwdRingFlat == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
518  if (!Var_fwdRingFlat->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
519  if (!Var_fwdRingFlat->add_att("type", "Vec3")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
520  if (!Var_fwdRingFlat->add_att("description", "fwdRingFlat")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
521 
522  strcpy(&buf[l], "pcRing");
523  Var_pcRing = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV3());
524  if (Var_pcRing == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
525  if (!Var_pcRing->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
526  if (!Var_pcRing->add_att("type", "Vec3")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
527  if (!Var_pcRing->add_att("description", "pcRing")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
528 
529  strcpy(&buf[l], "VparWheel");
530  Var_VparWheel = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV3());
531  if (Var_VparWheel == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
532  if (!Var_VparWheel->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
533  if (!Var_VparWheel->add_att("type", "Vec3")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
534  if (!Var_VparWheel->add_att("description", "VparWheel")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
535 
536  strcpy(&buf[l], "Fr");
537  Var_Fr = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV3());
538  if (Var_Fr == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
539  if (!Var_Fr->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
540  if (!Var_Fr->add_att("type", "Vec3")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
541  if (!Var_Fr->add_att("description", "Fr")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
542 
543  strcpy(&buf[l], "Mz");
544  Var_Mz = pBinFile->add_var(buf, ncDouble, OH.DimTime(), OH.DimV3());
545  if (Var_Mz == 0) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
546  if (!Var_Mz->add_att("units", "NA")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
547  if (!Var_Mz->add_att("type", "Vec3")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
548  if (!Var_Mz->add_att("description", "Mz")) throw DataManager::ErrGeneric(MBDYN_EXCEPT_ARGS);
549 
550 
551  }
552 #endif // USE_NETCDF
553  }
554 
555 }
virtual bool bToBeOutput(void) const
Definition: output.cc:890
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
bool UseNetCDF(int out) const
Definition: output.cc:491
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977
#define STRLENOF(s)
Definition: mbdyn.h:166
static doublereal buf[BUFSIZE]
Definition: discctrl.cc:333
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

std::ostream & Wheel4::Restart ( std::ostream &  out) const
virtual

Implements Elem.

Definition at line 1810 of file module-wheel4.cc.

1811 {
1812  return out << "# not implemented yet" << std::endl;
1813 }
doublereal Wheel4::sec ( doublereal  x) const
inlineprivate

Definition at line 264 of file module-wheel4.h.

References grad::cos().

Referenced by AssJac().

264  {
265  return 1.0 / cos(x);
266  };
GradientExpression< UnaryExpr< FuncCos, Expr > > cos(const GradientExpression< Expr > &u)
Definition: gradient.h:2978

Here is the call graph for this function:

void Wheel4::SetInitialValue ( VectorHandler X)
virtual

Initialize state vector used in initial assembly. May set internal states of the element. Do not rely on being always called, because initial assembly could be implicitly or explicitly skipped

Reimplemented from DofOwnerOwner.

Definition at line 1744 of file module-wheel4.cc.

References DofOwnerOwner::iGetFirstIndex(), VectorHandler::PutCoef(), and XpaPrev.

Referenced by AssRes().

1745 {
1746 integer iFirstIndex = iGetFirstIndex();
1747 XCurr.PutCoef(iFirstIndex + 4, XpaPrev(2));
1748 XCurr.PutCoef(iFirstIndex + 2, XpaPrev(1));
1749 XCurr.PutCoef(iFirstIndex + 3, 0);
1750 XCurr.PutCoef(iFirstIndex + 1, 0);
1751 }
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51
Vec3 XpaPrev

Here is the call graph for this function:

void Wheel4::SetValue ( DataManager pDM,
VectorHandler X,
VectorHandler XP,
SimulationEntity::Hints ph 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 1802 of file module-wheel4.cc.

References NO_OP.

1805 {
1806  NO_OP;
1807 }
#define NO_OP
Definition: myassert.h:74
int Wheel4::sign ( const doublereal  x)
inlineprivate

Definition at line 268 of file module-wheel4.h.

Referenced by AssRes().

268  {
269  if (x >= 0.) {
270  return 1;
271  } else if (x < 0.) {
272  return -1;
273  }
274  return 0;
275  };
void Wheel4::WorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
virtual

Implements Elem.

Definition at line 685 of file module-wheel4.cc.

Referenced by AssRes().

686 {
687  *piNumRows = 16; // defines dimensions of work vector having X DOF
688  *piNumCols = 16;
689 }

Member Data Documentation

bool Wheel4::bFirstAC
private

Definition at line 157 of file module-wheel4.h.

Referenced by AfterConvergence(), AssRes(), and Wheel4().

bool Wheel4::bFirstAP
private

Definition at line 158 of file module-wheel4.h.

Referenced by AfterPredict(), AssRes(), and Wheel4().

bool Wheel4::bLoadedRadius
private

Definition at line 79 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

bool Wheel4::boolFn
private

Definition at line 186 of file module-wheel4.h.

Referenced by AssJac(), and AssRes().

bool Wheel4::bSlip
private

Definition at line 78 of file module-wheel4.h.

Referenced by Wheel4().

bool Wheel4::bSwift
private

Definition at line 154 of file module-wheel4.h.

Referenced by Wheel4().

Vec3 Wheel4::Cpa
private

Definition at line 134 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

Vec3 Wheel4::Cpatv
private

Definition at line 96 of file module-wheel4.h.

Referenced by AssJac(), and AssRes().

doublereal Wheel4::curTime
private

Definition at line 155 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::dAlpha
private

Definition at line 249 of file module-wheel4.h.

Referenced by AfterConvergence(), AssJac(), AssRes(), and Output().

doublereal Wheel4::dAlpha_r
private

Definition at line 251 of file module-wheel4.h.

Referenced by AssJac(), and AssRes().

doublereal Wheel4::dAlpha_t
private

Definition at line 250 of file module-wheel4.h.

Referenced by AssJac(), and AssRes().

doublereal Wheel4::dCpa
private

Definition at line 95 of file module-wheel4.h.

Referenced by AssRes().

doublereal Wheel4::dCt
private

Definition at line 184 of file module-wheel4.h.

Referenced by AssRes(), and Output().

doublereal Wheel4::dDebug
private

Definition at line 260 of file module-wheel4.h.

Referenced by AssRes(), and Output().

doublereal Wheel4::ddistM
private

Definition at line 125 of file module-wheel4.h.

Referenced by AssRes(), and Output().

doublereal Wheel4::dEffRad
private

Definition at line 126 of file module-wheel4.h.

Referenced by AfterConvergence(), and AssRes().

doublereal Wheel4::deltaPrev
private

Definition at line 246 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::derivSign
private

Definition at line 235 of file module-wheel4.h.

Referenced by AssJac().

Vec3 Wheel4::distM
private

Definition at line 124 of file module-wheel4.h.

Referenced by AfterConvergence(), AssJac(), AssRes(), and Output().

doublereal Wheel4::dKpa
private

Definition at line 92 of file module-wheel4.h.

Referenced by AssRes().

doublereal Wheel4::dLs
private

Definition at line 190 of file module-wheel4.h.

Referenced by AssRes(), and Output().

doublereal Wheel4::dLsProj
private

Definition at line 194 of file module-wheel4.h.

Referenced by AssRes().

doublereal Wheel4::dLsProjPrev
private

Definition at line 197 of file module-wheel4.h.

Referenced by AssRes().

doublereal Wheel4::dLsProjRatio
private

Definition at line 200 of file module-wheel4.h.

doublereal Wheel4::dMuX
private

Definition at line 252 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), and Output().

doublereal Wheel4::dMuY
private

Definition at line 253 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), and Output().

doublereal Wheel4::dn
private

Definition at line 220 of file module-wheel4.h.

Referenced by AssRes().

doublereal Wheel4::dPls
private

Definition at line 191 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::dR_0
private

Definition at line 245 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), CalculateR_e(), and Wheel4().

doublereal Wheel4::dR_a1
private

Definition at line 192 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::dR_a2
private

Definition at line 193 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::dRoad
private

Definition at line 100 of file module-wheel4.h.

Referenced by AssRes(), Output(), and Wheel4().

doublereal Wheel4::dRoadAhead
private

Definition at line 101 of file module-wheel4.h.

Referenced by AssRes(), and Output().

doublereal Wheel4::dRoadBehind
private

Definition at line 102 of file module-wheel4.h.

Referenced by AssRes(), and Output().

doublereal Wheel4::dRoadInitial
private

Definition at line 103 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::dRoadPrev
private

Definition at line 104 of file module-wheel4.h.

Referenced by AssRes(), and Output().

doublereal Wheel4::dRoadPrevPrev
private

Definition at line 105 of file module-wheel4.h.

Referenced by AssRes().

doublereal Wheel4::dRoadVel
private

Definition at line 179 of file module-wheel4.h.

doublereal Wheel4::dSa
private

Definition at line 248 of file module-wheel4.h.

Referenced by AfterConvergence(), and Output().

doublereal Wheel4::dSr
private

Definition at line 247 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), and Output().

doublereal Wheel4::dt
private

Definition at line 153 of file module-wheel4.h.

Referenced by AssRes(), Output(), and Wheel4().

doublereal Wheel4::dt_adjFactor
private

Definition at line 203 of file module-wheel4.h.

Referenced by AssRes().

doublereal Wheel4::dt_divF
private

Definition at line 212 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::dt_divF3
private

Definition at line 213 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::dt_divF4
private

Definition at line 214 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::dt_fNow
private

Definition at line 204 of file module-wheel4.h.

Referenced by AssRes().

doublereal Wheel4::dt_maxF
private

Definition at line 198 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::dt_maxH
private

Definition at line 202 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::dt_maxstep
private

Definition at line 205 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::dt_minF
private

Definition at line 199 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::dt_minstep
private

Definition at line 206 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

int Wheel4::dt_minStepsCycle
private

Definition at line 211 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

int Wheel4::dt_numAhead
private

Definition at line 210 of file module-wheel4.h.

Referenced by AssRes().

bool Wheel4::dt_On
private

Definition at line 207 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::dt_Res
private

Definition at line 208 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::dtMax
private

Definition at line 209 of file module-wheel4.h.

Referenced by AssRes(), and dGetPrivData().

doublereal Wheel4::dtPrev
private

Definition at line 201 of file module-wheel4.h.

doublereal Wheel4::dvao
private

Definition at line 256 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::dvax
private

Definition at line 222 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), and Output().

doublereal Wheel4::dvay
private

Definition at line 223 of file module-wheel4.h.

Referenced by AssRes(), and Output().

doublereal Wheel4::dVPx
private

Definition at line 52 of file module-wheel4.h.

Referenced by AssRes().

doublereal Wheel4::dVPy
private

Definition at line 52 of file module-wheel4.h.

Referenced by AssRes().

doublereal Wheel4::dVx
private

Definition at line 52 of file module-wheel4.h.

Referenced by AssRes().

doublereal Wheel4::dvx
private

Definition at line 221 of file module-wheel4.h.

Referenced by AssRes(), CalculateR_e(), and Output().

doublereal Wheel4::dVy
private

Definition at line 52 of file module-wheel4.h.

Referenced by AssRes().

doublereal Wheel4::dXPx
private

Definition at line 52 of file module-wheel4.h.

Referenced by AssRes().

doublereal Wheel4::dXPy
private

Definition at line 52 of file module-wheel4.h.

Referenced by AssRes().

doublereal Wheel4::dXx
private

Definition at line 52 of file module-wheel4.h.

Referenced by AssRes().

doublereal Wheel4::dXxPrev
private

Definition at line 225 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::dXxProj
private

Definition at line 195 of file module-wheel4.h.

Referenced by AssRes(), and Output().

doublereal Wheel4::dXxProjPrev
private

Definition at line 196 of file module-wheel4.h.

Referenced by AssRes().

doublereal Wheel4::dXy
private

Definition at line 52 of file module-wheel4.h.

Referenced by AssRes().

doublereal Wheel4::E
private

Definition at line 226 of file module-wheel4.h.

Referenced by AfterConvergence(), and Output().

Vec3 Wheel4::EffRad
private

Definition at line 127 of file module-wheel4.h.

Referenced by AfterConvergence().

Vec3 Wheel4::F
private

Definition at line 242 of file module-wheel4.h.

Referenced by AssRes(), and Output().

doublereal Wheel4::Fcent
private

Definition at line 183 of file module-wheel4.h.

Referenced by AssRes(), and Output().

Vec3 Wheel4::Fint
private

Definition at line 143 of file module-wheel4.h.

Referenced by AssRes(), and Output().

Vec3 Wheel4::Fint_old
private

Definition at line 144 of file module-wheel4.h.

Referenced by AssJac(), and AssRes().

Vec3 Wheel4::Fint_ring
private

Definition at line 145 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), and Output().

Vec3 Wheel4::FintPrev
private

Definition at line 216 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

Vec3 Wheel4::FintPrevPrev
private

Definition at line 217 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

std::vector< std::vector<int> > Wheel4::FintSignCk
private

Definition at line 215 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

bool Wheel4::firstRes
private

Definition at line 258 of file module-wheel4.h.

Referenced by AssRes().

doublereal Wheel4::Fn
private

Definition at line 182 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), and Output().

Vec3 Wheel4::Fpatch
private

Definition at line 146 of file module-wheel4.h.

Referenced by AssRes().

Vec3 Wheel4::Fr
private

Definition at line 185 of file module-wheel4.h.

Referenced by AssRes(), and Output().

Vec3 Wheel4::fwd
private

Definition at line 170 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), CalculateR_e(), and Output().

bool Wheel4::fwdBool
private

Definition at line 237 of file module-wheel4.h.

Referenced by AssJac().

Vec3 Wheel4::fwdRing
private

Definition at line 171 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), and Output().

Vec3 Wheel4::fwdRingFlat
private

Definition at line 172 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), and Output().

Vec3 Wheel4::fwdRingPrev
private

Definition at line 178 of file module-wheel4.h.

Referenced by AssRes().

Vec3 Wheel4::i
private

Definition at line 187 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), and Wheel4().

Vec3 Wheel4::j
private

Definition at line 188 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), and Wheel4().

Vec3 Wheel4::k
private

Definition at line 189 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), and Wheel4().

doublereal Wheel4::KE
private

Definition at line 227 of file module-wheel4.h.

Referenced by AfterConvergence(), and Output().

Vec3 Wheel4::Kpa
private

Definition at line 133 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

Vec3 Wheel4::Kpatv
private

Definition at line 93 of file module-wheel4.h.

Referenced by AssJac(), and AssRes().

doublereal Wheel4::Krz
private

Definition at line 88 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

Vec3 Wheel4::lat
private

Definition at line 173 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), and CalculateR_e().

bool Wheel4::latBool
private

Definition at line 236 of file module-wheel4.h.

Referenced by AssJac().

Vec3 Wheel4::latRing
private

Definition at line 174 of file module-wheel4.h.

Referenced by AssJac(), and AssRes().

Vec3 Wheel4::latRingFlat
private

Definition at line 175 of file module-wheel4.h.

Referenced by AssJac(), and AssRes().

Vec3 Wheel4::M
private

Definition at line 243 of file module-wheel4.h.

Referenced by AssRes(), and Output().

doublereal Wheel4::M_zr
private

Definition at line 152 of file module-wheel4.h.

Referenced by AssRes().

Vec3 Wheel4::Mint
private

Definition at line 147 of file module-wheel4.h.

doublereal Wheel4::Mpa
private

Definition at line 148 of file module-wheel4.h.

Referenced by AfterConvergence(), AssJac(), AssRes(), and Wheel4().

Vec3 Wheel4::Mz
private

Definition at line 244 of file module-wheel4.h.

Referenced by AssRes(), and Output().

Vec3 Wheel4::n
private

Definition at line 176 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), and Output().

Vec3 Wheel4::nPrev
private

Definition at line 177 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::oldTime
private

Definition at line 156 of file module-wheel4.h.

Referenced by AssRes().

DriveCaller* Wheel4::pCpa
private

Definition at line 94 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

Vec3 Wheel4::pcRing
private

Definition at line 161 of file module-wheel4.h.

Referenced by AssRes(), and Output().

Vec3 Wheel4::pcRingPrev
private

Definition at line 162 of file module-wheel4.h.

Referenced by AssRes().

doublereal Wheel4::PE
private

Definition at line 228 of file module-wheel4.h.

Referenced by AfterConvergence(), and Output().

StructNode* Wheel4::pGround
private

Definition at line 73 of file module-wheel4.h.

DriveCaller* Wheel4::pKpa
private

Definition at line 91 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

DriveCaller* Wheel4::pMuX0
private

Definition at line 80 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), and Wheel4().

DriveCaller* Wheel4::pMuY0
private

Definition at line 81 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), and Wheel4().

DriveCaller* Wheel4::pMzr
private

Definition at line 83 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), and Wheel4().

StructNode* Wheel4::pPatch
private

Definition at line 66 of file module-wheel4.h.

StructNode* Wheel4::pRing
private

Definition at line 62 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), GetConnectedNodes(), and Wheel4().

Elem* Wheel4::pRingB
private

Definition at line 63 of file module-wheel4.h.

Referenced by AfterConvergence(), AssRes(), and Wheel4().

DriveCaller* Wheel4::pRoad
private

Definition at line 99 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

DriveCaller* Wheel4::pTr
private

Definition at line 82 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), and Wheel4().

StructNode* Wheel4::pWheel
private
Elem* Wheel4::pWheelB
private

Definition at line 58 of file module-wheel4.h.

Referenced by AfterConvergence(), and Wheel4().

Elem* Wheel4::pWheelE
private

Definition at line 59 of file module-wheel4.h.

doublereal Wheel4::q_sy1
private

Definition at line 254 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::q_sy3
private

Definition at line 255 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::R_e
private

Definition at line 128 of file module-wheel4.h.

Referenced by AssRes(), CalculateR_e(), and Output().

doublereal Wheel4::RDA
private

Definition at line 116 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::RDB
private

Definition at line 117 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::RDL
private

Definition at line 118 of file module-wheel4.h.

Referenced by AssRes(), CapLoop(), and Wheel4().

int Wheel4::RDLC
private

Definition at line 119 of file module-wheel4.h.

Vec3 Wheel4::RingRad
private

Definition at line 163 of file module-wheel4.h.

Referenced by AssRes().

Vec3 Wheel4::RingRadPrev
private

Definition at line 164 of file module-wheel4.h.

Referenced by AssRes().

Vec3 Wheel4::RpaBC
private

Definition at line 137 of file module-wheel4.h.

doublereal Wheel4::rRatio
private

Definition at line 87 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::S_hf
private

Definition at line 151 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::S_ht
private

Definition at line 150 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

DriveOwner Wheel4::tdc
private

Definition at line 159 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::TdLs
private

Definition at line 113 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::TdR_e
private

Definition at line 115 of file module-wheel4.h.

Referenced by CalculateR_e(), and Wheel4().

doublereal Wheel4::TdReDiv
private

Definition at line 114 of file module-wheel4.h.

Referenced by CalculateR_e(), and Wheel4().

doublereal Wheel4::tr
private

Definition at line 149 of file module-wheel4.h.

Referenced by AssJac(), and AssRes().

doublereal Wheel4::TRH
private

Definition at line 108 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), and Wheel4().

doublereal Wheel4::TRHA
private

Definition at line 109 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::TRHC
private

Definition at line 112 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

doublereal Wheel4::TRHT
private

Definition at line 110 of file module-wheel4.h.

Referenced by Wheel4().

doublereal Wheel4::TRHTA
private

Definition at line 111 of file module-wheel4.h.

Referenced by Wheel4().

Vec3 Wheel4::va
private

Definition at line 224 of file module-wheel4.h.

Referenced by AssJac(), and AssRes().

Vec3 Wheel4::Vpa
private

Definition at line 139 of file module-wheel4.h.

Referenced by AfterConvergence(), AssRes(), Output(), and Wheel4().

Vec3 Wheel4::VpaBC
private

Definition at line 136 of file module-wheel4.h.

Referenced by Wheel4().

Vec3 Wheel4::VpaPrev
private

Definition at line 142 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

Vec3 Wheel4::Vpar
private

Definition at line 140 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), and Output().

Vec3 Wheel4::Vparp
private

Definition at line 181 of file module-wheel4.h.

Referenced by AssRes().

Vec3 Wheel4::VparWheel
private

Definition at line 141 of file module-wheel4.h.

Referenced by AssRes(), and Output().

Vec3 Wheel4::VpcRing
private

Definition at line 166 of file module-wheel4.h.

Referenced by AssRes().

Vec3 Wheel4::VpcRingPrev
private

Definition at line 165 of file module-wheel4.h.

Referenced by AssRes().

Vec3 Wheel4::VpcRingPrevPrev
private

Definition at line 167 of file module-wheel4.h.

Referenced by AssRes().

Vec3 Wheel4::Vwheel
private

Definition at line 169 of file module-wheel4.h.

Vec3 Wheel4::WheelAxle
private

Definition at line 70 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), and Wheel4().

Vec3 Wheel4::WpaBC
private

Definition at line 138 of file module-wheel4.h.

Vec3 Wheel4::Xpa
private

Definition at line 122 of file module-wheel4.h.

Referenced by AssRes(), Output(), and Wheel4().

Vec3 Wheel4::XpaBC
private

Definition at line 135 of file module-wheel4.h.

Referenced by Wheel4().

Vec3 Wheel4::XpaPrev
private

Definition at line 130 of file module-wheel4.h.

Referenced by AssRes(), SetInitialValue(), and Wheel4().

Vec3 Wheel4::XpaPrevPrev
private

Definition at line 132 of file module-wheel4.h.

Referenced by AssRes().

Vec3 Wheel4::Xpar
private

Definition at line 123 of file module-wheel4.h.

Referenced by AssJac(), AssRes(), and Output().

Vec3 Wheel4::Xparp
private

Definition at line 180 of file module-wheel4.h.

Referenced by AssRes(), and Output().

Vec3 Wheel4::XparpPrev
private

Definition at line 218 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

Vec3 Wheel4::XparpPrevPrev
private

Definition at line 219 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

Vec3 Wheel4::XparPrev
private

Definition at line 129 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

Vec3 Wheel4::XparPrevPrev
private

Definition at line 131 of file module-wheel4.h.

Referenced by AssRes(), and Wheel4().

Vec3 Wheel4::Xring
private

Definition at line 168 of file module-wheel4.h.

Referenced by AfterConvergence(), and AssRes().

Vec3 Wheel4::zZero
private

Definition at line 160 of file module-wheel4.h.

Referenced by Wheel4().


The documentation for this class was generated from the following files: