Sunday, June 20, 2021

TI-84 Plus CE: Bode Plots of Transfer Functions

 TI-84 Plus CE: Bode Plots of Transfer Functions


Introduction


The problem BODEPLOT (2021) plots the Bode plot of a transfer function in the form:


f(s) = ( (s - z1) (s - z2) (s - z3) * ... ) / ( (s - p1) (s - p2) (s - p3) * ... )


where:

z_i = zeros of the transfer function

p_i = pole of the transfer function

s = jw

j = i = √-1

w = frequency


The plot uses a linlog plotting where each x is replaced with 10^x.  The y axis represents the conversion y = 20 log_10 ( abs f( 10^x * j) ).


Lists used:

L1:  list of zeros

L2:  list of poles

L3:  x

L4:  20 log_10 ( abs f( 10^x * j) )


You can review the zeros and poles after each entry.  Erasing zeros and poles will erase the latest entry. 


TI-84 Plus CE Program:  BODEPLOT

Version 5.3 and above


"EWS 2021-05-02"

ClrHome

Disp "TRANSFER FUNCTION","F(S)=(S-ZERO).../(S-POLE)","S=JW 10^(W),20log(abs())"

Pause 

a+bi

0→A

0→B

0→Z

Lbl 0

toString(A)+" ZEROS, "+toString(B)+" POLES"

Menu(Ans,"ADD ZERO",1,"ADD POLE",2,"ERASE LAST ZERO",3,"ERASE LAST POLE",4,"REVIEW",5,"PLOT",6)

Lbl 1

Input "ZERO? ",S

If A=0

{S}→L1

If A>0

augment(L1,{S})→L1

A+1→A

Goto 0

Lbl 2

Input "POLE? ",S

If B=0

{S}→L2

If B>0

augment(L2,{S})→L2

B+1→B

Goto 0

Lbl 3

If A>1

Then

A-1→A

A→dim(L1)

Else

0→A

DelVar L1

End

Goto 0

Lbl 4

If B>0

Then

B-1→B

B→dim(L2)

Else

0→B

DelVar L2

End

Goto 0

Lbl 5

ClrHome

If A>0

Then

Disp "ZEROS:"

Pause L1

End

If B>0

Then

Disp "POLES:"

Pause L2

End

Goto 0

Lbl 6

For(I,-­6,6)

1→N

If A>0

prod(i*10^(I)-L1)→N

1→D

If B>0

prod(i*10^(I)-L2)→D

If Z=0

Then

{I}→L3

{20log(abs(N/D))}→L4

1→Z

Else

augment(L3,{I})→L3

augment(L4,{20log(abs(N/D))})→L4

End

End

FnOff 

PlotsOff 

-­7→Xmin

7→Xmax

1→Xscl

min(L4)-.5→Ymin

max(L4)+.5→Ymax

10→Yscl

Plot1(xyLine,L3,L4)

PlotsOn 1

DispGraph


You can download the zip file here.


Examples


f(s) = 1/(s-3)

Poles:  { 3 }










f(s) = s-0.5

Zeros: { 0.5 }










f(s) = ((s+2)(s-2))/((s-1)(s-3))

Zeros: { -2, 2 }

Poles: { 1, 3}










f(s) = (s-4)/((s+1)(s-3))

Zeros: { 4 }

Poles: { -1, 3 }










Eddie


All original content copyright, © 2011-2021.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.