5
$\begingroup$

Is there a simple way to determine the order of the poles of a rational function?

I have a difficult function where I need Mathematica to find the poles. It would be interesting to also know what the order is. Does there exist a basic command?

$\endgroup$
  • $\begingroup$ Is your function a rational function? $\endgroup$ – John McGee Jul 27 '15 at 11:50
  • 1
    $\begingroup$ It'd be nice if you posted exactly what your "difficult function" looks like. $\endgroup$ – J. M. will be back soon Jul 27 '15 at 12:44
  • 1
    $\begingroup$ Yes @JohnMcGee it is a rational function. $\endgroup$ – cherzieandkressy Jul 27 '15 at 13:09
  • $\begingroup$ @J. M. I really don't think it would be illuminating if I explicitly gave you this function. Also I just wanted to know if this was possible in general. $\endgroup$ – cherzieandkressy Jul 27 '15 at 13:10
  • 1
    $\begingroup$ Well, as noted, rational functions are easy. Transcendentals will require some work, since nothing's built-in. $\endgroup$ – J. M. will be back soon Jul 27 '15 at 13:11
11
$\begingroup$

One quick way for rational functions is to leverage built-in control system functions:

TransferFunctionPoles[TransferFunctionModel[1/(1 + s^2), s]][[1, 1]]
   {-I, I}
$\endgroup$
  • $\begingroup$ This only gives me the poles, not the order... $\endgroup$ – cherzieandkressy Jul 27 '15 at 13:24
  • 1
    $\begingroup$ You can use Tally[] for that. ;) $\endgroup$ – J. M. will be back soon Jul 27 '15 at 13:29
  • 1
    $\begingroup$ Ah nice, I understand. TransferFunctionPoles will give the solution multiple times in contrast to Solve. Thanks! $\endgroup$ – cherzieandkressy Jul 27 '15 at 13:34
8
$\begingroup$

Yo can go by solving the inverse of the function and then Count the solution.

f[x_] := x/(a - x)^3/(b - x);
div = x /. Solve[1/f[x] == 0, x];
poles = Union[div]
Count[div, #] & /@ poles

{a,b}

{3,1}

Depending on how complicated your function is, you may have to go for numerical treatment, like NSolve or NRoots.

Tally

As Guess who it is suggests, You can use Tally[div] instead of Count.

For some reason I always forget the right command at right time :] .

$\endgroup$
  • $\begingroup$ Thanks! This works. As alternatives you mean Reduce? $\endgroup$ – cherzieandkressy Jul 27 '15 at 13:16
  • 1
    $\begingroup$ You could, of course, use Solve[]/Reduce[] on Denominator[f[x]]. $\endgroup$ – J. M. will be back soon Jul 27 '15 at 13:20
  • 1
    $\begingroup$ @cherzieandkressy, if your function is too heavy for Solve then you may have to go numeric, like NSolve or NRoots. $\endgroup$ – Sumit Jul 27 '15 at 16:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.