Problem with NSolve Speed

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite
1












I have a very complicated function but only of 1 variable. I want to find the first value for which that function is zero. Mathematica can easily plot it:



func = Det[coeffMatrix];
Plot[func, [Beta]1, 0, 3]


enter image description here



From that plot, one can easily see that the first value would be ~2.556.



To show that $beta_1$ = 2.556 is actually the approximate solution:



func /. [Beta]1 -> 2.556



-0.00139597




However, when I try to find it numerically:



NSolve[func == 0 && 0 < [Beta]1 < 10, [Beta]1]


...it just runs and runs and runs and never gives an answer. Why ? and how can I fix it ?



The complete code



constants = b1 -> (-(Cosh[
0.68*[Beta]1]*(0.6553600000000004*Cos[0.15*[Beta]1]*
Cos[0.68*[Beta]1] -
0.6553600000000004*Cos[0.68*[Beta]1]*
Cosh[0.15*[Beta]1] +
1.2621440000000002*Sin[0.15*[Beta]1]*Sin[0.68*[Beta]1] +
0.7378559999999998*Sin[0.68*[Beta]1]*
Sinh[0.15*[Beta]1])) +
Cos[0.68*[Beta]1]*(-0.7378559999999998*Sin[0.15*[Beta]1] -
1.2621440000000002*Sinh[0.15*[Beta]1])*
Sinh[0.68*[Beta]1])/(Cosh[
0.68*[Beta]1]*(-0.6553600000000004*Cos[0.68*[Beta]1]*
Sin[0.15*[Beta]1] +
1.2621440000000002*Cos[0.15*[Beta]1]*Sin[0.68*[Beta]1] +
0.7378559999999998*Cosh[0.15*[Beta]1]*Sin[0.68*[Beta]1] -
0.6553600000000004*Cos[0.68*[Beta]1]*Sinh[0.15*[Beta]1]) +
Cos[0.68*[Beta]1]*(0.7378559999999998*Cos[0.15*[Beta]1] +
1.2621440000000002*Cosh[0.15*[Beta]1])*Sinh[0.68*[Beta]1]),
b2 -> (2.5*
Sec[0.68*[Beta]1]*(Cosh[
0.68*[Beta]1]*(-0.26214400000000015 +
0.26214400000000015*Cos[0.15*[Beta]1]*
Cosh[0.15*[Beta]1] -
Sin[0.15*[Beta]1]*Sinh[0.15*[Beta]1]) +
0.8*(Cosh[0.15*[Beta]1]*Sin[0.15*[Beta]1] -
Cos[0.15*[Beta]1]*Sinh[0.15*[Beta]1])*
Sinh[0.68*[Beta]1]))/((0.7378559999999998*
Cos[0.15*[Beta]1] +
1.2621440000000002*Cosh[0.15*[Beta]1])*Sinh[0.68*[Beta]1] +
Cosh[0.68*[Beta]1]*(-0.6553600000000004*Sin[0.15*[Beta]1] -
0.6553600000000004*Sinh[0.15*[Beta]1] +
1.2621440000000002*Cos[0.15*[Beta]1]*Tan[0.68*[Beta]1] +
0.7378559999999998*Cosh[0.15*[Beta]1]*Tan[0.68*[Beta]1])),
d2 -> (2.5*
Sech[0.68*[Beta]1]*(-0.26214400000000015*Cos[0.68*[Beta]1] +
0.8*Cosh[
0.15*[Beta]1]*(0.3276800000000002*Cos[0.15*[Beta]1]*
Cos[0.68*[Beta]1] +
Sin[0.15*[Beta]1]*
Sin[0.68*[Beta]1]) + (Cos[0.68*[Beta]1]*
Sin[0.15*[Beta]1] -
0.8*Cos[0.15*[Beta]1]*Sin[0.68*[Beta]1])*
Sinh[0.15*[Beta]1]))/(-0.6553600000000004*
Cos[0.68*[Beta]1]*Sin[0.15*[Beta]1] +
1.2621440000000002*Cos[0.15*[Beta]1]*Sin[0.68*[Beta]1] -
0.6553600000000004*Cos[0.68*[Beta]1]*Sinh[0.15*[Beta]1] +
0.7378559999999998*Cos[0.15*[Beta]1]*Cos[0.68*[Beta]1]*
Tanh[0.68*[Beta]1] +
Cosh[0.15*[Beta]1]*(0.7378559999999998*Sin[0.68*[Beta]1] +
1.2621440000000002*Cos[0.68*[Beta]1]*Tanh[0.68*[Beta]1]))

