Example #1
0
	def cleanup(self):
		symbolDictionary = dict(zip(self.state + self.velocity, self.cleanState + self.cleanVelocity))
		N                = len(self._fullCoordinate)
		cleanMatrix      = Matrix([simplify(element).subs(symbolDictionary) for element in  self.mass])
		self._cleanMass  = list([cleanMatrix.reshape(N, N)])
		self._cleanForce = [simplify(element).subs(symbolDictionary) for element in self.force]
		self.SpecialFunctions(symbolDictionary)
		self.cleanConstraint      = simplify(self.constraint_equation.subs(symbolDictionary))
		self.cleanConstraintForce = [simplify(element).subs(symbolDictionary) for element in self.virtualForce]
		self.cleanNullForce       = self.nullForce
Example #2
0
	def cleanup(self):
		self.cleanState           = symbols(self.dofNames)
		self.cleanVelocity        = symbols(['d'+name for name in self.dofNames])
		symdict                   = dict(zip(self.state+self.velocity, self.cleanState+self.cleanVelocity))
		cleanMatrix               = Matrix([simplify(element).subs(symdict) for element in  self.mass])
		self.cleanMass            = list([cleanMatrix.reshape(self.degreesOfFreedom, self.degreesOfFreedom)])
		self.cleanForce           = [simplify(element).subs(symdict) for element in self.force]
		self.cleanConstraint      = simplify(self.constraint_equation.subs(symdict))
		self.cleanConstraintForce = [simplify(element).subs(symdict) for element in self.virtualForce]
		self.cleanNullForce       = self.nullForce