I want to solve the following problem: Given a complex matrix $m=\textbf{m}(J, ω)$, with $J, ω \in \mathbb R$, find $λ$ and $ω$ such that
$$\det[\textbf{m} (J, ω)] = 0$$
I tried to solve it with FindRoot
. I've found a solution with specific initial values $(J_c,\omega_c)$, but it works only with MachinePrecision->13
and not grater MachinePrecision
. Moreover, when I test the solution, it gives me back a zero with a low accuracy, about $10^-3$.
My question is the following: is it possible that FindRoot
finds points which are not actual zeros of the function but point for which the function is very small?
How can I distinguish a zero for a "almost zero" numerically?
d = Rationalize[5/10^6]; \[Tau] = Rationalize[0.1]; L = Rationalize[15/10^3]; h = Rationalize[50/10^6]; \[Xi] = Rationalize[0.001]; \[Rho] = Rationalize[1400];
\[CapitalGamma] = Rationalize[0.001]; c = Rationalize[0.05]; Ee = Rationalize[10^8]; w = Rationalize[10^(-3)];
A = Rationalize[w*h]; \[CapitalIota] = Rationalize[w*(h^3/12)]; B = Rationalize[Ee*\[CapitalIota]]; \[Alpha] = Rationalize[(d/2)*(2*d - h - Exp[-h/d]*(2*d + h))];
\[Lambda] = Rationalize[c*\[CapitalGamma]*\[Alpha]*(12/h^3)];
m2[\[Beta]j_, \[CapitalLambda]_, \[Sigma]_] = ( \[Beta]j^3 - \
\[CapitalLambda] \[Beta]j^2)
m3[\[Beta]j_, \[CapitalLambda]_, \[Sigma]_] = ( \[Beta]j^2 - \
\[CapitalLambda] \[Beta]j) Exp[\[Beta]j L];
m4[\[Beta]j_, \[CapitalLambda]_, \[Sigma]_] = ( \[Beta]j - \
\[CapitalLambda]) Exp[\[Beta]j L];
(*To find \[Beta]j (j=1,2,3,4) we solve a polynomial equation.*)
eigen[\[CapitalLambda]_, \[Sigma]_] =
FullSimplify[
B ( x^4 - \[CapitalLambda] x^3) + \[Sigma] (\[Xi] + \[Rho] A \
\[Sigma])];
root = Simplify[Solve[eigen[\[CapitalLambda], \[Sigma]] == 0, x]];
xx[\[CapitalLambda]_, \[Sigma]_] = x /. root;
\[CapitalLambda]lin[J_, \[Sigma]_] =
FullSimplify[\[Lambda] J /(1/\[Tau] + \[Sigma])]
m[\[CapitalLambda]_, \[Sigma]_] = {{m2[
xx[\[CapitalLambda], \[Sigma]][[1]], \[CapitalLambda], \[Sigma]],
m2[xx[\[CapitalLambda], \[Sigma]][[
2]], \[CapitalLambda], \[Sigma]],
m2[xx[\[CapitalLambda], \[Sigma]][[
3]], \[CapitalLambda], \[Sigma]],
m2[xx[\[CapitalLambda], \[Sigma]][[
4]], \[CapitalLambda], \[Sigma]]}, {1, 1, 1,
1}, {m3[xx[\[CapitalLambda], \[Sigma]][[
1]], \[CapitalLambda], \[Sigma]],
m3[xx[\[CapitalLambda], \[Sigma]][[
2]], \[CapitalLambda], \[Sigma]],
m3[xx[\[CapitalLambda], \[Sigma]][[
3]], \[CapitalLambda], \[Sigma]],
m3[xx[\[CapitalLambda], \[Sigma]][[
4]], \[CapitalLambda], \[Sigma]]}, {m4[
xx[\[CapitalLambda], \[Sigma]][[1]], \[CapitalLambda], \[Sigma]],
m4[xx[\[CapitalLambda], \[Sigma]][[
2]], \[CapitalLambda], \[Sigma]],
m4[xx[\[CapitalLambda], \[Sigma]][[
3]], \[CapitalLambda], \[Sigma]],
m4[xx[\[CapitalLambda], \[Sigma]][[
4]], \[CapitalLambda], \[Sigma]]}};
detexp[J_, \[Sigma]_] =
Det[m[\[CapitalLambda]lin[J, \[Sigma]], \[Sigma]]]/10^12;
det[J_, \[Omega]_] = detexp[J, I \[Omega]];
Jc = 4.5*10^3 // Rationalize;
\[Omega]c = 15;
firstmode = FindRoot[{Re[det[J, \[Omega]]] == 0, Im[det[J, \[Omega]]] == 0}, {J,
Jc}, {\[Omega], \[Omega]c}, WorkingPrecision -> 13]
(*out {J -> 4397.165861009, \[Omega] -> 14.81874398305}*)
{J1, \[Omega]1} = {J, \[Omega]} /. firstmode;
det[J1, \[Omega]1]
(*out 0.*10^-3 + 0.*10^-3 I*)
PS. I asked a similar question How can I improve the accuracy of FindRoot for a complex equation? and tried to implement the old suggestions, but the question here is slightly different.
Thank you!
\[Omega]_c
in variable names in MMA. Second:Rationalize
does noting to values that are already rational and only makes people question that and other things in your code. Third{Re[det[J, \[Omega]]]==0,Im[det[J, \[Omega]]]==0}
seems likedet[J,\[Omega]]]==0
Fourth: If you want an exact zero then I'd try eliminating all decimal points and possibly simplifying the problem a little and finally askReduce
to find the exact solutions and see what happens. $\endgroup$