From: <par...@us...> - 2011-12-07 15:17:21
|
Revision: 9300 http://octave.svn.sourceforge.net/octave/?rev=9300&view=rev Author: paramaniac Date: 2011-12-07 15:17:11 +0000 (Wed, 07 Dec 2011) Log Message: ----------- control: solve problem with purely imaginary poles and zeros Modified Paths: -------------- trunk/octave-forge/main/control/inst/bode.m trunk/octave-forge/main/control/inst/bodemag.m trunk/octave-forge/main/control/inst/nichols.m trunk/octave-forge/main/control/inst/sigma.m Modified: trunk/octave-forge/main/control/inst/bode.m =================================================================== --- trunk/octave-forge/main/control/inst/bode.m 2011-12-07 13:40:26 UTC (rev 9299) +++ trunk/octave-forge/main/control/inst/bode.m 2011-12-07 15:17:11 UTC (rev 9300) @@ -1,4 +1,4 @@ -## Copyright (C) 2009, 2010 Lukas F. Reichlin +## Copyright (C) 2009, 2010, 2011 Lukas F. Reichlin ## ## This file is part of LTI Syncope. ## @@ -45,7 +45,7 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: November 2009 -## Version: 0.2 +## Version: 0.3 function [mag_r, pha_r, w_r] = bode (sys, w = []) @@ -78,6 +78,10 @@ subplot (2, 1, 1) semilogx (w, mag_db) + ax = axis; + if (any (isinf (ax_vec_mag))) # catch case purely imaginary poles or zeros + ax_vec_mag(3:4) = ax(3:4); + endif axis (ax_vec_mag) grid ("on") title (["Bode Diagram of ", inputname(1)]) Modified: trunk/octave-forge/main/control/inst/bodemag.m =================================================================== --- trunk/octave-forge/main/control/inst/bodemag.m 2011-12-07 13:40:26 UTC (rev 9299) +++ trunk/octave-forge/main/control/inst/bodemag.m 2011-12-07 15:17:11 UTC (rev 9300) @@ -1,4 +1,4 @@ -## Copyright (C) 2009, 2010 Lukas F. Reichlin +## Copyright (C) 2009, 2010, 2011 Lukas F. Reichlin ## ## This file is part of LTI Syncope. ## @@ -43,7 +43,7 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: November 2009 -## Version: 0.2 +## Version: 0.3 function [mag_r, w_r] = bodemag (sys, w = []) @@ -72,6 +72,10 @@ endif semilogx (w, mag_db) + ax = axis; + if (any (isinf (ax_vec_mag))) # catch case purely imaginary poles or zeros + ax_vec_mag(3:4) = ax(3:4); + endif axis (ax_vec_mag) grid ("on") title (["Bode Magnitude Diagram of ", inputname(1)]) Modified: trunk/octave-forge/main/control/inst/nichols.m =================================================================== --- trunk/octave-forge/main/control/inst/nichols.m 2011-12-07 13:40:26 UTC (rev 9299) +++ trunk/octave-forge/main/control/inst/nichols.m 2011-12-07 15:17:11 UTC (rev 9300) @@ -1,4 +1,4 @@ -## Copyright (C) 2009, 2010 Lukas F. Reichlin +## Copyright (C) 2009, 2010, 2011 Lukas F. Reichlin ## ## This file is part of LTI Syncope. ## @@ -45,7 +45,7 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: November 2009 -## Version: 0.2 +## Version: 0.3 function [mag_r, pha_r, w_r] = nichols (sys, w = []) @@ -66,6 +66,10 @@ ax_vec = __axis_limits__ ([reshape(pha, [], 1), reshape(mag_db, [], 1)]); plot (pha, mag_db) + ax = axis; + if (any (isinf (ax_vec))) # catch case purely imaginary poles or zeros + ax_vec(3:4) = ax(3:4); + endif axis (ax_vec) grid ("on") title (["Nichols Chart of ", inputname(1)]) Modified: trunk/octave-forge/main/control/inst/sigma.m =================================================================== --- trunk/octave-forge/main/control/inst/sigma.m 2011-12-07 13:40:26 UTC (rev 9299) +++ trunk/octave-forge/main/control/inst/sigma.m 2011-12-07 15:17:11 UTC (rev 9300) @@ -1,4 +1,4 @@ -## Copyright (C) 2009, 2010 Lukas F. Reichlin +## Copyright (C) 2009, 2010, 2011 Lukas F. Reichlin ## ## This file is part of LTI Syncope. ## @@ -57,7 +57,7 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: May 2009 -## Version: 0.4 +## Version: 0.5 function [sv_r, w_r] = sigma (sys, w = [], resptype = 0) @@ -91,6 +91,10 @@ ## plot results semilogx (w, sv_db, "b") + ax = axis; + if (any (isinf (ax_vec))) # catch case purely imaginary poles or zeros + ax_vec(3:4) = ax(3:4); + endif axis (ax_vec) title (["Singular Values of ", inputname(1)]) xlabel (xl_str) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |