RE: Getting rid of the arrow in FindRoot output (newbie question)
- To: mathgroup at smc.vnet.net
- Subject: [mg38837] RE: [mg38812] Getting rid of the arrow in FindRoot output (newbie question)
- From: "David Park" <djmp at earthlink.net>
- Date: Wed, 15 Jan 2003 02:20:58 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
David, For all people who are new to Mathematica and intend to make some regular use of it, it strongly advise working through all relevant sections of Part I in The Mathematica Book. Actually typing in and seeing that each instruction works properly is a good way to learn. In the long run it will save a lot of time. Mathematica generally returns solutions to equations as replacement rules or a set of replacement rules. These are convenient to use. I would do your problem this way. rootsol = FindRoot[x + Log[x] == 5, {x, 1}] {x -> 3.69344} Then it can be substituted into any expression in the following manner. Sin[x] + x^2 % /. rootsol x^2 + Sin[x] 13.1172 David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: David Jones [mailto:djones at REMOVE_THIS.borve.demon.co.uk] To: mathgroup at smc.vnet.net Hi, this is a newbie question, I am just starting to learn how to use Mathematica. How do I get rid of the arrow ("->") from the output when using FindRoot? E.g. p := FindRoot[x + Log[x] == 5, {x, 1}] Print[p] gives the output {x -> 3.69344} and then if I change Print[p] to Print[p + 1] then the output is {1 + (x -> 3.69344)} I need to have the output as a number so as to be able to put it into other functions and plot it. Cheers, David -- David Jones