How to plot phase margin

조회 수: 4 (최근 30일)
Jayesh Patil
Jayesh Patil 2015년 4월 16일
답변: Sebastian Castro 2015년 4월 16일
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?

답변 (1개)

Sebastian Castro
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

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by