Complex roots

Complex roots - Сообщения

#1 Опубликовано: 21.04.2010 20:56:46
cos_phi

cos_phi

0 сообщений из 39 понравились пользователям.

Группа: User

I know I did post here but I don't know what I did, it never showed up...

Searching the forums didn't reveal anything, so here is my big list: complex roots. For example, I could implement a Bessel polynomial very easy, "expand" for a 4th order resulted in this:

105+s*(105+s*(45+s*(10+s)))

which doesn't bother me, but I'm interested in finding the roots for a transfer function with variable order (Bessel filter). The wiki page also says "solve" only works for real numbers. I could try Bairstow's method, but that would complicate things a bit. I'll do it, though tomorrow, now my eyes are fighting the light...

So, if time allows and interest fuels, could you consider a future function similar to Maxima's "allroots"?


Regards,
Vlad.
#2 Опубликовано: 22.04.2010 06:12:27
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

Hello Vlad,

As far as I know, you can get all the roots of a polynomial by "polyroots" function
[MATH]p←105+105*x+45*x^2+10*x^3+1[/MATH]
[MATH]polyroots(mat(105;105;45;10;1;5;1))=mat(-2,8962+0,8672*i;-2,8962-0,8672*i;-2,1038+2,6574*i;-2,1038-2,6574*i;4;1)[/MATH]
You need the polynomial coefficients here. I think that SMath, at the moment, does not have the ability to extract coefficients from a polynomial expression or to expand it in order to get the polynomial (not sure).

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Опубликовано: 22.04.2010 08:17:03
cos_phi

cos_phi

0 сообщений из 39 понравились пользователям.

Группа: User

Thank you for the solution! With a little work I can get the terms of the polynomial by recursion and then use polyroots. I'm working on it now.


Happy regards,
Vlad.
#4 Опубликовано: 22.04.2010 08:51:13
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

You are welcome

I hope you would not mind sharing your SMath files with us or adding them to the Examples on the Wiki, when you get them ready.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#5 Опубликовано: 22.04.2010 11:51:47
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3729 понравились пользователям.

Группа: Super Administrator

Wrote

I think that SMath, at the moment, does not have the ability to extract coefficients from a polynomial expression or to expand it in order to get the polynomial (not sure).


You are right.
#6 Опубликовано: 22.04.2010 12:13:33
cos_phi

cos_phi

0 сообщений из 39 понравились пользователям.

Группа: User

Of course I will, I meant to say it but I didn't know how it will end up, so I chose safety first



This is the basis, a crude version. a(n) was a left-over from the previous version, now reused. Lots of room for improvement. Since this is for calculating a Bessel filter, H(s) is made just to see how the transfer function would look like, a feast of the success for the eyes, if you want
Next steps are printing real and imaginary parts of the poles and converting them to parameters for LTspice. Then transformations from low-pass (these ones) to high-pass, band-pass and band-reject. Then Butterworth, Chebyshev type I and II and Cauer.
All these are assisting me in making a universal filter; it will be ready (it is half-ready now) on LTspice Yahoo groups. The files already exist in wxMaxima, about 90% finished, but with SMath... it's a pleasure
I'm not working all of the time, but when they are ready I'll post them here.

Regards,
Vlad.
#7 Опубликовано: 22.04.2010 12:53:31
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

Thank you, the contribution to Wiki will be very welcome

BTW if I understood you well - you are using Ubuntu, are'nt you?
This screenshot is very interesting. I think I've never seen the screenshot like this one. I suppose you've chosen some Custom background color for regions (near white - some grayish). If you define background color as white from the Basic colors palette, the regions will be transparent (at least on my computer). Is there any option in the "Interface" I am not aware of, or something else? Maybe Ubuntu?

Regards,
Radovan

EDIT: Sorry, it seems I was wrong. Regions are not white.
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#8 Опубликовано: 22.04.2010 14:46:33
cos_phi

cos_phi

0 сообщений из 39 понравились пользователям.

Группа: User

(255 251 240) is the color, it's not that much but it lessens the contrast a bit. Maybe in a future version there will be an option to set the whole background color? Ah, wishes, wishes... One at a time.


Regards,
Vlad.

[EDIT]
I forgot, Ubuntu Karmic, yes
[/EDIT]
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений