How to plot phase margin
5 ビュー (過去 30 日間)
古いコメントを表示
I am new on matlab and want to plot phase margin from equation. The equations are given below. A=(pi-(w+tan^-1((uw+sinw)/(1-cosw))))*(180/pi). How to plot this equation A vs w?
0 件のコメント
回答 (1 件)
Sebastian Castro
2015 年 4 月 16 日
One of the most awesome things about MATLAB is the "dot multiply" and "dot divide" operators that lets you do this relatively easily.
The first step is to create a vector of "w" values. Below are a few ways.
% This first vector starts at 1 and ends at 1000, in increments of 10.
w = 1:10:1000;
% This second vector does something similar, but with logarithmic spacing (which is more common for frequency sweeps) - Starts at 10^0, ends at 10^3, 100 total data points.
w = logspace(0,3,100);
Next, you compute the corresponding "A" values and plot them. Notice that the expression is basically exactly the same as the one you gave, except for the "dot divide" operation. This makes sure that the vectors are divided element-by-element instead of with matrix operations.
A = (pi - w + atan( (u*w + sin(w)) ./ (1 - cos(w)))) * (180/pi);
plot(w,A)
- Sebastian
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!