[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Equation Display or Problem
From: |
Lukas Reichlin |
Subject: |
Re: Equation Display or Problem |
Date: |
Mon, 15 Jun 2015 21:02:22 +0200 |
On 15.06.2015, at 08:18, Thomas D. Dean <address@hidden> wrote:
> Back to my previous problem. I expected to bet the same system from either
> the zpk or equation representation. But, they are different
>
> octave:1869> clear all
> octave:1870> a0 = 1e5;
> octave:1871> w1 = 1e4;
> octave:1872> w2 = 1e6;
> octave:1873> s = tf('s');
> octave:1874> a_eqn = a0/(1+s/w1)/(1+s/w2)
>
> Transfer function 'a_eqn' from input 'u1' to output ...
> 1e+05
> y1: --------------------------
> 1e-10 s^2 + 0.000101 s + 1
> Continuous-time model.
>
> octave:1875> a_zpk = zpk([],[w1,w2],a0)
>
> Transfer function 'a_zpk' from input 'u1' to output ...
> 1e+05
> y1: ------------------------
> s^2 - 1.01e+06 s + 1e+10
> Continuous-time model.
>
> octave:1876> a_eqn(w1)
> ans = 4.9495e+04 - 5.0495e+04i
> octave:1877> a_zpk(w1)
> ans = 4.9495e-06 + 5.0495e-06i
>
> Is this correct? What am I doing wrong?
>
> Tom Dean
There's a thinko in the code above:
a_eqn = a0/(1+s/w1)/(1+s/w2)
is equivalent (after normalization by minreal)
a_eqn_norm = minreal (a_eqn)
to
b_zpk = zpk ([], [-w1, -w2], a0*w1*w2)
and
a_zpk = zpk([],[w1,w2],a0)
is equivalent to
b_eqn = a0/(s-w1)/(s-w2)
Lukas
Transfer function 'a_eqn' from input 'u1' to output ...
1e+05
y1: --------------------------
1e-10 s^2 + 0.000101 s + 1
Continuous-time model.
Transfer function 'a_eqn_norm' from input 'u1' to output ...
1e+15
y1: ------------------------
s^2 + 1.01e+06 s + 1e+10
Continuous-time model.
Transfer function 'b_zpk' from input 'u1' to output ...
1e+15
y1: ------------------------
s^2 + 1.01e+06 s + 1e+10
Continuous-time model.
Transfer function 'a_zpk' from input 'u1' to output ...
1e+05
y1: ------------------------
s^2 - 1.01e+06 s + 1e+10
Continuous-time model.
Transfer function 'b_eqn' from input 'u1' to output ...
1e+05
y1: ------------------------
s^2 - 1.01e+06 s + 1e+10
Continuous-time model.