matrix = a1 (Sin[u [Beta]1] - Sinh[u [Beta]1]),
b1 (Cos[u [Beta]1] - Cosh[u [Beta]1]), -b2*
Cos[y*[Theta]*[Beta]1], -d2*
Cosh[y*[Theta]*[Beta]1], a1 (Cos[u [Beta]1] -
Cosh[u [Beta]1]), b1 (-Sin[u [Beta]1] - Sinh[u [Beta]1]),
b2*[Theta]*Sin[y*[Theta]*[Beta]1], -d2*[Theta]*
Sinh[y*[Theta]*[Beta]1], a1 (-Sin[u [Beta]1] -
Sinh[u [Beta]1]), b1 (-Cos[u [Beta]1] - Cosh[u [Beta]1]),
b2*[Alpha]^4*[Theta]^2*
Cos[y*[Theta]*[Beta]1], -d2*[Alpha]^4*[Theta]^2*
Cosh[y*[Theta]*[Beta]1], a1 (-Cos[u [Beta]1] -
Cosh[u [Beta]1]),
b1 (Sin[u [Beta]1] -
Sinh[u [Beta]1]), -b2*[Alpha]^4*[Theta]^3*
Sin[y*[Theta]*[Beta]1], -d2*[Alpha]^4*[Theta]^3*
Sinh[y*[Theta]*[Beta]1];

testingParam = [Theta] -> 0.8, [Alpha] -> 0.8, u -> 0.15,
y -> 1 - 0.15 ;

coeffMatrix = (matrix /. a1 -> 1) /. constants /. testingParam ;

func = Det[coeffMatrix];
NSolve[func == 0 && 0 < [Beta]1 < 10, [Beta]1]









share|improve this question





















  • Since you can use Plot on your function, use the MeshFunctions option, like what was done here.
    – J. M. is somewhat okay.♦
    2 hours ago










  • @J.M.issomewhatokay. Thank you for your comment and suggestion. However, I am not such an advanced user. Would you mind to post an answer of how to use the MeshFunctions ? I did not quite understand it from the example following your link. Thanks ! :)
    – james
    1 hour ago














up vote
1
down vote

favorite
1












I have a very complicated function but only of 1 variable. I want to find the first value for which that function is zero. Mathematica can easily plot it:



func = Det[coeffMatrix];
Plot[func, [Beta]1, 0, 3]


enter image description here



From that plot, one can easily see that the first value would be ~2.556.



To show that $beta_1$ = 2.556 is actually the approximate solution:



func /. [Beta]1 -> 2.556



-0.00139597




However, when I try to find it numerically:



NSolve[func == 0 && 0 < [Beta]1 < 10, [Beta]1]


...it just runs and runs and runs and never gives an answer. Why ? and how can I fix it ?



The complete code



