# How do I evaluate a certain transfer function at desired frequencies numerically?: Difference between revisions

From Murray Wiki

Jump to navigationJump to search
No edit summary |
mNo edit summary |
||

Line 3: | Line 3: | ||

1. If you'd like to evaluate G(s) at a single frequency f (f is real, in Hz), you can use: evalfr(G,i*f) | 1. If you'd like to evaluate G(s) at a single frequency f (f is real, in Hz), you can use: evalfr(G,i*f) | ||

2. For a range of angular frequencies w (w is real, in rad/s): | 2. For a range of angular frequencies w (w is real, in rad/s), either: | ||

* Use H = freqresp(G,w) and use squeeze(H) to get an array; H is complex | * Use H = freqresp(G,w) and use squeeze(H) to get an array; H is complex | ||

* Use [mag phase] = bode(G,w) to get the magnitude and phase separately; | * Use [mag phase] = bode(G,w) to get the magnitude and phase separately; use squeeze() accordingly. | ||

--Shuo | --Shuo |

## Latest revision as of 01:45, 1 December 2008

There are several ways to do it other than writing out the transfer function explicitly:

1. If you'd like to evaluate G(s) at a single frequency f (f is real, in Hz), you can use: evalfr(G,i*f)

2. For a range of angular frequencies w (w is real, in rad/s), either:

- Use H = freqresp(G,w) and use squeeze(H) to get an array; H is complex
- Use [mag phase] = bode(G,w) to get the magnitude and phase separately; use squeeze() accordingly.

--Shuo