Useful for electric phasors.
Functions:
Descripe phasors in polar as:
R = [Length Angle]
a = [30 40]
b = [10 30]
c = [40 -59]
Pkon: Complex conjugate
pkon(c) == [40 59]
Pmult: Polar multiplication
Pmult(Z,X) == Z.*X
Pdiv: Polar division
Pdiv(Z,X) == Z/X
Padd: Polar addition
Padd(X,Z) == X+Z
Psub: Polar substitution
Psub(X,Z) == X-Z
ssplot: Plot phasors
If input variable contains X,Z or R. it will be plotted as a resistance.
If input variable contains V. it will be plotted as a voltage.
If input variable contains P,S,Q. it will be plotted as a power.
If input variable contains I. it will be plotted as a current.
Other inputs such as 'A1' will not be affected by this.
The larger phasor the longer time the plotting.
Examples in the bottom took approx. 40 secs.
Example:
XL = [(0.0555*2*pi*50) 90]; %Getting the reactance from a 55.5 mH 50Hz reactor at angle +90
R = [15 0]; %Resistor at 0
Z = padd(R,XL); % Definition of impedance
V = [230 30]; % 230 volts at angle +30
I = pdiv(V,Z); %Pdiv: Polar division
S = pmult(V,pkon(I)); % pmult: Polar multiply. Pkon = Complex conjugate
P = [S(1)*cosd(S(2) ) 0];
Q = [ S(1)*sind(S(2)) 90];
spplot(S,P,Q)
spplot(XL,R,Z)
spplot(V,I)
V1 = [230 0];
V2 = [230 120];
V3 = [230 240];
I1 = [10 -10];
I2 = [11 120-7];
I3 = [7 240-8];
Isum = padd(I1,I2,I3);
spplot(V1,V2,V3,I3,I2,I1,Isum)
Cite As
Maarten Kjær den Haan (2024). Polar Phasors (https://github.com/mdenh17/Phasors), GitHub. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Graphics > 2-D and 3-D Plots > Polar Plots >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Versions that use the GitHub default branch cannot be downloaded
Version | Published | Release Notes | |
---|---|---|---|
1.1.3 | Updated example |
|
|
1.1.2 | Updated Example in description |
|
|
1.1.1 | Updated Legend |
|
|
1.1.0 | Added phasor representation in subplot. |
|
|
1.0.4 | New description |
|
|
1.0.3 | New colors |
|
|
1.0.2 | Faster plot |
|
|
1.0.1 |