On Mon, Mar 29, 2010 at 3:34 AM, notmyaddr...@teewars.org <notmyaddr...@teewars.org> wrote: > Hallo, > > I trying to solve a generalized eigenvalue problem with two matrices > <= 8x8. > > A*x = lambda*B*x where A and B are symmetric matrices > > Sympy only take one matrix for method eigenvals. So what I have tried > by now is > > B^-1 *A*x = lambda*x > > but inverting B is much to heavy. In maple inverting B takes a very > long time too, but maple also has the option to put both in eigenvals > method like eigenvals(A,B) which is pretty fast. > > Here an example for two matrices: > > F = Symbol('F') > L = Symbol('L') > E = Symbol('E') > J = Symbol('J') > lmbda = Symbol('lambda') > > B = Matrix([[-4*F*L/75, F/10, F*L/150, 0, 0, 0, 0, 0], [F/10, -12*F/L, > 0, 6*F/L, -F/10, 0, 0, 0], [F*L/150, 0, -4*F*L/75, F/10, F*L/150, 0, > 0, 0], [0, 6*F/L, F/10, -12*F/L, 0, 6*F/L, 0, 0], [0, -F/10, F*L/150, > 0, -4*F*L/75, F/10, 0, 0], [0, 0, 0, 6*F/L, F/10, -12*F/L, 6*F/L, -F/ > 10], [0, 0, 0, 0, 0, 6*F/L, -6*F/L, F/10], [0, 0, 0, 0, 0, -F/10, F/ > 10, -2*F*L/75]]) > > A= Matrix([[40*E*J/L, -150*E*J/L**2, 10*E*J/L, 0, 0, 0, 0, 0], > [-150*E*J/L**2, 3000*E*J/L**3, 0, -1500*E*J/L**3, -150*E*J/L**2, 0, 0, > 0], [10*E*J/L, 0, 40*E*J/L, -150*E*J/L**2, 10*E*J/L, 0, 0, 0], [0, > -1500*E*J/L**3, -150*E*J/L**2, 3000*E*J/L**3, 0, -1500*E*J/L**3, 0, > 0], [0, -150*E*J/L**2, 10*E*J/L, 0, 40*E*J/L, -150*E*J/L**2, 0, 0], > [0, 0, 0, -1500*E*J/L**3, -150*E*J/L**2, 3000*E*J/L**3, -1500*E*J/ > L**3, -150*E*J/L**2], [0, 0, 0, 0, 0, -1500*E*J/L**3, 1500*E*J/L**3, > -150*E*J/L**2], [0, 0, 0, 0, 0, -150*E*J/L**2, -150*E*J/L**2, 20*E*J/ > L]]) > > Any suggestions how to solve this in sympy?
We need to figure out some algorithm to calculate generalized eigenvalue problems symbolically. Do you have any idea how to do that? I am not surprised that B^-1 is a no go, that's the same with numerical eigen problems. Btw, just curious --- what is your application? I myself need this in quantum mechanics. Ondrej -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sy...@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.