Effacer les filtres
Effacer les filtres

How to plot phase margin

5 vues (au cours des 30 derniers jours)
Jayesh Patil
Jayesh Patil le 16 Avr 2015
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?

Réponses (1)

Sebastian Castro
Sebastian Castro le 16 Avr 2015
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

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by