constants = b1 -> (-(Cosh[
0.68*[Beta]1]*(0.6553600000000004*Cos[0.15*[Beta]1]*
Cos[0.68*[Beta]1] -
0.6553600000000004*Cos[0.68*[Beta]1]*
Cosh[0.15*[Beta]1] +
1.2621440000000002*Sin[0.15*[Beta]1]*Sin[0.68*[Beta]1] +
0.7378559999999998*Sin[0.68*[Beta]1]*
Sinh[0.15*[Beta]1])) +
Cos[0.68*[Beta]1]*(-0.7378559999999998*Sin[0.15*[Beta]1] -
1.2621440000000002*Sinh[0.15*[Beta]1])*
Sinh[0.68*[Beta]1])/(Cosh[
0.68*[Beta]1]*(-0.6553600000000004*Cos[0.68*[Beta]1]*
Sin[0.15*[Beta]1] +
1.2621440000000002*Cos[0.15*[Beta]1]*Sin[0.68*[Beta]1] +
0.7378559999999998*Cosh[0.15*[Beta]1]*Sin[0.68*[Beta]1] -
0.6553600000000004*Cos[0.68*[Beta]1]*Sinh[0.15*[Beta]1]) +
Cos[0.68*[Beta]1]*(0.7378559999999998*Cos[0.15*[Beta]1] +
1.2621440000000002*Cosh[0.15*[Beta]1])*Sinh[0.68*[Beta]1]),
b2 -> (2.5*
Sec[0.68*[Beta]1]*(Cosh[
0.68*[Beta]1]*(-0.26214400000000015 +
0.26214400000000015*Cos[0.15*[Beta]1]*
Cosh[0.15*[Beta]1] -
Sin[0.15*[Beta]1]*Sinh[0.15*[Beta]1]) +
0.8*(Cosh[0.15*[Beta]1]*Sin[0.15*[Beta]1] -
Cos[0.15*[Beta]1]*Sinh[0.15*[Beta]1])*
Sinh[0.68*[Beta]1]))/((0.7378559999999998*
Cos[0.15*[Beta]1] +
1.2621440000000002*Cosh[0.15*[Beta]1])*Sinh[0.68*[Beta]1] +
Cosh[0.68*[Beta]1]*(-0.6553600000000004*Sin[0.15*[Beta]1] -
0.6553600000000004*Sinh[0.15*[Beta]1] +
1.2621440000000002*Cos[0.15*[Beta]1]*Tan[0.68*[Beta]1] +
0.7378559999999998*Cosh[0.15*[Beta]1]*Tan[0.68*[Beta]1])),
d2 -> (2.5*
Sech[0.68*[Beta]1]*(-0.26214400000000015*Cos[0.68*[Beta]1] +
0.8*Cosh[
0.15*[Beta]1]*(0.3276800000000002*Cos[0.15*[Beta]1]*
Cos[0.68*[Beta]1] +
Sin[0.15*[Beta]1]*
Sin[0.68*[Beta]1]) + (Cos[0.68*[Beta]1]*
Sin[0.15*[Beta]1] -
0.8*Cos[0.15*[Beta]1]*Sin[0.68*[Beta]1])*
Sinh[0.15*[Beta]1]))/(-0.6553600000000004*
Cos[0.68*[Beta]1]*Sin[0.15*[Beta]1] +
1.2621440000000002*Cos[0.15*[Beta]1]*Sin[0.68*[Beta]1] -
0.6553600000000004*Cos[0.68*[Beta]1]*Sinh[0.15*[Beta]1] +
0.7378559999999998*Cos[0.15*[Beta]1]*Cos[0.68*[Beta]1]*
Tanh[0.68*[Beta]1] +
Cosh[0.15*[Beta]1]*(0.7378559999999998*Sin[0.68*[Beta]1] +
1.2621440000000002*Cos[0.68*[Beta]1]*Tanh[0.68*[Beta]1]))

matrix = a1 (Sin[u [Beta]1] - Sinh[u [Beta]1]),
b1 (Cos[u [Beta]1] - Cosh[u [Beta]1]), -b2*
Cos[y*[Theta]*[Beta]1], -d2*
Cosh[y*[Theta]*[Beta]1], a1 (Cos[u [Beta]1] -
Cosh[u [Beta]1]), b1 (-Sin[u [Beta]1] - Sinh[u [Beta]1]),
b2*[Theta]*Sin[y*[Theta]*[Beta]1], -d2*[Theta]*
Sinh[y*[Theta]*[Beta]1], a1 (-Sin[u [Beta]1] -
Sinh[u [Beta]1]), b1 (-Cos[u [Beta]1] - Cosh[u [Beta]1]),
b2*[Alpha]^4*[Theta]^2*
Cos[y*[Theta]*[Beta]1], -d2*[Alpha]^4*[Theta]^2*
Cosh[y*[Theta]*[Beta]1], a1 (-Cos[u [Beta]1] -
Cosh[u [Beta]1]),
b1 (Sin[u [Beta]1] -
Sinh[u [Beta]1]), -b2*[Alpha]^4*[Theta]^3*
Sin[y*[Theta]*[Beta]1], -d2*[Alpha]^4*[Theta]^3*
Sinh[y*[Theta]*[Beta]1];

