From help-octave-request at bevo dot che dot wisc dot edu Mon Feb 16 09:59:53 2004 Subject: Re: Problem in OCST From: A S Hodel To: help-octave at bevo dot che dot wisc dot edu Date: Mon, 16 Feb 2004 09:58:36 -0600 --Apple-Mail-4--144331114 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8; format=flowed There weere some cell array/list structure problems in the OCST for=20 which I recently submitted fixes; they should be in the CVS sources shortly if not=20 already. However, your real problem below is in the command tf2sys([1,0,1],[1 0]) Octave will only accept transfer functions that have a realizable=20 state-space implementation. The above system has one more zero than pole, and so cannot be converted to state space form. I understand that MATLAB will permit non-proper transfer functions,=20 since many systems (e.g., the op-amp differentiation circuit) can be=20 approximated at low frequencies as differentiators. However, the omitted poles for=20= such an approximation will have an impact on the root-locus of a system, so=20= the results need to be handled carefully. For the time being, you'll need to put in an approximation to a=20 derivative, s "=3D" s/(tau*s + 1) where tau is very small. On Feb 16, 2004, at 1:48 AM, =E0=B8=9C=E0=B8=A8.=E0=B8=94=E0=B8=A3.=E0=B8=A8= =E0=B8=B8=E0=B8=A0=E0=B8=8A=E0=B8=B1=E0=B8=A2 = =E0=B8=A7=E0=B8=A3=E0=B8=9E=E0=B8=88=E0=B8=99=E0=B9=8C=E0=B8=9E=E0=B8=B4=E0= =B8=A8=E0=B8=B8=E0=B8=97=E0=B8=98=E0=B8=B4=E0=B9=8C wrote: > Hello, > > I plan to use Octave in my control theory classroom. However, I found=20= > some > strange problems while trying to simulate DC motor with PI controller. > Function bode() does not work even it should be. Now, I am using = Octave > 2.1.50a on Win2k downloaded from octave.sf.net. May someone please=20 > explain > how to solve this problem? > > Thank you in advance > Supachai > >>> motor =3D tf2sys([4500],[1 361.2 0]); >>> PI =3D tf2sys([1 0.1],[1 0]); >>> G =3D sysmult(motor,PI); > warning: in > /opt/octave/share/octave/2.1.50/m/control/system/__sysgroupn__.m near=20= > line > 44, column 9: > >>>> warning ("sysgroup: %s name(%d) =3D %s name(%d) =3D %s", kind, ii, = kind, > jj, st1); > > > warning: sysgroup: state name(1) =3D state name(3) =3D x_1 > warning: sysgroup: changed state name 3 to x_1_3 >>> bode(G) > error: number of columns must match (2 !=3D 1) > error: evaluating assignment expression near line 97, column 7 > error: evaluating if command near line 71, column 3 > error: called from `sysgroup' in file > `/opt/octave/share/octave/2.1.50/m/control/system/sysgroup.m' > error: evaluating assignment expression near line 96, column 9 > error: evaluating if command near line 65, column 3 > error: called from `sysmult' in file > `/opt/octave/share/octave/2.1.50/m/control/system/sysmult.m' > error: evaluating assignment expression near line 146, column 11 > error: evaluating while command near line 95, column 3 > error: called from `zp2ss' in file > `/opt/octave/share/octave/2.1.50/m/control/system/zp2ss.m' > error: evaluating if command near line 109, column 5 > error: evaluating if command near line 107, column 3 > error: called from `sysupdate' in file > `/opt/octave/share/octave/2.1.50/m/control/system/sysupdate.m' > error: evaluating assignment expression near line 153, column 9 > error: evaluating if command near line 152, column 3 > error: called from `sysgetsignals' in file > `/opt/octave/share/octave/2.1.50/m/control/system/sysgetsignals.m' > error: called from `bode' in file > `/opt/octave/share/octave/2.1.50/m/control/base/bode.m' >>> > > > > ------------------------------------------------------------- > Octave is freely available under the terms of the GNU GPL. > > Octave's home on the web: http://www.octave.org > How to fund new projects: http://www.octave.org/funding.html > Subscription information: http://www.octave.org/archive.html > ------------------------------------------------------------- > > > A. S. Hodel, Associate Professor, Dept. ECE, 200 Broun Hall, Auburn=20 University, AL, 36849-5201 334 844 1854 http://www.eng.auburn.edu/users/hodelas hodelas at auburn dot edu --Apple-Mail-4--144331114 Content-Transfer-Encoding: quoted-printable Content-Type: text/enriched; charset=UTF-8 There weere some cell array/list structure problems in the OCST for which I recently=20 submitted fixes; they should be in the CVS sources shortly if not already. However, your real problem below is in the command tf2sys([1,0,1],[1 0]) Octave will only accept transfer functions that have a realizable state-space implementation. The above system has one more zero than pole, and so cannot be converted to state space form. I understand that MATLAB will permit non-proper transfer functions, since many systems (e.g., the op-amp differentiation circuit) can be approximated at low frequencies as differentiators. However, the omitted poles for such an approximation will have an impact on the root-locus of a system, so the results need to be handled carefully. For the time being, you'll need to put in an approximation to a derivative, s "=3D" s/(tau*s + 1) where tau is very small. On Feb 16, 2004, at 1:48 AM, Lucida = Grande=E0=B8=9C=E0=B8=A8.Lucida = Grande=E0=B8=94=E0=B8=A3.Lucida = Grande=E0=B8=A8=E0=B8=B8=E0=B8=A0=E0=B8=8A=E0=B8=B1=E0=B8=A2 Lucida = Grande=E0=B8=A7=E0=B8=A3=E0=B8=9E=E0=B8=88=E0=B8=99=E0=B9=8C=E0=B8= =9E=E0=B8=B4=E0=B8=A8=E0=B8=B8=E0=B8=97=E0=B8=98=E0=B8=B4=E0=B9=8C wrote: Hello, I plan to use Octave in my control theory classroom. However, I found some strange problems while trying to simulate DC motor with PI controller. Function bode() does not work even it should be. Now, I am using Octave 2.1.50a on Win2k downloaded from octave.sf.net. May someone please explain how to solve this problem? Thank you in advance Supachai motor =3D tf2sys([4500],[1 361.2 0]); PI =3D tf2sys([1 0.1],[1 0]); G =3D sysmult(motor,PI); warning: in /opt/octave/share/octave/2.1.50/m/control/system/__sysgroupn__.m near line 44, column 9: warning ("sysgroup: %s name(%d) =3D %s name(%d) =3D %s", kind, ii, kind, jj, st1); warning: sysgroup: state name(1) =3D state name(3) =3D x_1 warning: sysgroup: changed state name 3 to x_1_3 bode(G) error: number of columns must match (2 !=3D 1) error: evaluating assignment expression near line 97, column 7 error: evaluating if command near line 71, column 3 error: called from `sysgroup' in file `/opt/octave/share/octave/2.1.50/m/control/system/sysgroup.m' error: evaluating assignment expression near line 96, column 9 error: evaluating if command near line 65, column 3 error: called from `sysmult' in file `/opt/octave/share/octave/2.1.50/m/control/system/sysmult.m' error: evaluating assignment expression near line 146, column 11 error: evaluating while command near line 95, column 3 error: called from `zp2ss' in file `/opt/octave/share/octave/2.1.50/m/control/system/zp2ss.m' error: evaluating if command near line 109, column 5 error: evaluating if command near line 107, column 3 error: called from `sysupdate' in file `/opt/octave/share/octave/2.1.50/m/control/system/sysupdate.m' error: evaluating assignment expression near line 153, column 9 error: evaluating if command near line 152, column 3 error: called from `sysgetsignals' in file `/opt/octave/share/octave/2.1.50/m/control/system/sysgetsignals.m' error: called from `bode' in file `/opt/octave/share/octave/2.1.50/m/control/base/bode.m' ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html ------------------------------------------------------------- A. S. Hodel, Associate Professor, Dept. ECE, 200 Broun Hall, Auburn University, AL, 36849-5201 334 844 1854 http://www.eng.auburn.edu/users/hodelas hodelas at auburn dot edu --Apple-Mail-4--144331114-- ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------