Message Boards Message Boards

FindRoot error: function value is not a list of numbers

I would like to use Find Root on the following expression. Any help would be appreciated. Differential Equation

POSTED BY: Alan White
14 Replies

All I see are images and I will not attempt to reenter them by hand. As written, it won't have a solution. Even after the definition gets fixed (in a way that makes this have an actual answer),it looks like the problem will still have really bad scaling.

POSTED BY: Daniel Lichtblau

Thank you, sir for your kind attention to my issues. I tried other alternatives, like: AccuracyGoal-> Infinity and WorkingPrecision->MachinePrecision. Nothing seems to work. If I start things off with elctrn[eV_]:= I do indeed get a numerical answer. {eV -> 4.476 x 10^-6} free of error messages. Unfortunately, the correct answer (arrived at through trial and error) is 399.8 electron volts. Am I using the wrong version of Scientific Notation for my numbers? The equation in question is a popular rewrite of De Broglie's expression for particle wavelength in terms of electron volts. Not much I can do about the magnitude of the terms. I apologize to you for all the trouble I'm causing to the Mathematica community.

POSTED BY: Alan White

What steps did you use to arrive at 398.8?

POSTED BY: Daniel Lichtblau

Trial and error. Please note. I started in with Mathematica in 2002. Never had a problem I couldn't solve by reading your tutorials. Soon as I upgraded to Windows 11 Pro in November of 2022 things went south. I suspect very few of your clients are on Windows 11 Pro. Thus, you never get complaints. Except from me.

POSTED BY: Alan White

"Trial and error" is not "showing steps". Also I doubt any issue with this example involves Windows 11 Pro. This looks to be strictly a kernel evaluation, with the user interface particulars not implicated.

POSTED BY: Daniel Lichtblau

First. I am relieved to learn you are not finding any conflict between Mathematica 13 and Windows 11 Pro. Second. A great many years ago a Nobel Laureate, Arthur Holly Compton made a careful study of the relationship between the dominant wavelength in an X Ray range energy field and the production of 'Recoil Electrons' at a given wavelength. My goal, to explain his findings in terms of the De Broglie wave / particle equations in units of electron volts. Among other wavelengths Compton reported 0.614 Angstroms (6.14 x 10 ^-9 centimeters) as especially productive of 'Recoil Electrons'. I wrote the equation (above) to search for the amount of energy in units of electron volts needed to produce non-relativistic waves at a wavelength of 0.614 angstroms. Before I tried 'FindRoot' I entered different values into the electron volt term (eV) in the equation above at the top of the page. A few minutes of labor and I arrived at 399.8 electron volts as able to produce X ray waves at 0.614 angstroms. Then I tried FindRoot. Your expression returns an unlikely value of 4.7 x 10^-6. So, next, I posted this plea for help.

POSTED BY: Alan White
elctrn[eV_] := 
  6.626*10^-34/Sqrt[2.0*9.11*10^-31*eV*1.6*10^-19]*100.0;
productiveValue = 6.14 10^-9;
Solve[elctrn[ev] == productiveValue]
FindRoot[elctrn[ev] == productiveValue, {ev, 6.14 10^-9}]
POSTED BY: Gianluca Gorni

To summarize, the equation you posted had elctrn[eV]==0 whereas, as Gianluca Gorni shows, you most likely intended it to be elctrn[eV]==6.14 10^-9. Which gives a solution very close to the one you had obtained by plugging in possible values.

POSTED BY: Daniel Lichtblau

Professor Daniel Lichtblau, Wolfram Research Please be patient. I am going to explore the solution offered up by Professor Gianluca Gorni. I will get back to both of you at some time later in the week. Thanks again.

POSTED BY: Alan White

Maybe You type a wrong expression to calculate?

enter image description here

It seems the only solution is x to infinity.

POSTED BY: Bowen Ping

Thank you very much for your input. I found, by trial and error, an electron Volt level of 399.8 electron volts returns the correct answer: 6.14 x 10^-9.

POSTED BY: Alan White

Your expression is always positive.

POSTED BY: Gianluca Gorni
Posted 7 months ago
elctrn[eV_]:=6.626*10^-34/Sqrt[2.0*9.11*10^-31*eV*1.6*10^-19]*100.0;
FindRoot[elctrn[eV],{eV,6.14*10^-9},AccuracyGoal->4,PrecisionGoal->4]

instantly returns

{eV->4.47606*^-6}
POSTED BY: Bill Nelson

Thanks for your help and enthusiasm. Unfortunately, the correct answer is: 398.8 electron volts (I worked the answer out by trial and error). Then I thought to try 'FindRoot'.

POSTED BY: Alan White
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract