2 * Functions and Variables for bode::
5 @node Functions and Variables for bode, , Package bode, Package bode
6 @section Functions and Variables for bode
10 @deffn {Function} bode_gain (@var{H}, @var{range}, ...@var{plot_opts}...)
11 Function to draw Bode gain plots.
13 Examples (1 through 7 from
15 @url{http://www.swarthmore.edu/NatSci/echeeve1/Ref/Bode/BodeHow.html},
21 (%i2) H1 (s) := 100 * (1 + s) / ((s + 10) * (s + 100))$
23 (%i3) bode_gain (H1 (s), [w, 1/1000, 1000])$
25 (%i4) H2 (s) := 1 / (1 + s/omega0)$
27 (%i5) bode_gain (H2 (s), [w, 1/1000, 1000]), omega0 = 10$
29 (%i6) H3 (s) := 1 / (1 + s/omega0)^2$
31 (%i7) bode_gain (H3 (s), [w, 1/1000, 1000]), omega0 = 10$
33 (%i8) H4 (s) := 1 + s/omega0$
35 (%i9) bode_gain (H4 (s), [w, 1/1000, 1000]), omega0 = 10$
39 (%i11) bode_gain (H5 (s), [w, 1/1000, 1000])$
41 (%i12) H6 (s) := 1/((s/omega0)^2 + 2 * zeta * (s/omega0) + 1)$
43 (%i13) bode_gain (H6 (s), [w, 1/1000, 1000]),
44 omega0 = 10, zeta = 1/10$
46 (%i14) H7 (s) := (s/omega0)^2 + 2 * zeta * (s/omega0) + 1$
48 (%i15) bode_gain (H7 (s), [w, 1/1000, 1000]),
49 omega0 = 10, zeta = 1/10$
51 (%i16) H8 (s) := 0.5 / (0.0001 * s^3 + 0.002 * s^2 + 0.01 * s)$
53 (%i17) bode_gain (H8 (s), [w, 1/1000, 1000])$
56 To use this function write first @code{load("bode")}. See also @mrefdot{bode_phase}
58 @opencatbox{Categories:}
60 @category{Package bode}
66 @deffn {Function} bode_phase (@var{H}, @var{range}, ...@var{plot_opts}...)
67 Function to draw Bode phase plots.
69 Examples (1 through 7 from
71 @url{http://www.swarthmore.edu/NatSci/echeeve1/Ref/Bode/BodeHow.html},
77 (%i2) H1 (s) := 100 * (1 + s) / ((s + 10) * (s + 100))$
79 (%i3) bode_phase (H1 (s), [w, 1/1000, 1000])$
81 (%i4) H2 (s) := 1 / (1 + s/omega0)$
83 (%i5) bode_phase (H2 (s), [w, 1/1000, 1000]), omega0 = 10$
85 (%i6) H3 (s) := 1 / (1 + s/omega0)^2$
87 (%i7) bode_phase (H3 (s), [w, 1/1000, 1000]), omega0 = 10$
89 (%i8) H4 (s) := 1 + s/omega0$
91 (%i9) bode_phase (H4 (s), [w, 1/1000, 1000]), omega0 = 10$
95 (%i11) bode_phase (H5 (s), [w, 1/1000, 1000])$
97 (%i12) H6 (s) := 1/((s/omega0)^2 + 2 * zeta * (s/omega0) + 1)$
99 (%i13) bode_phase (H6 (s), [w, 1/1000, 1000]),
100 omega0 = 10, zeta = 1/10$
102 (%i14) H7 (s) := (s/omega0)^2 + 2 * zeta * (s/omega0) + 1$
104 (%i15) bode_phase (H7 (s), [w, 1/1000, 1000]),
105 omega0 = 10, zeta = 1/10$
107 (%i16) H8 (s) := 0.5 / (0.0001 * s^3 + 0.002 * s^2 + 0.01 * s)$
109 (%i17) bode_phase (H8 (s), [w, 1/1000, 1000])$
111 (%i18) block ([bode_phase_unwrap : false],
112 bode_phase (H8 (s), [w, 1/1000, 1000]));
114 (%i19) block ([bode_phase_unwrap : true],
115 bode_phase (H8 (s), [w, 1/1000, 1000]));
118 To use this function write first @code{load("bode")}. See also @mrefdot{bode_gain}
120 @opencatbox{Categories:}
122 @category{Package bode}