Hi,
I am having few issue with plotting transfer function:
Attached is what i have done.
Solved! Go to Solution.
The "error message" under the phase plot provides a potential clue! Try " Re(H(w*1j)) "
omega is a range, not a vector and so you get into troubles when you use omega as argument in your function H.
H(omega*1j)= will display what looks like a vector (but isn't) and trying to assign it a variable like X:=H(omega*1j) would throw an error.
One way to deal with the problem would be to turn omega into a vector.
But I was surprised to see that just applying vectorization does the job as well:
Vectorization (the arrow over the expression) can be applied via its keyboard short or via the menu
EDIT: Actually it is a strange error as IMHO it SHOULD work the way you had tried to do.
EDIT2: Actually it indeed does work the way you had set it up. As I noticed later (see my answer below) simply recalculating the sheet makes the error vanish.
This morning i copied a phase plot from other documents and it starts to work! this is wield!
Strange, yes.
I just gave it a try, opened your original sheet (which shows the error) in Prime 9 and simply, without changing anything, let it recalculate - the plot showed up without any error.
But using log spaced values for omega and vectorization as shown is the better approach anyway.
According the visibility of the traces in your first plot:
Prime only plots tiny points without connecting them if the trace consists of 50000 or more points which is the case in your plot. The settings for Symbol, Line Style and Trace Thickness are ignored, only the color can be changed. Using your range variable each trace consists of 200001 points.
One way to deal with is to decrease the number of points to be plotted by using a larger step in the range
But as you have a logarithmically scaled abscissa, it would be a better idea to evenly space the omega values at the log x-axis. This can't be done using a range variable, but this is exactly what the functions "logpts()" and "logspace()" are made for.
As they create a vector and not a range, you should use vectorization when you use omega as function argument.
Here just 1000 points are used for plotting each trace:
Using a vector for omega and using vectorization when you use it also cures the problem with the "arg" function.
Prime 9 file attached
Thanks, the 1,22,...10^6 trick worked! But last method didn't, on my side it didn't give me any error, but there is no line anymore in graph area.
You will have to post the sheet so we could see what did not work and why.
Did you experience that "empty" plot right after opening my sheet?
Using logspace definitely is the better approach as (even though it works) its not a good idea to set up about half a million points for each trace to compute.
You forgot to vectorize the function calls at the y-axis!!