testingParam = [Theta] -> 0.8, [Alpha] -> 0.8, u -> 0.15,
y -> 1 - 0.15 ;

coeffMatrix = (matrix /. a1 -> 1) /. constants /. testingParam ;

func = Det[coeffMatrix];
NSolve[func == 0 && 0 < [Beta]1 < 10, [Beta]1]









share|improve this question





















  • Since you can use Plot on your function, use the MeshFunctions option, like what was done here.
    – J. M. is somewhat okay.♦
    2 hours ago










  • @J.M.issomewhatokay. Thank you for your comment and suggestion. However, I am not such an advanced user. Would you mind to post an answer of how to use the MeshFunctions ? I did not quite understand it from the example following your link. Thanks ! :)
    – james
    1 hour ago












up vote
1
down vote

favorite
1









up vote
1
down vote

favorite
1






1





I have a very complicated function but only of 1 variable. I want to find the first value for which that function is zero. Mathematica can easily plot it:



func = Det[coeffMatrix];
Plot[func, [Beta]1, 0, 3]


enter image description here



From that plot, one can easily see that the first value would be ~2.556.



To show that $beta_1$ = 2.556 is actually the approximate solution:



func /. [Beta]1 -> 2.556



-0.00139597




However, when I try to find it numerically:



NSolve[func == 0 && 0 < [Beta]1 < 10, [Beta]1]


...it just runs and runs and runs and never gives an answer. Why ? and how can I fix it ?



The complete code



constants = b1 -> (-(Cosh[
0.68*[Beta]1]*(0.6553600000000004*Cos[0.15*[Beta]1]*
Cos[0.68*[Beta]1] -
0.6553600000000004*Cos[0.68*[Beta]1]*
Cosh[0.15*[Beta]1] +
1.2621440000000002*Sin[0.15*[Beta]1]*Sin[0.68*[Beta]1] +
0.7378559999999998*Sin[0.68*[Beta]1]*
Sinh[0.15*[Beta]1])) +
Cos[0.68*[Beta]1]*(-0.7378559999999998*Sin[0.15*[Beta]1] -
1.2621440000000002*Sinh[0.15*[Beta]1])*
Sinh[0.68*[Beta]1])/(Cosh[
0.68*[Beta]1]*(-0.6553600000000004*Cos[0.68*[Beta]1]*
Sin[0.15*[Beta]1] +
1.2621440000000002*Cos[0.15*[Beta]1]*Sin[0.68*[Beta]1] +
0.7378559999999998*Cosh[0.15*[Beta]1]*Sin[0.68*[Beta]1] -
0.6553600000000004*Cos[0.68*[Beta]1]*Sinh[0.15*[Beta]1]) +
Cos[0.68*[Beta]1]*(0.7378559999999998*Cos[0.15*[Beta]1] +
1.2621440000000002*Cosh[0.15*[Beta]1])*Sinh[0.68*[Beta]1]),
b2 -> (2.5*
Sec[0.68*[Beta]1]*(Cosh[
0.68*[Beta]1]*(-0.26214400000000015 +
0.26214400000000015*Cos[0.15*[Beta]1]*
Cosh[0.15*[Beta]1] -
Sin[0.15*[Beta]1]*Sinh[0.15*[Beta]1]) +
0.8*(Cosh[0.15*[Beta]1]*Sin[0.15*[Beta]1] -
Cos[0.15*[Beta]1]*Sinh[0.15*[Beta]1])*
Sinh[0.68*[Beta]1]))/((0.7378559999999998*
Cos[0.15*[Beta]1] +
1.2621440000000002*Cosh[0.15*[Beta]1])*Sinh[0.68*[Beta]1] +
Cosh[0.68*[Beta]1]*(-0.6553600000000004*Sin[0.15*[Beta]1] -
0.6553600000000004*Sinh[0.15*[Beta]1] +
1.2621440000000002*Cos[0.15*[Beta]1]*Tan[0.68*[Beta]1] +
0.7378559999999998*Cosh[0.15*[Beta]1]*Tan[0.68*[Beta]1])),
d2 -> (2.5*
Sech[0.68*[Beta]1]*(-0.26214400000000015*Cos[0.68*[Beta]1] +
0.8*Cosh[
0.15*[Beta]1]*(0.3276800000000002*Cos[0.15*[Beta]1]*
Cos[0.68*[Beta]1] +
Sin[0.15*[Beta]1]*
Sin[0.68*[Beta]1]) + (Cos[0.68*[Beta]1]*
Sin[0.15*[Beta]1] -
0.8*Cos[0.15*[Beta]1]*Sin[0.68*[Beta]1])*
Sinh[0.15*[Beta]1]))/(-0.6553600000000004*
Cos[0.68*[Beta]1]*Sin[0.15*[Beta]1] +
1.2621440000000002*Cos[0.15*[Beta]1]*Sin[0.68*[Beta]1] -
0.6553600000000004*Cos[0.68*[Beta]1]*Sinh[0.15*[Beta]1] +
0.7378559999999998*Cos[0.15*[Beta]1]*Cos[0.68*[Beta]1]*
Tanh[0.68*[Beta]1] +
Cosh[0.15*[Beta]1]*(0.7378559999999998*Sin[0.68*[Beta]1] +
1.2621440000000002*Cos[0.68*[Beta]1]*Tanh[0.68*[Beta]1]))

