# Path: odelab/system/base.py
# class System(object):
# 	"""
# 	General System class to define a simple dynamics given by a right-hand side.
# 	"""
# 	def __init__(self, f=None):
# 		if f is not None:
# 			self._f = f
# 
# 	def label(self, component):
# 		return '%s' % component
# 
# 	def preprocess(self, u0):
# 		return u0
# 
# 	def postprocess(self, u1):
# 		return u1
# 
# 	def __call__(self, t, x):
# 		return self._f(t, x)


from odelab.system.base import System
import numpy as np
#!/usr/bin/env python
# −*− coding: UTF−8 −*−
from __future__ import division


class MechanicalSystem(System):
	def velocity(self, u):
		return self.momentum(u)

	def position(self, u):
		"""select the position component"""

	def lag(self, u):
		"""select the lagrangian component"""

	def vel_lag_split(self, vl):
		"""splits between velocity and lagrangian"""

	def vel_lag_stack(self,v,l):
		"""stacks together the velocity and lagrangian parts"""

	def force(self, u):
		r"""compute the force as a function of `u`
		It may be interpreted as :math:`-\frac{∂H}{∂q}`"""


# Path: odelab/system/base.py
# class System(object):
# 	"""
# 	General System class to define a simple dynamics given by a right-hand side.
# 	"""
# 	def __init__(self, f=None):
# 		if f is not None:
# 			self._f = f
# 
# 	def label(self, component):
# 		return '%s' % component
# 
# 	def preprocess(self, u0):
# 		return u0
# 
# 	def postprocess(self, u1):
# 		return u1
# 
# 	def __call__(self, t, x):
# 		return self._f(t, x)


# Path: odelab/system/mechanics.py
from odelab.system.base import System
import numpy as np

#!/usr/bin/env python
# −*− coding: UTF−8 −*−
from __future__ import division


class MechanicalSystem(System):
	def velocity(self, u):
		return self.momentum(u)

	def position(self, u):
		"""select the position component"""

	def lag(self, u):
		"""select the lagrangian component"""

	def vel_lag_split(self, vl):
		"""splits between velocity and lagrangian"""

	def vel_lag_stack(self,v,l):
		"""stacks together the velocity and lagrangian parts"""

	def force(self, u):
		r"""compute the force as a function of `u`
		It may be interpreted as :math:`-\frac{∂H}{∂q}`"""


	def codistribution(self, u):