Borrar filtros
Borrar filtros

How to plot phase margin

5 visualizaciones (últimos 30 días)
Jayesh Patil
Jayesh Patil el 16 de Abr. de 2015
Respondida: Sebastian Castro el 16 de Abr. de 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?

Respuestas (1)

Sebastian Castro
Sebastian Castro el 16 de Abr. de 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

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by