1
$\begingroup$
ClearAll["Global`*"]
a = k/(4*b^3*(1 - Cosh[b]*Cos[b]));
a1 = (Cos[b*x] - Cosh[b*x]);
a2 = (Sin[b*x] - Sinh[b*x]);
phi1 = (Cos[b] - Cosh[b])*(Sin[b*(1 - z)] - Sinh[b*(1 - z)]);
phi2 = (Sin[b] - Sinh[b])*(Cos[b*(1 - z)] - Cosh[b*(1 - z)]);
phi3 = (Sin[b] + Sinh[b])*(Sin[b*(1 - z)] - Sinh[b*(1 - z)]);
phi4 = (Cos[b] - Cosh[b])*(Cos[b*(1 - z)] - Cosh[b*(1 - z)]);
f[k1_, z1_] := 
  Module[{s1}, k = k1; z = z1; 
   s1 = (a*((phi1 - phi2)*(a1 /. x -> z) + (phi3 + phi4)*(a2 /. 
           x -> z))); s1];
p11 = 1 - f[1*^12, 0.25];
p12 = -f[1*^12, 0.25];
p21 = -f[1*^12, 0.75];
p22 = 1 - f[1*^12, 0.75];
R = {{p11, p12}, {p21, p22}};
p = FullSimplify[Det[R]]
s2 = NSolve[p == 0 && 0 < b < 30]
s3 = b /. s2;
s4 = s3[[1]];
R1 = R /. b -> s4;
NullSpace[R1]

I have Matrix which contains Trig Function which is having a dependency on b . I took the Det of that Matrix and found b. I Substitute back one of the b in the Matrix R and tried to find the NullSpace of that Matrix, but end up in getting an empty matrix. Is there any other way to **Find the NullSpace of a Matrix in Mathematica**

$\endgroup$
1
  • 2
    $\begingroup$ Try lowering from default Tolerance: NullSpace[R1, Tolerance -> 10^(-4)] for example. Also could NSolve to higher precision. $\endgroup$ May 17, 2018 at 17:51

1 Answer 1

1
$\begingroup$

Basically, I am doing here what Daniel Lichtblau suggested: First, I rationalize the matrix R in order to compute with higher precision. Then -- instead of NSolve (which appears to have a hard time) -- I use FindRoot with increased precision and with initial guesses generated by the undocumented function Graphics`Mesh`FindIntersections (it computes all intersection of Line objects within a Graphics object). Afterwards, the solutions for b have sufficiently high accuracy such that NullSpace with its standard setting for Tolerance has no problems swallowing them.

R = Rationalize[R];
p = FullSimplify[Det[R]];
x0 = Graphics`Mesh`FindIntersections[Plot[{p, 0}, {b, 0, 30}]][[All, 1]];
sol = FindRoot[p, {b, #}, AccuracyGoal -> 20, 
     WorkingPrecision -> 40] & /@ x0;
NullSpace /@ (R /. sol)

{{{-0.707106781186547524400844362, -0.707106781186547524400844362}}, {{-0.7071067811865475244008444, -0.7071067811865475244008444}}, {{-0.70710678118654752440084, -0.70710678118654752440084}}, {{-0.7071067811865475244008, -0.7071067811865475244008}}, {{-0.7071067811865475244008, -0.7071067811865475244008}}, {{-0.707106781186547524401, -0.707106781186547524401}}, {{-0.707106781186547524, -0.707106781186547524}}, {{-0.70710678118654752, -0.70710678118654752}}}

$\endgroup$
2
  • $\begingroup$ Where can I get more informationGraphicsMeshFindIntersections? what you are suggesting is like between 0 to 30 there are 17 roots, and it gives me null space for all 17 right? $\endgroup$
    – acoustics
    May 18, 2018 at 3:18
  • $\begingroup$ it is working thanks for the suggestion $\endgroup$
    – acoustics
    May 18, 2018 at 3:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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