help-octave
[Top][All Lists]

## Re: plotting transfer function in octave 5.2: How to fix error: set: "da

 From: Torsten Lilge Subject: Re: plotting transfer function in octave 5.2: How to fix error: set: "dataaspectratio' must be finite Date: Sat, 01 Aug 2020 10:27:08 +0200

```On Fri, 2020-07-31 at 16:59 -0400, Doug Stewart wrote:
>
>
> On Fri, Jul 31, 2020 at 4:49 PM shall689 <sahallacy@hotmail.com>
> wrote:
> > Hello Doug,
> >
> > Won't s^8 counteract that small value.  What if the frequency is
> > 500Hz, then
> > w=2pi*500= 1000pi and (1000pi)^8*6.25e-18 = 59303318850.
> >
> > I would have to solve the denominator equation to determine which
> > ones to
> > exclude?
> >
> > Stephen
> >
> >
>
> Here is what I tried. I am not saying this is the best, but it is a
> starting point.
>
> I do not know what you expect so just use it as a starting point.
>
>
> s=tf('s')
> n=4.63e-12*s^7+1.346e-07*s^6-0.02167*s^5-
> 632.2*s^4+1.04e8*s^3+3.035e12*s^2+1.284e16*s+3.225e20
> d=6.25e-5*s^8+6.136e-12*s^7+2.875e-7*s^6-0.01399*s^5-
> 448.9*s^4+1.057e8*s^3+3.068e12*s^2+1.293e16*s+3.241e20
> #Note ^^^^^^^^ I changed this number.
> sys =n/d
> #step(sys)
>
> [nn,dd]=tfdata(sys,'v')
>
> rn=roots(nn)
> n1=rn(5:7)
> n2=poly(n1)
>
> rd=roots(dd)
> [sr,idx]=sort(real(rd))
> idx1=idx(1:4)
> d1=rd(idx1)
>
> d2=poly(d1)
>
> sys2=tf(n2,d2)
> step(sys2)
>

First of all the coefficients a4 and a5 of the denominator are negative.
>From the Hurwitz criterion, we can conclude that the system ist not
stable. Thus, no surprise that you can not plot  the step response.

Moreover, I think, it is not possible to really analyze the system based
on the transfer function coefficients printed with only 4 digits and due
to numerical issues resulting from very large and very small
coefficients (as already mentioned by Doug). When you calculate the
roots of the denominator (the original one, not the one adjusted by
Doug), you get two poles in the right s half plane, confirming the
instability of the system.

*But:* when computing the denominator at its "roots", the result is not
zero due to the numerical issues. Please try:

s = tf('s')
n = 4.63e-12*s^7+1.346e-07*s^6-0.02167*s^5-632.2*s^4+...

1.04e8*s^3+3.035e12*s^2+1.284e16*s+3.225e20
d = 6.25e-
18*s^8+6.136e-12*s^7+2.875e-7*s^6-0.01399*s^5-...
448.9*s^4+1.057e8
*s^3+3.068e12*s^2+1.293e16*s+3.241e20

[nn,dd] = tfdata (n/d)

rd =
roots (dd{1})
n = length (rd);

for i = 1:n
polyval (dd{1}, rd(i))
end

Torsten

```

reply via email to