Reprezentacja graficzna odwroconej impedacji

10 views
Skip to first unread message

Kazik

unread,
Jan 19, 2010, 8:26:06 PM1/19/10
to Sysquake
Mam problem z tym programem. Obliczenie sa poprawne, ale brak jest
przedstawienia graficznego.
A oto moj problem. Chce, aby program przedstawial w ukladzie zmienna
real-zmienna imag przebieg admitancji w pewnym zakresie
czestotliwosci. Wiec robie:

w (niby omega) = 1:10:100;
z=10 + w*0.1j;
y=1/z;
scale ([, , , ]);
plot(real(y), imag(y)

I nic nie jest wyswietlane na grafie. Dlaczego tak sie dzieje.

Jezeli sie wyswietli np:

y
czy
z to wszystko jest OK. Ale na grafie nic nie ma. Chodzi o admitancje.
Impedancja odwzorowana jest korrekt.

Czy to jest problem programu czy moj?

Yves Piguet

unread,
Jan 20, 2010, 3:05:50 AM1/20/10
to sysq...@googlegroups.com
Hello,

I'll try to answer in English to the part of your post I've understood, the code fragment...

> w (niby omega) = 1:10:100;
> z=10 + w*0.1j;
> y=1/z;
> scale ([, , , ]);
> plot(real(y), imag(y)

Assuming "(niby omega)" is a comment, one gets the following errors:

w = 1:10:100;


z=10 + w*0.1j;
y=1/z;
scale ([, , , ]);
plot(real(y), imag(y)

Incomplete expression (5)

At line 5 ("plot..."), there is a missing closing parenthesis.

w = 1:10:100;


z=10 + w*0.1j;
y=1/z;
scale ([, , , ]);

plot(real(y), imag(y))

Incompatible size (3) '/'

At line 3, operator / has a scalar left operand and a row vector of length 10 as its right operand. A / B is equivalent to A*inv(B) where inv(B) is the matrix inverse of B. Element-wise division is performed with operator "./".

w = 1:10:100;
z=10 + w*0.1j;
y=1./z;


scale ([, , , ]);

plot(real(y), imag(y))

Bad argument (4) 'scale'

Function scale doesn't accept an empty array as argument.

w = 1:10:100;
z=10 + w*0.1j;
y=1./z;
plot(real(y), imag(y))

That works!

If you want a smoother Nyquist diagram, you can use the nyquist function which selects automatically the frequencies where the transfer function is evaluated:

clf % clear the figure

num = 1;
den = [0.1, 10]; % 0.1 s + 10
scale('equal', [-0.1, 0.2, -0.2, 0.2]);
nyquist(num, den);

Hope this helps,

Yves

Reply all
Reply to author
Forward
0 new messages