matrix = a1 (Sin[u [Beta]1] - Sinh[u [Beta]1]),
b1 (Cos[u [Beta]1] - Cosh[u [Beta]1]), -b2*
Cos[y*[Theta]*[Beta]1], -d2*
Cosh[y*[Theta]*[Beta]1], a1 (Cos[u [Beta]1] -
Cosh[u [Beta]1]), b1 (-Sin[u [Beta]1] - Sinh[u [Beta]1]),
b2*[Theta]*Sin[y*[Theta]*[Beta]1], -d2*[Theta]*
Sinh[y*[Theta]*[Beta]1], a1 (-Sin[u [Beta]1] -
Sinh[u [Beta]1]), b1 (-Cos[u [Beta]1] - Cosh[u [Beta]1]),
b2*[Alpha]^4*[Theta]^2*
Cos[y*[Theta]*[Beta]1], -d2*[Alpha]^4*[Theta]^2*
Cosh[y*[Theta]*[Beta]1], a1 (-Cos[u [Beta]1] -
Cosh[u [Beta]1]),
b1 (Sin[u [Beta]1] -
Sinh[u [Beta]1]), -b2*[Alpha]^4*[Theta]^3*
Sin[y*[Theta]*[Beta]1], -d2*[Alpha]^4*[Theta]^3*
Sinh[y*[Theta]*[Beta]1];

testingParam = [Theta] -> 0.8, [Alpha] -> 0.8, u -> 0.15,
y -> 1 - 0.15 ;

coeffMatrix = (matrix /. a1 -> 1) /. constants /. testingParam ;

func = Det[coeffMatrix];
NSolve[func == 0 && 0 < [Beta]1 < 10, [Beta]1]









share|improve this question













I have a very complicated function but only of 1 variable. I want to find the first value for which that function is zero. Mathematica can easily plot it:



func = Det[coeffMatrix];
Plot[func, [Beta]1, 0, 3]


enter image description here



From that plot, one can easily see that the first value would be ~2.556.



To show that $beta_1$ = 2.556 is actually the approximate solution:



func /. [Beta]1 -> 2.556



-0.00139597




However, when I try to find it numerically:



NSolve[func == 0 && 0 < [Beta]1 < 10, [Beta]1]


...it just runs and runs and runs and never gives an answer. Why ? and how can I fix it ?



The complete code



