MATLAB: Finding the root of a steep function

fzeroMATLABsolveSymbolic Math Toolbox

How do I consistently find the root of the following function? I cannot obtain it consistently using symbolic solver or fzero.
a=0.3414
syms k
assume(k,'real')
assumeAlso(k>1)
solve(-5681.8+k*(1-((1.66-1)*(a)*(k-1))/(2*1.4*(2*1.4+(1.4+1)*(k-1)))^.5)^((-2*1.66)/(1.66-1))==0);
fzero(@(k) -5681.8+k*(1-((1.66-1)*(a)*(k-1))/(2*1.4*(2*1.4+(1.4+1)*(k-1)))^.5)^((-2*1.66)/(1.66-1)),100);
The symbolic solver simply runs forever without reaching an answer.
Fzero works if the initial guess is really close to the correct root, otherwise it reaches a complex value and aborts. The "a" input can change by several magnitudes, which means k can change a lot. An intial intervial is tricky because it can either not contain the root, or the upper bound could lead to an infinite function value.
Wolfram could find the root without issue. The root is 51, nothing crazy.
Any suggestions to consistently find the root given any value of "a"?

Best Answer

vpasolve instead of solve. solve is for finding indefinitely precise solutions (formulas)