Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #13953 > unrolled thread

Re: Using FindRoot for Numerical Solutions

Started byBob Hanlon <hanlonr357@gmail.com>
First post2013-03-29 09:56 +0000
Last post2013-03-29 09:56 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Using FindRoot for Numerical Solutions Bob Hanlon <hanlonr357@gmail.com> - 2013-03-29 09:56 +0000

#13953 — Re: Using FindRoot for Numerical Solutions

FromBob Hanlon <hanlonr357@gmail.com>
Date2013-03-29 09:56 +0000
SubjectRe: Using FindRoot for Numerical Solutions
Message-ID<kj3ofi$26o$1@smc.vnet.net>
>From the documentation for FindRoot (
http://reference.wolfram.com/mathematica/ref/FindRoot.html ):

"FindRoot returns a list of replacements for x, y, ... , in the same
form as obtained from Solve."

eqns = {Exp[x - 2] == y, y^2 == x};

sol = FindRoot[eqns, {{x, 1}, {y, 1}}]

{x -> 0.019026, y -> 0.137935}

The arrow-like symbol is \[Rule]

Replacement rules (e.g., Rule[x, value] or x -> value) are used with
Replace, ReplaceAll ( /. ) or ReplaceRepeated ( //. ). For example, to
obtain the numeric values:

{x, y} /. sol

{0.019026, 0.137935}

Or to verify the solution

And @@ (eqns /. sol)

True


Bob Hanlon


On Thu, Mar 28, 2013 at 11:56 AM, Ben Blomberg
<bblomberg@mail.bradley.edu> wrote:
>
> 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
>
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web