constants = b1 -> (-(Cosh[
0.68*[Beta]1]*(0.6553600000000004*Cos[0.15*[Beta]1]*
Cos[0.68*[Beta]1] -
0.6553600000000004*Cos[0.68*[Beta]1]*
Cosh[0.15*[Beta]1] +
1.2621440000000002*Sin[0.15*[Beta]1]*Sin[0.68*[Beta]1] +
0.7378559999999998*Sin[0.68*[Beta]1]*
Sinh[0.15*[Beta]1])) +
Cos[0.68*[Beta]1]*(-0.7378559999999998*Sin[0.15*[Beta]1] -
1.2621440000000002*Sinh[0.15*[Beta]1])*
Sinh[0.68*[Beta]1])/(Cosh[
0.68*[Beta]1]*(-0.6553600000000004*Cos[0.68*[Beta]1]*
Sin[0.15*[Beta]1] +
1.2621440000000002*Cos[0.15*[Beta]1]*Sin[0.68*[Beta]1] +
0.7378559999999998*Cosh[0.15*[Beta]1]*Sin[0.68*[Beta]1] -
0.6553600000000004*Cos[0.68*[Beta]1]*Sinh[0.15*[Beta]1]) +
Cos[0.68*[Beta]1]*(0.7378559999999998*Cos[0.15*[Beta]1] +
1.2621440000000002*Cosh[0.15*[Beta]1])*Sinh[0.68*[Beta]1]),
b2 -> (2.5*
Sec[0.68*[Beta]1]*(Cosh[
0.68*[Beta]1]*(-0.26214400000000015 +
0.26214400000000015*Cos[0.15*[Beta]1]*
Cosh[0.15*[Beta]1] -
Sin[0.15*[Beta]1]*Sinh[0.15*[Beta]1]) +
0.8*(Cosh[0.15*[Beta]1]*Sin[0.15*[Beta]1] -
Cos[0.15*[Beta]1]*Sinh[0.15*[Beta]1])*
Sinh[0.68*[Beta]1]))/((0.7378559999999998*
Cos[0.15*[Beta]1] +
1.2621440000000002*Cosh[0.15*[Beta]1])*Sinh[0.68*[Beta]1] +
Cosh[0.68*[Beta]1]*(-0.6553600000000004*Sin[0.15*[Beta]1] -
0.6553600000000004*Sinh[0.15*[Beta]1] +
1.2621440000000002*Cos[0.15*[Beta]1]*Tan[0.68*[Beta]1] +
0.7378559999999998*Cosh[0.15*[Beta]1]*Tan[0.68*[Beta]1])),
d2 -> (2.5*
Sech[0.68*[Beta]1]*(-0.26214400000000015*Cos[0.68*[Beta]1] +
0.8*Cosh[
0.15*[Beta]1]*(0.3276800000000002*Cos[0.15*[Beta]1]*
Cos[0.68*[Beta]1] +
Sin[0.15*[Beta]1]*
Sin[0.68*[Beta]1]) + (Cos[0.68*[Beta]1]*
Sin[0.15*[Beta]1] -
0.8*Cos[0.15*[Beta]1]*Sin[0.68*[Beta]1])*
Sinh[0.15*[Beta]1]))/(-0.6553600000000004*
Cos[0.68*[Beta]1]*Sin[0.15*[Beta]1] +
1.2621440000000002*Cos[0.15*[Beta]1]*Sin[0.68*[Beta]1] -
0.6553600000000004*Cos[0.68*[Beta]1]*Sinh[0.15*[Beta]1] +
0.7378559999999998*Cos[0.15*[Beta]1]*Cos[0.68*[Beta]1]*
Tanh[0.68*[Beta]1] +
Cosh[0.15*[Beta]1]*(0.7378559999999998*Sin[0.68*[Beta]1] +
1.2621440000000002*Cos[0.68*[Beta]1]*Tanh[0.68*[Beta]1]))

