csu-hmc / opty

A library for using direct collocation in the optimization of dynamic systems.
http://opty.readthedocs.io
Other
92 stars 20 forks source link

8 links failed the controllability test #11

Open moorepants opened 10 years ago

moorepants commented 10 years ago
(inverted-pendulum-id)moorepants@moorepants-2170p:inverted-pendulum-sys-id(master)$ ipython
Python 2.7.8 |Continuum Analytics, Inc.| (default, Aug 21 2014, 18:22:21) 
Type "copyright", "credits" or "license" for more information.

IPython 2.1.0 -- An enhanced Interactive Python.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: run pendulum.py -n 8 -d 10.0 -r -s 100.0 -i known
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Running an identification for a 8 link inverted pendulum with a 10.0 second simulation discretized at 100.0 hz.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Generating equations of motion.
Finding the optimal gains.
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
/home/moorepants/src/inverted-pendulum-sys-id/pendulum.py in <module>()
   1503                             args.samplerate, args.initialconditions,
   1504                             args.sensornoise, args.plot, args.animate)
-> 1505     identifier.identify()

/home/moorepants/src/inverted-pendulum-sys-id/pendulum.py in identify(self)
   1265         self.compute_discretization()
   1266         self.generate_eoms()
-> 1267         self.find_optimal_gains()
   1268         self.simulate()
   1269         self.generate_constraint_funcs()

/home/moorepants/src/inverted-pendulum-sys-id/pendulum.py in find_optimal_gains(self)
   1073         # Find some optimal gains for stablizing the pendulum on the cart.
   1074         print('Finding the optimal gains.')
-> 1075         self.gains = compute_controller_gains(self.num_links)
   1076 
   1077     def simulate(self):

/home/moorepants/src/inverted-pendulum-sys-id/pendulum.py in compute_controller_gains(num_links)
    127     B = np.dot(invM, F_B)
    128 
--> 129     assert controllable(A, B)
    130 
    131     Q = np.eye(len(states))

AssertionError: 

In [2]: 
moorepants commented 10 years ago

So does 6 links:

(inverted-pendulum-id)moorepants@moorepants-2170p:inverted-pendulum-sys-id(master)$ ipython
Python 2.7.8 |Continuum Analytics, Inc.| (default, Aug 21 2014, 18:22:21) 
Type "copyright", "credits" or "license" for more information.

IPython 2.1.0 -- An enhanced Interactive Python.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: run pendulum.py -n 6 -d 10.0 -r -s 100.0 -i known
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Running an identification for a 6 link inverted pendulum with a 10.0 second simulation discretized at 100.0 hz.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Generating equations of motion.
Finding the optimal gains.
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
/home/moorepants/src/inverted-pendulum-sys-id/pendulum.py in <module>()
   1503                             args.samplerate, args.initialconditions,
   1504                             args.sensornoise, args.plot, args.animate)
-> 1505     identifier.identify()

/home/moorepants/src/inverted-pendulum-sys-id/pendulum.py in identify(self)
   1265         self.compute_discretization()
   1266         self.generate_eoms()
-> 1267         self.find_optimal_gains()
   1268         self.simulate()
   1269         self.generate_constraint_funcs()

/home/moorepants/src/inverted-pendulum-sys-id/pendulum.py in find_optimal_gains(self)
   1073         # Find some optimal gains for stablizing the pendulum on the cart.
   1074         print('Finding the optimal gains.')
-> 1075         self.gains = compute_controller_gains(self.num_links)
   1076 
   1077     def simulate(self):

/home/moorepants/src/inverted-pendulum-sys-id/pendulum.py in compute_controller_gains(num_links)
    127     B = np.dot(invM, F_B)
    128 
--> 129     assert controllable(A, B)
    130 
    131     Q = np.eye(len(states))

AssertionError: