@--This program good for bond economy Decide what cutoff value to use to distinguish unstable from stable eigenvalues--@ cutoff=1.00001; critc=0.0000001; dlibrary -a PszTgSen; #include PsTgSen.prc; lhs=(gradp(&lhs1,xbar)|gradp(&lhs2,xbar)|gradp(&lhs3,xbar)| gradp(&lhs4,xbar)|gradp(&lhs5,xbar)|gradp(&lhs6,xbar)| gradp(&lhs7,xbar)|gradp(&lhs8,xbar)|gradp(&lhs9,xbar)| gradp(&lhs10,xbar)|gradp(&lhs11,xbar)|gradp(&lhs12,xbar)); rhs=(gradp(&rhs1,xbar)|gradp(&rhs2,xbar)|gradp(&rhs3,xbar)| gradp(&rhs4,xbar)|gradp(&rhs5,xbar)|gradp(&rhs6,xbar)| gradp(&rhs7,xbar)|gradp(&rhs8,xbar)|gradp(&rhs9,xbar)| gradp(&rhs10,xbar)|gradp(&rhs11,xbar)|gradp(&rhs12,xbar)); @--Now use Paul Soderlind's procedure to give alternative representations for lhs and rhs. Use Golub and Van Loan notation: lhs=B=QSZh, rhs=A=QTZh--@ { t,s,q,z, lamdap } = zTgSen( rhs,lhs,cutoff,1,0); ns=rows(selif(abs(lamdap),abs(lamdap).=nvar; @--All eigenvalues are less than cutoff - no unstable roots - nothing more to do--@ elseif ns