matrix = a1 (Sin[u [Beta]1] - Sinh[u [Beta]1]),
b1 (Cos[u [Beta]1] - Cosh[u [Beta]1]), -b2*
Cos[y*[Theta]*[Beta]1], -d2*
Cosh[y*[Theta]*[Beta]1], a1 (Cos[u [Beta]1] -
Cosh[u [Beta]1]), b1 (-Sin[u [Beta]1] - Sinh[u [Beta]1]),
b2*[Theta]*Sin[y*[Theta]*[Beta]1], -d2*[Theta]*
Sinh[y*[Theta]*[Beta]1], a1 (-Sin[u [Beta]1] -
Sinh[u [Beta]1]), b1 (-Cos[u [Beta]1] - Cosh[u [Beta]1]),
b2*[Alpha]^4*[Theta]^2*
Cos[y*[Theta]*[Beta]1], -d2*[Alpha]^4*[Theta]^2*
Cosh[y*[Theta]*[Beta]1], a1 (-Cos[u [Beta]1] -
Cosh[u [Beta]1]),
b1 (Sin[u [Beta]1] -
Sinh[u [Beta]1]), -b2*[Alpha]^4*[Theta]^3*
Sin[y*[Theta]*[Beta]1], -d2*[Alpha]^4*[Theta]^3*
Sinh[y*[Theta]*[Beta]1];

testingParam = [Theta] -> 0.8, [Alpha] -> 0.8, u -> 0.15,
y -> 1 - 0.15 ;

coeffMatrix = (matrix /. a1 -> 1) /. constants /. testingParam ;

func = Det[coeffMatrix];
NSolve[func == 0 && 0 < [Beta]1 < 10, [Beta]1]






equation-solving






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 3 hours ago









james

745418




745418











  • Since you can use Plot on your function, use the MeshFunctions option, like what was done here.
    – J. M. is somewhat okay.♦
    2 hours ago










  • @J.M.issomewhatokay. Thank you for your comment and suggestion. However, I am not such an advanced user. Would you mind to post an answer of how to use the MeshFunctions ? I did not quite understand it from the example following your link. Thanks ! :)
    – james
    1 hour ago
















  • Since you can use Plot on your function, use the MeshFunctions option, like what was done here.
    – J. M. is somewhat okay.♦
    2 hours ago










  • @J.M.issomewhatokay. Thank you for your comment and suggestion. However, I am not such an advanced user. Would you mind to post an answer of how to use the MeshFunctions ? I did not quite understand it from the example following your link. Thanks ! :)
    – james
    1 hour ago















Since you can use Plot on your function, use the MeshFunctions option, like what was done here.
– J. M. is somewhat okay.♦
2 hours ago




Since you can use Plot on your function, use the MeshFunctions option, like what was done here.
– J. M. is somewhat okay.♦
2 hours ago












@J.M.issomewhatokay. Thank you for your comment and suggestion. However, I am not such an advanced user. Would you mind to post an answer of how to use the MeshFunctions ? I did not quite understand it from the example following your link. Thanks ! :)
– james
1 hour ago




@J.M.issomewhatokay. Thank you for your comment and suggestion. However, I am not such an advanced user. Would you mind to post an answer of how to use the MeshFunctions ? I did not quite understand it from the example following your link. Thanks ! :)
– james
1 hour ago










2 Answers
2






active

oldest

votes

















up vote
1
down vote













From: About multi-root search in Mathematica for transcendental equations



f[[Beta]1_] = Det[coeffMatrix];
zeros = Reap[
NDSolve[y'[x] == D[f[x], x], WhenEvent[y[x] == 0, Sow[x, y[x]]],
y[1] == f[1], , x, 3, 0.01]][[-1, 1]]
Plot[f[x], x, 0, 3,
Epilog -> PointSize[Medium], Red, Point[zeros]]



2.61534, -5.0246*10^-18




enter image description here






share|improve this answer




















  • Thanks a lot. This seems to work. I still need to understand it though...
    – james
    1 hour ago

















up vote
1
down vote













FindRoot[func == 0, [Beta]1, 2.566]
[Beta]1 -> 2.61535





share|improve this answer




















  • Thanks ! Do you always need an initial guess ?
    – james
    14 mins ago










Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f183236%2fproblem-with-nsolve-speed%23new-answer', 'question_page');

);

