Diff of the two buildlogs: -- --- b1/build.log 2023-06-07 11:47:24.566539379 +0000 +++ b2/build.log 2023-06-07 11:55:18.453810213 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Tue Jun 6 23:38:57 -12 2023 -I: pbuilder-time-stamp: 1686137937 +I: Current time: Thu Jun 8 01:47:42 +14 2023 +I: pbuilder-time-stamp: 1686138462 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/bookworm-reproducible-base.tgz] I: copying local configuration @@ -16,7 +16,7 @@ I: copying [./octave-control_3.4.0.orig.tar.gz] I: copying [./octave-control_3.4.0-3.debian.tar.xz] I: Extracting source -gpgv: Signature made Sun Dec 4 20:51:50 2022 -12 +gpgv: Signature made Mon Dec 5 22:51:50 2022 +14 gpgv: using RSA key 3F464391498FE874BDB5D98F2124AA1983785C90 gpgv: issuer "rafael@debian.org" gpgv: Can't check signature: No public key @@ -31,135 +31,167 @@ dpkg-source: info: applying add-distclean-target.patch I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/6348/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/21088/tmp/hooks/D01_modify_environment starting +debug: Running on virt32c. +I: Changing host+domainname to test build reproducibility +I: Adding a custom variable just for the fun of it... +I: Changing /bin/sh to bash +'/bin/sh' -> '/bin/bash' +lrwxrwxrwx 1 root root 9 Jun 8 01:47 /bin/sh -> /bin/bash +I: Setting pbuilder2's login shell to /bin/bash +I: Setting pbuilder2's GECOS to second user,second room,second work-phone,second home-phone,second other +I: user script /srv/workspace/pbuilder/21088/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/21088/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='armhf' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=3 ' - DISTRIBUTION='bookworm' - HOME='/root' - HOST_ARCH='armhf' + BASH=/bin/sh + BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:globskipdots:hostcomplete:interactive_comments:patsub_replacement:progcomp:promptvars:sourcepath + BASH_ALIASES=() + BASH_ARGC=() + BASH_ARGV=() + BASH_CMDS=() + BASH_LINENO=([0]="12" [1]="0") + BASH_LOADABLES_PATH=/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:. + BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") + BASH_VERSINFO=([0]="5" [1]="2" [2]="15" [3]="1" [4]="release" [5]="arm-unknown-linux-gnueabihf") + BASH_VERSION='5.2.15(1)-release' + BUILDDIR=/build + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=armhf + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=4 ' + DIRSTACK=() + DISTRIBUTION=bookworm + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=arm + HOST_ARCH=armhf IFS=' ' - INVOCATION_ID='8c61e258eac24957a933399de51cd119' - LANG='C' - LANGUAGE='en_US:en' - LC_ALL='C' - MAIL='/var/mail/root' - OPTIND='1' - PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games' - PBCURRENTCOMMANDLINEOPERATION='build' - PBUILDER_OPERATION='build' - PBUILDER_PKGDATADIR='/usr/share/pbuilder' - PBUILDER_PKGLIBDIR='/usr/lib/pbuilder' - PBUILDER_SYSCONFDIR='/etc' - PPID='6348' - PS1='# ' - PS2='> ' + INVOCATION_ID=5e2d8ffa091e40ac97992044515a5c0f + LANG=C + LANGUAGE=it_CH:it + LC_ALL=C + MACHTYPE=arm-unknown-linux-gnueabihf + MAIL=/var/mail/root + OPTERR=1 + OPTIND=1 + OSTYPE=linux-gnueabihf + PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path + PBCURRENTCOMMANDLINEOPERATION=build + PBUILDER_OPERATION=build + PBUILDER_PKGDATADIR=/usr/share/pbuilder + PBUILDER_PKGLIBDIR=/usr/lib/pbuilder + PBUILDER_SYSCONFDIR=/etc + PIPESTATUS=([0]="0") + POSIXLY_CORRECT=y + PPID=21088 PS4='+ ' - PWD='/' - SHELL='/bin/bash' - SHLVL='2' - SUDO_COMMAND='/usr/bin/timeout -k 18.1h 18h /usr/bin/ionice -c 3 /usr/bin/nice /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.sJZ1vocu/pbuilderrc_lg9R --distribution bookworm --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bookworm-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.sJZ1vocu/b1 --logfile b1/build.log octave-control_3.4.0-3.dsc' - SUDO_GID='114' - SUDO_UID='108' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://10.0.0.15:3142/' + PWD=/ + SHELL=/bin/bash + SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix + SHLVL=3 + SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.sJZ1vocu/pbuilderrc_TCXo --distribution bookworm --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bookworm-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.sJZ1vocu/b2 --logfile b2/build.log --extrapackages usrmerge octave-control_3.4.0-3.dsc' + SUDO_GID=113 + SUDO_UID=107 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://10.0.0.15:3142/ I: uname -a - Linux jtx1c 5.10.0-23-arm64 #1 SMP Debian 5.10.179-1 (2023-05-12) aarch64 GNU/Linux + Linux i-capture-the-hostname 5.10.0-23-armmp-lpae #1 SMP Debian 5.10.179-1 (2023-05-12) armv7l GNU/Linux I: ls -l /bin total 5072 - -rwxr-xr-x 1 root root 838488 Apr 23 09:24 bash - -rwxr-xr-x 3 root root 67144 Sep 18 2022 bunzip2 - -rwxr-xr-x 3 root root 67144 Sep 18 2022 bzcat - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzcmp -> bzdiff - -rwxr-xr-x 1 root root 2225 Sep 18 2022 bzdiff - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzegrep -> bzgrep - -rwxr-xr-x 1 root root 4893 Nov 27 2021 bzexe - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzfgrep -> bzgrep - -rwxr-xr-x 1 root root 3775 Sep 18 2022 bzgrep - -rwxr-xr-x 3 root root 67144 Sep 18 2022 bzip2 - -rwxr-xr-x 1 root root 67112 Sep 18 2022 bzip2recover - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzless -> bzmore - -rwxr-xr-x 1 root root 1297 Sep 18 2022 bzmore - -rwxr-xr-x 1 root root 67632 Sep 20 2022 cat - -rwxr-xr-x 1 root root 67676 Sep 20 2022 chgrp - -rwxr-xr-x 1 root root 67644 Sep 20 2022 chmod - -rwxr-xr-x 1 root root 67684 Sep 20 2022 chown - -rwxr-xr-x 1 root root 133532 Sep 20 2022 cp - -rwxr-xr-x 1 root root 132868 Jan 5 01:20 dash - -rwxr-xr-x 1 root root 133220 Sep 20 2022 date - -rwxr-xr-x 1 root root 67732 Sep 20 2022 dd - -rwxr-xr-x 1 root root 68104 Sep 20 2022 df - -rwxr-xr-x 1 root root 133632 Sep 20 2022 dir - -rwxr-xr-x 1 root root 59128 Mar 22 21:02 dmesg - lrwxrwxrwx 1 root root 8 Dec 19 01:33 dnsdomainname -> hostname - lrwxrwxrwx 1 root root 8 Dec 19 01:33 domainname -> hostname - -rwxr-xr-x 1 root root 67560 Sep 20 2022 echo - -rwxr-xr-x 1 root root 41 Jan 24 02:43 egrep - -rwxr-xr-x 1 root root 67548 Sep 20 2022 false - -rwxr-xr-x 1 root root 41 Jan 24 02:43 fgrep - -rwxr-xr-x 1 root root 55748 Mar 22 21:02 findmnt - -rwsr-xr-x 1 root root 26208 Mar 22 20:15 fusermount - -rwxr-xr-x 1 root root 128608 Jan 24 02:43 grep - -rwxr-xr-x 2 root root 2346 Apr 9 2022 gunzip - -rwxr-xr-x 1 root root 6447 Apr 9 2022 gzexe - -rwxr-xr-x 1 root root 64220 Apr 9 2022 gzip - -rwxr-xr-x 1 root root 67032 Dec 19 01:33 hostname - -rwxr-xr-x 1 root root 67720 Sep 20 2022 ln - -rwxr-xr-x 1 root root 35132 Mar 22 21:51 login - -rwxr-xr-x 1 root root 133632 Sep 20 2022 ls - -rwxr-xr-x 1 root root 136808 Mar 22 21:02 lsblk - -rwxr-xr-x 1 root root 67800 Sep 20 2022 mkdir - -rwxr-xr-x 1 root root 67764 Sep 20 2022 mknod - -rwxr-xr-x 1 root root 67596 Sep 20 2022 mktemp - -rwxr-xr-x 1 root root 38504 Mar 22 21:02 more - -rwsr-xr-x 1 root root 38496 Mar 22 21:02 mount - -rwxr-xr-x 1 root root 9824 Mar 22 21:02 mountpoint - -rwxr-xr-x 1 root root 133532 Sep 20 2022 mv - lrwxrwxrwx 1 root root 8 Dec 19 01:33 nisdomainname -> hostname - lrwxrwxrwx 1 root root 14 Apr 2 18:25 pidof -> /sbin/killall5 - -rwxr-xr-x 1 root root 67608 Sep 20 2022 pwd - lrwxrwxrwx 1 root root 4 Apr 23 09:24 rbash -> bash - -rwxr-xr-x 1 root root 67600 Sep 20 2022 readlink - -rwxr-xr-x 1 root root 67672 Sep 20 2022 rm - -rwxr-xr-x 1 root root 67600 Sep 20 2022 rmdir - -rwxr-xr-x 1 root root 67400 Nov 2 2022 run-parts - -rwxr-xr-x 1 root root 133372 Jan 5 07:55 sed - lrwxrwxrwx 1 root root 4 Jan 5 01:20 sh -> dash - -rwxr-xr-x 1 root root 67584 Sep 20 2022 sleep - -rwxr-xr-x 1 root root 67644 Sep 20 2022 stty - -rwsr-xr-x 1 root root 50800 Mar 22 21:02 su - -rwxr-xr-x 1 root root 67584 Sep 20 2022 sync - -rwxr-xr-x 1 root root 336764 Apr 6 02:25 tar - -rwxr-xr-x 1 root root 67144 Nov 2 2022 tempfile - -rwxr-xr-x 1 root root 133224 Sep 20 2022 touch - -rwxr-xr-x 1 root root 67548 Sep 20 2022 true - -rwxr-xr-x 1 root root 9768 Mar 22 20:15 ulockmgr_server - -rwsr-xr-x 1 root root 22108 Mar 22 21:02 umount - -rwxr-xr-x 1 root root 67572 Sep 20 2022 uname - -rwxr-xr-x 2 root root 2346 Apr 9 2022 uncompress - -rwxr-xr-x 1 root root 133632 Sep 20 2022 vdir - -rwxr-xr-x 1 root root 42608 Mar 22 21:02 wdctl - lrwxrwxrwx 1 root root 8 Dec 19 01:33 ypdomainname -> hostname - -rwxr-xr-x 1 root root 1984 Apr 9 2022 zcat - -rwxr-xr-x 1 root root 1678 Apr 9 2022 zcmp - -rwxr-xr-x 1 root root 6460 Apr 9 2022 zdiff - -rwxr-xr-x 1 root root 29 Apr 9 2022 zegrep - -rwxr-xr-x 1 root root 29 Apr 9 2022 zfgrep - -rwxr-xr-x 1 root root 2081 Apr 9 2022 zforce - -rwxr-xr-x 1 root root 8103 Apr 9 2022 zgrep - -rwxr-xr-x 1 root root 2206 Apr 9 2022 zless - -rwxr-xr-x 1 root root 1842 Apr 9 2022 zmore - -rwxr-xr-x 1 root root 4577 Apr 9 2022 znew -I: user script /srv/workspace/pbuilder/6348/tmp/hooks/D02_print_environment finished + -rwxr-xr-x 1 root root 838488 Apr 24 11:24 bash + -rwxr-xr-x 3 root root 67144 Sep 19 2022 bunzip2 + -rwxr-xr-x 3 root root 67144 Sep 19 2022 bzcat + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzcmp -> bzdiff + -rwxr-xr-x 1 root root 2225 Sep 19 2022 bzdiff + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzegrep -> bzgrep + -rwxr-xr-x 1 root root 4893 Nov 28 2021 bzexe + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzfgrep -> bzgrep + -rwxr-xr-x 1 root root 3775 Sep 19 2022 bzgrep + -rwxr-xr-x 3 root root 67144 Sep 19 2022 bzip2 + -rwxr-xr-x 1 root root 67112 Sep 19 2022 bzip2recover + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzless -> bzmore + -rwxr-xr-x 1 root root 1297 Sep 19 2022 bzmore + -rwxr-xr-x 1 root root 67632 Sep 21 2022 cat + -rwxr-xr-x 1 root root 67676 Sep 21 2022 chgrp + -rwxr-xr-x 1 root root 67644 Sep 21 2022 chmod + -rwxr-xr-x 1 root root 67684 Sep 21 2022 chown + -rwxr-xr-x 1 root root 133532 Sep 21 2022 cp + -rwxr-xr-x 1 root root 132868 Jan 6 03:20 dash + -rwxr-xr-x 1 root root 133220 Sep 21 2022 date + -rwxr-xr-x 1 root root 67732 Sep 21 2022 dd + -rwxr-xr-x 1 root root 68104 Sep 21 2022 df + -rwxr-xr-x 1 root root 133632 Sep 21 2022 dir + -rwxr-xr-x 1 root root 59128 Mar 23 23:02 dmesg + lrwxrwxrwx 1 root root 8 Dec 20 03:33 dnsdomainname -> hostname + lrwxrwxrwx 1 root root 8 Dec 20 03:33 domainname -> hostname + -rwxr-xr-x 1 root root 67560 Sep 21 2022 echo + -rwxr-xr-x 1 root root 41 Jan 25 04:43 egrep + -rwxr-xr-x 1 root root 67548 Sep 21 2022 false + -rwxr-xr-x 1 root root 41 Jan 25 04:43 fgrep + -rwxr-xr-x 1 root root 55748 Mar 23 23:02 findmnt + -rwsr-xr-x 1 root root 26208 Mar 23 22:15 fusermount + -rwxr-xr-x 1 root root 128608 Jan 25 04:43 grep + -rwxr-xr-x 2 root root 2346 Apr 10 2022 gunzip + -rwxr-xr-x 1 root root 6447 Apr 10 2022 gzexe + -rwxr-xr-x 1 root root 64220 Apr 10 2022 gzip + -rwxr-xr-x 1 root root 67032 Dec 20 03:33 hostname + -rwxr-xr-x 1 root root 67720 Sep 21 2022 ln + -rwxr-xr-x 1 root root 35132 Mar 23 23:51 login + -rwxr-xr-x 1 root root 133632 Sep 21 2022 ls + -rwxr-xr-x 1 root root 136808 Mar 23 23:02 lsblk + -rwxr-xr-x 1 root root 67800 Sep 21 2022 mkdir + -rwxr-xr-x 1 root root 67764 Sep 21 2022 mknod + -rwxr-xr-x 1 root root 67596 Sep 21 2022 mktemp + -rwxr-xr-x 1 root root 38504 Mar 23 23:02 more + -rwsr-xr-x 1 root root 38496 Mar 23 23:02 mount + -rwxr-xr-x 1 root root 9824 Mar 23 23:02 mountpoint + -rwxr-xr-x 1 root root 133532 Sep 21 2022 mv + lrwxrwxrwx 1 root root 8 Dec 20 03:33 nisdomainname -> hostname + lrwxrwxrwx 1 root root 14 Apr 3 20:25 pidof -> /sbin/killall5 + -rwxr-xr-x 1 root root 67608 Sep 21 2022 pwd + lrwxrwxrwx 1 root root 4 Apr 24 11:24 rbash -> bash + -rwxr-xr-x 1 root root 67600 Sep 21 2022 readlink + -rwxr-xr-x 1 root root 67672 Sep 21 2022 rm + -rwxr-xr-x 1 root root 67600 Sep 21 2022 rmdir + -rwxr-xr-x 1 root root 67400 Nov 3 2022 run-parts + -rwxr-xr-x 1 root root 133372 Jan 6 09:55 sed + lrwxrwxrwx 1 root root 9 Jun 8 01:47 sh -> /bin/bash + -rwxr-xr-x 1 root root 67584 Sep 21 2022 sleep + -rwxr-xr-x 1 root root 67644 Sep 21 2022 stty + -rwsr-xr-x 1 root root 50800 Mar 23 23:02 su + -rwxr-xr-x 1 root root 67584 Sep 21 2022 sync + -rwxr-xr-x 1 root root 336764 Apr 7 04:25 tar + -rwxr-xr-x 1 root root 67144 Nov 3 2022 tempfile + -rwxr-xr-x 1 root root 133224 Sep 21 2022 touch + -rwxr-xr-x 1 root root 67548 Sep 21 2022 true + -rwxr-xr-x 1 root root 9768 Mar 23 22:15 ulockmgr_server + -rwsr-xr-x 1 root root 22108 Mar 23 23:02 umount + -rwxr-xr-x 1 root root 67572 Sep 21 2022 uname + -rwxr-xr-x 2 root root 2346 Apr 10 2022 uncompress + -rwxr-xr-x 1 root root 133632 Sep 21 2022 vdir + -rwxr-xr-x 1 root root 42608 Mar 23 23:02 wdctl + lrwxrwxrwx 1 root root 8 Dec 20 03:33 ypdomainname -> hostname + -rwxr-xr-x 1 root root 1984 Apr 10 2022 zcat + -rwxr-xr-x 1 root root 1678 Apr 10 2022 zcmp + -rwxr-xr-x 1 root root 6460 Apr 10 2022 zdiff + -rwxr-xr-x 1 root root 29 Apr 10 2022 zegrep + -rwxr-xr-x 1 root root 29 Apr 10 2022 zfgrep + -rwxr-xr-x 1 root root 2081 Apr 10 2022 zforce + -rwxr-xr-x 1 root root 8103 Apr 10 2022 zgrep + -rwxr-xr-x 1 root root 2206 Apr 10 2022 zless + -rwxr-xr-x 1 root root 1842 Apr 10 2022 zmore + -rwxr-xr-x 1 root root 4577 Apr 10 2022 znew +I: user script /srv/workspace/pbuilder/21088/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -708,7 +740,7 @@ Get: 505 http://deb.debian.org/debian bookworm/main armhf dh-octave all 1.2.7 [22.8 kB] Get: 506 http://deb.debian.org/debian bookworm/main armhf libslicot0 armhf 5.0+20101122-4 [891 kB] Get: 507 http://deb.debian.org/debian bookworm/main armhf libslicot-dev armhf 5.0+20101122-4 [944 kB] -Fetched 172 MB in 15s (11.7 MB/s) +Fetched 172 MB in 7s (26.2 MB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package netbase. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 19324 files and directories currently installed.) @@ -2787,8 +2819,19 @@ Writing extended state information... Building tag database... -> Finished parsing the build-deps +Reading package lists... +Building dependency tree... +Reading state information... +usrmerge is already the newest version (35). +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. I: Building the package -I: Running cd /build/octave-control-3.4.0/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-genchanges -S > ../octave-control_3.4.0-3_source.changes +I: user script /srv/workspace/pbuilder/21088/tmp/hooks/A99_set_merged_usr starting +Re-configuring usrmerge... +removed '/etc/unsupported-skip-usrmerge-conversion' +The system has been successfully converted. +I: user script /srv/workspace/pbuilder/21088/tmp/hooks/A99_set_merged_usr finished +hostname: Name or service not known +I: Running cd /build/octave-control-3.4.0/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-genchanges -S > ../octave-control_3.4.0-3_source.changes dpkg-buildpackage: info: source package octave-control dpkg-buildpackage: info: source version 3.4.0-3 dpkg-buildpackage: info: source distribution unstable @@ -2845,37 +2888,37 @@ config.status: creating config.h make[1]: Entering directory '/build/octave-control-3.4.0/src' mkdir -p sltmp -cp AB08NX.fortran sltmp/AB08NX.f mkdir -p sltmp +cp AB08NX.fortran sltmp/AB08NX.f cp AG08BY.fortran sltmp/AG08BY.f mkdir -p sltmp -cp SB01BY.fortran sltmp/SB01BY.f mkdir -p sltmp +cp SB01BY.fortran sltmp/SB01BY.f cp SB01FY.fortran sltmp/SB01FY.f mkdir -p sltmp -cp SB06ND.fortran sltmp/SB06ND.f mkdir -p sltmp +cp SB06ND.fortran sltmp/SB06ND.f cp TB01MD.fortran sltmp/TB01MD.f mkdir -p sltmp -cp TB01ND.fortran sltmp/TB01ND.f mkdir -p sltmp +cp TB01ND.fortran sltmp/TB01ND.f cp TB01ZD.fortran sltmp/TB01ZD.f mkdir -p sltmp -cp TG04BX.fortran sltmp/TG04BX.f mkdir -p sltmp +cp TG04BX.fortran sltmp/TG04BX.f cp ODLTZM.fortran sltmp/ODLTZM.f mkdir -p sltmp -cp SB04OD.fortran sltmp/SB04OD.f mkdir -p sltmp +cp SB04OD.fortran sltmp/SB04OD.f cp SG03AD.fortran sltmp/SG03AD.f mkdir -p sltmp -cp SG03BD.fortran sltmp/SG03BD.f /usr/bin/mkoctfile --verbose -Wall -Wno-deprecated-declarations __control_helper_functions__.cc -g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-deprecated-declarations __control_helper_functions__.cc -o /tmp/oct-NgIm7L.o +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-deprecated-declarations __control_helper_functions__.cc -o /tmp/oct-WFuOgh.o +cp SG03BD.fortran sltmp/SG03BD.f LDFLAGS="-Wl,-z,relro -llapack -lblas -L/usr/lib/gcc/arm-linux-gnueabihf/12 -L/usr/lib/gcc/arm-linux-gnueabihf/12/../../../arm-linux-gnueabihf -L/usr/lib/gcc/arm-linux-gnueabihf/12/../../.. -L/lib/arm-linux-gnueabihf -L/usr/lib/arm-linux-gnueabihf -lgfortran -lm" \ /usr/bin/mkoctfile --verbose -Wall -Wno-deprecated-declarations __control_slicot_functions__.cc common.cc sltmp/AB08NX.f sltmp/AG08BY.f sltmp/SB01BY.f sltmp/SB01FY.f sltmp/SB06ND.f sltmp/TB01MD.f sltmp/TB01ND.f sltmp/TB01ZD.f sltmp/TG04BX.f sltmp/ODLTZM.f sltmp/SB04OD.f sltmp/SG03AD.f sltmp/SG03BD.f -lslicot -gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/AB08NX.f -o /tmp/oct-rZ03DW.o -gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/AG08BY.f -o /tmp/oct-TFQCvd.o +gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/AB08NX.f -o /tmp/oct-2GRsVa.o +gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/AG08BY.f -o /tmp/oct-5dDThe.o sltmp/AG08BY.f:650:72: 650 | $ INFZ(NBLCKS-1) = MUIM1 - TAUI @@ -2886,8 +2929,8 @@ 271 | $ MNTAU, MP1, MPM, MUI, MUIM1, N1, NB, NBLCKS, | ^ note: 'muim1' was declared here -gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/SB01BY.f -o /tmp/oct-dV4E2A.o -gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/SB01FY.f -o /tmp/oct-MJLX9P.o +gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/SB01BY.f -o /tmp/oct-aAp6NX.o +gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/SB01FY.f -o /tmp/oct-6UPbNs.o sltmp/SB01FY.f:298:72: 298 | R12 = CS*R12 + SN*U(1,2) @@ -2898,10 +2941,10 @@ 137 | DOUBLE PRECISION CS, R11, R12, R22, SCALE, SN, TEMP | ^ note: 'r12' was declared here -gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/SB06ND.f -o /tmp/oct-noW5pq.o -gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/TB01MD.f -o /tmp/oct-Mdh6FR.o -gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/TB01ND.f -o /tmp/oct-ygHEJV.o -gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/TB01ZD.f -o /tmp/oct-04SF3R.o +gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/SB06ND.f -o /tmp/oct-s9YQTC.o +gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/TB01MD.f -o /tmp/oct-hiKV4J.o +gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/TB01ND.f -o /tmp/oct-a7yKU0.o +gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/TB01ZD.f -o /tmp/oct-cwS0te.o sltmp/TB01ZD.f:381:19: 381 | IF ( LPIV ) THEN @@ -2932,9 +2975,9 @@ 231 | DOUBLE PRECISION ANORM, B1, BNORM, FANORM, FBNORM, H, THRESH, | ^ note: 'thresh' was declared here -gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/TG04BX.f -o /tmp/oct-usBcbb.o -gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/ODLTZM.f -o /tmp/oct-PAqcw5.o -gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/SB04OD.f -o /tmp/oct-yon3Yg.o +gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/TG04BX.f -o /tmp/oct-eNxeoz.o +gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/ODLTZM.f -o /tmp/oct-9aFzbY.o +gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/SB04OD.f -o /tmp/oct-KyT99S.o sltmp/SB04OD.f:888:23: 888 | IF ( LJOBD.OR.LJOBF ) @@ -2980,85 +3023,118 @@ 418 | LOGICAL ILASCL, ILBSCL, ILDSCL, ILESCL, LJOB1, LJOB2, | ^ note: 'ljob1' was declared here -gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/SG03AD.f -o /tmp/oct-v2xpJv.o -gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/SG03BD.f -o /tmp/oct-fXyUGO.o -g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-deprecated-declarations __control_slicot_functions__.cc -o /tmp/oct-R7kcKI.o -g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-deprecated-declarations -o __control_helper_functions__.oct /tmp/oct-NgIm7L.o -shared -Wl,-Bsymbolic -Wl,-z,relro -llapack -lblas -L/usr/lib/gcc/arm-linux-gnueabihf/12 -L/usr/lib/gcc/arm-linux-gnueabihf/12/../../../arm-linux-gnueabihf -L/usr/lib/gcc/arm-linux-gnueabihf/12/../../.. -L/lib/arm-linux-gnueabihf -L/usr/lib/arm-linux-gnueabihf -lgfortran -lm -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro -g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-deprecated-declarations common.cc -o /tmp/oct-WwN2X4.o -g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-deprecated-declarations -o __control_slicot_functions__.oct /tmp/oct-rZ03DW.o /tmp/oct-TFQCvd.o /tmp/oct-dV4E2A.o /tmp/oct-MJLX9P.o /tmp/oct-noW5pq.o /tmp/oct-Mdh6FR.o /tmp/oct-ygHEJV.o /tmp/oct-04SF3R.o /tmp/oct-usBcbb.o /tmp/oct-PAqcw5.o /tmp/oct-yon3Yg.o /tmp/oct-v2xpJv.o /tmp/oct-fXyUGO.o /tmp/oct-R7kcKI.o /tmp/oct-WwN2X4.o -lslicot -shared -Wl,-Bsymbolic -Wl,-z,relro -llapack -lblas -L/usr/lib/gcc/arm-linux-gnueabihf/12 -L/usr/lib/gcc/arm-linux-gnueabihf/12/../../../arm-linux-gnueabihf -L/usr/lib/gcc/arm-linux-gnueabihf/12/../../.. -L/lib/arm-linux-gnueabihf -L/usr/lib/arm-linux-gnueabihf -lgfortran -lm -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro +gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/SG03AD.f -o /tmp/oct-JISZI9.o +gfortran -c -fPIC -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wall -Wno-deprecated-declarations sltmp/SG03BD.f -o /tmp/oct-TtY27k.o +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-deprecated-declarations __control_slicot_functions__.cc -o /tmp/oct-g1Ky8L.o +g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-deprecated-declarations -o __control_helper_functions__.oct /tmp/oct-WFuOgh.o -shared -Wl,-Bsymbolic -Wl,-z,relro -llapack -lblas -L/usr/lib/gcc/arm-linux-gnueabihf/12 -L/usr/lib/gcc/arm-linux-gnueabihf/12/../../../arm-linux-gnueabihf -L/usr/lib/gcc/arm-linux-gnueabihf/12/../../.. -L/lib/arm-linux-gnueabihf -L/usr/lib/arm-linux-gnueabihf -lgfortran -lm -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-deprecated-declarations common.cc -o /tmp/oct-tj6gcX.o +g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-control-3.4.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-deprecated-declarations -o __control_slicot_functions__.oct /tmp/oct-2GRsVa.o /tmp/oct-5dDThe.o /tmp/oct-aAp6NX.o /tmp/oct-6UPbNs.o /tmp/oct-s9YQTC.o /tmp/oct-hiKV4J.o /tmp/oct-a7yKU0.o /tmp/oct-cwS0te.o /tmp/oct-eNxeoz.o /tmp/oct-9aFzbY.o /tmp/oct-KyT99S.o /tmp/oct-JISZI9.o /tmp/oct-TtY27k.o /tmp/oct-g1Ky8L.o /tmp/oct-tj6gcX.o -lslicot -shared -Wl,-Bsymbolic -Wl,-z,relro -llapack -lblas -L/usr/lib/gcc/arm-linux-gnueabihf/12 -L/usr/lib/gcc/arm-linux-gnueabihf/12/../../../arm-linux-gnueabihf -L/usr/lib/gcc/arm-linux-gnueabihf/12/../../.. -L/lib/arm-linux-gnueabihf -L/usr/lib/arm-linux-gnueabihf -lgfortran -lm -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro make[1]: Leaving directory '/build/octave-control-3.4.0/src' copyfile /build/octave-control-3.4.0/./src/__control_helper_functions__.oct /build/octave-control-3.4.0/./src/__control_slicot_functions__.oct /build/octave-control-3.4.0/./inst/arm-unknown-linux-gnueabihf-api-v57 For information about changes from previous versions of the control package, run 'news control'. dh_octave_check -O--buildsystem=octave Checking package... Checking m files ... -[inst/dsort.m] ->>>>> /build/octave-control-3.4.0/inst/dsort.m -***** shared s_exp, ndx_exp, s_obs, ndx_obs - p = [-0.2410+0.5573i; - -0.2410-0.5573i; - 0.1503; - -0.0972; - -0.2590]; - s_exp = [ -0.2410+0.5573i; - -0.2410-0.5573i; - -0.2590; - 0.1503; - -0.0972]; - ndx_exp = [ 1; - 2; - 5; - 3; - 4]; - [s_obs, ndx_obs] = dsort(p); -***** assert(s_obs, s_exp, 0); -***** assert(ndx_obs, ndx_exp, 0); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/filt.m] ->>>>> /build/octave-control-3.4.0/inst/filt.m -***** shared num, den, n1, d1, n2, d2, n2e, d2e - num = [0, 3]; - den = [1, 4, 2]; - sys = filt (num, den); - [n1, d1] = filtdata (sys, "vector"); - [n2, d2] = tfdata (sys, "vector"); - n2e = [3, 0]; - d2e = [1, 4, 2]; -***** assert (n1, num, 1e-4); -***** assert (d1, den, 1e-4); -***** assert (n2, n2e, 1e-4); -***** assert (d2, d2e, 1e-4); -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/hsvd.m] ->>>>> /build/octave-control-3.4.0/inst/hsvd.m -***** shared hsv, hsv_exp - a = [ -0.04165 0.0000 4.9200 -4.9200 0.0000 0.0000 0.0000 - -5.2100 -12.500 0.0000 0.0000 0.0000 0.0000 0.0000 - 0.0000 3.3300 -3.3300 0.0000 0.0000 0.0000 0.0000 - 0.5450 0.0000 0.0000 0.0000 -0.5450 0.0000 0.0000 - 0.0000 0.0000 0.0000 4.9200 -0.04165 0.0000 4.9200 - 0.0000 0.0000 0.0000 0.0000 -5.2100 -12.500 0.0000 - 0.0000 0.0000 0.0000 0.0000 0.0000 3.3300 -3.3300]; +[inst/lyap.m] +>>>>> /build/octave-control-3.4.0/inst/lyap.m +***** shared X, X_exp + A = [1, 2; -3, -4]; + Q = [3, 1; 1, 1]; + X = lyap (A, Q); + X_exp = [ 6.1667, -3.8333; + -3.8333, 3.0000]; +***** assert (X, X_exp, 1e-4); +***** shared X, X_exp + A = [2.0 1.0 3.0 + 0.0 2.0 1.0 + 6.0 1.0 2.0]; - b = [ 0.0000 0.0000 - 12.5000 0.0000 - 0.0000 0.0000 - 0.0000 0.0000 - 0.0000 0.0000 - 0.0000 12.500 - 0.0000 0.0000]; + B = [2.0 1.0 + 1.0 6.0]; - c = [ 1.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 - 0.0000 0.0000 0.0000 1.0000 0.0000 0.0000 0.0000 - 0.0000 0.0000 0.0000 0.0000 1.0000 0.0000 0.0000]; + C = [2.0 1.0 + 1.0 4.0 + 0.0 5.0]; - sys = ss (a, b, c, [], "scaled", true); - hsv = hsvd (sys, "alpha", 0.0); + X = lyap (A, B, -C); - hsv_exp = [2.5139; 2.0846; 1.9178; 0.7666; 0.5473; 0.0253; 0.0246]; + X_exp = [-2.7685 0.5498 + -1.0531 0.6865 + 4.5257 -0.4389]; -***** assert (hsv, hsv_exp, 1e-4); -1 test, 1 passed, 0 known failure, 0 skipped +***** assert (X, X_exp, 1e-4); +***** shared X, X_exp + A = [ 3.0 1.0 1.0 + 1.0 3.0 0.0 + 1.0 0.0 2.0]; + + E = [ 1.0 3.0 0.0 + 3.0 2.0 1.0 + 1.0 0.0 1.0]; + + B = [-64.0 -73.0 -28.0 + -73.0 -70.0 -25.0 + -28.0 -25.0 -18.0]; + + X = lyap (A.', -B, [], E.'); + + X_exp = [-2.0000 -1.0000 0.0000 + -1.0000 -3.0000 -1.0000 + 0.0000 -1.0000 -3.0000]; + +***** assert (X, X_exp, 1e-4); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/lyapchol.m] +>>>>> /build/octave-control-3.4.0/inst/lyapchol.m +***** shared U, U_exp, X, X_exp + + A = [ -1.0 37.0 -12.0 -12.0 + -1.0 -10.0 0.0 4.0 + 2.0 -4.0 7.0 -6.0 + 2.0 2.0 7.0 -9.0 ].'; + + B = [ 1.0 2.5 1.0 3.5 + 0.0 1.0 0.0 1.0 + -1.0 -2.5 -1.0 -1.5 + 1.0 2.5 4.0 -5.5 + -1.0 -2.5 -4.0 3.5 ].'; + + U = lyapchol (A, B); + + X = U.' * U; # use lyap at home! + + U_exp = [ 1.0000 0.0000 0.0000 0.0000 + 3.0000 1.0000 0.0000 0.0000 + 2.0000 -1.0000 1.0000 0.0000 + -1.0000 1.0000 -2.0000 1.0000 ].'; + + X_exp = [ 1.0000 3.0000 2.0000 -1.0000 + 3.0000 10.0000 5.0000 -2.0000 + 2.0000 5.0000 6.0000 -5.0000 + -1.0000 -2.0000 -5.0000 7.0000 ]; + +***** assert (U, U_exp, 1e-4); +***** assert (X, X_exp, 1e-4); +***** shared U, U_exp, X, X_exp + + A = [ -1.0 3.0 -4.0 + 0.0 5.0 -2.0 + -4.0 4.0 1.0 ].'; + + E = [ 2.0 1.0 3.0 + 2.0 0.0 1.0 + 4.0 5.0 1.0 ].'; + + B = [ 2.0 -1.0 7.0 ].'; + + U = lyapchol (A, B, E); + + U_exp = [ 1.6003 -0.4418 -0.1523 + 0.0000 0.6795 -0.2499 + 0.0000 0.0000 0.2041 ]; + +***** assert (U, U_exp, 1e-4); +3 tests, 3 passed, 0 known failure, 0 skipped [inst/pole.m] >>>>> /build/octave-control-3.4.0/inst/pole.m ***** shared pol_exp, pol_obs @@ -3123,41 +3199,401 @@ ***** assert (kronr, kronr_exp); ***** assert (kronl, kronl_exp); 5 tests, 5 passed, 0 known failure, 0 skipped -[inst/ctrbf.m] ->>>>> /build/octave-control-3.4.0/inst/ctrbf.m -***** shared Ao, Bo, Co, Zo, Ae, Be, Ce, Ze, NCONT - A = [ -1.0 0.0 0.0 - -2.0 -2.0 -2.0 - -1.0 0.0 -3.0 ]; +[inst/cfconred.m] +>>>>> /build/octave-control-3.4.0/inst/cfconred.m +***** shared Mo, Me, Info, HSVe + A = [ 0 1.0000 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + 0 0 -0.0150 0.7650 0 0 0 0 + 0 0 -0.7650 -0.0150 0 0 0 0 + 0 0 0 0 -0.0280 1.4100 0 0 + 0 0 0 0 -1.4100 -0.0280 0 0 + 0 0 0 0 0 0 -0.0400 1.850 + 0 0 0 0 0 0 -1.8500 -0.040 ]; - B = [ 1.0 0.0 0.0 - 0.0 2.0 1.0 ].'; + B = [ 0.0260 + -0.2510 + 0.0330 + -0.8860 + -4.0170 + 0.1450 + 3.6040 + 0.2800 ]; - C = [ 0.0 2.0 1.0 - 1.0 0.0 0.0 ]; + C = [ -.996 -.105 0.261 .009 -.001 -.043 0.002 -0.026 ]; - [Ao, Bo, Co, Zo, NCONT] = ctrbf (A, B, C); + D = [ 0.0 ]; - Ae = [ -3.0000 2.2361 - 0.0000 -1.0000 ]; + G = ss (A, B, C, D); % "scaled", false - Be = [ 0.0000 -2.2361 - 1.0000 0.0000 ]; + F = [ 4.4721e-002 6.6105e-001 4.6986e-003 3.6014e-001 1.0325e-001 -3.7541e-002 -4.2685e-002 3.2873e-002 ]; - Ce = [ -2.2361 0.0000 - 0.0000 1.0000 ]; + L = [ 4.1089e-001 + 8.6846e-002 + 3.8523e-004 + -3.6194e-003 + -8.8037e-003 + 8.4205e-003 + 1.2349e-003 + 4.2632e-003 ]; - Ze = [ 0.0000 1.0000 0.0000 - -0.8944 0.0000 -0.4472 - -0.4472 0.0000 0.8944 ]; + [Kr, Info] = cfconred (G, F, L, 4, "method", "bfsr-bta", "cf", "left", "feedback", "+"); + [Ao, Bo, Co, Do] = ssdata (Kr); -***** assert (Ao(1:NCONT, 1:NCONT), Ae, 1e-4); -***** assert (Bo(1:NCONT, :), Be, 1e-4); -***** assert (Co(:, 1:NCONT), Ce, 1e-4); -***** assert (Zo, Ze, 1e-4); + Ae = [ 0.5946 -0.7336 0.1914 -0.3368 + 0.5960 -0.0184 -0.1088 0.0207 + 1.2253 0.2043 0.1009 -1.4948 + -0.0330 -0.0243 1.3440 0.0035 ]; + + Be = [ 0.0015 + -0.0202 + 0.0159 + -0.0544 ]; + + Ce = [ 0.3534 0.0274 0.0337 -0.0320 ]; + + De = [ 0.0000 ]; + + HSVe = [ 4.9078 4.8745 3.8455 3.7811 1.2289 1.1785 0.5176 0.1148 ].'; + + Mo = [Ao, Bo; Co, Do]; + Me = [Ae, Be; Ce, De]; + +***** xtest assert (Mo, Me, 1e-4); +***** assert (Info.hsv, HSVe, 1e-4); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/btaconred.m] +>>>>> /build/octave-control-3.4.0/inst/btaconred.m +***** shared Mo, Me, Info, HSVCe + A = [ -1. 0. 4. + 0. 2. 0. + 0. 0. -3. ]; + + B = [ 1. + 1. + 1. ]; + + C = [ 1. 1. 1. ]; + + D = [ 0. ]; + + G = ss (A, B, C, D, "scaled", true); + + AC = [ -26.4000, 6.4023, 4.3868; + 32.0000, 0, 0; + 0, 8.0000, 0 ]; + + BC = [ -16 + 0 + 0 ]; + + CC = [ 9.2994 1.1624 0.1090 ]; + + DC = [ 0 ]; + + K = ss (AC, BC, CC, DC, "scaled", true); + + [Kr, Info] = btaconred (G, K, 2, "weight", "input", "feedback", "+"); + [Ao, Bo, Co, Do] = ssdata (Kr); + + Ae = [ 9.1900 0.0000 + 0.0000 -34.5297 ]; + + Be = [ -11.9593 + 86.3137 ]; + + Ce = [ 2.8955 -1.3566 ]; + + De = [ 0.0000 ]; + + HSVCe = [ 3.8253 0.2005 ].'; + + Mo = [Ao, Bo; Co, Do]; + Me = [Ae, Be; Ce, De]; + +***** xtest assert (Mo, Me, 1e-4); +!!!!! known failure +ASSERT errors for: assert (Mo,Me,1e-4) + + Location | Observed | Expected | Reason + (3,1) -2.89553 2.8955 Abs err 5.791 exceeds tol 0.0001 by 6 + (3,2) 1.35663 -1.3566 Abs err 2.7132 exceeds tol 0.0001 by 3 + (1,3) 11.9593 -11.9593 Abs err 23.919 exceeds tol 0.0001 by 2e+01 + (2,3) -86.3137 86.3137 Abs err 172.63 exceeds tol 0.0001 by 2e+02 +***** assert (Info.hsvc, HSVCe, 1e-4); +2 tests, 1 passed, 1 known failure, 0 skipped +[inst/care.m] +>>>>> /build/octave-control-3.4.0/inst/care.m +***** shared x, l, g, xe, le, ge + a = [-3 2 + 1 1]; + + b = [ 0 + 1]; + + c = [ 1 -1]; + + r = 3; + + [x, l, g] = care (a, b, c.'*c, r); + + xe = [ 0.5895 1.8216 + 1.8216 8.8188]; + + le = [-3.5026 + -1.4370]; + + ge = [ 0.6072 2.9396]; + +***** assert (x, xe, 1e-4); +***** assert (l, le, 1e-4); +***** assert (g, ge, 1e-4); +***** shared x, l, g, xe, le, ge + a = [ 0.0 1.0 + 0.0 0.0]; + + b = [ 0.0 + 1.0]; + + c = [ 1.0 0.0 + 0.0 1.0 + 0.0 0.0]; + + d = [ 0.0 + 0.0 + 1.0]; + + [x, l, g] = care (a, b, c.'*c, d.'*d); + + xe = [ 1.7321 1.0000 + 1.0000 1.7321]; + + le = [-0.8660 + 0.5000i + -0.8660 - 0.5000i]; + + ge = [ 1.0000 1.7321]; + +***** assert (x, xe, 1e-4); +***** assert (l, le, 1e-4); +***** assert (g, ge, 1e-4); +***** shared x, xe + a = [ 0.0 1.0 + 0.0 0.0 ]; + + e = [ 1.0 0.0 + 0.0 1.0 ]; + + b = [ 0.0 + 1.0 ]; + + c = [ 1.0 0.0 + 0.0 1.0 + 0.0 0.0 ]; + + d = [ 0.0 + 0.0 + 1.0 ]; + + x = care (a, b, c.'*c, d.'*d, [], e); + + xe = [ 1.7321 1.0000 + 1.0000 1.7321 ]; + +***** assert (x, xe, 1e-4); +7 tests, 7 passed, 0 known failure, 0 skipped +[inst/mag2db.m] +>>>>> /build/octave-control-3.4.0/inst/mag2db.m +***** assert (mag2db (100), 40); +***** assert (mag2db (0.1), -20); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/kalman.m] +>>>>> /build/octave-control-3.4.0/inst/kalman.m +***** shared m, m_exp, g, g_exp, x, x_exp + sys = ss (-2, 1, 1, 3); + [est, g, x] = kalman (sys, 1, 1, 1); + [a, b, c, d] = ssdata (est); + m = [a, b; c, d]; + m_exp = [-2.25, 0.25; 1, 0; 1, 0]; + g_exp = 0.25; + x_exp = 0; +***** assert (m, m_exp, 1e-2); +***** assert (g, g_exp, 1e-2); +***** assert (x, x_exp, 1e-2); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/covar.m] +>>>>> /build/octave-control-3.4.0/inst/covar.m +***** shared p, q, p_exp, q_exp + sys = ss (-1, 1, 1, 0); + [p, q] = covar (sys, 5); + p_exp = 2.5000; + q_exp = 2.5000; +***** assert (p, p_exp, 1e-4); +***** assert (q, q_exp, 1e-4); +***** shared p, q, p_exp, q_exp + sys = ss ([-0.2, -0.5; 1, 0], [2; 0], [1, 0.5], [0], 0.1); + [p, q] = covar (sys, 5); + p_exp = 30.3167; + q_exp = [27.1493, -3.6199; -3.6199, 27.1493]; +***** assert (p, p_exp, 1e-4); +***** assert (q, q_exp, 1e-4); 4 tests, 4 passed, 0 known failure, 0 skipped -[inst/hinfsyn.m] ->>>>> /build/octave-control-3.4.0/inst/hinfsyn.m +[inst/esort.m] +>>>>> /build/octave-control-3.4.0/inst/esort.m +***** shared s_exp, ndx_exp, s_obs, ndx_obs + p = [-0.2410+0.5573i; + -0.2410-0.5573i; + 0.1503; + -0.0972; + -0.2590]; + s_exp = [ 0.1503; + -0.0972; + -0.2410+0.5573i; + -0.2410-0.5573i; + -0.2590]; + ndx_exp = [ 3; + 4; + 1; + 2; + 5]; + [s_obs, ndx_obs] = esort(p); +***** assert(s_obs, s_exp, 0); +***** assert(ndx_obs, ndx_exp, 0); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/btamodred.m] +>>>>> /build/octave-control-3.4.0/inst/btamodred.m +***** shared Mo, Me, Info, HSVe + A = [ -26.4000, 6.4023, 4.3868; + 32.0000, 0, 0; + 0, 8.0000, 0 ]; + + B = [ 16 + 0 + 0 ]; + + C = [ 9.2994 1.1624 0.1090 ]; + + D = [ 0 ]; + + G = ss (A, B, C, D); % "scaled", false + + AV = [ -1.0000, 0, 4.0000, -9.2994, -1.1624, -0.1090; + 0, 2.0000, 0, -9.2994, -1.1624, -0.1090; + 0, 0, -3.0000, -9.2994, -1.1624, -0.1090; + 16.0000, 16.0000, 16.0000, -26.4000, 6.4023, 4.3868; + 0, 0, 0, 32.0000, 0, 0; + 0, 0, 0, 0, 8.0000, 0 ]; + + BV = [ 1 + 1 + 1 + 0 + 0 + 0 ]; + + CV = [ 1 1 1 0 0 0 ]; + + DV = [ 0 ]; + + V = ss (AV, BV, CV, DV); + + [Gr, Info] = btamodred (G, 2, "left", V); + [Ao, Bo, Co, Do] = ssdata (Gr); + + Ae = [ 9.1900 0.0000 + 0.0000 -34.5297 ]; + + Be = [ 11.9593 + 16.9329 ]; + + Ce = [ 2.8955 6.9152 ]; + + De = [ 0.0000 ]; + + HSVe = [ 3.8253 0.2005 ].'; + + Mo = [Ao, Bo; Co, Do]; + Me = [Ae, Be; Ce, De]; + +***** xtest assert (Mo, Me, 1e-4); +!!!!! known failure +ASSERT errors for: assert (Mo,Me,1e-4) + + Location | Observed | Expected | Reason + (3,1) -2.89553 2.8955 Abs err 5.791 exceeds tol 0.0001 by 6 + (3,2) -6.91524 6.9152 Abs err 13.83 exceeds tol 0.0001 by 1e+01 + (1,3) -11.9593 11.9593 Abs err 23.919 exceeds tol 0.0001 by 2e+01 + (2,3) -16.9329 16.9329 Abs err 33.866 exceeds tol 0.0001 by 3e+01 +***** assert (Info.hsv, HSVe, 1e-4); +2 tests, 1 passed, 1 known failure, 0 skipped +[inst/__dss2ss__.m] +>>>>> /build/octave-control-3.4.0/inst/__dss2ss__.m +***** shared a, b, c, e, ranke, rnka22, q, z, a_exp, b_exp, c_exp, e_exp, q_exp, z_exp + + e = [1, 2, 0, 0; 0, 1, 0, 1; 3, 9, 6, 3; 0, 0, 2, 0]; + a = [-1, 0, 0, 3; 0, 0, 1, 2; 1, 1, 0, 4; 0, 0, 0, 0]; + b = [1, 0; 0, 0; 0, 1; 1, 1]; + c = [-1, 0, 1, 0; 0, 1, -1, 1]; + + [a, e, b, c, ranke, rnka22, q, z] = __sl_tg01fd__ (a, e, b, c, true, 0.0); + + e_exp = [10.1587 5.8230 1.3021 0.0000; + 0.0000 -2.4684 -0.1896 0.0000; + 0.0000 0.0000 1.0338 0.0000; + 0.0000 0.0000 0.0000 0.0000]; + + a_exp = [ 2.0278 0.1078 3.9062 -2.1571; + -0.0980 0.2544 1.6053 -0.1269; + 0.2713 0.7760 -0.3692 -0.4853; + 0.0690 -0.5669 -2.1974 0.3086]; + + b_exp = [-0.2157 -0.9705; + 0.3015 0.9516; + 0.7595 0.0991; + 1.1339 0.3780]; + + c_exp = [ 0.3651 -1.0000 -0.4472 -0.8165; + -1.0954 1.0000 -0.8944 0.0000]; + + q_exp = [-0.2157 -0.5088 0.6109 0.5669; + -0.1078 -0.2544 -0.7760 0.5669; + -0.9705 0.1413 -0.0495 -0.1890; + 0.0000 0.8102 0.1486 0.5669]; + + z_exp = [-0.3651 0.0000 0.4472 0.8165; + -0.9129 0.0000 0.0000 -0.4082; + 0.0000 -1.0000 0.0000 0.0000; + -0.1826 0.0000 -0.8944 0.4082]; + +***** assert (a, a_exp, 1e-4); +***** assert (e, e_exp, 1e-4); +***** assert (b, b_exp, 1e-4); +***** assert (c, c_exp, 1e-4); +***** assert (q, q_exp, 1e-4); +***** assert (z, z_exp, 1e-4); +***** assert (ranke, 3); +***** assert (rnka22, 1); +***** shared mms + + mm = tf ([3, 5, 0], [4, 1]); + mms = ss (mm); +***** error (__dss2ss__ (mms.a, mms.b, mms.c, mms.d, mms.e)); +***** test + A = [1 0; 0 1]; + B = [1; 0]; + C = [1 0]; + D = 0; + E = [1 0; 0 0]; + + sys = dss (A, B, C, D, E); + [Ao, Bo, Co, Do] = ssdata (sys); + + assert (Ao, 1, 1e-4); + assert (Bo, 1, 1e-4); + assert (Co, 1, 1e-4); + assert (Do, 0, 1e-4); +10 tests, 10 passed, 0 known failure, 0 skipped +[inst/h2syn.m] +>>>>> /build/octave-control-3.4.0/inst/h2syn.m ***** shared M, M_exp A = [-1.0 0.0 4.0 5.0 -3.0 -2.0 -2.0 4.0 -7.0 -2.0 0.0 3.0 @@ -3179,35 +3615,35 @@ 9.0 -3.0 4.0 0.0 3.0 7.0 0.0 1.0 -2.0 1.0 -6.0 -2.0]; - D = [ 1.0 -2.0 -3.0 0.0 0.0 - 0.0 4.0 0.0 1.0 0.0 - 5.0 -3.0 -4.0 0.0 1.0 - 0.0 1.0 0.0 1.0 -3.0 - 0.0 0.0 1.0 7.0 1.0]; + D = [ 0.0 0.0 0.0 -4.0 -1.0 + 0.0 0.0 0.0 1.0 0.0 + 0.0 0.0 0.0 0.0 1.0 + 3.0 1.0 0.0 1.0 -3.0 + -2.0 0.0 1.0 7.0 1.0]; P = ss (A, B, C, D); - K = hinfsyn (P, 2, 2, "method", "sub", "gmax", 15); + K = h2syn (P, 2, 2); M = [K.A, K.B; K.C, K.D]; - KA = [ -2.8043 14.7367 4.6658 8.1596 0.0848 2.5290 - 4.6609 3.2756 -3.5754 -2.8941 0.2393 8.2920 - -15.3127 23.5592 -7.1229 2.7599 5.9775 -2.0285 - -22.0691 16.4758 12.5523 -16.3602 4.4300 -3.3168 - 30.6789 -3.9026 -1.3868 26.2357 -8.8267 10.4860 - -5.7429 0.0577 10.8216 -11.2275 1.5074 -10.7244]; + KA = [ 88.0015 -145.7298 -46.2424 82.2168 -45.2996 -31.1407 + 25.7489 -31.4642 -12.4198 9.4625 -3.5182 2.7056 + 54.3008 -102.4013 -41.4968 50.8412 -20.1286 -26.7191 + 108.1006 -198.0785 -45.4333 70.3962 -25.8591 -37.2741 + -115.8900 226.1843 47.2549 -47.8435 -12.5004 34.7474 + 59.0362 -101.8471 -20.1052 36.7834 -16.1063 -26.4309]; - KB = [ -0.1581 -0.0793 - -0.9237 -0.5718 - 0.7984 0.6627 - 0.1145 0.1496 - -0.6743 -0.2376 - 0.0196 -0.7598]; + KB = [ 3.7345 3.4758 + -0.3020 0.6530 + 3.4735 4.0499 + 4.3198 7.2755 + -3.9424 -10.5942 + 2.1784 2.5048]; - KC = [ -0.2480 -0.1713 -0.0880 0.1534 0.5016 -0.0730 - 2.8810 -0.3658 1.3007 0.3945 1.2244 2.5690]; + KC = [ -2.3346 3.2556 0.7150 -0.9724 0.6962 0.4074 + 7.6899 -8.4558 -2.9642 7.0365 -4.2844 0.1390]; - KD = [ 0.0554 0.1334 - -0.3195 0.0333]; + KD = [ 0.0000 0.0000 + 0.0000 0.0000]; M_exp = [KA, KB; KC, KD]; @@ -3240,262 +3676,33 @@ 0.0 0.0 1.0 2.0 1.0]; P = ss (A, B, C, D, 1); # value of sampling time doesn't matter - K = hinfsyn (P, 2, 2, "method", "sub", "gmax", 111.294); + K = h2syn (P, 2, 2); M = [K.A, K.B; K.C, K.D]; - KA = [-18.0030 52.0376 26.0831 -0.4271 -40.9022 18.0857 - 18.8203 -57.6244 -29.0938 0.5870 45.3309 -19.8644 - -26.5994 77.9693 39.0368 -1.4020 -60.1129 26.6910 - -21.4163 62.1719 30.7507 -0.9201 -48.6221 21.8351 - -0.8911 4.2787 2.3286 -0.2424 -3.0376 1.2169 - -5.3286 16.1955 8.4824 -0.2489 -12.2348 5.1590]; + KA = [-0.0551 -2.1891 -0.6607 -0.2532 0.6674 -1.0044 + -1.0379 2.3804 0.5031 0.3960 -0.6605 1.2673 + -0.0876 -2.1320 -0.4701 -1.1461 1.2927 -1.5116 + -0.1358 -2.1237 -0.9560 -0.7144 0.6673 -0.7957 + 0.4900 0.0895 0.2634 -0.2354 0.1623 -0.2663 + 0.1672 -0.4163 0.2871 -0.1983 0.4944 -0.6967]; - KB = [ 16.9788 14.1648 - -18.9215 -15.6726 - 25.2046 21.2848 - 20.1122 16.8322 - 1.4104 1.2040 - 5.3181 4.5149]; + KB = [-0.5985 -0.5464 + 0.5285 0.6087 + -0.7600 -0.4472 + -0.7288 -0.6090 + 0.0532 0.0658 + -0.0663 0.0059]; - KC = [ -9.1941 27.5165 13.7364 -0.3639 -21.5983 9.6025 - 3.6490 -10.6194 -5.2772 0.2432 8.1108 -3.6293]; + KC = [ 0.2500 -1.0200 -0.3371 -0.2733 0.2747 -0.4444 + 0.0654 0.2095 0.0632 0.2089 -0.1895 0.1834]; - KD = [ 9.0317 7.5348 - -3.4006 -2.8219]; + KD = [-0.2181 -0.2070 + 0.1094 0.1159]; M_exp = [KA, KB; KC, KD]; ***** assert (M, M_exp, 1e-4); -***** shared M, M_exp, GAM_exp, GAM - A = [-0.7 0.0 0.3 0.0 -0.5 -0.1 - -0.6 0.2 -0.4 -0.3 0.0 0.0 - -0.5 0.7 -0.1 0.0 0.0 -0.8 - -0.7 0.0 0.0 -0.5 -1.0 0.0 - 0.0 0.3 0.6 -0.9 0.1 -0.4 - 0.5 -0.8 0.0 0.0 0.2 -0.9]; - - B = [-1.0 -2.0 -2.0 1.0 0.0 - 1.0 0.0 1.0 -2.0 1.0 - -3.0 -4.0 0.0 2.0 -2.0 - 1.0 -2.0 1.0 0.0 -1.0 - 0.0 1.0 -2.0 0.0 3.0 - 1.0 0.0 3.0 -1.0 -2.0]; - - C = [ 1.0 -1.0 2.0 -2.0 0.0 -3.0 - -3.0 0.0 1.0 -1.0 1.0 0.0 - 0.0 2.0 0.0 -4.0 0.0 -2.0 - 1.0 -3.0 0.0 0.0 3.0 1.0 - 0.0 1.0 -2.0 1.0 0.0 -2.0]; - - D = [ 1.0 -1.0 -2.0 0.0 0.0 - 0.0 1.0 0.0 1.0 0.0 - 2.0 -1.0 -3.0 0.0 1.0 - 0.0 1.0 0.0 1.0 -1.0 - 0.0 0.0 1.0 2.0 1.0]; - - P = ss (A, B, C, D, 1); - [K, ~, GAM] = hinfsyn (P, 2, 2, "gmax", 1000, "tolgam", 1e-4); - M = [K.A, K.B; K.C, K.D]; - - KA = [-18.0030 52.0376 26.0831 -0.4271 -40.9022 18.0857 - 18.8203 -57.6244 -29.0938 0.5870 45.3309 -19.8644 - -26.5994 77.9693 39.0368 -1.4020 -60.1129 26.6910 - -21.4163 62.1719 30.7507 -0.9201 -48.6221 21.8351 - -0.8911 4.2787 2.3286 -0.2424 -3.0376 1.2169 - -5.3286 16.1955 8.4824 -0.2489 -12.2348 5.1590]; - - KB = [ 16.9788 14.1648 - -18.9215 -15.6726 - 25.2046 21.2848 - 20.1122 16.8322 - 1.4104 1.2040 - 5.3181 4.5149]; - - KC = [ -9.1941 27.5165 13.7364 -0.3639 -21.5983 9.6025 - 3.6490 -10.6194 -5.2772 0.2432 8.1108 -3.6293]; - - KD = [ 9.0317 7.5348 - -3.4006 -2.8219]; - - M_exp = [KA, KB; KC, KD]; - GAM_exp = 111.294; - -***** assert (M, M_exp, 1e-1); -***** assert (GAM, GAM_exp, 1e-3); -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/initial.m] ->>>>> /build/octave-control-3.4.0/inst/initial.m -***** shared initial_c, initial_c_exp, initial_d, initial_d_exp - - A = [ -2.8 2.0 -1.8 - -2.4 -2.0 0.8 - 1.1 1.7 -1.0 ]; - - B = [ -0.8 0.5 0 - 0 0.7 2.3 - -0.3 -0.1 0.5 ]; - - C = [ -0.1 0 -0.3 - 0.9 0.5 1.2 - 0.1 -0.1 1.9 ]; - - D = [ -0.5 0 0 - 0.1 0 0.3 - -0.8 0 0 ]; - - x_0 = [1, 2, 3]; - - sysc = ss (A, B, C, D); - - [yc, tc, xc] = initial (sysc, x_0, 0.2, 0.1); - initial_c = [yc, tc, xc]; - - sysd = c2d (sysc, 2); - - [yd, td, xd] = initial (sysd, x_0, 4); - initial_d = [yd, td, xd]; - - ## expected values computed by the "dark side" - - yc_exp = [ -1.0000 5.5000 5.6000 - -0.9872 5.0898 5.7671 - -0.9536 4.6931 5.7598 ]; - - tc_exp = [ 0.0000 - 0.1000 - 0.2000 ]; - - xc_exp = [ 1.0000 2.0000 3.0000 - 0.5937 1.6879 3.0929 - 0.2390 1.5187 3.0988 ]; - - initial_c_exp = [yc_exp, tc_exp, xc_exp]; - - yd_exp = [ -1.0000 5.5000 5.6000 - -0.6550 3.1673 4.2228 - -0.5421 2.6186 3.4968 ]; - - td_exp = [ 0 - 2 - 4 ]; - - xd_exp = [ 1.0000 2.0000 3.0000 - -0.4247 1.5194 2.3249 - -0.3538 1.2540 1.9250 ]; - - initial_d_exp = [yd_exp, td_exp, xd_exp]; - -***** assert (initial_c, initial_c_exp, 1e-4) -***** assert (initial_d, initial_d_exp, 1e-4) -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/db2mag.m] ->>>>> /build/octave-control-3.4.0/inst/db2mag.m -***** assert (db2mag (40), 100); -***** assert (db2mag (-20), 0.1); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/margin.m] ->>>>> /build/octave-control-3.4.0/inst/margin.m -***** shared margin_c, margin_c_exp, margin_d, margin_d_exp - sysc = tf ([24], [1, 6, 11, 6]); - [gamma_c, phi_c, w_gamma_c, w_phi_c] = margin (sysc); - sysd = c2d (sysc, 0.3); - [gamma_d, phi_d, w_gamma_d, w_phi_d] = margin (sysd); - - margin_c = [gamma_c, phi_c, w_gamma_c, w_phi_c]; - margin_d = [gamma_d, phi_d, w_gamma_d, w_phi_d]; - - ## results from this implementation and the "dark side" diverge - ## from the third digit after the decimal point on - - gamma_c_exp = 2.50; - phi_c_exp = 35.43; - w_gamma_c_exp = 3.32; - w_phi_c_exp = 2.06; - - gamma_d_exp = 1.41; - phi_d_exp = 18.60; - w_gamma_d_exp = 2.48; - w_phi_d_exp = 2.04; - - margin_c_exp = [gamma_c_exp, phi_c_exp, w_gamma_c_exp, w_phi_c_exp]; - margin_d_exp = [gamma_d_exp, phi_d_exp, w_gamma_d_exp, w_phi_d_exp]; - -***** assert (margin_c, margin_c_exp, 1e-2); -***** assert (margin_d, margin_d_exp, 1e-2); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/dare.m] ->>>>> /build/octave-control-3.4.0/inst/dare.m -***** shared x, l, g, xe, le, ge - a = [ 0.4 1.7 - 0.9 3.8]; - - b = [ 0.8 - 2.1]; - - c = [ 1 -1]; - - r = 3; - - [x, l, g] = dare (a, b, c.'*c, r); - - xe = [ 1.5354 1.2623 - 1.2623 10.5596]; - - le = [-0.0022 - 0.2454]; - - ge = [ 0.4092 1.7283]; - -***** assert (x, xe, 1e-4); -***** assert (sort (l), sort (le), 1e-4); -***** assert (g, ge, 1e-4); -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/@iddata/cat.m] ->>>>> /build/octave-control-3.4.0/inst/@iddata/cat.m -***** error (cat (1, iddata (1, 1), iddata ({2, 3}, {2, 3}))); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/@iddata/iddata.m] ->>>>> /build/octave-control-3.4.0/inst/@iddata/iddata.m -***** error (iddata); -***** error (iddata ((1:10).', (1:11).')); -***** warning (iddata (1:10)); -***** warning (iddata (1:10, 1:10)); -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/@iddata/filter.m] ->>>>> /build/octave-control-3.4.0/inst/@iddata/filter.m -***** shared DATD, Z - DAT = iddata ({[(1:10).', (1:2:20).'], [(10:-1:1).', (20:-2:1).']}, {[(41:50).', (46:55).'], [(61:70).', (-66:-1:-75).']}); - DATD = detrend (DAT, "linear"); - Z = zeros (10, 2); -***** assert (DATD.y{1}, Z, 1e-10); -***** assert (DATD.y{2}, Z, 1e-10); -***** assert (DATD.u{1}, Z, 1e-10); -***** assert (DATD.u{2}, Z, 1e-10); -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/@iddata/fft.m] ->>>>> /build/octave-control-3.4.0/inst/@iddata/fft.m -***** shared DATD, Y, U - Y = 1:10; - U = 20:-2:1; - W = warning ("query", "iddata:transpose"); - warning ("off", W.identifier); - DAT = iddata (Y, U); - DATD = fft (DAT); - warning (W.identifier, W.state); -***** assert (DATD.y{1}, Y, 1e-10); -***** assert (DATD.u{1}, U, 1e-10); 2 tests, 2 passed, 0 known failure, 0 skipped -[inst/@iddata/detrend.m] ->>>>> /build/octave-control-3.4.0/inst/@iddata/detrend.m -***** shared DATD, Z - DAT = iddata ({[(1:10).', (1:2:20).'], [(10:-1:1).', (20:-2:1).']}, {[(41:50).', (46:55).'], [(61:70).', (-66:-1:-75).']}); - DATD = detrend (DAT, "linear"); - Z = zeros (10, 2); -***** assert (DATD.y{1}, Z, 1e-10); -***** assert (DATD.y{2}, Z, 1e-10); -***** assert (DATD.u{1}, Z, 1e-10); -***** assert (DATD.u{2}, Z, 1e-10); -4 tests, 4 passed, 0 known failure, 0 skipped [inst/moen4.m] >>>>> /build/octave-control-3.4.0/inst/moen4.m ***** shared SYS, X0, INFO, Ae, Be, Ce, De, Ke, Qe, Rye, Se, X0e @@ -6326,6 +6533,308 @@ (2,3) -0.06978 0.0698 Abs err 0.13958 exceeds tol 0.0001 by 0.1 ***** assert (SYS.D, De, 1e-4); 17 tests, 14 passed, 3 known failures, 0 skipped +[inst/hinfsyn.m] +>>>>> /build/octave-control-3.4.0/inst/hinfsyn.m +***** shared M, M_exp + A = [-1.0 0.0 4.0 5.0 -3.0 -2.0 + -2.0 4.0 -7.0 -2.0 0.0 3.0 + -6.0 9.0 -5.0 0.0 2.0 -1.0 + -8.0 4.0 7.0 -1.0 -3.0 0.0 + 2.0 5.0 8.0 -9.0 1.0 -4.0 + 3.0 -5.0 8.0 0.0 2.0 -6.0]; + + B = [-3.0 -4.0 -2.0 1.0 0.0 + 2.0 0.0 1.0 -5.0 2.0 + -5.0 -7.0 0.0 7.0 -2.0 + 4.0 -6.0 1.0 1.0 -2.0 + -3.0 9.0 -8.0 0.0 5.0 + 1.0 -2.0 3.0 -6.0 -2.0]; + + C = [ 1.0 -1.0 2.0 -4.0 0.0 -3.0 + -3.0 0.0 5.0 -1.0 1.0 1.0 + -7.0 5.0 0.0 -8.0 2.0 -2.0 + 9.0 -3.0 4.0 0.0 3.0 7.0 + 0.0 1.0 -2.0 1.0 -6.0 -2.0]; + + D = [ 1.0 -2.0 -3.0 0.0 0.0 + 0.0 4.0 0.0 1.0 0.0 + 5.0 -3.0 -4.0 0.0 1.0 + 0.0 1.0 0.0 1.0 -3.0 + 0.0 0.0 1.0 7.0 1.0]; + + P = ss (A, B, C, D); + K = hinfsyn (P, 2, 2, "method", "sub", "gmax", 15); + M = [K.A, K.B; K.C, K.D]; + + KA = [ -2.8043 14.7367 4.6658 8.1596 0.0848 2.5290 + 4.6609 3.2756 -3.5754 -2.8941 0.2393 8.2920 + -15.3127 23.5592 -7.1229 2.7599 5.9775 -2.0285 + -22.0691 16.4758 12.5523 -16.3602 4.4300 -3.3168 + 30.6789 -3.9026 -1.3868 26.2357 -8.8267 10.4860 + -5.7429 0.0577 10.8216 -11.2275 1.5074 -10.7244]; + + KB = [ -0.1581 -0.0793 + -0.9237 -0.5718 + 0.7984 0.6627 + 0.1145 0.1496 + -0.6743 -0.2376 + 0.0196 -0.7598]; + + KC = [ -0.2480 -0.1713 -0.0880 0.1534 0.5016 -0.0730 + 2.8810 -0.3658 1.3007 0.3945 1.2244 2.5690]; + + KD = [ 0.0554 0.1334 + -0.3195 0.0333]; + + M_exp = [KA, KB; KC, KD]; + +***** assert (M, M_exp, 1e-4); +***** shared M, M_exp + A = [-0.7 0.0 0.3 0.0 -0.5 -0.1 + -0.6 0.2 -0.4 -0.3 0.0 0.0 + -0.5 0.7 -0.1 0.0 0.0 -0.8 + -0.7 0.0 0.0 -0.5 -1.0 0.0 + 0.0 0.3 0.6 -0.9 0.1 -0.4 + 0.5 -0.8 0.0 0.0 0.2 -0.9]; + + B = [-1.0 -2.0 -2.0 1.0 0.0 + 1.0 0.0 1.0 -2.0 1.0 + -3.0 -4.0 0.0 2.0 -2.0 + 1.0 -2.0 1.0 0.0 -1.0 + 0.0 1.0 -2.0 0.0 3.0 + 1.0 0.0 3.0 -1.0 -2.0]; + + C = [ 1.0 -1.0 2.0 -2.0 0.0 -3.0 + -3.0 0.0 1.0 -1.0 1.0 0.0 + 0.0 2.0 0.0 -4.0 0.0 -2.0 + 1.0 -3.0 0.0 0.0 3.0 1.0 + 0.0 1.0 -2.0 1.0 0.0 -2.0]; + + D = [ 1.0 -1.0 -2.0 0.0 0.0 + 0.0 1.0 0.0 1.0 0.0 + 2.0 -1.0 -3.0 0.0 1.0 + 0.0 1.0 0.0 1.0 -1.0 + 0.0 0.0 1.0 2.0 1.0]; + + P = ss (A, B, C, D, 1); # value of sampling time doesn't matter + K = hinfsyn (P, 2, 2, "method", "sub", "gmax", 111.294); + M = [K.A, K.B; K.C, K.D]; + + KA = [-18.0030 52.0376 26.0831 -0.4271 -40.9022 18.0857 + 18.8203 -57.6244 -29.0938 0.5870 45.3309 -19.8644 + -26.5994 77.9693 39.0368 -1.4020 -60.1129 26.6910 + -21.4163 62.1719 30.7507 -0.9201 -48.6221 21.8351 + -0.8911 4.2787 2.3286 -0.2424 -3.0376 1.2169 + -5.3286 16.1955 8.4824 -0.2489 -12.2348 5.1590]; + + KB = [ 16.9788 14.1648 + -18.9215 -15.6726 + 25.2046 21.2848 + 20.1122 16.8322 + 1.4104 1.2040 + 5.3181 4.5149]; + + KC = [ -9.1941 27.5165 13.7364 -0.3639 -21.5983 9.6025 + 3.6490 -10.6194 -5.2772 0.2432 8.1108 -3.6293]; + + KD = [ 9.0317 7.5348 + -3.4006 -2.8219]; + + M_exp = [KA, KB; KC, KD]; + +***** assert (M, M_exp, 1e-4); +***** shared M, M_exp, GAM_exp, GAM + A = [-0.7 0.0 0.3 0.0 -0.5 -0.1 + -0.6 0.2 -0.4 -0.3 0.0 0.0 + -0.5 0.7 -0.1 0.0 0.0 -0.8 + -0.7 0.0 0.0 -0.5 -1.0 0.0 + 0.0 0.3 0.6 -0.9 0.1 -0.4 + 0.5 -0.8 0.0 0.0 0.2 -0.9]; + + B = [-1.0 -2.0 -2.0 1.0 0.0 + 1.0 0.0 1.0 -2.0 1.0 + -3.0 -4.0 0.0 2.0 -2.0 + 1.0 -2.0 1.0 0.0 -1.0 + 0.0 1.0 -2.0 0.0 3.0 + 1.0 0.0 3.0 -1.0 -2.0]; + + C = [ 1.0 -1.0 2.0 -2.0 0.0 -3.0 + -3.0 0.0 1.0 -1.0 1.0 0.0 + 0.0 2.0 0.0 -4.0 0.0 -2.0 + 1.0 -3.0 0.0 0.0 3.0 1.0 + 0.0 1.0 -2.0 1.0 0.0 -2.0]; + + D = [ 1.0 -1.0 -2.0 0.0 0.0 + 0.0 1.0 0.0 1.0 0.0 + 2.0 -1.0 -3.0 0.0 1.0 + 0.0 1.0 0.0 1.0 -1.0 + 0.0 0.0 1.0 2.0 1.0]; + + P = ss (A, B, C, D, 1); + [K, ~, GAM] = hinfsyn (P, 2, 2, "gmax", 1000, "tolgam", 1e-4); + M = [K.A, K.B; K.C, K.D]; + + KA = [-18.0030 52.0376 26.0831 -0.4271 -40.9022 18.0857 + 18.8203 -57.6244 -29.0938 0.5870 45.3309 -19.8644 + -26.5994 77.9693 39.0368 -1.4020 -60.1129 26.6910 + -21.4163 62.1719 30.7507 -0.9201 -48.6221 21.8351 + -0.8911 4.2787 2.3286 -0.2424 -3.0376 1.2169 + -5.3286 16.1955 8.4824 -0.2489 -12.2348 5.1590]; + + KB = [ 16.9788 14.1648 + -18.9215 -15.6726 + 25.2046 21.2848 + 20.1122 16.8322 + 1.4104 1.2040 + 5.3181 4.5149]; + + KC = [ -9.1941 27.5165 13.7364 -0.3639 -21.5983 9.6025 + 3.6490 -10.6194 -5.2772 0.2432 8.1108 -3.6293]; + + KD = [ 9.0317 7.5348 + -3.4006 -2.8219]; + + M_exp = [KA, KB; KC, KD]; + GAM_exp = 111.294; + +***** assert (M, M_exp, 1e-1); +***** assert (GAM, GAM_exp, 1e-3); +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/bstmodred.m] +>>>>> /build/octave-control-3.4.0/inst/bstmodred.m +***** shared Mo, Me, Info, HSVe + A = [ -0.04165 0.0000 4.9200 -4.9200 0.0000 0.0000 0.0000 + -5.2100 -12.500 0.0000 0.0000 0.0000 0.0000 0.0000 + 0.0000 3.3300 -3.3300 0.0000 0.0000 0.0000 0.0000 + 0.5450 0.0000 0.0000 0.0000 -0.5450 0.0000 0.0000 + 0.0000 0.0000 0.0000 4.9200 -0.04165 0.0000 4.9200 + 0.0000 0.0000 0.0000 0.0000 -5.2100 -12.500 0.0000 + 0.0000 0.0000 0.0000 0.0000 0.0000 3.3300 -3.3300 ]; + + B = [ 0.0000 0.0000 + 12.500 0.0000 + 0.0000 0.0000 + 0.0000 0.0000 + 0.0000 0.0000 + 0.0000 12.500 + 0.0000 0.0000 ]; + + C = [ 1.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 + 0.0000 0.0000 0.0000 1.0000 0.0000 0.0000 0.0000 + 0.0000 0.0000 0.0000 0.0000 1.0000 0.0000 0.0000 ]; + + D = [ 0.0000 0.0000 + 0.0000 0.0000 + 0.0000 0.0000 ]; + + G = ss (A, B, C, D, "scaled", true); + + [Gr, Info] = bstmodred (G, "beta", 1.0, "tol1", 0.1, "tol2", 0.0); + [Ao, Bo, Co, Do] = ssdata (Gr); + + Ae = [ 1.2729 0.0000 6.5947 0.0000 -3.4229 + 0.0000 0.8169 0.0000 2.4821 0.0000 + -2.9889 0.0000 -2.9028 0.0000 -0.3692 + 0.0000 -3.3921 0.0000 -3.1126 0.0000 + -1.4767 0.0000 -2.0339 0.0000 -0.6107 ]; + + Be = [ 0.1331 -0.1331 + -0.0862 -0.0862 + -2.6777 2.6777 + -3.5767 -3.5767 + -2.3033 2.3033 ]; + + Ce = [ -0.6907 -0.6882 0.0779 0.0958 -0.0038 + 0.0676 0.0000 0.6532 0.0000 -0.7522 + 0.6907 -0.6882 -0.0779 0.0958 0.0038 ]; + + De = [ 0.0000 0.0000 + 0.0000 0.0000 + 0.0000 0.0000 ]; + + HSVe = [ 0.8803 0.8506 0.8038 0.4494 0.3973 0.0214 0.0209 ].'; + + Mo = [Ao, Bo; Co, Do]; + Me = [Ae, Be; Ce, De]; + +***** xtest assert (Mo, Me, 1e-4); +***** assert (Info.hsv, HSVe, 1e-4); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/dlyap.m] +>>>>> /build/octave-control-3.4.0/inst/dlyap.m +***** shared X, X_exp + A = [3.0 1.0 1.0 + 1.0 3.0 0.0 + 0.0 0.0 3.0]; + + B = [25.0 24.0 15.0 + 24.0 32.0 8.0 + 15.0 8.0 40.0]; + + X = dlyap (A.', -B); + + X_exp = [2.0000 1.0000 1.0000 + 1.0000 3.0000 0.0000 + 1.0000 0.0000 4.0000]; + +***** assert (X, X_exp, 1e-4); +***** shared X, X_exp + A = [3.0 1.0 1.0 + 1.0 3.0 0.0 + 0.0 0.0 3.0]; + + B = [1.0 0.2 2.0 + 0.5 0.5 1.0 + 1.0 -2.0 1.0]; + + X = dlyap (A.', -B); + + X_exp = [0.1390 -0.0514 0.1831 + -0.0086 0.0676 0.0422 + 0.2005 -0.3233 -0.0362]; + +***** assert (X, X_exp, 1e-4); +***** shared X, X_exp + A = [1.0 2.0 3.0 + 6.0 7.0 8.0 + 9.0 2.0 3.0]; + + B = [7.0 2.0 3.0 + 2.0 1.0 2.0 + 3.0 4.0 1.0]; + + C = [271.0 135.0 147.0 + 923.0 494.0 482.0 + 578.0 383.0 287.0]; + + X = dlyap (-A, B, C); + + X_exp = [2.0000 3.0000 6.0000 + 4.0000 7.0000 1.0000 + 5.0000 3.0000 2.0000]; + +***** assert (X, X_exp, 1e-4); +***** shared X, X_exp + A = [3.0 1.0 1.0 + 1.0 3.0 0.0 + 1.0 0.0 2.0]; + + E = [1.0 3.0 0.0 + 3.0 2.0 1.0 + 1.0 0.0 1.0]; + + B = [ -3.0 -10.0 7.0 + -10.0 -14.0 -2.0 + 7.0 -2.0 9.0 ]; + + X = dlyap (A, B, [], E); + + X_exp = [-2.0000 -1.0000 0.0000 + -1.0000 -3.0000 -1.0000 + 0.0000 -1.0000 -3.0000]; + +***** assert (X, X_exp, 1e-4); +4 tests, 4 passed, 0 known failure, 0 skipped [inst/ltimodels.m] >>>>> /build/octave-control-3.4.0/inst/ltimodels.m ***** shared ltisys @@ -8006,199 +8515,6 @@ ***** assert (Mo, Me, 1e-4); 33 tests, 23 passed, 0 known failure, 10 skipped -[inst/acker.m] ->>>>> /build/octave-control-3.4.0/inst/acker.m -***** test - # https://en.wikipedia.org/wiki/Ackermann's_formula#Example - A = [1 1; 1 2]; - B = [1; 0]; - P = roots ([1 11 30]); - K = acker(A,B,P); - assert (K, [14 57]); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/btamodred.m] ->>>>> /build/octave-control-3.4.0/inst/btamodred.m -***** shared Mo, Me, Info, HSVe - A = [ -26.4000, 6.4023, 4.3868; - 32.0000, 0, 0; - 0, 8.0000, 0 ]; - - B = [ 16 - 0 - 0 ]; - - C = [ 9.2994 1.1624 0.1090 ]; - - D = [ 0 ]; - - G = ss (A, B, C, D); % "scaled", false - - AV = [ -1.0000, 0, 4.0000, -9.2994, -1.1624, -0.1090; - 0, 2.0000, 0, -9.2994, -1.1624, -0.1090; - 0, 0, -3.0000, -9.2994, -1.1624, -0.1090; - 16.0000, 16.0000, 16.0000, -26.4000, 6.4023, 4.3868; - 0, 0, 0, 32.0000, 0, 0; - 0, 0, 0, 0, 8.0000, 0 ]; - - BV = [ 1 - 1 - 1 - 0 - 0 - 0 ]; - - CV = [ 1 1 1 0 0 0 ]; - - DV = [ 0 ]; - - V = ss (AV, BV, CV, DV); - - [Gr, Info] = btamodred (G, 2, "left", V); - [Ao, Bo, Co, Do] = ssdata (Gr); - - Ae = [ 9.1900 0.0000 - 0.0000 -34.5297 ]; - - Be = [ 11.9593 - 16.9329 ]; - - Ce = [ 2.8955 6.9152 ]; - - De = [ 0.0000 ]; - - HSVe = [ 3.8253 0.2005 ].'; - - Mo = [Ao, Bo; Co, Do]; - Me = [Ae, Be; Ce, De]; - -***** xtest assert (Mo, Me, 1e-4); -!!!!! known failure -ASSERT errors for: assert (Mo,Me,1e-4) - - Location | Observed | Expected | Reason - (3,1) -2.89553 2.8955 Abs err 5.791 exceeds tol 0.0001 by 6 - (3,2) -6.91524 6.9152 Abs err 13.83 exceeds tol 0.0001 by 1e+01 - (1,3) -11.9593 11.9593 Abs err 23.919 exceeds tol 0.0001 by 2e+01 - (2,3) -16.9329 16.9329 Abs err 33.866 exceeds tol 0.0001 by 3e+01 -***** assert (Info.hsv, HSVe, 1e-4); -2 tests, 1 passed, 1 known failure, 0 skipped -[inst/obsv.m] ->>>>> /build/octave-control-3.4.0/inst/obsv.m -***** assert (obsv ([1, 0; 0, -0.5], [8, 8]), [8, 8; 8, -4]); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/mag2db.m] ->>>>> /build/octave-control-3.4.0/inst/mag2db.m -***** assert (mag2db (100), 40); -***** assert (mag2db (0.1), -20); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/lyap.m] ->>>>> /build/octave-control-3.4.0/inst/lyap.m -***** shared X, X_exp - A = [1, 2; -3, -4]; - Q = [3, 1; 1, 1]; - X = lyap (A, Q); - X_exp = [ 6.1667, -3.8333; - -3.8333, 3.0000]; -***** assert (X, X_exp, 1e-4); -***** shared X, X_exp - A = [2.0 1.0 3.0 - 0.0 2.0 1.0 - 6.0 1.0 2.0]; - - B = [2.0 1.0 - 1.0 6.0]; - - C = [2.0 1.0 - 1.0 4.0 - 0.0 5.0]; - - X = lyap (A, B, -C); - - X_exp = [-2.7685 0.5498 - -1.0531 0.6865 - 4.5257 -0.4389]; - -***** assert (X, X_exp, 1e-4); -***** shared X, X_exp - A = [ 3.0 1.0 1.0 - 1.0 3.0 0.0 - 1.0 0.0 2.0]; - - E = [ 1.0 3.0 0.0 - 3.0 2.0 1.0 - 1.0 0.0 1.0]; - - B = [-64.0 -73.0 -28.0 - -73.0 -70.0 -25.0 - -28.0 -25.0 -18.0]; - - X = lyap (A.', -B, [], E.'); - - X_exp = [-2.0000 -1.0000 0.0000 - -1.0000 -3.0000 -1.0000 - 0.0000 -1.0000 -3.0000]; - -***** assert (X, X_exp, 1e-4); -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/pzmap.m] ->>>>> /build/octave-control-3.4.0/inst/pzmap.m -***** demo - s = tf('s'); - g = (s-1)/(s-2)/(s-3); - pzmap(g); -***** test - s = tf('s'); - g = (s-1)/(s-2)/(s-3); - [pol zer] = pzmap(g); - assert(sort(pol), [2 3]', 2*eps); - assert(zer, 1, eps); -***** demo - s = tf('s'); - g = 1/(2*s^2+3*s+4); - pzmap(g); -***** test - s = tf('s'); - g = 1/(2*s^2+3*s+4); - pol = pzmap(g); - assert(sort(pol), sort(roots([2 3 4]')), eps); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/dlyapchol.m] ->>>>> /build/octave-control-3.4.0/inst/dlyapchol.m -***** shared U, U_exp - - A = [ 0.5000 0.5000 -0.5000 - 0.0000 1.0000 -0.5000 - 1.0000 -0.5000 0.0000 ]; - - B = [ -2.0 ; 1.0 ; -1.0 ]; - - U = dlyapchol (A, B); - - U_exp = [ 5.6042 5.1284 1.9562 - 0.0000 3.4313 -1.6716 - 0.0000 0.0000 2.5621 ]; - -***** assert (U, U_exp, 1e-4); -***** shared U, U_exp - - A = [ 0.5000 0.5000 -0.5000 - 0.0000 1.0000 -0.5000 - 1.0000 -0.5000 0.0000 ]; - - B = [ -2.0 ; 1.0 ; -1.0 ]; - - E = [ 2.0000 0.0000 0.0000 - 0.0000 2.0000 0.0000 - 0.0000 0.0000 2.0000 ]; - - U = dlyapchol (A, B, E); - - U_exp = [ 1.0488 -0.3546 0.4644 - 0.0000 0.6560 -0.5187 - 0.0000 0.0000 0.4099 ]; - -***** assert (U, U_exp, 1e-4); -2 tests, 2 passed, 0 known failure, 0 skipped [inst/damp.m] >>>>> /build/octave-control-3.4.0/inst/damp.m ***** test @@ -8261,268 +8577,6 @@ assert (zeta_obs, zeta_exp, 1e-4); assert (P_obs, P_exp, 1e-4); 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/hnamodred.m] ->>>>> /build/octave-control-3.4.0/inst/hnamodred.m -***** shared Mo, Me, Info, HSVe - A = [ -3.8637 -7.4641 -9.1416 -7.4641 -3.8637 -1.0000 - 1.0000, 0 0 0 0 0 - 0 1.0000 0 0 0 0 - 0 0 1.0000 0 0 0 - 0 0 0 1.0000 0 0 - 0 0 0 0 1.0000 0 ]; - - B = [ 1 - 0 - 0 - 0 - 0 - 0 ]; - - C = [ 0 0 0 0 0 1 ]; - - D = [ 0 ]; - - G = ss (A, B, C, D); # "scaled", false - - AV = [ 0.2000 -1.0000 - 1.0000 0 ]; - - BV = [ 1 - 0 ]; - - CV = [ -1.8000 0 ]; - - DV = [ 1 ]; - - V = ss (AV, BV, CV, DV); - - [Gr, Info] = hnamodred (G, "left", V, "tol1", 1e-1, "tol2", 1e-14); - [Ao, Bo, Co, Do] = ssdata (Gr); - - Ae = [ -0.2391 0.3072 1.1630 1.1967 - -2.9709 -0.2391 2.6270 3.1027 - 0.0000 0.0000 -0.5137 -1.2842 - 0.0000 0.0000 0.1519 -0.5137 ]; - - Be = [ -1.0497 - -3.7052 - 0.8223 - 0.7435 ]; - - Ce = [ -0.4466 0.0143 -0.4780 -0.2013 ]; - - De = [ 0.0219 ]; - - HSVe = [ 2.6790 2.1589 0.8424 0.1929 0.0219 0.0011 ].'; - - Mo = [Ao, Bo; Co, Do]; - Me = [Ae, Be; Ce, De]; - -***** xtest assert (Mo, Me, 1e-4); -!!!!! known failure -ASSERT errors for: assert (Mo,Me,1e-4) - - Location | Observed | Expected | Reason - (5,1) 0.4466 -0.4466 Abs err 0.8932 exceeds tol 0.0001 by 0.9 - (5,2) -0.014267 0.0143 Abs err 0.028567 exceeds tol 0.0001 by 0.03 - (1,3) -1.163 1.163 Abs err 2.326 exceeds tol 0.0001 by 2 - (2,3) -2.627 2.627 Abs err 5.254 exceeds tol 0.0001 by 5 - (1,4) -1.1967 1.1967 Abs err 2.3934 exceeds tol 0.0001 by 2 - (2,4) -3.1027 3.1027 Abs err 6.2054 exceeds tol 0.0001 by 6 - (1,5) 1.0497 -1.0497 Abs err 2.0994 exceeds tol 0.0001 by 2 - (2,5) 3.7052 -3.7052 Abs err 7.4104 exceeds tol 0.0001 by 7 -***** assert (Info.hsv, HSVe, 1e-4); -2 tests, 1 passed, 1 known failure, 0 skipped -[inst/cfconred.m] ->>>>> /build/octave-control-3.4.0/inst/cfconred.m -***** shared Mo, Me, Info, HSVe - A = [ 0 1.0000 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 -0.0150 0.7650 0 0 0 0 - 0 0 -0.7650 -0.0150 0 0 0 0 - 0 0 0 0 -0.0280 1.4100 0 0 - 0 0 0 0 -1.4100 -0.0280 0 0 - 0 0 0 0 0 0 -0.0400 1.850 - 0 0 0 0 0 0 -1.8500 -0.040 ]; - - B = [ 0.0260 - -0.2510 - 0.0330 - -0.8860 - -4.0170 - 0.1450 - 3.6040 - 0.2800 ]; - - C = [ -.996 -.105 0.261 .009 -.001 -.043 0.002 -0.026 ]; - - D = [ 0.0 ]; - - G = ss (A, B, C, D); % "scaled", false - - F = [ 4.4721e-002 6.6105e-001 4.6986e-003 3.6014e-001 1.0325e-001 -3.7541e-002 -4.2685e-002 3.2873e-002 ]; - - L = [ 4.1089e-001 - 8.6846e-002 - 3.8523e-004 - -3.6194e-003 - -8.8037e-003 - 8.4205e-003 - 1.2349e-003 - 4.2632e-003 ]; - - [Kr, Info] = cfconred (G, F, L, 4, "method", "bfsr-bta", "cf", "left", "feedback", "+"); - [Ao, Bo, Co, Do] = ssdata (Kr); - - Ae = [ 0.5946 -0.7336 0.1914 -0.3368 - 0.5960 -0.0184 -0.1088 0.0207 - 1.2253 0.2043 0.1009 -1.4948 - -0.0330 -0.0243 1.3440 0.0035 ]; - - Be = [ 0.0015 - -0.0202 - 0.0159 - -0.0544 ]; - - Ce = [ 0.3534 0.0274 0.0337 -0.0320 ]; - - De = [ 0.0000 ]; - - HSVe = [ 4.9078 4.8745 3.8455 3.7811 1.2289 1.1785 0.5176 0.1148 ].'; - - Mo = [Ao, Bo; Co, Do]; - Me = [Ae, Be; Ce, De]; - -***** xtest assert (Mo, Me, 1e-4); -***** assert (Info.hsv, HSVe, 1e-4); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/place.m] ->>>>> /build/octave-control-3.4.0/inst/place.m -***** shared A, B, C, P, Kexpected - A = [0, 1; 3, 2]; - B = [0; 1]; - C = [2, 1]; # C is needed for ss; it doesn't matter what the value of C is - P = [-1, -0.5]; - Kexpected = [3.5, 3.5]; -***** assert (place (ss (A, B, C), P), Kexpected, 2*eps); -***** assert (place (A, B, P), Kexpected, 2*eps); -***** shared F, F_exp, ev_ol, ev_cl - A = [-6.8000 0.0000 -207.0000 0.0000 - 1.0000 0.0000 0.0000 0.0000 - 43.2000 0.0000 0.0000 -4.2000 - 0.0000 0.0000 1.0000 0.0000]; - - B = [ 5.6400 0.0000 - 0.0000 0.0000 - 0.0000 1.1800 - 0.0000 0.0000]; - - P = [-0.5000 + 0.1500i - -0.5000 - 0.1500i]; - - ALPHA = -0.4; - TOL = 1e-8; - - F = place (A, B, P, ALPHA, TOL); - - F_exp = - [-0.0876 -4.2138 0.0837 -18.1412 - -0.0233 18.2483 -0.4259 -4.8120]; - - ev_ol = sort (eig (A)); - ev_cl = sort (eig (A - B*F)); - -***** assert (F, F_exp, 1e-4); -***** assert (ev_ol(3:4), ev_cl(3:4), 1e-4); -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/kalman.m] ->>>>> /build/octave-control-3.4.0/inst/kalman.m -***** shared m, m_exp, g, g_exp, x, x_exp - sys = ss (-2, 1, 1, 3); - [est, g, x] = kalman (sys, 1, 1, 1); - [a, b, c, d] = ssdata (est); - m = [a, b; c, d]; - m_exp = [-2.25, 0.25; 1, 0; 1, 0]; - g_exp = 0.25; - x_exp = 0; -***** assert (m, m_exp, 1e-2); -***** assert (g, g_exp, 1e-2); -***** assert (x, x_exp, 1e-2); -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/sigma.m] ->>>>> /build/octave-control-3.4.0/inst/sigma.m -***** shared sv_exp, w_exp, sv_obs, w_obs - A = [1, 2; 3, 4]; - B = [5, 6; 7, 8]; - C = [4, 3; 2, 1]; - D = [8, 7; 6, 5]; - w = [2, 3, 4]; - sv_exp = [7.9176, 8.6275, 9.4393; - 0.6985, 0.6086, 0.5195]; - w_exp = [2; 3; 4]; - [sv_obs, w_obs] = sigma (ss (A, B, C, D), w); -***** assert (sv_obs, sv_exp, 1e-4); -***** assert (w_obs, w_exp, 1e-4); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/bstmodred.m] ->>>>> /build/octave-control-3.4.0/inst/bstmodred.m -***** shared Mo, Me, Info, HSVe - A = [ -0.04165 0.0000 4.9200 -4.9200 0.0000 0.0000 0.0000 - -5.2100 -12.500 0.0000 0.0000 0.0000 0.0000 0.0000 - 0.0000 3.3300 -3.3300 0.0000 0.0000 0.0000 0.0000 - 0.5450 0.0000 0.0000 0.0000 -0.5450 0.0000 0.0000 - 0.0000 0.0000 0.0000 4.9200 -0.04165 0.0000 4.9200 - 0.0000 0.0000 0.0000 0.0000 -5.2100 -12.500 0.0000 - 0.0000 0.0000 0.0000 0.0000 0.0000 3.3300 -3.3300 ]; - - B = [ 0.0000 0.0000 - 12.500 0.0000 - 0.0000 0.0000 - 0.0000 0.0000 - 0.0000 0.0000 - 0.0000 12.500 - 0.0000 0.0000 ]; - - C = [ 1.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 - 0.0000 0.0000 0.0000 1.0000 0.0000 0.0000 0.0000 - 0.0000 0.0000 0.0000 0.0000 1.0000 0.0000 0.0000 ]; - - D = [ 0.0000 0.0000 - 0.0000 0.0000 - 0.0000 0.0000 ]; - - G = ss (A, B, C, D, "scaled", true); - - [Gr, Info] = bstmodred (G, "beta", 1.0, "tol1", 0.1, "tol2", 0.0); - [Ao, Bo, Co, Do] = ssdata (Gr); - - Ae = [ 1.2729 0.0000 6.5947 0.0000 -3.4229 - 0.0000 0.8169 0.0000 2.4821 0.0000 - -2.9889 0.0000 -2.9028 0.0000 -0.3692 - 0.0000 -3.3921 0.0000 -3.1126 0.0000 - -1.4767 0.0000 -2.0339 0.0000 -0.6107 ]; - - Be = [ 0.1331 -0.1331 - -0.0862 -0.0862 - -2.6777 2.6777 - -3.5767 -3.5767 - -2.3033 2.3033 ]; - - Ce = [ -0.6907 -0.6882 0.0779 0.0958 -0.0038 - 0.0676 0.0000 0.6532 0.0000 -0.7522 - 0.6907 -0.6882 -0.0779 0.0958 0.0038 ]; - - De = [ 0.0000 0.0000 - 0.0000 0.0000 - 0.0000 0.0000 ]; - - HSVe = [ 0.8803 0.8506 0.8038 0.4494 0.3973 0.0214 0.0209 ].'; - - Mo = [Ao, Bo; Co, Do]; - Me = [Ae, Be; Ce, De]; - -***** xtest assert (Mo, Me, 1e-4); -***** assert (Info.hsv, HSVe, 1e-4); -2 tests, 2 passed, 0 known failure, 0 skipped [inst/@lti/horzcat.m] >>>>> /build/octave-control-3.4.0/inst/@lti/horzcat.m ***** shared M, Me @@ -8582,73 +8636,140 @@ ***** assert (M, Me, 1e-4); 1 test, 1 passed, 0 known failure, 0 skipped -[inst/@lti/pole.m] ->>>>> /build/octave-control-3.4.0/inst/@lti/pole.m -***** shared pol_exp, pol_obs - A = [-1, 0, 0; - 0, -2, 0; - 0, 0, -3]; - pol_exp = [-3; - -2; - -1]; - pol_obs = pole (ss (A, ones (3, 1))); +[inst/@lti/feedback.m] +>>>>> /build/octave-control-3.4.0/inst/@lti/feedback.m +***** shared M, Me + A1 = [ 1.0 0.0 -1.0 + 0.0 -1.0 1.0 + 1.0 1.0 2.0 ]; -***** assert(pol_obs, pol_exp, 0); -***** shared pol, pol_exp, infp, kronr, kronl, infp_exp, kronr_exp, kronl_exp - A = [ 1 0 0 0 0 0 0 0 0 - 0 1 0 0 0 0 0 0 0 - 0 0 1 0 0 0 0 0 0 - 0 0 0 1 0 0 0 0 0 - 0 0 0 0 1 0 0 0 0 - 0 0 0 0 0 1 0 0 0 - 0 0 0 0 0 0 1 0 0 - 0 0 0 0 0 0 0 1 0 - 0 0 0 0 0 0 0 0 1 ]; + B1 = [ 1.0 1.0 0.0 + 2.0 0.0 1.0 ].'; - E = [ 0 0 0 0 0 0 0 0 0 - 1 0 0 0 0 0 0 0 0 - 0 1 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 - 0 0 0 1 0 0 0 0 0 - 0 0 0 0 1 0 0 0 0 - 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 1 0 0 - 0 0 0 0 0 0 0 1 0 ]; + C1 = [ 3.0 -2.0 1.0 + 0.0 1.0 0.0 ]; - B = [ -1 0 0 - 0 0 0 - 0 0 0 - 0 -1 0 - 0 0 0 - 0 0 0 - 0 0 -1 - 0 0 0 - 0 0 0 ]; + D1 = [ 1.0 0.0 + 0.0 1.0 ]; - C = [ 0 1 1 0 3 4 0 0 2 - 0 1 0 0 4 0 0 2 0 - 0 0 1 0 -1 4 0 -2 2 ]; + A2 = [-3.0 0.0 0.0 + 1.0 0.0 1.0 + 0.0 -1.0 2.0 ]; - D = [ 1 2 -2 - 0 -1 -2 - 0 0 0 ]; + B2 = [ 0.0 -1.0 0.0 + 1.0 0.0 2.0 ].'; - sys = dss (A, B, C, D, E, "scaled", true); - [pol, ~, infp, kronr, kronl] = __sl_ag08bd__ (A, E, [], [], [], true); + C2 = [ 1.0 1.0 0.0 + 1.0 1.0 -1.0 ]; - pol_exp = zeros (0,1); + D2 = [ 1.0 1.0 + 0.0 1.0 ]; - infp_exp = [0, 3]; - kronr_exp = zeros (1,0); - kronl_exp = zeros (1,0); + sys1 = ss (A1, B1, C1, D1); + sys2 = ss (A2, B2, C2, D2); + sys = feedback (sys1, sys2); + [A, B, C, D] = ssdata (sys); + M = [A, B; C, D]; -***** assert (pol, pol_exp, 1e-4); -***** assert (infp, infp_exp); -***** assert (kronr, kronr_exp); -***** assert (kronl, kronl_exp); + Ae = [-0.5000 -0.2500 -1.5000 -1.2500 -1.2500 0.7500 + -1.5000 -0.2500 0.5000 -0.2500 -0.2500 -0.2500 + 1.0000 0.5000 2.0000 -0.5000 -0.5000 0.5000 + 0.0000 0.5000 0.0000 -3.5000 -0.5000 0.5000 + -1.5000 1.2500 -0.5000 1.2500 0.2500 1.2500 + 0.0000 1.0000 0.0000 -1.0000 -2.0000 3.0000 ]; + + Be = [ 0.5000 0.7500 + 0.5000 -0.2500 + 0.0000 0.5000 + 0.0000 0.5000 + -0.5000 0.2500 + 0.0000 1.0000 ]; + + Ce = [ 1.5000 -1.2500 0.5000 -0.2500 -0.2500 -0.2500 + 0.0000 0.5000 0.0000 -0.5000 -0.5000 0.5000 ]; + + De = [ 0.5000 -0.2500 + 0.0000 0.5000 ]; + + Me = [Ae, Be; Ce, De]; + +***** assert (M, Me, 1e-4); +***** shared S1, S2 + P = ss (-2, 3, 4, 5); # meaningless numbers + C = ss (-1, 1, 1, 0); # ditto + L = P * C; + I = eye (size (L)); + S1 = feedback (I, L); + S2 = inv (I + L); +***** assert (S1.a, S2.a, 1e-4); +***** assert (S1.b, S2.b, 1e-4); +***** assert (S1.c, S2.c, 1e-4); +***** assert (S1.d, S2.d, 1e-4); 5 tests, 5 passed, 0 known failure, 0 skipped -[inst/@lti/d2c.m] ->>>>> /build/octave-control-3.4.0/inst/@lti/d2c.m +[inst/@lti/c2d.m] +>>>>> /build/octave-control-3.4.0/inst/@lti/c2d.m +***** shared Mo, Me + A = [ 1.0 0.5 + 0.5 1.0 ].'; + + B = [ 0.0 -1.0 + 1.0 0.0 ].'; + + C = [ -1.0 0.0 + 0.0 1.0 ].'; + + D = [ 1.0 0.0 + 0.0 -1.0 ].'; + + [Ao, Bo, Co, Do] = __sl_ab04md__ (A, B, C, D, 1.0, 1.0, false); + + Ae = [ -1.0000 -4.0000 + -4.0000 -1.0000 ]; + + Be = [ 2.8284 0.0000 + 0.0000 -2.8284 ]; + + Ce = [ 0.0000 2.8284 + -2.8284 0.0000 ]; + + De = [ -1.0000 0.0000 + 0.0000 -3.0000 ]; + + Mo = [Ao, Bo; Co, Do]; + Me = [Ae, Be; Ce, De]; + +***** assert (Mo, Me, 1e-4); +***** shared Mo, Me + A = [ 1.0 0.5 + 0.5 1.0 ].'; + + B = [ 0.0 -1.0 + 1.0 0.0 ].'; + + C = [ -1.0 0.0 + 0.0 1.0 ].'; + + D = [ 1.0 0.0 + 0.0 -1.0 ].'; + + [Ao, Bo, Co, Do] = ssdata (c2d (ss (A, B, C, D), 2, "tustin")); + + Ae = [ -1.0000 -4.0000 + -4.0000 -1.0000 ]; + + Be = [ 2.8284 0.0000 + 0.0000 -2.8284 ]; + + Ce = [ 0.0000 2.8284 + -2.8284 0.0000 ]; + + De = [ -1.0000 0.0000 + 0.0000 -3.0000 ]; + + Mo = [Ao, Bo; Co, Do]; + Me = [Ae, Be; Ce, De]; + +***** assert (Mo, Me, 1e-4); ***** shared Mo, Me A = [ 1.0 0.5 0.5 1.0 ]; @@ -8700,53 +8821,181 @@ D = [ 1.0 0.0 0.0 -1.0 ]; + [Ao, Bo, Co, Do] = ssdata (c2d (ss (A, B, C, D), 2, "foh")); + + Ae = [ 11.4019 8.6836 + 8.6836 11.4019 ]; + + Be = [ 37.5206 -43.4256 + 43.4256 -37.5206 ]; + + Ce = [ -1.0000 0.0000 + 0.0000 1.0000 ]; + + De = [ -0.0690 2.5056 + 2.5056 -2.0690 ]; + + Mo = [Ao, Bo; Co, Do]; + Me = [Ae, Be; Ce, De]; + +***** assert (Mo, Me, 1e-4); +***** shared Mo, Me + A = [ 1.0 0.5 + 0.5 1.0 ]; + + B = [ 0.0 -1.0 + 1.0 0.0 ]; + + C = [ -1.0 0.0 + 0.0 1.0 ]; + + D = [ 1.0 0.0 + 0.0 -1.0 ]; + [Ao, Bo, Co, Do] = ssdata (d2c (c2d (ss (A, B, C, D), 2, "prewarp", 1000), "prewarp", 1000)); Mo = [Ao, Bo; Co, Do]; Me = [A, B; C, D]; ***** assert (Mo, Me, 1e-4); +***** shared Aex, Aexint, Aex_exp, Aexint_exp + A = [ 5.0 4.0 3.0 2.0 1.0 + 1.0 6.0 0.0 4.0 3.0 + 2.0 0.0 7.0 6.0 5.0 + 1.0 3.0 1.0 8.0 7.0 + 2.0 5.0 7.0 1.0 9.0 ]; + + Aex_exp = [ 1.8391 0.9476 0.7920 0.8216 0.7811 + 0.3359 2.2262 0.4013 1.0078 1.0957 + 0.6335 0.6776 2.6933 1.6155 1.8502 + 0.4804 1.1561 0.9110 2.7461 2.0854 + 0.7105 1.4244 1.8835 1.0966 3.4134 ]; + + Aexint_exp = [ 0.1347 0.0352 0.0284 0.0272 0.0231 + 0.0114 0.1477 0.0104 0.0369 0.0368 + 0.0218 0.0178 0.1624 0.0580 0.0619 + 0.0152 0.0385 0.0267 0.1660 0.0732 + 0.0240 0.0503 0.0679 0.0317 0.1863 ]; + + [Aex, Aexint] = __sl_mb05nd__ (A, 0.1, 0.0001); + +***** assert (Aex, Aex_exp, 1e-4); +***** assert (Aexint, Aexint_exp, 1e-4); +8 tests, 8 passed, 0 known failure, 0 skipped +[inst/@lti/dcgain.m] +>>>>> /build/octave-control-3.4.0/inst/@lti/dcgain.m +***** assert( dcgain( tf(1,[1,1]) ) , 1 ) +***** assert( dcgain( tf(2,[1,1]) ) , 2 ) +***** assert( dcgain( ss([0,1;-2,-3],[0;1],[1,0],0) ) , 0.5 ) 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/@lti/inv.m] ->>>>> /build/octave-control-3.4.0/inst/@lti/inv.m -***** shared M, Me - A = [ 1.0 2.0 0.0 - 4.0 -1.0 0.0 - 0.0 0.0 1.0 ]; +[inst/@lti/pole.m] +>>>>> /build/octave-control-3.4.0/inst/@lti/pole.m +***** shared pol_exp, pol_obs + A = [-1, 0, 0; + 0, -2, 0; + 0, 0, -3]; + pol_exp = [-3; + -2; + -1]; + pol_obs = pole (ss (A, ones (3, 1))); - B = [ 1.0 0.0 - 0.0 1.0 - 1.0 0.0 ]; +***** assert(pol_obs, pol_exp, 0); +***** shared pol, pol_exp, infp, kronr, kronl, infp_exp, kronr_exp, kronl_exp + A = [ 1 0 0 0 0 0 0 0 0 + 0 1 0 0 0 0 0 0 0 + 0 0 1 0 0 0 0 0 0 + 0 0 0 1 0 0 0 0 0 + 0 0 0 0 1 0 0 0 0 + 0 0 0 0 0 1 0 0 0 + 0 0 0 0 0 0 1 0 0 + 0 0 0 0 0 0 0 1 0 + 0 0 0 0 0 0 0 0 1 ]; - C = [ 0.0 1.0 -1.0 - 0.0 0.0 1.0 ]; + E = [ 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 + 0 1 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 + 0 0 0 1 0 0 0 0 0 + 0 0 0 0 1 0 0 0 0 + 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 1 0 0 + 0 0 0 0 0 0 0 1 0 ]; - D = [ 4.0 0.0 - 0.0 1.0 ]; + B = [ -1 0 0 + 0 0 0 + 0 0 0 + 0 -1 0 + 0 0 0 + 0 0 0 + 0 0 -1 + 0 0 0 + 0 0 0 ]; - sys = ss (A, B, C, D); - sysinv = inv (sys); - [Ai, Bi, Ci, Di] = ssdata (sysinv); - M = [Ai, Bi; Ci, Di]; + C = [ 0 1 1 0 3 4 0 0 2 + 0 1 0 0 4 0 0 2 0 + 0 0 1 0 -1 4 0 -2 2 ]; - Ae = [ 1.0000 1.7500 0.2500 - 4.0000 -1.0000 -1.0000 - 0.0000 -0.2500 1.2500 ]; + D = [ 1 2 -2 + 0 -1 -2 + 0 0 0 ]; - Be = [-0.2500 0.0000 - 0.0000 -1.0000 - -0.2500 0.0000 ]; + sys = dss (A, B, C, D, E, "scaled", true); + [pol, ~, infp, kronr, kronl] = __sl_ag08bd__ (A, E, [], [], [], true); - Ce = [ 0.0000 0.2500 -0.2500 - 0.0000 0.0000 1.0000 ]; + pol_exp = zeros (0,1); - De = [ 0.2500 0.0000 - 0.0000 1.0000 ]; + infp_exp = [0, 3]; + kronr_exp = zeros (1,0); + kronl_exp = zeros (1,0); - Me = [Ae, -Be; -Ce, De]; +***** assert (pol, pol_exp, 1e-4); +***** assert (infp, infp_exp); +***** assert (kronr, kronr_exp); +***** assert (kronl, kronl_exp); +5 tests, 5 passed, 0 known failure, 0 skipped +[inst/@lti/sminreal.m] +>>>>> /build/octave-control-3.4.0/inst/@lti/sminreal.m +***** shared B, C -***** assert (M, Me, 1e-4); -1 test, 1 passed, 0 known failure, 0 skipped + A = ss (-2, 3, 4, 5); + B = A / A; + C = sminreal (B); # no states should be removed + +***** assert (C.a, B.a); +***** assert (C.b, B.b); +***** assert (C.c, B.c); +***** assert (C.d, B.d); +***** shared A, B, D, E + + A = ss (-1, 1, 1, 0); + B = ss (-2, 3, 4, 5); + C = [A, B]; + D = sminreal (C(:, 1)); + E = sminreal (C(:, 2)); + +***** assert (D.a, A.a); +***** assert (D.b, A.b); +***** assert (D.c, A.c); +***** assert (D.d, A.d); +***** assert (E.a, B.a); +***** assert (E.b, B.b); +***** assert (E.c, B.c); +***** assert (E.d, B.d); +12 tests, 12 passed, 0 known failure, 0 skipped +[inst/@lti/d2d.m] +>>>>> /build/octave-control-3.4.0/inst/@lti/d2d.m +***** shared num, den, z, p, k + H1 = zpk (0.7, 0.5, 1, 0.1); + H2 = d2d (H1, 0.05); + H3 = d2d (H2, 0.1); + [num, den] = tfdata (H2, "vector"); + [z, p, k] = zpkdata (H3, "vector"); +***** assert (num, [1.00000 -0.82426], 1e-4); +***** assert (den, [1.00000 -0.70711], 1e-4); +***** assert (z, 0.7, 1e-4); +***** assert (p, 0.5, 1e-4); +***** assert (k, 1.0, 1e-4); +5 tests, 5 passed, 0 known failure, 0 skipped [inst/@lti/minreal.m] >>>>> /build/octave-control-3.4.0/inst/@lti/minreal.m ***** shared C, D @@ -8861,206 +9110,270 @@ ***** assert (c, 0.5, 1e-4); ***** assert (d, 1, 1e-4); 15 tests, 15 passed, 0 known failure, 0 skipped -[inst/@lti/subsref.m] ->>>>> /build/octave-control-3.4.0/inst/@lti/subsref.m -***** shared a - s = tf ("s"); - G = (s+1)*s*5/(s+1)/(s^2+s+1); - a = G(1,1).num{1,1}(1); -***** assert (a, 5, 1e-4); +[inst/@lti/norm.m] +>>>>> /build/octave-control-3.4.0/inst/@lti/norm.m +***** shared H2, Hinf + sys = ss (-1, 1, 1, 0); + H2 = norm (sys, 2); + Hinf = norm (sys, inf); +***** assert (H2, 0.7071, 1.5e-5); +***** assert (Hinf, 1, 5e-4); +***** shared H2, Hinf + a = [ 2.417 -1.002 0.5488 + 2 0 0 + 0 0.5 0 ]; + b = [ 1 + 0 + 0 ]; + c = [-0.424 0.436 -0.4552 ]; + d = [ 1 ]; + sys = ss (a, b, c, d, 0.1); + H2 = norm (sys, 2); + Hinf = norm (sys, inf); +***** assert (H2, 1.2527, 1.5e-5); +***** assert (Hinf, 2.7, 0.1); +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/@lti/mtimes.m] +>>>>> /build/octave-control-3.4.0/inst/@lti/mtimes.m +***** shared sysmat, sysmat_exp + sys1 = ss ([0, 1; -3, -2], [0; 1], [-5, 1], [2]); + sys2 = ss ([-10], [1], [-40], [5]); + sys3 = sys2 * sys1; + [A, B, C, D] = ssdata (sys3); + sysmat = [A, B; C, D]; + A_exp = [ -10 -5 1 + 0 0 1 + 0 -3 -2 ]; + B_exp = [ 2 + 0 + 1 ]; + C_exp = [ -40 -25 5 ]; + D_exp = [ 10 ]; + sysmat_exp = [A_exp, B_exp; C_exp, D_exp]; +***** assert (sysmat, sysmat_exp) 1 test, 1 passed, 0 known failure, 0 skipped -[inst/@lti/c2d.m] ->>>>> /build/octave-control-3.4.0/inst/@lti/c2d.m -***** shared Mo, Me - A = [ 1.0 0.5 - 0.5 1.0 ].'; - - B = [ 0.0 -1.0 - 1.0 0.0 ].'; - - C = [ -1.0 0.0 - 0.0 1.0 ].'; - - D = [ 1.0 0.0 - 0.0 -1.0 ].'; - - [Ao, Bo, Co, Do] = __sl_ab04md__ (A, B, C, D, 1.0, 1.0, false); - - Ae = [ -1.0000 -4.0000 - -4.0000 -1.0000 ]; - - Be = [ 2.8284 0.0000 - 0.0000 -2.8284 ]; - - Ce = [ 0.0000 2.8284 - -2.8284 0.0000 ]; - - De = [ -1.0000 0.0000 - 0.0000 -3.0000 ]; - - Mo = [Ao, Bo; Co, Do]; - Me = [Ae, Be; Ce, De]; - -***** assert (Mo, Me, 1e-4); -***** shared Mo, Me - A = [ 1.0 0.5 - 0.5 1.0 ].'; - - B = [ 0.0 -1.0 - 1.0 0.0 ].'; - - C = [ -1.0 0.0 - 0.0 1.0 ].'; - - D = [ 1.0 0.0 - 0.0 -1.0 ].'; - - [Ao, Bo, Co, Do] = ssdata (c2d (ss (A, B, C, D), 2, "tustin")); - - Ae = [ -1.0000 -4.0000 - -4.0000 -1.0000 ]; - - Be = [ 2.8284 0.0000 - 0.0000 -2.8284 ]; - - Ce = [ 0.0000 2.8284 - -2.8284 0.0000 ]; - - De = [ -1.0000 0.0000 - 0.0000 -3.0000 ]; - - Mo = [Ao, Bo; Co, Do]; - Me = [Ae, Be; Ce, De]; - -***** assert (Mo, Me, 1e-4); -***** shared Mo, Me - A = [ 1.0 0.5 - 0.5 1.0 ]; +[inst/@lti/isminimumphase.m] +>>>>> /build/octave-control-3.4.0/inst/@lti/isminimumphase.m +***** assert (isminimumphase (tf (1, [1, 0])), true); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/@lti/zero.m] +>>>>> /build/octave-control-3.4.0/inst/@lti/zero.m +***** shared z, z_exp + A = [ -0.7 -0.0458 -12.2 0 + 0 -0.014 -0.2904 -0.562 + 1 -0.0057 -1.4 0 + 1 0 0 0 ]; - B = [ 0.0 -1.0 - 1.0 0.0 ]; + B = [ -19.1 -3.1 + -0.0119 -0.0096 + -0.14 -0.72 + 0 0 ]; - C = [ -1.0 0.0 - 0.0 1.0 ]; + C = [ 0 0 -1 1 + 0 0 0.733 0 ]; - D = [ 1.0 0.0 - 0.0 -1.0 ]; + D = [ 0 0 + 0.0768 0.1134 ]; - [Ao, Bo, Co, Do] = ssdata (d2c (c2d (ss (A, B, C, D), 2, "tustin"), "tustin")); + sys = ss (A, B, C, D, "scaled", true); + z = sort (zero (sys)); - Mo = [Ao, Bo; Co, Do]; - Me = [A, B; C, D]; + z_exp = sort ([-13.2759; 12.5774; -0.0155]); -***** assert (Mo, Me, 1e-4); -***** shared Mo, Me - A = [ 1.0 0.5 - 0.5 1.0 ]; +***** assert (z, z_exp, 1e-4); +***** shared z, z_exp, info, rank_exp, infz_exp, kronr_exp, kronl_exp + A = [ 1.0 0.0 0.0 0.0 0.0 0.0 + 0.0 1.0 0.0 0.0 0.0 0.0 + 0.0 0.0 3.0 0.0 0.0 0.0 + 0.0 0.0 0.0 -4.0 0.0 0.0 + 0.0 0.0 0.0 0.0 -1.0 0.0 + 0.0 0.0 0.0 0.0 0.0 3.0 ]; - B = [ 0.0 -1.0 - 1.0 0.0 ]; + B = [ 0.0 -1.0 + -1.0 0.0 + 1.0 -1.0 + 0.0 0.0 + 0.0 1.0 + -1.0 -1.0 ]; - C = [ -1.0 0.0 - 0.0 1.0 ]; + C = [ 1.0 0.0 0.0 1.0 0.0 0.0 + 0.0 1.0 0.0 1.0 0.0 1.0 + 0.0 0.0 1.0 0.0 0.0 1.0 ]; - D = [ 1.0 0.0 - 0.0 -1.0 ]; + D = [ 0.0 0.0 + 0.0 0.0 + 0.0 0.0 ]; - [Ao, Bo, Co, Do] = ssdata (d2c (c2d (ss (A, B, C, D), 2, "zoh"), "zoh")); + sys = ss (A, B, C, D, "scaled", true); + [z, ~, info] = zero (sys); - Mo = [Ao, Bo; Co, Do]; - Me = [A, B; C, D]; + z_exp = [ 2.0000 + -1.0000 ]; -***** assert (Mo, Me, 1e-4); -***** shared Mo, Me - A = [ 1.0 0.5 - 0.5 1.0 ]; + rank_exp = 2; + infz_exp = 2; + kronr_exp = zeros (1, 0); + kronl_exp = 2; - B = [ 0.0 -1.0 - 1.0 0.0 ]; +***** assert (z, z_exp, 1e-4); +***** assert (info.rank, rank_exp); +***** assert (info.infz, infz_exp); +***** assert (info.kronr, kronr_exp); +***** assert (info.kronl, kronl_exp); +***** shared z, z_exp, info, rank_exp, infz_exp, kronr_exp, kronl_exp + A = [ 1 0 0 0 0 0 0 0 0 + 0 1 0 0 0 0 0 0 0 + 0 0 1 0 0 0 0 0 0 + 0 0 0 1 0 0 0 0 0 + 0 0 0 0 1 0 0 0 0 + 0 0 0 0 0 1 0 0 0 + 0 0 0 0 0 0 1 0 0 + 0 0 0 0 0 0 0 1 0 + 0 0 0 0 0 0 0 0 1 ]; - C = [ -1.0 0.0 - 0.0 1.0 ]; + E = [ 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 + 0 1 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 + 0 0 0 1 0 0 0 0 0 + 0 0 0 0 1 0 0 0 0 + 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 1 0 0 + 0 0 0 0 0 0 0 1 0 ]; - D = [ 1.0 0.0 - 0.0 -1.0 ]; + B = [ -1 0 0 + 0 0 0 + 0 0 0 + 0 -1 0 + 0 0 0 + 0 0 0 + 0 0 -1 + 0 0 0 + 0 0 0 ]; - [Ao, Bo, Co, Do] = ssdata (c2d (ss (A, B, C, D), 2, "foh")); + C = [ 0 1 1 0 3 4 0 0 2 + 0 1 0 0 4 0 0 2 0 + 0 0 1 0 -1 4 0 -2 2 ]; - Ae = [ 11.4019 8.6836 - 8.6836 11.4019 ]; + D = [ 1 2 -2 + 0 -1 -2 + 0 0 0 ]; - Be = [ 37.5206 -43.4256 - 43.4256 -37.5206 ]; + sys = dss (A, B, C, D, E, "scaled", true); + [z, ~, info] = zero (sys); - Ce = [ -1.0000 0.0000 - 0.0000 1.0000 ]; + z_exp = 1; - De = [ -0.0690 2.5056 - 2.5056 -2.0690 ]; + rank_exp = 11; + infz_exp = [0, 1]; + kronr_exp = 2; + kronl_exp = 1; - Mo = [Ao, Bo; Co, Do]; - Me = [Ae, Be; Ce, De]; +***** assert (z, z_exp, 1e-4); +***** assert (info.rank, rank_exp); +***** assert (info.infz, infz_exp); +***** assert (info.kronr, kronr_exp); +***** assert (info.kronl, kronl_exp); +***** shared p, pi, z, zi, k, ki, p_tf, pi_tf, z_tf, zi_tf, k_tf, ki_tf + P = ss (-2, 3, 4, 5); + Pi = inv (P); -***** assert (Mo, Me, 1e-4); -***** shared Mo, Me - A = [ 1.0 0.5 - 0.5 1.0 ]; + p = pole (P); + [z, k] = zero (P); - B = [ 0.0 -1.0 - 1.0 0.0 ]; + pi = pole (Pi); + [zi, ki] = zero (Pi); - C = [ -1.0 0.0 - 0.0 1.0 ]; + P_tf = tf (P); + Pi_tf = tf (Pi); - D = [ 1.0 0.0 - 0.0 -1.0 ]; + p_tf = pole (P_tf); + [z_tf, k_tf] = zero (P_tf); - [Ao, Bo, Co, Do] = ssdata (d2c (c2d (ss (A, B, C, D), 2, "prewarp", 1000), "prewarp", 1000)); + pi_tf = pole (Pi_tf); + [zi_tf, ki_tf] = zero (Pi_tf); - Mo = [Ao, Bo; Co, Do]; - Me = [A, B; C, D]; +***** assert (p, zi, 1e-4); +***** assert (z, pi, 1e-4); +***** assert (k, inv (ki), 1e-4); +***** assert (p_tf, zi_tf, 1e-4); +***** assert (z_tf, pi_tf, 1e-4); +***** assert (k_tf, inv (ki_tf), 1e-4); +***** shared z_inv, z_tra, z_inp, z_out, z_sys, z_inv_e, z_tra_e, z_inp_e, z_out_e, z_sys_e + A = diag ([1, 1, 3, -4, -1, 3]); + + B = [ 0, -1 + -1, 0 + 1, -1 + 0, 0 + 0, 1 + -1, -1 ]; + + C = [ 1, 0, 0, 1, 0, 0 + 0, 1, 0, 1, 0, 1 + 0, 0, 1, 0, 0, 1 ]; + + D = zeros (3, 2); + + SYS = ss (A, B, C, D); -***** assert (Mo, Me, 1e-4); -***** shared Aex, Aexint, Aex_exp, Aexint_exp - A = [ 5.0 4.0 3.0 2.0 1.0 - 1.0 6.0 0.0 4.0 3.0 - 2.0 0.0 7.0 6.0 5.0 - 1.0 3.0 1.0 8.0 7.0 - 2.0 5.0 7.0 1.0 9.0 ]; + z_inv = zero (SYS); + z_tra = zero (SYS, "transmission"); + z_inp = zero (SYS, "input decoupling"); + z_out = zero (SYS, "output decoupling"); + z_sys = zero (SYS, "system"); - Aex_exp = [ 1.8391 0.9476 0.7920 0.8216 0.7811 - 0.3359 2.2262 0.4013 1.0078 1.0957 - 0.6335 0.6776 2.6933 1.6155 1.8502 - 0.4804 1.1561 0.9110 2.7461 2.0854 - 0.7105 1.4244 1.8835 1.0966 3.4134 ]; + z_inv_e = [2; -1]; + z_tra_e = [2]; + z_inp_e = [-4]; + z_out_e = [-1]; + z_sys_e = [-4, -1, 2]; + +***** assert (z_inv, z_inv_e, 1e-4); +***** assert (z_tra, z_tra_e, 1e-4); +***** assert (z_inp, z_inp_e, 1e-4); +***** assert (z_out, z_out_e, 1e-4); +***** assert (z_sys, z_sys_e, 1e-4); +***** shared z_inv, z_tra, z_inp, z_out, z_sys, z_inv_e, z_tra_e, z_inp_e, z_out_e, z_sys_e + A = diag ([1, 1, 3, -4, -1, 3]); + + B = [ 0, -1 + -1, 0 + 1, -1 + 0, 0 + 0, 1 + -1, -1 ]; + + C = [ 1, 0, 0, 1, 0, 0 + 0, 1, 0, 1, 0, 1 + 0, 0, 1, 0, 0, 1 ]; + + D = zeros (3, 2); - Aexint_exp = [ 0.1347 0.0352 0.0284 0.0272 0.0231 - 0.0114 0.1477 0.0104 0.0369 0.0368 - 0.0218 0.0178 0.1624 0.0580 0.0619 - 0.0152 0.0385 0.0267 0.1660 0.0732 - 0.0240 0.0503 0.0679 0.0317 0.1863 ]; + E = eye (6); + + SYS = dss (A, B, C, D, E); - [Aex, Aexint] = __sl_mb05nd__ (A, 0.1, 0.0001); + z_inv = zero (SYS); + z_tra = zero (SYS, "transmission"); + z_inp = zero (SYS, "input decoupling"); + z_out = zero (SYS, "output decoupling"); + z_sys = zero (SYS, "system"); -***** assert (Aex, Aex_exp, 1e-4); -***** assert (Aexint, Aexint_exp, 1e-4); -8 tests, 8 passed, 0 known failure, 0 skipped -[inst/@lti/d2d.m] ->>>>> /build/octave-control-3.4.0/inst/@lti/d2d.m -***** shared num, den, z, p, k - H1 = zpk (0.7, 0.5, 1, 0.1); - H2 = d2d (H1, 0.05); - H3 = d2d (H2, 0.1); - [num, den] = tfdata (H2, "vector"); - [z, p, k] = zpkdata (H3, "vector"); -***** assert (num, [1.00000 -0.82426], 1e-4); -***** assert (den, [1.00000 -0.70711], 1e-4); -***** assert (z, 0.7, 1e-4); -***** assert (p, 0.5, 1e-4); -***** assert (k, 1.0, 1e-4); -5 tests, 5 passed, 0 known failure, 0 skipped -[inst/@lti/feedback.m] ->>>>> /build/octave-control-3.4.0/inst/@lti/feedback.m + z_inv_e = [2; -1]; + z_tra_e = [2]; + z_inp_e = [-4]; + z_out_e = [-1]; + z_sys_e = [-4, -1, 2]; + +***** assert (z_inv, z_inv_e, 1e-4); +***** assert (z_tra, z_tra_e, 1e-4); +***** assert (z_inp, z_inp_e, 1e-4); +***** assert (z_out, z_out_e, 1e-4); +***** assert (z_sys, z_sys_e, 1e-4); +27 tests, 27 passed, 0 known failure, 0 skipped +[inst/@lti/plus.m] +>>>>> /build/octave-control-3.4.0/inst/@lti/plus.m ***** shared M, Me A1 = [ 1.0 0.0 -1.0 0.0 -1.0 1.0 @@ -9090,78 +9403,34 @@ sys1 = ss (A1, B1, C1, D1); sys2 = ss (A2, B2, C2, D2); - sys = feedback (sys1, sys2); + sys = sys1 + sys2; [A, B, C, D] = ssdata (sys); M = [A, B; C, D]; - Ae = [-0.5000 -0.2500 -1.5000 -1.2500 -1.2500 0.7500 - -1.5000 -0.2500 0.5000 -0.2500 -0.2500 -0.2500 - 1.0000 0.5000 2.0000 -0.5000 -0.5000 0.5000 - 0.0000 0.5000 0.0000 -3.5000 -0.5000 0.5000 - -1.5000 1.2500 -0.5000 1.2500 0.2500 1.2500 - 0.0000 1.0000 0.0000 -1.0000 -2.0000 3.0000 ]; + Ae = [ 1.0000 0.0000 -1.0000 0.0000 0.0000 0.0000 + 0.0000 -1.0000 1.0000 0.0000 0.0000 0.0000 + 1.0000 1.0000 2.0000 0.0000 0.0000 0.0000 + 0.0000 0.0000 0.0000 -3.0000 0.0000 0.0000 + 0.0000 0.0000 0.0000 1.0000 0.0000 1.0000 + 0.0000 0.0000 0.0000 0.0000 -1.0000 2.0000 ]; - Be = [ 0.5000 0.7500 - 0.5000 -0.2500 - 0.0000 0.5000 - 0.0000 0.5000 - -0.5000 0.2500 - 0.0000 1.0000 ]; + Be = [ 1.0000 2.0000 + 1.0000 0.0000 + 0.0000 1.0000 + 0.0000 1.0000 + -1.0000 0.0000 + 0.0000 2.0000 ]; - Ce = [ 1.5000 -1.2500 0.5000 -0.2500 -0.2500 -0.2500 - 0.0000 0.5000 0.0000 -0.5000 -0.5000 0.5000 ]; + Ce = [ 3.0000 -2.0000 1.0000 1.0000 1.0000 0.0000 + 0.0000 1.0000 0.0000 1.0000 1.0000 -1.0000 ]; - De = [ 0.5000 -0.2500 - 0.0000 0.5000 ]; + De = [ 2.0000 1.0000 + 0.0000 2.0000 ]; Me = [Ae, Be; Ce, De]; ***** assert (M, Me, 1e-4); -***** shared S1, S2 - P = ss (-2, 3, 4, 5); # meaningless numbers - C = ss (-1, 1, 1, 0); # ditto - L = P * C; - I = eye (size (L)); - S1 = feedback (I, L); - S2 = inv (I + L); -***** assert (S1.a, S2.a, 1e-4); -***** assert (S1.b, S2.b, 1e-4); -***** assert (S1.c, S2.c, 1e-4); -***** assert (S1.d, S2.d, 1e-4); -5 tests, 5 passed, 0 known failure, 0 skipped -[inst/@lti/norm.m] ->>>>> /build/octave-control-3.4.0/inst/@lti/norm.m -***** shared H2, Hinf - sys = ss (-1, 1, 1, 0); - H2 = norm (sys, 2); - Hinf = norm (sys, inf); -***** assert (H2, 0.7071, 1.5e-5); -***** assert (Hinf, 1, 5e-4); -***** shared H2, Hinf - a = [ 2.417 -1.002 0.5488 - 2 0 0 - 0 0.5 0 ]; - b = [ 1 - 0 - 0 ]; - c = [-0.424 0.436 -0.4552 ]; - d = [ 1 ]; - sys = ss (a, b, c, d, 0.1); - H2 = norm (sys, 2); - Hinf = norm (sys, inf); -***** assert (H2, 1.2527, 1.5e-5); -***** assert (Hinf, 2.7, 0.1); -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/@lti/isminimumphase.m] ->>>>> /build/octave-control-3.4.0/inst/@lti/isminimumphase.m -***** assert (isminimumphase (tf (1, [1, 0])), true); 1 test, 1 passed, 0 known failure, 0 skipped -[inst/@lti/dcgain.m] ->>>>> /build/octave-control-3.4.0/inst/@lti/dcgain.m -***** assert( dcgain( tf(1,[1,1]) ) , 1 ) -***** assert( dcgain( tf(2,[1,1]) ) , 2 ) -***** assert( dcgain( ss([0,1;-2,-3],[0;1],[1,0],0) ) , 0.5 ) -3 tests, 3 passed, 0 known failure, 0 skipped [inst/@lti/connect.m] >>>>> /build/octave-control-3.4.0/inst/@lti/connect.m ***** shared T, Texp @@ -9176,24 +9445,13 @@ ***** assert (T.c, Texp.c, 1e-4); ***** assert (T.d, Texp.d, 1e-4); 4 tests, 4 passed, 0 known failure, 0 skipped -[inst/@lti/mtimes.m] ->>>>> /build/octave-control-3.4.0/inst/@lti/mtimes.m -***** shared sysmat, sysmat_exp - sys1 = ss ([0, 1; -3, -2], [0; 1], [-5, 1], [2]); - sys2 = ss ([-10], [1], [-40], [5]); - sys3 = sys2 * sys1; - [A, B, C, D] = ssdata (sys3); - sysmat = [A, B; C, D]; - A_exp = [ -10 -5 1 - 0 0 1 - 0 -3 -2 ]; - B_exp = [ 2 - 0 - 1 ]; - C_exp = [ -40 -25 5 ]; - D_exp = [ 10 ]; - sysmat_exp = [A_exp, B_exp; C_exp, D_exp]; -***** assert (sysmat, sysmat_exp) +[inst/@lti/subsref.m] +>>>>> /build/octave-control-3.4.0/inst/@lti/subsref.m +***** shared a + s = tf ("s"); + G = (s+1)*s*5/(s+1)/(s^2+s+1); + a = G(1,1).num{1,1}(1); +***** assert (a, 5, 1e-4); 1 test, 1 passed, 0 known failure, 0 skipped [inst/@lti/prescale.m] >>>>> /build/octave-control-3.4.0/inst/@lti/prescale.m @@ -9402,549 +9660,392 @@ ***** assert (INFOo.SL, LSCALEe.', 1e-4); ***** assert (INFOo.SR, RSCALEe.', 1e-4); 22 tests, 22 passed, 0 known failure, 0 skipped -[inst/@lti/sminreal.m] ->>>>> /build/octave-control-3.4.0/inst/@lti/sminreal.m -***** shared B, C - - A = ss (-2, 3, 4, 5); - B = A / A; - C = sminreal (B); # no states should be removed - -***** assert (C.a, B.a); -***** assert (C.b, B.b); -***** assert (C.c, B.c); -***** assert (C.d, B.d); -***** shared A, B, D, E - - A = ss (-1, 1, 1, 0); - B = ss (-2, 3, 4, 5); - C = [A, B]; - D = sminreal (C(:, 1)); - E = sminreal (C(:, 2)); - -***** assert (D.a, A.a); -***** assert (D.b, A.b); -***** assert (D.c, A.c); -***** assert (D.d, A.d); -***** assert (E.a, B.a); -***** assert (E.b, B.b); -***** assert (E.c, B.c); -***** assert (E.d, B.d); -12 tests, 12 passed, 0 known failure, 0 skipped -[inst/@lti/plus.m] ->>>>> /build/octave-control-3.4.0/inst/@lti/plus.m -***** shared M, Me - A1 = [ 1.0 0.0 -1.0 - 0.0 -1.0 1.0 - 1.0 1.0 2.0 ]; +[inst/@lti/d2c.m] +>>>>> /build/octave-control-3.4.0/inst/@lti/d2c.m +***** shared Mo, Me + A = [ 1.0 0.5 + 0.5 1.0 ]; - B1 = [ 1.0 1.0 0.0 - 2.0 0.0 1.0 ].'; + B = [ 0.0 -1.0 + 1.0 0.0 ]; - C1 = [ 3.0 -2.0 1.0 - 0.0 1.0 0.0 ]; + C = [ -1.0 0.0 + 0.0 1.0 ]; - D1 = [ 1.0 0.0 - 0.0 1.0 ]; + D = [ 1.0 0.0 + 0.0 -1.0 ]; - A2 = [-3.0 0.0 0.0 - 1.0 0.0 1.0 - 0.0 -1.0 2.0 ]; + [Ao, Bo, Co, Do] = ssdata (d2c (c2d (ss (A, B, C, D), 2, "tustin"), "tustin")); - B2 = [ 0.0 -1.0 0.0 - 1.0 0.0 2.0 ].'; + Mo = [Ao, Bo; Co, Do]; + Me = [A, B; C, D]; - C2 = [ 1.0 1.0 0.0 - 1.0 1.0 -1.0 ]; +***** assert (Mo, Me, 1e-4); +***** shared Mo, Me + A = [ 1.0 0.5 + 0.5 1.0 ]; - D2 = [ 1.0 1.0 - 0.0 1.0 ]; + B = [ 0.0 -1.0 + 1.0 0.0 ]; - sys1 = ss (A1, B1, C1, D1); - sys2 = ss (A2, B2, C2, D2); - sys = sys1 + sys2; - [A, B, C, D] = ssdata (sys); - M = [A, B; C, D]; + C = [ -1.0 0.0 + 0.0 1.0 ]; - Ae = [ 1.0000 0.0000 -1.0000 0.0000 0.0000 0.0000 - 0.0000 -1.0000 1.0000 0.0000 0.0000 0.0000 - 1.0000 1.0000 2.0000 0.0000 0.0000 0.0000 - 0.0000 0.0000 0.0000 -3.0000 0.0000 0.0000 - 0.0000 0.0000 0.0000 1.0000 0.0000 1.0000 - 0.0000 0.0000 0.0000 0.0000 -1.0000 2.0000 ]; + D = [ 1.0 0.0 + 0.0 -1.0 ]; - Be = [ 1.0000 2.0000 - 1.0000 0.0000 - 0.0000 1.0000 - 0.0000 1.0000 - -1.0000 0.0000 - 0.0000 2.0000 ]; + [Ao, Bo, Co, Do] = ssdata (d2c (c2d (ss (A, B, C, D), 2, "zoh"), "zoh")); - Ce = [ 3.0000 -2.0000 1.0000 1.0000 1.0000 0.0000 - 0.0000 1.0000 0.0000 1.0000 1.0000 -1.0000 ]; + Mo = [Ao, Bo; Co, Do]; + Me = [A, B; C, D]; - De = [ 2.0000 1.0000 - 0.0000 2.0000 ]; +***** assert (Mo, Me, 1e-4); +***** shared Mo, Me + A = [ 1.0 0.5 + 0.5 1.0 ]; - Me = [Ae, Be; Ce, De]; + B = [ 0.0 -1.0 + 1.0 0.0 ]; -***** assert (M, Me, 1e-4); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/@lti/zero.m] ->>>>> /build/octave-control-3.4.0/inst/@lti/zero.m -***** shared z, z_exp - A = [ -0.7 -0.0458 -12.2 0 - 0 -0.014 -0.2904 -0.562 - 1 -0.0057 -1.4 0 - 1 0 0 0 ]; + C = [ -1.0 0.0 + 0.0 1.0 ]; - B = [ -19.1 -3.1 - -0.0119 -0.0096 - -0.14 -0.72 - 0 0 ]; + D = [ 1.0 0.0 + 0.0 -1.0 ]; - C = [ 0 0 -1 1 - 0 0 0.733 0 ]; + [Ao, Bo, Co, Do] = ssdata (d2c (c2d (ss (A, B, C, D), 2, "prewarp", 1000), "prewarp", 1000)); - D = [ 0 0 - 0.0768 0.1134 ]; + Mo = [Ao, Bo; Co, Do]; + Me = [A, B; C, D]; - sys = ss (A, B, C, D, "scaled", true); - z = sort (zero (sys)); +***** assert (Mo, Me, 1e-4); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/@lti/inv.m] +>>>>> /build/octave-control-3.4.0/inst/@lti/inv.m +***** shared M, Me + A = [ 1.0 2.0 0.0 + 4.0 -1.0 0.0 + 0.0 0.0 1.0 ]; - z_exp = sort ([-13.2759; 12.5774; -0.0155]); + B = [ 1.0 0.0 + 0.0 1.0 + 1.0 0.0 ]; -***** assert (z, z_exp, 1e-4); -***** shared z, z_exp, info, rank_exp, infz_exp, kronr_exp, kronl_exp - A = [ 1.0 0.0 0.0 0.0 0.0 0.0 - 0.0 1.0 0.0 0.0 0.0 0.0 - 0.0 0.0 3.0 0.0 0.0 0.0 - 0.0 0.0 0.0 -4.0 0.0 0.0 - 0.0 0.0 0.0 0.0 -1.0 0.0 - 0.0 0.0 0.0 0.0 0.0 3.0 ]; + C = [ 0.0 1.0 -1.0 + 0.0 0.0 1.0 ]; - B = [ 0.0 -1.0 - -1.0 0.0 - 1.0 -1.0 - 0.0 0.0 - 0.0 1.0 - -1.0 -1.0 ]; + D = [ 4.0 0.0 + 0.0 1.0 ]; - C = [ 1.0 0.0 0.0 1.0 0.0 0.0 - 0.0 1.0 0.0 1.0 0.0 1.0 - 0.0 0.0 1.0 0.0 0.0 1.0 ]; + sys = ss (A, B, C, D); + sysinv = inv (sys); + [Ai, Bi, Ci, Di] = ssdata (sysinv); + M = [Ai, Bi; Ci, Di]; - D = [ 0.0 0.0 - 0.0 0.0 - 0.0 0.0 ]; + Ae = [ 1.0000 1.7500 0.2500 + 4.0000 -1.0000 -1.0000 + 0.0000 -0.2500 1.2500 ]; - sys = ss (A, B, C, D, "scaled", true); - [z, ~, info] = zero (sys); + Be = [-0.2500 0.0000 + 0.0000 -1.0000 + -0.2500 0.0000 ]; - z_exp = [ 2.0000 - -1.0000 ]; + Ce = [ 0.0000 0.2500 -0.2500 + 0.0000 0.0000 1.0000 ]; - rank_exp = 2; - infz_exp = 2; - kronr_exp = zeros (1, 0); - kronl_exp = 2; + De = [ 0.2500 0.0000 + 0.0000 1.0000 ]; -***** assert (z, z_exp, 1e-4); -***** assert (info.rank, rank_exp); -***** assert (info.infz, infz_exp); -***** assert (info.kronr, kronr_exp); -***** assert (info.kronl, kronl_exp); -***** shared z, z_exp, info, rank_exp, infz_exp, kronr_exp, kronl_exp - A = [ 1 0 0 0 0 0 0 0 0 - 0 1 0 0 0 0 0 0 0 - 0 0 1 0 0 0 0 0 0 - 0 0 0 1 0 0 0 0 0 - 0 0 0 0 1 0 0 0 0 - 0 0 0 0 0 1 0 0 0 - 0 0 0 0 0 0 1 0 0 - 0 0 0 0 0 0 0 1 0 - 0 0 0 0 0 0 0 0 1 ]; + Me = [Ae, -Be; -Ce, De]; - E = [ 0 0 0 0 0 0 0 0 0 - 1 0 0 0 0 0 0 0 0 - 0 1 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 - 0 0 0 1 0 0 0 0 0 - 0 0 0 0 1 0 0 0 0 - 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 1 0 0 - 0 0 0 0 0 0 0 1 0 ]; +***** assert (M, Me, 1e-4); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/impulse.m] +>>>>> /build/octave-control-3.4.0/inst/impulse.m +***** test + t=0:0.1:.3; + sys=tf(0.9375,[1 2 4]); + y=impulse(sys,t); + assert (y(1), 0, eps); + assert (y(2), 0.084405001160727, 2*eps); + assert (y(3), 0.150460144774958, 2*eps); + assert (y(4), 0.199104909042133, 2*eps); +***** test + t=0:0.1:.4; + sys=tf(0.9375,[1 2 4]); + sys2=c2d(sys, 0.1, "impulse"); + y=impulse(sys2,t); + assert (y(1), 0, eps); + assert (y(2), 0.084405001160727, 2*eps); + assert (y(3), 0.150460144774958, 2*eps); + assert (y(4), 0.199104909042133, 2*eps); +***** test + s = tf("s"); + R = 1/s; + y= impulse(R); + assert (y(1), 1, eps); +***** demo + clf; + s = tf('s'); + g = 1/(2*s^2+3*s+4); + impulse(g); + title ("Impulse response of a PT2 transfer function"); +***** demo + clf; + s = tf('s'); + g = 1/(2*s^2+3*s+4); + h = c2d(g,0.1); + impulse(h); + title ("Impulse response of a discretized PT2 transfer function"); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/initial.m] +>>>>> /build/octave-control-3.4.0/inst/initial.m +***** shared initial_c, initial_c_exp, initial_d, initial_d_exp - B = [ -1 0 0 - 0 0 0 - 0 0 0 - 0 -1 0 - 0 0 0 - 0 0 0 - 0 0 -1 - 0 0 0 - 0 0 0 ]; + A = [ -2.8 2.0 -1.8 + -2.4 -2.0 0.8 + 1.1 1.7 -1.0 ]; - C = [ 0 1 1 0 3 4 0 0 2 - 0 1 0 0 4 0 0 2 0 - 0 0 1 0 -1 4 0 -2 2 ]; + B = [ -0.8 0.5 0 + 0 0.7 2.3 + -0.3 -0.1 0.5 ]; - D = [ 1 2 -2 - 0 -1 -2 - 0 0 0 ]; + C = [ -0.1 0 -0.3 + 0.9 0.5 1.2 + 0.1 -0.1 1.9 ]; - sys = dss (A, B, C, D, E, "scaled", true); - [z, ~, info] = zero (sys); + D = [ -0.5 0 0 + 0.1 0 0.3 + -0.8 0 0 ]; - z_exp = 1; + x_0 = [1, 2, 3]; - rank_exp = 11; - infz_exp = [0, 1]; - kronr_exp = 2; - kronl_exp = 1; + sysc = ss (A, B, C, D); -***** assert (z, z_exp, 1e-4); -***** assert (info.rank, rank_exp); -***** assert (info.infz, infz_exp); -***** assert (info.kronr, kronr_exp); -***** assert (info.kronl, kronl_exp); -***** shared p, pi, z, zi, k, ki, p_tf, pi_tf, z_tf, zi_tf, k_tf, ki_tf - P = ss (-2, 3, 4, 5); - Pi = inv (P); + [yc, tc, xc] = initial (sysc, x_0, 0.2, 0.1); + initial_c = [yc, tc, xc]; - p = pole (P); - [z, k] = zero (P); + sysd = c2d (sysc, 2); - pi = pole (Pi); - [zi, ki] = zero (Pi); + [yd, td, xd] = initial (sysd, x_0, 4); + initial_d = [yd, td, xd]; - P_tf = tf (P); - Pi_tf = tf (Pi); + ## expected values computed by the "dark side" - p_tf = pole (P_tf); - [z_tf, k_tf] = zero (P_tf); + yc_exp = [ -1.0000 5.5000 5.6000 + -0.9872 5.0898 5.7671 + -0.9536 4.6931 5.7598 ]; - pi_tf = pole (Pi_tf); - [zi_tf, ki_tf] = zero (Pi_tf); + tc_exp = [ 0.0000 + 0.1000 + 0.2000 ]; -***** assert (p, zi, 1e-4); -***** assert (z, pi, 1e-4); -***** assert (k, inv (ki), 1e-4); -***** assert (p_tf, zi_tf, 1e-4); -***** assert (z_tf, pi_tf, 1e-4); -***** assert (k_tf, inv (ki_tf), 1e-4); -***** shared z_inv, z_tra, z_inp, z_out, z_sys, z_inv_e, z_tra_e, z_inp_e, z_out_e, z_sys_e - A = diag ([1, 1, 3, -4, -1, 3]); - - B = [ 0, -1 - -1, 0 - 1, -1 - 0, 0 - 0, 1 - -1, -1 ]; - - C = [ 1, 0, 0, 1, 0, 0 - 0, 1, 0, 1, 0, 1 - 0, 0, 1, 0, 0, 1 ]; - - D = zeros (3, 2); - - SYS = ss (A, B, C, D); + xc_exp = [ 1.0000 2.0000 3.0000 + 0.5937 1.6879 3.0929 + 0.2390 1.5187 3.0988 ]; - z_inv = zero (SYS); - z_tra = zero (SYS, "transmission"); - z_inp = zero (SYS, "input decoupling"); - z_out = zero (SYS, "output decoupling"); - z_sys = zero (SYS, "system"); + initial_c_exp = [yc_exp, tc_exp, xc_exp]; - z_inv_e = [2; -1]; - z_tra_e = [2]; - z_inp_e = [-4]; - z_out_e = [-1]; - z_sys_e = [-4, -1, 2]; - -***** assert (z_inv, z_inv_e, 1e-4); -***** assert (z_tra, z_tra_e, 1e-4); -***** assert (z_inp, z_inp_e, 1e-4); -***** assert (z_out, z_out_e, 1e-4); -***** assert (z_sys, z_sys_e, 1e-4); -***** shared z_inv, z_tra, z_inp, z_out, z_sys, z_inv_e, z_tra_e, z_inp_e, z_out_e, z_sys_e - A = diag ([1, 1, 3, -4, -1, 3]); - - B = [ 0, -1 - -1, 0 - 1, -1 - 0, 0 - 0, 1 - -1, -1 ]; - - C = [ 1, 0, 0, 1, 0, 0 - 0, 1, 0, 1, 0, 1 - 0, 0, 1, 0, 0, 1 ]; - - D = zeros (3, 2); + yd_exp = [ -1.0000 5.5000 5.6000 + -0.6550 3.1673 4.2228 + -0.5421 2.6186 3.4968 ]; - E = eye (6); - - SYS = dss (A, B, C, D, E); + td_exp = [ 0 + 2 + 4 ]; - z_inv = zero (SYS); - z_tra = zero (SYS, "transmission"); - z_inp = zero (SYS, "input decoupling"); - z_out = zero (SYS, "output decoupling"); - z_sys = zero (SYS, "system"); + xd_exp = [ 1.0000 2.0000 3.0000 + -0.4247 1.5194 2.3249 + -0.3538 1.2540 1.9250 ]; - z_inv_e = [2; -1]; - z_tra_e = [2]; - z_inp_e = [-4]; - z_out_e = [-1]; - z_sys_e = [-4, -1, 2]; - -***** assert (z_inv, z_inv_e, 1e-4); -***** assert (z_tra, z_tra_e, 1e-4); -***** assert (z_inp, z_inp_e, 1e-4); -***** assert (z_out, z_out_e, 1e-4); -***** assert (z_sys, z_sys_e, 1e-4); -27 tests, 27 passed, 0 known failure, 0 skipped -[inst/care.m] ->>>>> /build/octave-control-3.4.0/inst/care.m -***** shared x, l, g, xe, le, ge - a = [-3 2 - 1 1]; + initial_d_exp = [yd_exp, td_exp, xd_exp]; - b = [ 0 - 1]; +***** assert (initial_c, initial_c_exp, 1e-4) +***** assert (initial_d, initial_d_exp, 1e-4) +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/place.m] +>>>>> /build/octave-control-3.4.0/inst/place.m +***** shared A, B, C, P, Kexpected + A = [0, 1; 3, 2]; + B = [0; 1]; + C = [2, 1]; # C is needed for ss; it doesn't matter what the value of C is + P = [-1, -0.5]; + Kexpected = [3.5, 3.5]; +***** assert (place (ss (A, B, C), P), Kexpected, 2*eps); +***** assert (place (A, B, P), Kexpected, 2*eps); +***** shared F, F_exp, ev_ol, ev_cl + A = [-6.8000 0.0000 -207.0000 0.0000 + 1.0000 0.0000 0.0000 0.0000 + 43.2000 0.0000 0.0000 -4.2000 + 0.0000 0.0000 1.0000 0.0000]; - c = [ 1 -1]; + B = [ 5.6400 0.0000 + 0.0000 0.0000 + 0.0000 1.1800 + 0.0000 0.0000]; - r = 3; + P = [-0.5000 + 0.1500i + -0.5000 - 0.1500i]; - [x, l, g] = care (a, b, c.'*c, r); + ALPHA = -0.4; + TOL = 1e-8; - xe = [ 0.5895 1.8216 - 1.8216 8.8188]; + F = place (A, B, P, ALPHA, TOL); - le = [-3.5026 - -1.4370]; + F_exp = - [-0.0876 -4.2138 0.0837 -18.1412 + -0.0233 18.2483 -0.4259 -4.8120]; - ge = [ 0.6072 2.9396]; + ev_ol = sort (eig (A)); + ev_cl = sort (eig (A - B*F)); -***** assert (x, xe, 1e-4); -***** assert (l, le, 1e-4); -***** assert (g, ge, 1e-4); +***** assert (F, F_exp, 1e-4); +***** assert (ev_ol(3:4), ev_cl(3:4), 1e-4); +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/@iddata/filter.m] +>>>>> /build/octave-control-3.4.0/inst/@iddata/filter.m +***** shared DATD, Z + DAT = iddata ({[(1:10).', (1:2:20).'], [(10:-1:1).', (20:-2:1).']}, {[(41:50).', (46:55).'], [(61:70).', (-66:-1:-75).']}); + DATD = detrend (DAT, "linear"); + Z = zeros (10, 2); +***** assert (DATD.y{1}, Z, 1e-10); +***** assert (DATD.y{2}, Z, 1e-10); +***** assert (DATD.u{1}, Z, 1e-10); +***** assert (DATD.u{2}, Z, 1e-10); +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/@iddata/fft.m] +>>>>> /build/octave-control-3.4.0/inst/@iddata/fft.m +***** shared DATD, Y, U + Y = 1:10; + U = 20:-2:1; + W = warning ("query", "iddata:transpose"); + warning ("off", W.identifier); + DAT = iddata (Y, U); + DATD = fft (DAT); + warning (W.identifier, W.state); +***** assert (DATD.y{1}, Y, 1e-10); +***** assert (DATD.u{1}, U, 1e-10); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/@iddata/detrend.m] +>>>>> /build/octave-control-3.4.0/inst/@iddata/detrend.m +***** shared DATD, Z + DAT = iddata ({[(1:10).', (1:2:20).'], [(10:-1:1).', (20:-2:1).']}, {[(41:50).', (46:55).'], [(61:70).', (-66:-1:-75).']}); + DATD = detrend (DAT, "linear"); + Z = zeros (10, 2); +***** assert (DATD.y{1}, Z, 1e-10); +***** assert (DATD.y{2}, Z, 1e-10); +***** assert (DATD.u{1}, Z, 1e-10); +***** assert (DATD.u{2}, Z, 1e-10); +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/@iddata/cat.m] +>>>>> /build/octave-control-3.4.0/inst/@iddata/cat.m +***** error (cat (1, iddata (1, 1), iddata ({2, 3}, {2, 3}))); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/@iddata/iddata.m] +>>>>> /build/octave-control-3.4.0/inst/@iddata/iddata.m +***** error (iddata); +***** error (iddata ((1:10).', (1:11).')); +***** warning (iddata (1:10)); +***** warning (iddata (1:10, 1:10)); +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/dare.m] +>>>>> /build/octave-control-3.4.0/inst/dare.m ***** shared x, l, g, xe, le, ge - a = [ 0.0 1.0 - 0.0 0.0]; + a = [ 0.4 1.7 + 0.9 3.8]; - b = [ 0.0 - 1.0]; + b = [ 0.8 + 2.1]; - c = [ 1.0 0.0 - 0.0 1.0 - 0.0 0.0]; + c = [ 1 -1]; - d = [ 0.0 - 0.0 - 1.0]; + r = 3; - [x, l, g] = care (a, b, c.'*c, d.'*d); + [x, l, g] = dare (a, b, c.'*c, r); - xe = [ 1.7321 1.0000 - 1.0000 1.7321]; + xe = [ 1.5354 1.2623 + 1.2623 10.5596]; - le = [-0.8660 + 0.5000i - -0.8660 - 0.5000i]; + le = [-0.0022 + 0.2454]; - ge = [ 1.0000 1.7321]; + ge = [ 0.4092 1.7283]; ***** assert (x, xe, 1e-4); -***** assert (l, le, 1e-4); +***** assert (sort (l), sort (le), 1e-4); ***** assert (g, ge, 1e-4); -***** shared x, xe - a = [ 0.0 1.0 - 0.0 0.0 ]; - - e = [ 1.0 0.0 - 0.0 1.0 ]; - - b = [ 0.0 - 1.0 ]; - - c = [ 1.0 0.0 - 0.0 1.0 - 0.0 0.0 ]; - - d = [ 0.0 - 0.0 - 1.0 ]; - - x = care (a, b, c.'*c, d.'*d, [], e); - - xe = [ 1.7321 1.0000 - 1.0000 1.7321 ]; - -***** assert (x, xe, 1e-4); -7 tests, 7 passed, 0 known failure, 0 skipped -[inst/dlyap.m] ->>>>> /build/octave-control-3.4.0/inst/dlyap.m -***** shared X, X_exp - A = [3.0 1.0 1.0 - 1.0 3.0 0.0 - 0.0 0.0 3.0]; - - B = [25.0 24.0 15.0 - 24.0 32.0 8.0 - 15.0 8.0 40.0]; - - X = dlyap (A.', -B); - - X_exp = [2.0000 1.0000 1.0000 - 1.0000 3.0000 0.0000 - 1.0000 0.0000 4.0000]; - -***** assert (X, X_exp, 1e-4); -***** shared X, X_exp - A = [3.0 1.0 1.0 - 1.0 3.0 0.0 - 0.0 0.0 3.0]; - - B = [1.0 0.2 2.0 - 0.5 0.5 1.0 - 1.0 -2.0 1.0]; - - X = dlyap (A.', -B); - - X_exp = [0.1390 -0.0514 0.1831 - -0.0086 0.0676 0.0422 - 0.2005 -0.3233 -0.0362]; - -***** assert (X, X_exp, 1e-4); -***** shared X, X_exp - A = [1.0 2.0 3.0 - 6.0 7.0 8.0 - 9.0 2.0 3.0]; - - B = [7.0 2.0 3.0 - 2.0 1.0 2.0 - 3.0 4.0 1.0]; - - C = [271.0 135.0 147.0 - 923.0 494.0 482.0 - 578.0 383.0 287.0]; - - X = dlyap (-A, B, C); - - X_exp = [2.0000 3.0000 6.0000 - 4.0000 7.0000 1.0000 - 5.0000 3.0000 2.0000]; - -***** assert (X, X_exp, 1e-4); -***** shared X, X_exp - A = [3.0 1.0 1.0 - 1.0 3.0 0.0 - 1.0 0.0 2.0]; - - E = [1.0 3.0 0.0 - 3.0 2.0 1.0 - 1.0 0.0 1.0]; - - B = [ -3.0 -10.0 7.0 - -10.0 -14.0 -2.0 - 7.0 -2.0 9.0 ]; - - X = dlyap (A, B, [], E); - - X_exp = [-2.0000 -1.0000 0.0000 - -1.0000 -3.0000 -1.0000 - 0.0000 -1.0000 -3.0000]; - -***** assert (X, X_exp, 1e-4); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/filt.m] +>>>>> /build/octave-control-3.4.0/inst/filt.m +***** shared num, den, n1, d1, n2, d2, n2e, d2e + num = [0, 3]; + den = [1, 4, 2]; + sys = filt (num, den); + [n1, d1] = filtdata (sys, "vector"); + [n2, d2] = tfdata (sys, "vector"); + n2e = [3, 0]; + d2e = [1, 4, 2]; +***** assert (n1, num, 1e-4); +***** assert (d1, den, 1e-4); +***** assert (n2, n2e, 1e-4); +***** assert (d2, d2e, 1e-4); 4 tests, 4 passed, 0 known failure, 0 skipped -[inst/lyapchol.m] ->>>>> /build/octave-control-3.4.0/inst/lyapchol.m -***** shared U, U_exp, X, X_exp - - A = [ -1.0 37.0 -12.0 -12.0 - -1.0 -10.0 0.0 4.0 - 2.0 -4.0 7.0 -6.0 - 2.0 2.0 7.0 -9.0 ].'; - - B = [ 1.0 2.5 1.0 3.5 - 0.0 1.0 0.0 1.0 - -1.0 -2.5 -1.0 -1.5 - 1.0 2.5 4.0 -5.5 - -1.0 -2.5 -4.0 3.5 ].'; - - U = lyapchol (A, B); - - X = U.' * U; # use lyap at home! - - U_exp = [ 1.0000 0.0000 0.0000 0.0000 - 3.0000 1.0000 0.0000 0.0000 - 2.0000 -1.0000 1.0000 0.0000 - -1.0000 1.0000 -2.0000 1.0000 ].'; +[inst/db2mag.m] +>>>>> /build/octave-control-3.4.0/inst/db2mag.m +***** assert (db2mag (40), 100); +***** assert (db2mag (-20), 0.1); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/obsv.m] +>>>>> /build/octave-control-3.4.0/inst/obsv.m +***** assert (obsv ([1, 0; 0, -0.5], [8, 8]), [8, 8; 8, -4]); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/sigma.m] +>>>>> /build/octave-control-3.4.0/inst/sigma.m +***** shared sv_exp, w_exp, sv_obs, w_obs + A = [1, 2; 3, 4]; + B = [5, 6; 7, 8]; + C = [4, 3; 2, 1]; + D = [8, 7; 6, 5]; + w = [2, 3, 4]; + sv_exp = [7.9176, 8.6275, 9.4393; + 0.6985, 0.6086, 0.5195]; + w_exp = [2; 3; 4]; + [sv_obs, w_obs] = sigma (ss (A, B, C, D), w); +***** assert (sv_obs, sv_exp, 1e-4); +***** assert (w_obs, w_exp, 1e-4); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/ctrbf.m] +>>>>> /build/octave-control-3.4.0/inst/ctrbf.m +***** shared Ao, Bo, Co, Zo, Ae, Be, Ce, Ze, NCONT + A = [ -1.0 0.0 0.0 + -2.0 -2.0 -2.0 + -1.0 0.0 -3.0 ]; - X_exp = [ 1.0000 3.0000 2.0000 -1.0000 - 3.0000 10.0000 5.0000 -2.0000 - 2.0000 5.0000 6.0000 -5.0000 - -1.0000 -2.0000 -5.0000 7.0000 ]; + B = [ 1.0 0.0 0.0 + 0.0 2.0 1.0 ].'; -***** assert (U, U_exp, 1e-4); -***** assert (X, X_exp, 1e-4); -***** shared U, U_exp, X, X_exp + C = [ 0.0 2.0 1.0 + 1.0 0.0 0.0 ]; - A = [ -1.0 3.0 -4.0 - 0.0 5.0 -2.0 - -4.0 4.0 1.0 ].'; + [Ao, Bo, Co, Zo, NCONT] = ctrbf (A, B, C); - E = [ 2.0 1.0 3.0 - 2.0 0.0 1.0 - 4.0 5.0 1.0 ].'; + Ae = [ -3.0000 2.2361 + 0.0000 -1.0000 ]; - B = [ 2.0 -1.0 7.0 ].'; + Be = [ 0.0000 -2.2361 + 1.0000 0.0000 ]; - U = lyapchol (A, B, E); + Ce = [ -2.2361 0.0000 + 0.0000 1.0000 ]; - U_exp = [ 1.6003 -0.4418 -0.1523 - 0.0000 0.6795 -0.2499 - 0.0000 0.0000 0.2041 ]; + Ze = [ 0.0000 1.0000 0.0000 + -0.8944 0.0000 -0.4472 + -0.4472 0.0000 0.8944 ]; -***** assert (U, U_exp, 1e-4); -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/covar.m] ->>>>> /build/octave-control-3.4.0/inst/covar.m -***** shared p, q, p_exp, q_exp - sys = ss (-1, 1, 1, 0); - [p, q] = covar (sys, 5); - p_exp = 2.5000; - q_exp = 2.5000; -***** assert (p, p_exp, 1e-4); -***** assert (q, q_exp, 1e-4); -***** shared p, q, p_exp, q_exp - sys = ss ([-0.2, -0.5; 1, 0], [2; 0], [1, 0.5], [0], 0.1); - [p, q] = covar (sys, 5); - p_exp = 30.3167; - q_exp = [27.1493, -3.6199; -3.6199, 27.1493]; -***** assert (p, p_exp, 1e-4); -***** assert (q, q_exp, 1e-4); +***** assert (Ao(1:NCONT, 1:NCONT), Ae, 1e-4); +***** assert (Bo(1:NCONT, :), Be, 1e-4); +***** assert (Co(:, 1:NCONT), Ce, 1e-4); +***** assert (Zo, Ze, 1e-4); 4 tests, 4 passed, 0 known failure, 0 skipped -[inst/bode.m] ->>>>> /build/octave-control-3.4.0/inst/bode.m -***** demo - s = tf('s'); - g = 1/(2*s^2+3*s+4); - bode(g); -***** test - s = tf('s'); - K = 1; - T = 2; - g = K/(1+T*s); - [mag phas w] = bode(g); - mag_dB = 20*log10(mag); - index = find(mag_dB < -3,1); - w_cutoff = w(index); - assert (1/T, w_cutoff, eps); -1 test, 1 passed, 0 known failure, 0 skipped [inst/ncfsyn.m] >>>>> /build/octave-control-3.4.0/inst/ncfsyn.m ***** shared AK, BK, CK, DK, RCOND, AKe, BKe, CKe, DKe, RCONDe @@ -10261,6 +10362,42 @@ ***** assert (CK, CKe, 1e-4); ***** assert (DK, DKe, 1e-4); 27 tests, 27 passed, 0 known failure, 0 skipped +[inst/gram.m] +>>>>> /build/octave-control-3.4.0/inst/gram.m +***** test + a = [-1 0 0; 1/2 -1 0; 1/2 0 -1]; + b = [1 0; 0 -1; 0 1]; + c = [0 0 1; 1 1 0]; ## it doesn't matter what the value of c is + Wc = gram (ss (a, b, c), "c"); + assert (a * Wc + Wc * a.' + b * b.', zeros (size (a))) +***** test + a = [-1 0 0; 1/2 -1 0; 1/2 0 -1]; + b = [1 0; 0 -1; 0 1]; ## it doesn't matter what the value of b is + c = [0 0 1; 1 1 0]; + Wo = gram (ss (a, b, c), "o"); + assert (a.' * Wo + Wo * a + c.' * c, zeros (size (a))) +***** test + a = [-1 0 0; 1/2 -1 0; 1/2 0 -1]; + b = [1 0; 0 -1; 0 1]; + Wc = gram (a, b); + assert (a * Wc + Wc * a.' + b * b.', zeros (size (a))) +***** test + a = [-1 0 0; 1/2 1 0; 1/2 0 -1] / 2; + b = [1 0; 0 -1; 0 1]; + c = [0 0 1; 1 1 0]; ## it doesn't matter what the value of c is + d = zeros (rows (c), columns (b)); ## it doesn't matter what the value of d is + Ts = 0.1; ## Ts != 0 + Wc = gram (ss (a, b, c, d, Ts), "c"); + assert (a * Wc * a.' - Wc + b * b.', zeros (size (a)), 1e-12) +***** test + a = [-1 0 0; 1/2 1 0; 1/2 0 -1] / 2; + b = [1 0; 0 -1; 0 1]; ## it doesn't matter what the value of b is + c = [0 0 1; 1 1 0]; + d = zeros (rows (c), columns (b)); ## it doesn't matter what the value of d is + Ts = 0.1; ## Ts != 0 + Wo = gram (ss (a, b, c, d, Ts), "o"); + assert (a.' * Wo * a - Wo + c.' * c, zeros (size (a)), 1e-12) +5 tests, 5 passed, 0 known failure, 0 skipped [inst/fitfrd.m] >>>>> /build/octave-control-3.4.0/inst/fitfrd.m ***** shared Yo, Ye @@ -10274,116 +10411,27 @@ Yo = step (SYSID, T); ***** assert (Yo, Ye, 1e-2); 1 test, 1 passed, 0 known failure, 0 skipped -[inst/h2syn.m] ->>>>> /build/octave-control-3.4.0/inst/h2syn.m -***** shared M, M_exp - A = [-1.0 0.0 4.0 5.0 -3.0 -2.0 - -2.0 4.0 -7.0 -2.0 0.0 3.0 - -6.0 9.0 -5.0 0.0 2.0 -1.0 - -8.0 4.0 7.0 -1.0 -3.0 0.0 - 2.0 5.0 8.0 -9.0 1.0 -4.0 - 3.0 -5.0 8.0 0.0 2.0 -6.0]; - - B = [-3.0 -4.0 -2.0 1.0 0.0 - 2.0 0.0 1.0 -5.0 2.0 - -5.0 -7.0 0.0 7.0 -2.0 - 4.0 -6.0 1.0 1.0 -2.0 - -3.0 9.0 -8.0 0.0 5.0 - 1.0 -2.0 3.0 -6.0 -2.0]; - - C = [ 1.0 -1.0 2.0 -4.0 0.0 -3.0 - -3.0 0.0 5.0 -1.0 1.0 1.0 - -7.0 5.0 0.0 -8.0 2.0 -2.0 - 9.0 -3.0 4.0 0.0 3.0 7.0 - 0.0 1.0 -2.0 1.0 -6.0 -2.0]; - - D = [ 0.0 0.0 0.0 -4.0 -1.0 - 0.0 0.0 0.0 1.0 0.0 - 0.0 0.0 0.0 0.0 1.0 - 3.0 1.0 0.0 1.0 -3.0 - -2.0 0.0 1.0 7.0 1.0]; - - P = ss (A, B, C, D); - K = h2syn (P, 2, 2); - M = [K.A, K.B; K.C, K.D]; - - KA = [ 88.0015 -145.7298 -46.2424 82.2168 -45.2996 -31.1407 - 25.7489 -31.4642 -12.4198 9.4625 -3.5182 2.7056 - 54.3008 -102.4013 -41.4968 50.8412 -20.1286 -26.7191 - 108.1006 -198.0785 -45.4333 70.3962 -25.8591 -37.2741 - -115.8900 226.1843 47.2549 -47.8435 -12.5004 34.7474 - 59.0362 -101.8471 -20.1052 36.7834 -16.1063 -26.4309]; - - KB = [ 3.7345 3.4758 - -0.3020 0.6530 - 3.4735 4.0499 - 4.3198 7.2755 - -3.9424 -10.5942 - 2.1784 2.5048]; - - KC = [ -2.3346 3.2556 0.7150 -0.9724 0.6962 0.4074 - 7.6899 -8.4558 -2.9642 7.0365 -4.2844 0.1390]; - - KD = [ 0.0000 0.0000 - 0.0000 0.0000]; - - M_exp = [KA, KB; KC, KD]; - -***** assert (M, M_exp, 1e-4); -***** shared M, M_exp - A = [-0.7 0.0 0.3 0.0 -0.5 -0.1 - -0.6 0.2 -0.4 -0.3 0.0 0.0 - -0.5 0.7 -0.1 0.0 0.0 -0.8 - -0.7 0.0 0.0 -0.5 -1.0 0.0 - 0.0 0.3 0.6 -0.9 0.1 -0.4 - 0.5 -0.8 0.0 0.0 0.2 -0.9]; - - B = [-1.0 -2.0 -2.0 1.0 0.0 - 1.0 0.0 1.0 -2.0 1.0 - -3.0 -4.0 0.0 2.0 -2.0 - 1.0 -2.0 1.0 0.0 -1.0 - 0.0 1.0 -2.0 0.0 3.0 - 1.0 0.0 3.0 -1.0 -2.0]; - - C = [ 1.0 -1.0 2.0 -2.0 0.0 -3.0 - -3.0 0.0 1.0 -1.0 1.0 0.0 - 0.0 2.0 0.0 -4.0 0.0 -2.0 - 1.0 -3.0 0.0 0.0 3.0 1.0 - 0.0 1.0 -2.0 1.0 0.0 -2.0]; - - D = [ 1.0 -1.0 -2.0 0.0 0.0 - 0.0 1.0 0.0 1.0 0.0 - 2.0 -1.0 -3.0 0.0 1.0 - 0.0 1.0 0.0 1.0 -1.0 - 0.0 0.0 1.0 2.0 1.0]; - - P = ss (A, B, C, D, 1); # value of sampling time doesn't matter - K = h2syn (P, 2, 2); - M = [K.A, K.B; K.C, K.D]; - - KA = [-0.0551 -2.1891 -0.6607 -0.2532 0.6674 -1.0044 - -1.0379 2.3804 0.5031 0.3960 -0.6605 1.2673 - -0.0876 -2.1320 -0.4701 -1.1461 1.2927 -1.5116 - -0.1358 -2.1237 -0.9560 -0.7144 0.6673 -0.7957 - 0.4900 0.0895 0.2634 -0.2354 0.1623 -0.2663 - 0.1672 -0.4163 0.2871 -0.1983 0.4944 -0.6967]; - - KB = [-0.5985 -0.5464 - 0.5285 0.6087 - -0.7600 -0.4472 - -0.7288 -0.6090 - 0.0532 0.0658 - -0.0663 0.0059]; - - KC = [ 0.2500 -1.0200 -0.3371 -0.2733 0.2747 -0.4444 - 0.0654 0.2095 0.0632 0.2089 -0.1895 0.1834]; - - KD = [-0.2181 -0.2070 - 0.1094 0.1159]; - - M_exp = [KA, KB; KC, KD]; - -***** assert (M, M_exp, 1e-4); +[inst/dsort.m] +>>>>> /build/octave-control-3.4.0/inst/dsort.m +***** shared s_exp, ndx_exp, s_obs, ndx_obs + p = [-0.2410+0.5573i; + -0.2410-0.5573i; + 0.1503; + -0.0972; + -0.2590]; + s_exp = [ -0.2410+0.5573i; + -0.2410-0.5573i; + -0.2590; + 0.1503; + -0.0972]; + ndx_exp = [ 1; + 2; + 5; + 3; + 4]; + [s_obs, ndx_obs] = dsort(p); +***** assert(s_obs, s_exp, 0); +***** assert(ndx_obs, ndx_exp, 0); 2 tests, 2 passed, 0 known failure, 0 skipped [inst/estim.m] >>>>> /build/octave-control-3.4.0/inst/estim.m @@ -10402,194 +10450,6 @@ m_exp = [-16, 5; 3, 0; 1, 0]; ***** assert (m, m_exp, 1e-4); 2 tests, 2 passed, 0 known failure, 0 skipped -[inst/@ss/ss2ss.m] ->>>>> /build/octave-control-3.4.0/inst/@ss/ss2ss.m -***** test - A = [1 2 3; 4 5 6; 7 8 9]; - B = [1; 2; 3]; - C = [-1 0 1]; - D = 0; - - [T E] = eig(A); - - original_system = ss(A,B,C,D); - transformed_system = ss2ss(original_system,T); - assert(transformed_system.a, [0.5755 2.006 -0.8179; 6.684 13.62 -2.585; -4.476 -7.826 0.8073],e-14); - assert(transformed_system.b, [-0.5789; -3.148; 1.631],e-14); - assert(transformed_system.c, [0.8912 -0.2231 1.112],e-14); - assert(transformed_system.d, 0); - retransformed_system = ss2ss(transformed_system,inv(T)); - assert(original_system.a,retransformed_system.a,e-14); - assert(original_system.b,retransformed_system.b,e-14); - assert(original_system.c,retransformed_system.c,e-14); - assert(original_system.d,retransformed_system.d,e-14); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/__dss2ss__.m] ->>>>> /build/octave-control-3.4.0/inst/__dss2ss__.m -***** shared a, b, c, e, ranke, rnka22, q, z, a_exp, b_exp, c_exp, e_exp, q_exp, z_exp - - e = [1, 2, 0, 0; 0, 1, 0, 1; 3, 9, 6, 3; 0, 0, 2, 0]; - a = [-1, 0, 0, 3; 0, 0, 1, 2; 1, 1, 0, 4; 0, 0, 0, 0]; - b = [1, 0; 0, 0; 0, 1; 1, 1]; - c = [-1, 0, 1, 0; 0, 1, -1, 1]; - - [a, e, b, c, ranke, rnka22, q, z] = __sl_tg01fd__ (a, e, b, c, true, 0.0); - - e_exp = [10.1587 5.8230 1.3021 0.0000; - 0.0000 -2.4684 -0.1896 0.0000; - 0.0000 0.0000 1.0338 0.0000; - 0.0000 0.0000 0.0000 0.0000]; - - a_exp = [ 2.0278 0.1078 3.9062 -2.1571; - -0.0980 0.2544 1.6053 -0.1269; - 0.2713 0.7760 -0.3692 -0.4853; - 0.0690 -0.5669 -2.1974 0.3086]; - - b_exp = [-0.2157 -0.9705; - 0.3015 0.9516; - 0.7595 0.0991; - 1.1339 0.3780]; - - c_exp = [ 0.3651 -1.0000 -0.4472 -0.8165; - -1.0954 1.0000 -0.8944 0.0000]; - - q_exp = [-0.2157 -0.5088 0.6109 0.5669; - -0.1078 -0.2544 -0.7760 0.5669; - -0.9705 0.1413 -0.0495 -0.1890; - 0.0000 0.8102 0.1486 0.5669]; - - z_exp = [-0.3651 0.0000 0.4472 0.8165; - -0.9129 0.0000 0.0000 -0.4082; - 0.0000 -1.0000 0.0000 0.0000; - -0.1826 0.0000 -0.8944 0.4082]; - -***** assert (a, a_exp, 1e-4); -***** assert (e, e_exp, 1e-4); -***** assert (b, b_exp, 1e-4); -***** assert (c, c_exp, 1e-4); -***** assert (q, q_exp, 1e-4); -***** assert (z, z_exp, 1e-4); -***** assert (ranke, 3); -***** assert (rnka22, 1); -***** shared mms - - mm = tf ([3, 5, 0], [4, 1]); - mms = ss (mm); -***** error (__dss2ss__ (mms.a, mms.b, mms.c, mms.d, mms.e)); -***** test - A = [1 0; 0 1]; - B = [1; 0]; - C = [1 0]; - D = 0; - E = [1 0; 0 0]; - - sys = dss (A, B, C, D, E); - [Ao, Bo, Co, Do] = ssdata (sys); - - assert (Ao, 1, 1e-4); - assert (Bo, 1, 1e-4); - assert (Co, 1, 1e-4); - assert (Do, 0, 1e-4); -10 tests, 10 passed, 0 known failure, 0 skipped -[inst/esort.m] ->>>>> /build/octave-control-3.4.0/inst/esort.m -***** shared s_exp, ndx_exp, s_obs, ndx_obs - p = [-0.2410+0.5573i; - -0.2410-0.5573i; - 0.1503; - -0.0972; - -0.2590]; - s_exp = [ 0.1503; - -0.0972; - -0.2410+0.5573i; - -0.2410-0.5573i; - -0.2590]; - ndx_exp = [ 3; - 4; - 1; - 2; - 5]; - [s_obs, ndx_obs] = esort(p); -***** assert(s_obs, s_exp, 0); -***** assert(ndx_obs, ndx_exp, 0); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/thiran.m] ->>>>> /build/octave-control-3.4.0/inst/thiran.m -***** shared num, den, expc - expc = [1, 0.5294, -0.04813, 0.004159]; - sys = thiran (2.4, 1); - [num, den] = tfdata (sys, "vector"); -***** assert (den, expc, 1e-4); -***** assert (num, fliplr (expc), 1e-4); -***** shared num, den - sys = thiran (0.5, 0.1); - [num, den] = tfdata (sys, "vector"); -***** assert (den, [1, 0, 0, 0, 0, 0], eps); -***** assert (num, 1, eps); -***** error (thiran (-1, 1)); -***** error (thiran (1, -1)); -***** error (thiran ([1 2 3], 1)); -7 tests, 7 passed, 0 known failure, 0 skipped -[inst/btaconred.m] ->>>>> /build/octave-control-3.4.0/inst/btaconred.m -***** shared Mo, Me, Info, HSVCe - A = [ -1. 0. 4. - 0. 2. 0. - 0. 0. -3. ]; - - B = [ 1. - 1. - 1. ]; - - C = [ 1. 1. 1. ]; - - D = [ 0. ]; - - G = ss (A, B, C, D, "scaled", true); - - AC = [ -26.4000, 6.4023, 4.3868; - 32.0000, 0, 0; - 0, 8.0000, 0 ]; - - BC = [ -16 - 0 - 0 ]; - - CC = [ 9.2994 1.1624 0.1090 ]; - - DC = [ 0 ]; - - K = ss (AC, BC, CC, DC, "scaled", true); - - [Kr, Info] = btaconred (G, K, 2, "weight", "input", "feedback", "+"); - [Ao, Bo, Co, Do] = ssdata (Kr); - - Ae = [ 9.1900 0.0000 - 0.0000 -34.5297 ]; - - Be = [ -11.9593 - 86.3137 ]; - - Ce = [ 2.8955 -1.3566 ]; - - De = [ 0.0000 ]; - - HSVCe = [ 3.8253 0.2005 ].'; - - Mo = [Ao, Bo; Co, Do]; - Me = [Ae, Be; Ce, De]; - -***** xtest assert (Mo, Me, 1e-4); -!!!!! known failure -ASSERT errors for: assert (Mo,Me,1e-4) - - Location | Observed | Expected | Reason - (3,1) -2.89553 2.8955 Abs err 5.791 exceeds tol 0.0001 by 6 - (3,2) 1.35663 -1.3566 Abs err 2.7132 exceeds tol 0.0001 by 3 - (1,3) 11.9593 -11.9593 Abs err 23.919 exceeds tol 0.0001 by 2e+01 - (2,3) -86.3137 86.3137 Abs err 172.63 exceeds tol 0.0001 by 2e+02 -***** assert (Info.hsvc, HSVCe, 1e-4); -2 tests, 1 passed, 1 known failure, 0 skipped [inst/issample.m] >>>>> /build/octave-control-3.4.0/inst/issample.m ***** assert (issample (1)) @@ -10623,42 +10483,53 @@ ***** error (issample (5, rand (2,3))) ***** error (issample (0, 1+2i)) 30 tests, 30 passed, 0 known failure, 0 skipped -[inst/gram.m] ->>>>> /build/octave-control-3.4.0/inst/gram.m -***** test - a = [-1 0 0; 1/2 -1 0; 1/2 0 -1]; - b = [1 0; 0 -1; 0 1]; - c = [0 0 1; 1 1 0]; ## it doesn't matter what the value of c is - Wc = gram (ss (a, b, c), "c"); - assert (a * Wc + Wc * a.' + b * b.', zeros (size (a))) -***** test - a = [-1 0 0; 1/2 -1 0; 1/2 0 -1]; - b = [1 0; 0 -1; 0 1]; ## it doesn't matter what the value of b is - c = [0 0 1; 1 1 0]; - Wo = gram (ss (a, b, c), "o"); - assert (a.' * Wo + Wo * a + c.' * c, zeros (size (a))) -***** test - a = [-1 0 0; 1/2 -1 0; 1/2 0 -1]; - b = [1 0; 0 -1; 0 1]; - Wc = gram (a, b); - assert (a * Wc + Wc * a.' + b * b.', zeros (size (a))) -***** test - a = [-1 0 0; 1/2 1 0; 1/2 0 -1] / 2; - b = [1 0; 0 -1; 0 1]; - c = [0 0 1; 1 1 0]; ## it doesn't matter what the value of c is - d = zeros (rows (c), columns (b)); ## it doesn't matter what the value of d is - Ts = 0.1; ## Ts != 0 - Wc = gram (ss (a, b, c, d, Ts), "c"); - assert (a * Wc * a.' - Wc + b * b.', zeros (size (a)), 1e-12) +[inst/margin.m] +>>>>> /build/octave-control-3.4.0/inst/margin.m +***** shared margin_c, margin_c_exp, margin_d, margin_d_exp + sysc = tf ([24], [1, 6, 11, 6]); + [gamma_c, phi_c, w_gamma_c, w_phi_c] = margin (sysc); + sysd = c2d (sysc, 0.3); + [gamma_d, phi_d, w_gamma_d, w_phi_d] = margin (sysd); + + margin_c = [gamma_c, phi_c, w_gamma_c, w_phi_c]; + margin_d = [gamma_d, phi_d, w_gamma_d, w_phi_d]; + + ## results from this implementation and the "dark side" diverge + ## from the third digit after the decimal point on + + gamma_c_exp = 2.50; + phi_c_exp = 35.43; + w_gamma_c_exp = 3.32; + w_phi_c_exp = 2.06; + + gamma_d_exp = 1.41; + phi_d_exp = 18.60; + w_gamma_d_exp = 2.48; + w_phi_d_exp = 2.04; + + margin_c_exp = [gamma_c_exp, phi_c_exp, w_gamma_c_exp, w_phi_c_exp]; + margin_d_exp = [gamma_d_exp, phi_d_exp, w_gamma_d_exp, w_phi_d_exp]; + +***** assert (margin_c, margin_c_exp, 1e-2); +***** assert (margin_d, margin_d_exp, 1e-2); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/bode.m] +>>>>> /build/octave-control-3.4.0/inst/bode.m +***** demo + s = tf('s'); + g = 1/(2*s^2+3*s+4); + bode(g); ***** test - a = [-1 0 0; 1/2 1 0; 1/2 0 -1] / 2; - b = [1 0; 0 -1; 0 1]; ## it doesn't matter what the value of b is - c = [0 0 1; 1 1 0]; - d = zeros (rows (c), columns (b)); ## it doesn't matter what the value of d is - Ts = 0.1; ## Ts != 0 - Wo = gram (ss (a, b, c, d, Ts), "o"); - assert (a.' * Wo * a - Wo + c.' * c, zeros (size (a)), 1e-12) -5 tests, 5 passed, 0 known failure, 0 skipped + s = tf('s'); + K = 1; + T = 2; + g = K/(1+T*s); + [mag phas w] = bode(g); + mag_dB = 20*log10(mag); + index = find(mag_dB < -3,1); + w_cutoff = w(index); + assert (1/T, w_cutoff, eps); +1 test, 1 passed, 0 known failure, 0 skipped [inst/fwcfconred.m] >>>>> /build/octave-control-3.4.0/inst/fwcfconred.m ***** shared Mo, Me, Info, HSVe @@ -10718,48 +10589,220 @@ ***** assert (Mo, Me, 1e-4); ***** assert (Info.hsv, HSVe, 1e-4); 2 tests, 2 passed, 0 known failure, 0 skipped +[inst/hsvd.m] +>>>>> /build/octave-control-3.4.0/inst/hsvd.m +***** shared hsv, hsv_exp + a = [ -0.04165 0.0000 4.9200 -4.9200 0.0000 0.0000 0.0000 + -5.2100 -12.500 0.0000 0.0000 0.0000 0.0000 0.0000 + 0.0000 3.3300 -3.3300 0.0000 0.0000 0.0000 0.0000 + 0.5450 0.0000 0.0000 0.0000 -0.5450 0.0000 0.0000 + 0.0000 0.0000 0.0000 4.9200 -0.04165 0.0000 4.9200 + 0.0000 0.0000 0.0000 0.0000 -5.2100 -12.500 0.0000 + 0.0000 0.0000 0.0000 0.0000 0.0000 3.3300 -3.3300]; + + b = [ 0.0000 0.0000 + 12.5000 0.0000 + 0.0000 0.0000 + 0.0000 0.0000 + 0.0000 0.0000 + 0.0000 12.500 + 0.0000 0.0000]; + + c = [ 1.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 + 0.0000 0.0000 0.0000 1.0000 0.0000 0.0000 0.0000 + 0.0000 0.0000 0.0000 0.0000 1.0000 0.0000 0.0000]; + + sys = ss (a, b, c, [], "scaled", true); + hsv = hsvd (sys, "alpha", 0.0); + + hsv_exp = [2.5139; 2.0846; 1.9178; 0.7666; 0.5473; 0.0253; 0.0246]; + +***** assert (hsv, hsv_exp, 1e-4); +1 test, 1 passed, 0 known failure, 0 skipped [inst/ctrb.m] >>>>> /build/octave-control-3.4.0/inst/ctrb.m ***** assert (ctrb ([1, 0; 0, -0.5], [8; 8]), [8, 8; 8, -4]); 1 test, 1 passed, 0 known failure, 0 skipped -[inst/impulse.m] ->>>>> /build/octave-control-3.4.0/inst/impulse.m -***** test - t=0:0.1:.3; - sys=tf(0.9375,[1 2 4]); - y=impulse(sys,t); - assert (y(1), 0, eps); - assert (y(2), 0.084405001160727, 2*eps); - assert (y(3), 0.150460144774958, 2*eps); - assert (y(4), 0.199104909042133, 2*eps); +[inst/acker.m] +>>>>> /build/octave-control-3.4.0/inst/acker.m ***** test - t=0:0.1:.4; - sys=tf(0.9375,[1 2 4]); - sys2=c2d(sys, 0.1, "impulse"); - y=impulse(sys2,t); - assert (y(1), 0, eps); - assert (y(2), 0.084405001160727, 2*eps); - assert (y(3), 0.150460144774958, 2*eps); - assert (y(4), 0.199104909042133, 2*eps); + # https://en.wikipedia.org/wiki/Ackermann's_formula#Example + A = [1 1; 1 2]; + B = [1; 0]; + P = roots ([1 11 30]); + K = acker(A,B,P); + assert (K, [14 57]); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/@ss/ss2ss.m] +>>>>> /build/octave-control-3.4.0/inst/@ss/ss2ss.m +***** test + A = [1 2 3; 4 5 6; 7 8 9]; + B = [1; 2; 3]; + C = [-1 0 1]; + D = 0; + + [T E] = eig(A); + + original_system = ss(A,B,C,D); + transformed_system = ss2ss(original_system,T); + assert(transformed_system.a, [0.5755 2.006 -0.8179; 6.684 13.62 -2.585; -4.476 -7.826 0.8073],e-14); + assert(transformed_system.b, [-0.5789; -3.148; 1.631],e-14); + assert(transformed_system.c, [0.8912 -0.2231 1.112],e-14); + assert(transformed_system.d, 0); + retransformed_system = ss2ss(transformed_system,inv(T)); + assert(original_system.a,retransformed_system.a,e-14); + assert(original_system.b,retransformed_system.b,e-14); + assert(original_system.c,retransformed_system.c,e-14); + assert(original_system.d,retransformed_system.d,e-14); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/pzmap.m] +>>>>> /build/octave-control-3.4.0/inst/pzmap.m +***** demo + s = tf('s'); + g = (s-1)/(s-2)/(s-3); + pzmap(g); ***** test - s = tf("s"); - R = 1/s; - y= impulse(R); - assert (y(1), 1, eps); + s = tf('s'); + g = (s-1)/(s-2)/(s-3); + [pol zer] = pzmap(g); + assert(sort(pol), [2 3]', 2*eps); + assert(zer, 1, eps); ***** demo - clf; s = tf('s'); g = 1/(2*s^2+3*s+4); - impulse(g); - title ("Impulse response of a PT2 transfer function"); -***** demo - clf; + pzmap(g); +***** test s = tf('s'); g = 1/(2*s^2+3*s+4); - h = c2d(g,0.1); - impulse(h); - title ("Impulse response of a discretized PT2 transfer function"); -3 tests, 3 passed, 0 known failure, 0 skipped + pol = pzmap(g); + assert(sort(pol), sort(roots([2 3 4]')), eps); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/hnamodred.m] +>>>>> /build/octave-control-3.4.0/inst/hnamodred.m +***** shared Mo, Me, Info, HSVe + A = [ -3.8637 -7.4641 -9.1416 -7.4641 -3.8637 -1.0000 + 1.0000, 0 0 0 0 0 + 0 1.0000 0 0 0 0 + 0 0 1.0000 0 0 0 + 0 0 0 1.0000 0 0 + 0 0 0 0 1.0000 0 ]; + + B = [ 1 + 0 + 0 + 0 + 0 + 0 ]; + + C = [ 0 0 0 0 0 1 ]; + + D = [ 0 ]; + + G = ss (A, B, C, D); # "scaled", false + + AV = [ 0.2000 -1.0000 + 1.0000 0 ]; + + BV = [ 1 + 0 ]; + + CV = [ -1.8000 0 ]; + + DV = [ 1 ]; + + V = ss (AV, BV, CV, DV); + + [Gr, Info] = hnamodred (G, "left", V, "tol1", 1e-1, "tol2", 1e-14); + [Ao, Bo, Co, Do] = ssdata (Gr); + + Ae = [ -0.2391 0.3072 1.1630 1.1967 + -2.9709 -0.2391 2.6270 3.1027 + 0.0000 0.0000 -0.5137 -1.2842 + 0.0000 0.0000 0.1519 -0.5137 ]; + + Be = [ -1.0497 + -3.7052 + 0.8223 + 0.7435 ]; + + Ce = [ -0.4466 0.0143 -0.4780 -0.2013 ]; + + De = [ 0.0219 ]; + + HSVe = [ 2.6790 2.1589 0.8424 0.1929 0.0219 0.0011 ].'; + + Mo = [Ao, Bo; Co, Do]; + Me = [Ae, Be; Ce, De]; + +***** xtest assert (Mo, Me, 1e-4); +!!!!! known failure +ASSERT errors for: assert (Mo,Me,1e-4) + + Location | Observed | Expected | Reason + (5,1) 0.4466 -0.4466 Abs err 0.8932 exceeds tol 0.0001 by 0.9 + (5,2) -0.014267 0.0143 Abs err 0.028567 exceeds tol 0.0001 by 0.03 + (1,3) -1.163 1.163 Abs err 2.326 exceeds tol 0.0001 by 2 + (2,3) -2.627 2.627 Abs err 5.254 exceeds tol 0.0001 by 5 + (1,4) -1.1967 1.1967 Abs err 2.3934 exceeds tol 0.0001 by 2 + (2,4) -3.1027 3.1027 Abs err 6.2054 exceeds tol 0.0001 by 6 + (1,5) 1.0497 -1.0497 Abs err 2.0994 exceeds tol 0.0001 by 2 + (2,5) 3.7052 -3.7052 Abs err 7.4104 exceeds tol 0.0001 by 7 +***** assert (Info.hsv, HSVe, 1e-4); +2 tests, 1 passed, 1 known failure, 0 skipped +[inst/dlyapchol.m] +>>>>> /build/octave-control-3.4.0/inst/dlyapchol.m +***** shared U, U_exp + + A = [ 0.5000 0.5000 -0.5000 + 0.0000 1.0000 -0.5000 + 1.0000 -0.5000 0.0000 ]; + + B = [ -2.0 ; 1.0 ; -1.0 ]; + + U = dlyapchol (A, B); + + U_exp = [ 5.6042 5.1284 1.9562 + 0.0000 3.4313 -1.6716 + 0.0000 0.0000 2.5621 ]; + +***** assert (U, U_exp, 1e-4); +***** shared U, U_exp + + A = [ 0.5000 0.5000 -0.5000 + 0.0000 1.0000 -0.5000 + 1.0000 -0.5000 0.0000 ]; + + B = [ -2.0 ; 1.0 ; -1.0 ]; + + E = [ 2.0000 0.0000 0.0000 + 0.0000 2.0000 0.0000 + 0.0000 0.0000 2.0000 ]; + + U = dlyapchol (A, B, E); + + U_exp = [ 1.0488 -0.3546 0.4644 + 0.0000 0.6560 -0.5187 + 0.0000 0.0000 0.4099 ]; + +***** assert (U, U_exp, 1e-4); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/thiran.m] +>>>>> /build/octave-control-3.4.0/inst/thiran.m +***** shared num, den, expc + expc = [1, 0.5294, -0.04813, 0.004159]; + sys = thiran (2.4, 1); + [num, den] = tfdata (sys, "vector"); +***** assert (den, expc, 1e-4); +***** assert (num, fliplr (expc), 1e-4); +***** shared num, den + sys = thiran (0.5, 0.1); + [num, den] = tfdata (sys, "vector"); +***** assert (den, [1, 0, 0, 0, 0, 0], eps); +***** assert (num, 1, eps); +***** error (thiran (-1, 1)); +***** error (thiran (1, -1)); +***** error (thiran ([1 2 3], 1)); +7 tests, 7 passed, 0 known failure, 0 skipped Checking C++ files ... Summary: 358 tests, 342 passed, 6 known failures, 10 skipped dh_installdocs -O--buildsystem=octave @@ -10784,8 +10827,8 @@ dpkg-gencontrol: warning: package octave-control: substitution variable ${octave:Upstream-Description} unused, but is defined dh_md5sums -O--buildsystem=octave dh_builddeb -O--buildsystem=octave -dpkg-deb: building package 'octave-control-dbgsym' in '../octave-control-dbgsym_3.4.0-3_armhf.deb'. dpkg-deb: building package 'octave-control' in '../octave-control_3.4.0-3_armhf.deb'. +dpkg-deb: building package 'octave-control-dbgsym' in '../octave-control-dbgsym_3.4.0-3_armhf.deb'. dpkg-genbuildinfo --build=binary -O../octave-control_3.4.0-3_armhf.buildinfo dpkg-genchanges --build=binary -O../octave-control_3.4.0-3_armhf.changes dpkg-genchanges: info: binary-only upload (no source code included) @@ -10793,12 +10836,14 @@ dpkg-buildpackage: info: binary-only upload (no source included) dpkg-genchanges: info: not including original source code in upload I: copying local configuration +I: user script /srv/workspace/pbuilder/21088/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/21088/tmp/hooks/B01_cleanup finished I: unmounting dev/ptmx filesystem I: unmounting dev/pts filesystem I: unmounting dev/shm filesystem I: unmounting proc filesystem I: unmounting sys filesystem I: cleaning the build env -I: removing directory /srv/workspace/pbuilder/6348 and its subdirectories -I: Current time: Tue Jun 6 23:47:15 -12 2023 -I: pbuilder-time-stamp: 1686138435 +I: removing directory /srv/workspace/pbuilder/21088 and its subdirectories +I: Current time: Thu Jun 8 01:55:08 +14 2023 +I: pbuilder-time-stamp: 1686138908