I have a problem to calculate eigenvalues of a symbolic matrix. here is the code is matlab format:
clc
clear all
i=1.824e-6;
j=0.11e-6;
c=7.342e-9;
e=200e9;
g=48.8e9;
a=0.075;
l=1;
syms p
k=[12*e*i/l^3,-6*e*i/l^2,0,0,-12*e*i/l^3,-6*e*i/l^2,0,0;-6*e*i/l^2,4*e*i/l,0,0,6*e*i/l^2,2*e*i/l,0,0;0,0,1.2*g*j/l+12*e*c/l^3,-0.1*g*j-6*e*c/l^2,0,0,-1.2*g*j/l-12*e*c/l^3,-1.2*g*j/l-12*e*c/l^3;0,0,-0.1*g*j-6*e*c/l^2,2/15*g*j*l+4*e*c/l,0,0,0.1*g*j+6*e*c/l^2,-1/30*g*j*l+2*e*c/l;-12*e*i/l^3,6*e*i/l^2,0,0,12*e*i/l^3,6*e*i/l^2,0,0;-6*e*i/l^2,2*e*i/l,0,0,6*e*i/l^2,4*e*i/l,0,0;0,0,-1.2*g*j/l-12*e*c/l^3,0.1*g*j+6*e*c/l^2,0,0,1.2*g*j/l+12*e*c/l^3,0.1*g*j+6*e*c/l^2;0,0,-0.1*g*j-6*e*c/l^2,-1/30*g*j*l+2*e*c/l,0,0,0.1*g*j+6*e*c/l^2,2/15*g*j*l+4*e*c/l];
kG=p/840*[0,0,198*l,-15*l^2,0,0,-198*l,-15*l^2;0,0,-169*l^2,18*l^3,0,0,29*l^2,-3*l^3;198*l,-169*l^2,-312*a*l,44*a*l^2,-198*l,-29*l^2,-108*a*l,-26*a*l^2;-15*l^2,18*l^3,44*a*l^2,-8*a*l^3,15*l^2,-3*l^3,26*a*l^2,6*a*l^3;0,0,-198*l,15*l^2,0,0,198*l,15*l^2;0,0,-29*l^2,-3*l^3,0,0,169*l^2,18*l^3;-198*l,29*l^2,-108*a*l,26*a*l^2,198*l,169*l^2,-312*a*l,-44*a*l^2;-15*l^2,-3*l^3,-26*a*l^2,6*a*l^3,15*l^2,18*l^3,-44*a*l^2,-8*a*l^3];
eig(k+kG)
I want a numerical result. matlab gives me as "root(...)". I heard maple can solve this problem but I am amateur on maple. please help me.
If you convert all your floating-point coefficients to exact rationals then it appears that
k+kGhas eigenvalue zero with multiplicity of two.But the characteristic polynomial that remains (after dividing out lambda^2) is of degree 6, and that does not appear to factor directly.
So you will need to substitute numeric values for
p, in order to obtain the remaining eigenvalues as floating-point. Perhaps the following code will help get you started.I could mention that
kGis symmetric, andkis almost symmetric. The entriesk[3,8]andk[8,3]differ. Is that intentional, or a mistake? (Ifkis intended to be symmetric then please clarify, because it means thatk+kGcan be cast as a Maple Matrix withshape=symmetricand the floating-point eigenvalue computation will be a little faster, produce no0.0*Iimaginary artefacts, and return sorted by default.)[edit] Following clarification by the Original Poster I make an adjustment below to replace the former definition of the [3,8] entry of Matrix
kby the value for its [8,3] entry.That makes Matrix
ksymmetric.That also allows the characteristic polynomial of the exact rational form of
k+kGto factor symbolically w.r.t. lambda. This results in 8 explicit formulas (in terms of parameterp) for the eigenvalues. Note however that these involve radicals and the imaginary unit, and immediate substitution of a floating-point value for parameterpresults in small nonzero imaginary component in the results (as numeric roundoff artefact).It thus still may be superior to use a dedicated root-finder on the characteristic polynomial, or compute the eigenvalues numerically, following substitution at floating-point values of parameter
p. These need not produce nonzero imaginary component artefacts as noise due to roundoff error.Here is revised code, with the now symmetric Matrix
k.