From: Ryan K. <rk...@si...> - 2013-06-15 03:36:35
|
That seems to work, but I am trying to wrap my head around the validity of it. It seems to rescale the matrices to improve numeric conditioning. If the relationship between the input and outputs is not affected, do I just replace my old state-space model with this? -- Ryan Krauss, Ph.D. Associate Professor Mechanical Engineering Southern Illinois University Edwardsville On Fri, Jun 14, 2013 at 4:16 PM, Rene van Paassen <ren...@gm... > wrote: > How about balancing the matrix first? > > Today I made a little fix in tb01id, at https://github.com/repagh/Slycot > > I get no errors with the attached modification. Don't know if the result > is valid, though. > > > On 14 June 2013 19:59, Ryan Krauss <rk...@si...> wrote: > >> I assume this is most likely an ill conditioning problem on my part >> (though I don't know how to fix the model if that is the case, since it is >> fitting experimental data as well as an infinite dimensional model), but I >> am getting the following error from control.lqr: >> >> /Users/rkrauss/siue/Research/papers/SFLR_2010_paper/CND_ASME_Special_Issue_Version/python/SFLR_ROM_2013/LQG_learn/lqr_problem.py >> in <module>() >> 54 >> 55 #K = control.lqr(ol_sys, Q, 1.0) >> ---> 56 K, S, E = control.lqr(A, B, Q, 0.01) >> 57 >> 58 >> >> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/control-0.6d-py2.7.egg/control/statefbk.pyc >> in lqr(*args, **keywords) >> 236 >> 237 # Call the SLICOT function >> --> 238 X,rcond,w,S,U,A_inv = sb02md(nstates, A_b, G, Q_b, 'C') >> 239 >> 240 # Now compute the return value >> >> /usr/local/lib/python2.7/site-packages/slycot/synthesis.pyc in sb02md(n, >> A, G, Q, dico, hinv, uplo, scal, sort, ldwork) >> 348 e = ValueError('the Hamiltonian or symplectic matrix H >> has less than n stable eigenvalues') >> 349 e.info = info >> --> 350 raise e >> 351 if info == 5: >> 352 e = ValueError('if the N-th order system of linear >> algebraic equations is singular to working precision') >> >> ValueError: the Hamiltonian or symplectic matrix H has less than n stable >> eigenvalues >> >> In [5]: run lqr_problem.py >> >> --------------------------------------------------------------------------- >> ValueError Traceback (most recent call >> last) >> /usr/local/lib/python2.7/site-packages/IPython/utils/py3compat.pyc in >> execfile(fname, *where) >> 176 else: >> 177 filename = fname >> --> 178 __builtin__.execfile(filename, *where) >> >> /Users/rkrauss/siue/Research/papers/SFLR_2010_paper/CND_ASME_Special_Issue_Version/python/SFLR_ROM_2013/LQG_learn/lqr_problem.py >> in <module>() >> 53 Q = dot(Ca.T,Ca) >> 54 >> ---> 55 K, S, E = control.lqr(A, B, Q, 1.0) >> 56 >> 57 >> >> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/control-0.6d-py2.7.egg/control/statefbk.pyc >> in lqr(*args, **keywords) >> 236 >> 237 # Call the SLICOT function >> --> 238 X,rcond,w,S,U,A_inv = sb02md(nstates, A_b, G, Q_b, 'C') >> 239 >> 240 # Now compute the return value >> >> /usr/local/lib/python2.7/site-packages/slycot/synthesis.pyc in sb02md(n, >> A, G, Q, dico, hinv, uplo, scal, sort, ldwork) >> 348 e = ValueError('the Hamiltonian or symplectic matrix H >> has less than n stable eigenvalues') >> 349 e.info = info >> --> 350 raise e >> 351 if info == 5: >> 352 e = ValueError('if the N-th order system of linear >> algebraic equations is singular to working precision') >> >> ValueError: the Hamiltonian or symplectic matrix H has less than n stable >> eigenvalues >> >> -- >> Ryan Krauss, Ph.D. >> Associate Professor >> Mechanical Engineering >> Southern Illinois University Edwardsville >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Windows: >> >> Build for Windows Store. >> >> http://p.sf.net/sfu/windows-dev2dev >> _______________________________________________ >> python-control-discuss mailing list >> pyt...@li... >> https://lists.sourceforge.net/lists/listinfo/python-control-discuss >> >> > > > -- > René van Paassen | ______o____/_| Ren...@gm... > <[___\_\_-----< t: +31 15 2628685 > | o' mobile: +31 6 39846891 > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > > _______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss > > |