Re: Using FindRoot for Numerical Solutions

• To: mathgroup at smc.vnet.net
• Subject: [mg130254] Re: Using FindRoot for Numerical Solutions
• From: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>
• Date: Fri, 29 Mar 2013 05:56:51 -0400 (EDT)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• Delivered-to: l-mathgroup@wolfram.com
• Delivered-to: mathgroup-newout@smc.vnet.net
• Delivered-to: mathgroup-newsend@smc.vnet.net

```Dear Mathgroup,

I am new to mathematica and I am trying to understand a bit of code written
by someone else. In the code shown below this person uses FindRoot to find
numerical solutions to the the equation. However after I run the code if I
print xplot I get {x->0.386332}. This is hard to see in gmail but that is
an arrow not a greater than equal to sign. I was hoping someone might be
able to help me understand what is going on here. Is this x goes to
0.386332 like a limit?

Do[xplot = FindRoot[Ucr[x] - (offset + eigenvaluesort[6][[i]]) == 0, =
{x, 0,
dp/2}];
xx[i] = x /. xplot, {i, 1, n - 1}];

offset, eigenvaluesort dp and Ucr[x] are set equal to values elsewhere in
the code.

Any help is greatly appreciated,
Ben

Hi, Ben,

No it is not a limit. This is the way Mathematica delivers the solution, co=
mmon for such operators as Solve, NSolve, FindRoot, DSolve and NDSolve. You=
may just understand the value 0.386332 in {x->0.386332} as the result of t=
he solution of the equation Ucr[x] - (offset + eigenvaluesort[6][[i]]) ==
= 0 (or at least, one of its solutions). In addition, the arrow here indi=
cates that it is the rule of substitution, and notation x/.{x->0.386332} me=
ans that in this place of your code the value of 0.386332 will be substitut=
ed instead of x. In the most general case for any function f[x] one finds f=
[x]/.x->0.386332 is equal to f[0.386332].

Your questions reveal, however, that you skipped looking into the Mathemati=
ca Help. I strongly encourage you to go to the Menu/Help/Rule, Menu/Help/Fi=
ndRoot and so on, to read explanations and especially to have a detailed lo=
ok at the examples there. Most of your questions will disappear by themselv=
es. It will bring you to results much faster than any other way.

Have fun, Alexei

Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone :  +352-2454-2566
Office fax:       +352-2454-3566
mobile phone:  +49 151 52 40 66 44

e-mail: alexei.boulbitch at iee.lu

```

• Prev by Date: Re: Using FindRoot for Numerical Solutions
• Next by Date: Re: cubic equation solver
• Previous by thread: Re: Using FindRoot for Numerical Solutions
• Next by thread: Moment's of student's t distribution