95 pStrNode1(pN1), pStrNode2(pN2), pVoltage1(pV1), pVoltage2(pV2),
96 Rn(Rn), dGain(dG), dL(dL), dR(dR), p(p), M0(pM0), M1(pM1), M(i0 * dG), i(i0)
124 <<
"orientation, " <<
Rn <<
", "
133 out <<
", initial current, " <<
i <<
", M0, ";
141 out <<
", terminal pairs, " <<
p <<
";" << std::endl;
187 for (
integer iCnt = 1; iCnt <= 3; iCnt++) {
189 WM.
PutRowIndex(3+iCnt, iStrNode2FirstMomIdx + iCnt);
192 WM.
PutColIndex(3+iCnt, iStrNode2FirstPosIdx + iCnt);
219 const doublereal a0 = DeltaR(1, 1) * DeltaR(1, 1) + DeltaR(2, 1) * DeltaR(2, 1);
220 const Vec3 dPhi_dg1_T = (dDeltaR21_dg1_T * DeltaR(1, 1) - dDeltaR11_dg1_T * DeltaR(2, 1)) / a0;
221 const Vec3 dPhi_dg2_T = (dDeltaR21_dg2_T * DeltaR(1, 1) - dDeltaR11_dg2_T * DeltaR(2, 1)) / a0;
224 const Vec3 dM0_dg1_T = dPhi_dg1_T * dM0_dPhi;
225 const Vec3 dM0_dg2_T = dPhi_dg2_T * dM0_dPhi;
226 const Vec3 dM1_dg1_T = dPhi_dg1_T * dM1_dPhi;
227 const Vec3 dM1_dg2_T = dPhi_dg2_T * dM1_dPhi;
228 const Vec3 dM_dg1_T = dM0_dg1_T + dM1_dg1_T *
i;
229 const Vec3 dM_dg2_T = dM0_dg2_T + dM1_dg2_T *
i;
233 const Vec3 dOmega_dg1_T = (omega1 - omega2).
Cross(R1_0 *
Rn.
GetCol(3)) - (gP1 * 0.5 + omega1_0).Cross(R1 *
Rn.
GetCol(3));
239 const Vec3 dfi_dg1_T = dOmega_dg1_T * (-
dGain);
240 const Vec3 dfi_dgP1_T = dOmega_dgP1_T * (-
dGain);
241 const Vec3 dfi_dg2_T = dOmega_dg2_T * (-
dGain);
242 const Vec3 dfi_dgP2_T = dOmega_dgP2_T * (-
dGain);
249 WM.
Put(1, 1, dC1_dg1 * (-dCoef));
250 WM.
Put(1, 4, dC1_dg2 * (-dCoef));
251 WM.
Put(4, 1, dC1_dg1 * dCoef);
252 WM.
Put(4, 4, dC1_dg2 * dCoef);
253 WM.
Put(1, 9, dC1_di * (-dCoef));
254 WM.
Put(4, 9, dC1_di * dCoef);
255 WM.
PutCoef(7, 9, -dCoef * di1_di);
256 WM.
PutCoef(8, 9, -dCoef * di2_di);
257 WM.
PutT(9, 1, -dfi_dgP1_T - dfi_dg1_T * dCoef);
258 WM.
PutT(9, 4, -dfi_dgP2_T - dfi_dg2_T * dCoef);
259 WM.
PutCoef(9, 7, -dCoef * dfi_du1);
260 WM.
PutCoef(9, 8, -dCoef * dfi_du2);
261 WM.
PutCoef(9, 9, -dfi_diP - dCoef * dfi_di);
284 for (
integer iCnt = 1; iCnt <= 3; iCnt++) {
285 WorkVec.
PutRowIndex(iCnt, iStrNode1FirstIndex + iCnt);
286 WorkVec.
PutRowIndex(3+iCnt, iStrNode2FirstIndex + iCnt);
295 i = XCurr(iFirstIndex);
296 iP = XPrimeCurr(iFirstIndex);
335 return atan2(DeltaR_e1(2), DeltaR_e1(1));
366 XP(iFirstIndex) =
iP;
373 connectedNodes.resize(4);
Vec3 GetAxisOfRotation() const
const StructNode * pStrNode1
virtual void SetInitialValue(VectorHandler &X)
const ElectricNode * pVoltage1
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
void PutColIndex(integer iSubCol, integer iCol)
virtual Electric::Type GetElectricType(void) const
Vec3 Cross(const Vec3 &v) const
virtual const Mat3x3 & GetRRef(void) const
#define MBDYN_EXCEPT_ARGS
virtual void ResizeReset(integer)
const MatCross_Manip MatCross
FullSubMatrixHandler & SetFull(void)
virtual const Mat3x3 & GetRCurr(void) const
void PutT(integer iRow, integer iCol, const Vec3 &v)
void Put(integer iRow, integer iCol, const Vec3 &v)
void PutCoef(integer iRow, integer iCol, const doublereal &dCoef)
Vec3 GetCol(unsigned short int i) const
static const unsigned int iNumPrivData
virtual doublereal dGetPrivData(unsigned int i) const
virtual unsigned int iGetNumPrivData(void) const
const Mat3x3 & Tens(const Vec3 &a, const Vec3 &b)
virtual const Vec3 & GetWRef(void) const
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
std::vector< Hint * > Hints
doublereal dGetP(const doublereal &dVar) const
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
virtual std::ostream & Restart(std::ostream &out) const =0
virtual unsigned int iGetPrivDataIdx(const char *s) const
virtual unsigned int iGetNumDof(void) const
Vec3 MulTV(const Vec3 &v) const
virtual std::ostream & Restart(std::ostream &out) const
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
doublereal dGetPhiElectric(doublereal Phi_m) const
doublereal dGetVoltage() const
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
const ElectricNode * pVoltage2
virtual DofOrder::Order GetDofType(unsigned int i) const
virtual integer iGetFirstRowIndex(void) const
virtual integer iGetFirstMomentumIndex(void) const =0
static const int iNumPrivData
virtual integer iGetFirstPositionIndex(void) const
virtual const Vec3 & GetWCurr(void) const
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
#define ASSERT(expression)
Mat3x3 MulTM(const Mat3x3 &m) const
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)
DriveCaller * pGetDriveCaller(void) const
static const struct Motor::PrivData rgPrivData[iNumPrivData]
virtual void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *h=0)
virtual void ResizeReset(integer, integer)
virtual doublereal dGet(const doublereal &dVar) const =0
doublereal dGetOmega() const
virtual void Put(integer iRow, const Vec3 &v)
Motor(unsigned int uL, const DofOwner *pD, const StructNode *pN1, const StructNode *pN2, const ElectricNode *pV1, const ElectricNode *pV2, const Mat3x3 &Rn, doublereal dG, doublereal dl, DriveCaller *dR, doublereal i0, integer p, const DriveCaller *pM0, const DriveCaller *pM1, flag fOut)
void PutRowIndex(integer iSubRow, integer iRow)
virtual const Vec3 & GetgPCurr(void) const
doublereal dGet(const doublereal &dVar) const
doublereal dGetPhiMechanical() const
const StructNode * pStrNode2
virtual integer iGetFirstIndex(void) const
GradientExpression< BinaryExpr< FuncAtan2, LhsExpr, RhsExpr > > atan2(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
unsigned int GetLabel(void) const
virtual const doublereal & dGetX(void) const