0
$\begingroup$
k1 = 0.01;
k2 - 0.01;
k3 = 0.01;
R = {{-317074. - 3255.08 k1 - 6510.16 k2 + 39.25 b^2, -241517. - 
     4593.15 k1 - 5295.88 k2 + 29.897 b^2, -7.25817*10^-7 + 
     4603.38 k1 - 3.69363*10^-9 k2 - 1.12278*10^-11 b^2, -10161.8 - 
     409.588 k1 + 0.397884 k2 + 1.25525 b^2, 
    126793. - 9.34595*10^-9 k1 + 2780.26 k2 - 15.6955 b^2, 
    64244.2 - 1.90887*10^-8 k1 + 2574.91 k2 - 7.95115 b^2, -10781.2 - 
     1.8725*10^-9 k1 + 0.292511 k2 + 1.33767 b^2, -2.07898 - 
     7.30152*10^-12 k1 + 0.00825368 k2 + 0.0000109055 b^2, -76688.6 + 
     3977.98 k1 - 7007.88 k2 + 9.49819 b^2, -9234.46 - 185.204 k1 + 
     0.0237841 k2 + 1.14341 b^2, 
    22001. - 2.12083*10^-8 k1 + 2009.06 k2 - 2.72346 b^2, 
    65.6162 - 8.03025*10^-10 k1 - 0.610304 k2 + 
     0.00145184 b^2}, {-241517. - 4593.15 k1 - 5295.88 k2 + 
     29.897 b^2, -1.49882*10^6 - 6481.27 k1 - 4308.09 k2 + 
     32.4507 b^2, 
    2.50722*10^6 + 6495.7 k1 - 3.00469*10^-9 k2 - 
     19.3977 b^2, -81891.2 - 577.959 k1 + 0.32367 k2 + 
     1.77261 b^2, -522099. - 1.31878*10^-8 k1 + 2261.69 k2 - 
     6.9699 b^2, 
    295696. - 2.69355*10^-8 k1 + 2094.64 k2 - 6.40372 b^2, 
    151362. - 2.64224*10^-9 k1 + 0.237952 k2 + 
     0.0314201 b^2, -5.60481 - 1.0303*10^-11 k1 + 0.0067142 k2 + 
     0.0000107143 b^2, 
    107.591 + 5613.22 k1 - 5700.77 k2 - 0.00126411 b^2, 
    26886.8 - 261.336 k1 + 0.0193479 k2 + 0.821086 b^2, 
    631401. - 2.99265*10^-8 k1 + 1634.33 k2 - 5.02847 b^2, -638.944 - 
     1.13313*10^-9 k1 - 0.49647 k2 + 
     0.00477873 b^2}, {-7.25817*10^-7 + 4603.38 k1 - 
     3.69363*10^-9 k2 - 1.12278*10^-11 b^2, 
    2.50722*10^6 + 6495.7 k1 - 3.00469*10^-9 k2 - 
     19.3977 b^2, -5.07318*10^6 - 6510.16 k1 - 2.09563*10^-21 k2 + 
     39.25 b^2, 
    227898. + 579.246 k1 + 2.25745*10^-13 k2 - 1.76248 b^2, 
    1.31625*10^6 + 1.32172*10^-8 k1 + 1.57742*10^-9 k2 - 
     10.1835 b^2, -31.4777 + 2.69954*10^-8 k1 + 1.46091*10^-9 k2 + 
     0.000244454 b^2, -243037. + 2.64812*10^-9 k1 + 
     1.6596*10^-13 k2 + 1.88102 b^2, 
    13.4875 + 1.03259*10^-11 k1 + 4.68284*10^-15 k2 - 
     0.0000171871 b^2, -2.29463*10^6 - 5625.71 k1 - 
     3.97602*10^-9 k2 + 17.7514 b^2, 
    29.4428 + 261.918 k1 + 1.34942*10^-14 k2 - 
     0.00009334 b^2, -657764. + 2.99931*10^-8 k1 + 1.13987*10^-9 k2 + 
     5.08896 b^2, 
    754.94 + 1.13565*10^-9 k1 - 3.46264*10^-13 k2 + 
     0.000759213 b^2}, {-10161.8 - 409.588 k1 + 0.397884 k2 + 
     1.25525 b^2, -81891.2 - 577.959 k1 + 0.32367 k2 + 1.77261 b^2, 
    227898. + 579.246 k1 + 2.25745*10^-13 k2 - 
     1.76248 b^2, -33454.3 - 51.5388 k1 - 0.0000243176 k2 + 
     0.152106 b^2, -74564.1 - 1.17601*10^-9 k1 - 0.169922 k2 - 
     0.0160892 b^2, -139509. - 2.40194*10^-9 k1 - 0.157372 k2 - 
     0.0454974 b^2, -13622.5 - 2.35618*10^-10 k1 - 0.0000178775 k2 - 
     0.006816 b^2, -13564.5 - 9.18755*10^-13 k1 - 5.04443*10^-7 k2 + 
     0.00780019 b^2, 
    718940. + 500.551 k1 + 0.428303 k2 - 1.41795 b^2, -21055.3 - 
     23.3043 k1 - 1.45362*10^-6 k2 + 0.0666351 b^2, -145331. - 
     2.66865*10^-9 k1 - 0.122789 k2 - 0.0507012 b^2, 
    613.183 - 1.01045*10^-10 k1 + 0.0000373002 k2 - 
     0.00251461 b^2}, {126793. - 9.34595*10^-9 k1 + 2780.26 k2 - 
     15.6955 b^2, -522099. - 1.31878*10^-8 k1 + 2261.69 k2 - 
     6.9699 b^2, 
    1.31625*10^6 + 1.32172*10^-8 k1 + 1.57742*10^-9 k2 - 
     10.1835 b^2, -74564.1 - 1.17601*10^-9 k1 - 0.169922 k2 - 
     0.0160892 b^2, -413088. - 2.6834*10^-20 k1 - 1187.35 k2 + 
     8.94374 b^2, -155164. - 5.48072*10^-20 k1 - 1099.65 k2 + 
     3.36173 b^2, 
    45802.1 - 5.37631*10^-21 k1 - 0.124921 k2 - 
     0.992499 b^2, -31.3605 - 2.09641*10^-23 k1 - 0.00352486 k2 + 
     0.0000116161 b^2, 
    1.15636*10^6 + 1.14215*10^-8 k1 + 2992.82 k2 - 
     9.20781 b^2, -14130.2 - 5.31756*10^-10 k1 - 0.0101574 k2 - 
     0.431012 b^2, 
    2.37586 - 6.08931*10^-20 k1 - 858.001 k2 - 
     8.16204*10^-7 b^2, -108.193 - 2.30564*10^-21 k1 + 0.260639 k2 - 
     0.00288933 b^2}, {64244.2 - 1.90887*10^-8 k1 + 2574.91 k2 - 
     7.95115 b^2, 
    295696. - 2.69355*10^-8 k1 + 2094.64 k2 - 6.40372 b^2, -31.4777 + 
     2.69954*10^-8 k1 + 1.46091*10^-9 k2 + 
     0.000244454 b^2, -139509. - 2.40194*10^-9 k1 - 0.157372 k2 - 
     0.0454974 b^2, -155164. - 5.48072*10^-20 k1 - 1099.65 k2 + 
     3.36173 b^2, -926805. - 1.11941*10^-19 k1 - 1018.43 k2 + 
     2.94103 b^2, -148344. - 1.09809*10^-20 k1 - 0.115695 k2 - 
     0.0490629 b^2, 
    8524.49 - 4.28181*10^-23 k1 - 0.00326451 k2 - 0.00548197 b^2, 
    3.95654*10^6 + 2.33279*10^-8 k1 + 2771.77 k2 - 
     7.81479 b^2, -126243. - 1.08609*10^-9 k1 - 0.00940712 k2 - 
     0.0403184 b^2, -1.134*10^6 - 1.24371*10^-19 k1 - 794.628 k2 + 
     2.24037 b^2, 
    5341.79 - 4.70916*10^-21 k1 + 0.241388 k2 - 
     0.016643 b^2}, {-10781.2 - 1.8725*10^-9 k1 + 0.292511 k2 + 
     1.33767 b^2, 
    151362. - 2.64224*10^-9 k1 + 0.237952 k2 + 
     0.0314201 b^2, -243037. + 2.64812*10^-9 k1 + 1.6596*10^-13 k2 + 
     1.88102 b^2, -13622.5 - 2.35618*10^-10 k1 - 0.0000178775 k2 - 
     0.006816 b^2, 
    45802.1 - 5.37631*10^-21 k1 - 0.124921 k2 - 
     0.992499 b^2, -148344. - 1.09809*10^-20 k1 - 0.115695 k2 - 
     0.0490629 b^2, -37896.2 - 1.07717*10^-21 k1 - 0.000013143 k2 + 
     0.172808 b^2, -248.398 - 4.20024*10^-24 k1 - 3.70851*10^-7 k2 + 
     0.00116987 b^2, 
    537479. + 2.28835*10^-9 k1 + 0.314875 k2 + 
     0.192445 b^2, -22369.3 - 1.0654*10^-10 k1 - 1.06866*10^-6 k2 + 
     0.0709145 b^2, -219083. - 1.22002*10^-20 k1 - 0.0902704 k2 + 
     0.432727 b^2, 
    651.855 - 4.61945*10^-22 k1 + 0.0000274219 k2 - 
     0.00258701 b^2}, {-2.07898 - 7.30152*10^-12 k1 + 0.00825368 k2 + 
     0.0000109055 b^2, -5.60481 - 1.0303*10^-11 k1 + 0.0067142 k2 + 
     0.0000107143 b^2, 
    13.4875 + 1.03259*10^-11 k1 + 4.68284*10^-15 k2 - 
     0.0000171871 b^2, -13564.5 - 9.18755*10^-13 k1 - 
     5.04443*10^-7 k2 + 0.00780019 b^2, -31.3605 - 
     2.09641*10^-23 k1 - 0.00352486 k2 + 0.0000116161 b^2, 
    8524.49 - 4.28181*10^-23 k1 - 0.00326451 k2 - 
     0.00548197 b^2, -248.398 - 4.20024*10^-24 k1 - 
     3.70851*10^-7 k2 + 0.00116987 b^2, -8.11709*10^7 - 
     1.63782*10^-26 k1 - 1.04641*10^-8 k2 + 39.25 b^2, 
    9474.45 + 8.92308*10^-12 k1 + 0.0088847 k2 - 
     0.00562637 b^2, -44.0457 - 4.15435*10^-13 k1 - 
     3.01538*10^-8 k2 + 0.000136984 b^2, -58.9499 - 
     4.75727*10^-23 k1 - 0.00254712 k2 + 0.0000461921 b^2, 
    12987.1 - 1.80128*10^-24 k1 + 7.73752*10^-7 k2 - 
     0.00461317 b^2}, {-76688.6 + 3977.98 k1 - 7007.88 k2 + 
     9.49819 b^2, 
    107.591 + 5613.22 k1 - 5700.77 k2 - 
     0.00126411 b^2, -2.29463*10^6 - 5625.71 k1 - 3.97602*10^-9 k2 + 
     17.7514 b^2, 718940. + 500.551 k1 + 0.428303 k2 - 1.41795 b^2, 
    1.15636*10^6 + 1.14215*10^-8 k1 + 2992.82 k2 - 9.20781 b^2, 
    3.95654*10^6 + 2.33279*10^-8 k1 + 2771.77 k2 - 7.81479 b^2, 
    537479. + 2.28835*10^-9 k1 + 0.314875 k2 + 0.192445 b^2, 
    9474.45 + 8.92308*10^-12 k1 + 0.0088847 k2 - 
     0.00562637 b^2, -1.84704*10^7 - 4861.42 k1 - 7543.66 k2 + 
     36.4663 b^2, 558416. + 226.335 k1 + 0.0256025 k2 - 0.570828 b^2, 
    4.6185*10^6 + 2.59183*10^-8 k1 + 2162.66 k2 - 
     5.84389 b^2, -38916.3 + 9.81364*10^-10 k1 - 0.656963 k2 + 
     0.0762635 b^2}, {-9234.46 - 185.204 k1 + 0.0237841 k2 + 
     1.14341 b^2, 26886.8 - 261.336 k1 + 0.0193479 k2 + 0.821086 b^2, 
    29.4428 + 261.918 k1 + 1.34942*10^-14 k2 - 
     0.00009334 b^2, -21055.3 - 23.3043 k1 - 1.45362*10^-6 k2 + 
     0.0666351 b^2, -14130.2 - 5.31756*10^-10 k1 - 0.0101574 k2 - 
     0.431012 b^2, -126243. - 1.08609*10^-9 k1 - 0.00940712 k2 - 
     0.0403184 b^2, -22369.3 - 1.0654*10^-10 k1 - 1.06866*10^-6 k2 + 
     0.0709145 b^2, -44.0457 - 4.15435*10^-13 k1 - 3.01538*10^-8 k2 + 
     0.000136984 b^2, 
    558416. + 226.335 k1 + 0.0256025 k2 - 0.570828 b^2, -19197.2 - 
     10.5375 k1 - 8.68923*10^-8 k2 + 0.0608603 b^2, -160055. - 
     1.20669*10^-9 k1 - 0.00733987 k2 + 0.163588 b^2, 
    767.742 - 4.56897*10^-11 k1 + 2.22967*10^-6 k2 - 
     0.00230975 b^2}, {22001. - 2.12083*10^-8 k1 + 2009.06 k2 - 
     2.72346 b^2, 
    631401. - 2.99265*10^-8 k1 + 1634.33 k2 - 5.02847 b^2, -657764. + 
     2.99931*10^-8 k1 + 1.13987*10^-9 k2 + 5.08896 b^2, -145331. - 
     2.66865*10^-9 k1 - 0.122789 k2 - 0.0507012 b^2, 
    2.37586 - 6.08931*10^-20 k1 - 858.001 k2 - 
     8.16204*10^-7 b^2, -1.134*10^6 - 1.24371*10^-19 k1 - 
     794.628 k2 + 2.24037 b^2, -219083. - 1.22002*10^-20 k1 - 
     0.0902704 k2 + 0.432727 b^2, -58.9499 - 4.75727*10^-23 k1 - 
     0.00254712 k2 + 0.0000461921 b^2, 
    4.6185*10^6 + 2.59183*10^-8 k1 + 2162.66 k2 - 
     5.84389 b^2, -160055. - 1.20669*10^-9 k1 - 0.00733987 k2 + 
     0.163588 b^2, -1.51759*10^6 - 1.38182*10^-19 k1 - 620.006 k2 + 
     2.99673 b^2, 
    11219.2 - 5.23207*10^-21 k1 + 0.188342 k2 - 
     0.0216322 b^2}, {65.6162 - 8.03025*10^-10 k1 - 0.610304 k2 + 
     0.00145184 b^2, -638.944 - 1.13313*10^-9 k1 - 0.49647 k2 + 
     0.00477873 b^2, 
    754.94 + 1.13565*10^-9 k1 - 3.46264*10^-13 k2 + 0.000759213 b^2, 
    613.183 - 1.01045*10^-10 k1 + 0.0000373002 k2 - 
     0.00251461 b^2, -108.193 - 2.30564*10^-21 k1 + 0.260639 k2 - 
     0.00288933 b^2, 
    5341.79 - 4.70916*10^-21 k1 + 0.241388 k2 - 0.016643 b^2, 
    651.855 - 4.61945*10^-22 k1 + 0.0000274219 k2 - 0.00258701 b^2, 
    12987.1 - 1.80128*10^-24 k1 + 7.73752*10^-7 k2 - 
     0.00461317 b^2, -38916.3 + 9.81364*10^-10 k1 - 0.656963 k2 + 
     0.0762635 b^2, 
    767.742 - 4.56897*10^-11 k1 + 2.22967*10^-6 k2 - 0.00230975 b^2, 
    11219.2 - 5.23207*10^-21 k1 + 0.188342 k2 - 
     0.0216322 b^2, -1249.8 - 1.98106*10^-22 k1 - 0.0000572138 k2 + 
     0.000444287 b^2}};
MatrixForm[R]
P = Simplify[Det[R]]
NSolve[{P == 0, 0 < b < 100000000}, b]

I have a 12 cross 12 system, I have taken the determinant, the determinant function depends on one single variable b. Now I am trying to find the roots of that det function. NSolve is taking too much of time. what is the best way to find the roots.

$\endgroup$
1
  • $\begingroup$ There is k2 - 0.01; rather than k2=0.01. This difference will have a big impact on speed. Even with this fixed, exact arithmetic is likely to make it much easier (as noted in a response by @kglr). $\endgroup$ Nov 29, 2018 at 23:29

1 Answer 1

3
$\begingroup$

Use exact numbers:

k1 = 1/100; k2 = 1/100; k3 = 1/100;
R = Rationalize[R, 10^(-12)];
P = Simplify[Det[R]];

NSolve[{P == 0, 0 < b < 100000000}, b] // RepeatedTiming

{0.0065, {{b -> 89.947}, {b -> 182.335}, {b -> 360.493}, {b -> 806.155}, {b -> 2248.09}, {b -> 3328.64}, {b -> 4776.58}, {b -> 19070.2}}}

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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