Post as a guest






























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote













From: About multi-root search in Mathematica for transcendental equations



f[[Beta]1_] = Det[coeffMatrix];
zeros = Reap[
NDSolve[y'[x] == D[f[x], x], WhenEvent[y[x] == 0, Sow[x, y[x]]],
y[1] == f[1], , x, 3, 0.01]][[-1, 1]]
Plot[f[x], x, 0, 3,
Epilog -> PointSize[Medium], Red, Point[zeros]]



2.61534, -5.0246*10^-18




enter image description here






share|improve this answer




















  • Thanks a lot. This seems to work. I still need to understand it though...
    – james
    1 hour ago














up vote
1
down vote













From: About multi-root search in Mathematica for transcendental equations



f[[Beta]1_] = Det[coeffMatrix];
zeros = Reap[
NDSolve[y'[x] == D[f[x], x], WhenEvent[y[x] == 0, Sow[x, y[x]]],
y[1] == f[1], , x, 3, 0.01]][[-1, 1]]
Plot[f[x], x, 0, 3,
Epilog -> PointSize[Medium], Red, Point[zeros]]



2.61534, -5.0246*10^-18




enter image description here






share|improve this answer




















  • Thanks a lot. This seems to work. I still need to understand it though...
    – james
    1 hour ago












up vote
1
down vote










up vote
1
down vote









From: About multi-root search in Mathematica for transcendental equations



f[[Beta]1_] = Det[coeffMatrix];
zeros = Reap[
NDSolve[y'[x] == D[f[x], x], WhenEvent[y[x] == 0, Sow[x, y[x]]],
y[1] == f[1], , x, 3, 0.01]][[-1, 1]]
Plot[f[x], x, 0, 3,
Epilog -> PointSize[Medium], Red, Point[zeros]]



2.61534, -5.0246*10^-18




enter image description here






share|improve this answer












From: About multi-root search in Mathematica for transcendental equations



f[[Beta]1_] = Det[coeffMatrix];
zeros = Reap[
NDSolve[y'[x] == D[f[x], x], WhenEvent[y[x] == 0, Sow[x, y[x]]],
y[1] == f[1], , x, 3, 0.01]][[-1, 1]]
Plot[f[x], x, 0, 3,
Epilog -> PointSize[Medium], Red, Point[zeros]]



2.61534, -5.0246*10^-18




enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered 2 hours ago









henry

1,140423




1,140423











  • Thanks a lot. This seems to work. I still need to understand it though...
    – james
    1 hour ago
















  • Thanks a lot. This seems to work. I still need to understand it though...
    – james
    1 hour ago















Thanks a lot. This seems to work. I still need to understand it though...
– james
1 hour ago




Thanks a lot. This seems to work. I still need to understand it though...
– james
1 hour ago










up vote
1
down vote













FindRoot[func == 0, [Beta]1, 2.566]
[Beta]1 -> 2.61535





share|improve this answer




















  • Thanks ! Do you always need an initial guess ?
    – james
    14 mins ago














up vote
1
down vote













FindRoot[func == 0, [Beta]1, 2.566]
[Beta]1 -> 2.61535





share|improve this answer




















  • Thanks ! Do you always need an initial guess ?
    – james
    14 mins ago












up vote
1
down vote










up vote
1
down vote









FindRoot[func == 0, [Beta]1, 2.566]
[Beta]1 -> 2.61535





share|improve this answer












FindRoot[func == 0, [Beta]1, 2.566]
[Beta]1 -> 2.61535






share|improve this answer












share|improve this answer



share|improve this answer










answered 35 mins ago









Alex Trounev

2,785312




2,785312











  • Thanks ! Do you always need an initial guess ?
    – james
    14 mins ago
















  • Thanks ! Do you always need an initial guess ?
    – james
    14 mins ago















Thanks ! Do you always need an initial guess ?
– james
14 mins ago




Thanks ! Do you always need an initial guess ?
– james
14 mins ago

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f183236%2fproblem-with-nsolve-speed%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

What does second last employer means? [closed]

List of Gilmore Girls characters

One-line joke