65 views (last 30 days)

Show older comments

I want to verify that two transfer functions are equal.

For example:

Kc = 0.4262; Ti=1.35;

C1 = pidstd(Kc,Ti);

tf(C1)

s = tf('s');

Gc1 = Kc*(1+1/(Ti*s))

assert(tf(C1) == Gc1)

Raises:

Undefined operator '==' for input arguments of type 'tf'.

Also note:

Gc1

tf(C1)

Gc1 - tf(C1)

Gc1 =

0.5754 s + 0.4262

-----------------

1.35 s

Continuous-time transfer function.

ans =

0.4262 s + 0.3157

-----------------

s

Continuous-time transfer function.

ans =

0

Static gain.

Walter Roberson
on 12 Aug 2020

Edited: Walter Roberson
on 12 Aug 2020

isequal(tfdata(tf(C1) - Gc1), {[0]})

This will probably fail if there are delays in the tf.

Walter Roberson
on 12 Aug 2020

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!