Post Reply 
Routh Hurwitz
03-11-2016, 04:03 AM (This post was last modified: 03-11-2016 04:06 AM by Han.)
Post: #4
RE: Routh Hurwitz
And here's a CAS version of the program above, with an extra modification that allows one to compute either the Hurwitz matrix, or the submatrix corresponding to the minors.

Usage: hurwitz({a0,a1,a2,...,an}, s) where s is the size of the submatrix (leading principal minor). If \( s=n \), then the entire matrix is produced. Otherwise, \( s \)-th minor is returned.

Code:
#cas
hurwitz(ai,s):=
BEGIN
  local n, m;
  local j,k,r0,r1,r;

  n:=size(ai)-1;
  if (s<1) or (s>n) then
    return("Bad Argument Value");
  end;
  m:=makemat(0,s,s);

  for j from 1 to s do
    k:=min(j-1,n-j);
    r0:=j-k; r:=j+k+1;
    k:=min(j,n-j);
    r1:=min(s,j+k);
    for k from r0 to r1 do
      m[k,j]:=ai[r];
      r:=r-1;
    end; 
  end;
  return(m);
END;
#end

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Routh Hurwitz - KennyDang - 03-10-2016, 05:00 AM
RE: Routh Hurwitz - toshk - 03-10-2016, 09:37 PM
RE: Routh Hurwitz - Han - 03-11-2016, 03:37 AM
RE: Routh Hurwitz - Han - 03-11-2016 04:03 AM
RE: Routh Hurwitz - Brad Barton - 03-11-2016, 08:09 PM



User(s) browsing this thread: 1 Guest(s)