示例#1
0
文件: Element.cs 项目: Zakant/MksNet
        /// <summary>
        /// Inserts the local vector of forces into the global one, and adds its negative to the parent entries
        /// </summary>
        /// <param name="GlobalForceVector">The global force vector</param>
        /// <returns>The global force vector with the local forces of the element and its children inserted</returns>
        public Vector <double> GetGlobalForceMomentVector(Vector <double> GlobalForceVector)
        {
            int             ElementIndex = GetElementIndex();
            int             ParentIndex  = Parent.GetElementIndex();
            Vector <double> LocalVector  = GetLocalForceMomentVector();

            GlobalForceVector.AddAtIndex(LocalVector, ElementIndex);
            GlobalForceVector.AddAtIndex(-LocalVector, ParentIndex);
            return(GlobalForceVector);
        }
示例#2
0
        /// <summary>
        /// Calculates the coriolis-vector
        /// </summary>
        /// <param name="CoriolisVector">The vector where the element-matrices get inserted</param>
        /// <param name="GlobalStateVector">The global state vector</param>
        /// <returns></returns>
        public Vector <double> GetCoriolisVector(Vector <double> CoriolisVector, StateVector GlobalStateVector)
        {
            Matrix <double> JacobianDerivative = GetGlobalJacobianDerivative(CreateMatrix.Dense <double>(Elements.Count * 6, Elements.Count * 6));
            Vector <double> Velocities         = CreateVector.Dense <double>(3);/// GlobalStateVector.SubVector(GlobalStateVector.Count / 2, GlobalStateVector.Count / 2);

            CoriolisVector = JacobianDerivative * Velocities;
            Vector <double> LocalStateVector, AngularVelocity;
            int             count = 3;

            foreach (Element i in Elements)
            {
                LocalStateVector = GlobalStateVector.GetStateVectorForId(i.ElementId);
                AngularVelocity  = i.GetLocalAngularVelocity(LocalStateVector);
                Matrix <double> Roessel = RoesselMatrix.GetRoesselMatrix(AngularVelocity);
                CoriolisVector.AddAtIndex(Roessel * i.Inertia * AngularVelocity, count);
                count += 3;
            }
            return(CoriolisVector);
        }