+ Reply to Thread
Results 1 to 6 of 6

Excel 2007 : solving for x - f(x) = 0 in excel 2007

Hybrid View

  1. #1
    Registered User
    Join Date
    10-08-2011
    Location
    NY, US
    MS-Off Ver
    Excel 2007
    Posts
    4

    solving for x - f(x) = 0 in excel 2007

    Greetings,

    this is in regards to excel 2007 - currently, I am trying to find a way to solve for x in the equation x - f(x) = 0, or x = f(x) where f(x) is a particular function of x. I have tried to use the solver in excel 2007 to find a solution, but was given an error on the value or the the constraint. Do you know of any solution to solve for something like this (the solution does not have to use solver) ? Thanks.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: solving for x - f(x) = 0 in excel 2007

    Welcome to the board.

    What's the function, what have you tried?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    10-08-2011
    Location
    NY, US
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: solving for x - f(x) = 0 in excel 2007

    I've set a cell ("A") to the formula: x - f(x) and another cell ("B") to the value of x, and in solver the target value of zero was assigned to cell "A" changing the value of cell "B". Solver can't seem to find a solution, and gave me an error message. On a side note, does solver only return integers ? Or does it return irrational numbers as well (1.33333..., 1.55777, etc.) ? Thanks.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: solving for x - f(x) = 0 in excel 2007

    Again, what is f(x)?

    Or does it return irrational numbers as well
    You computer's floating point format doesn't accommodate irrational numbers, but yes, Solver can certainly return numbers with decimals.

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,515

    Re: solving for x - f(x) = 0 in excel 2007

    You computer's floating point format doesn't accommodate irrational numbers,
    Are you thinking of something else? Unless I'm misunderstanding what is meant by "irrational," Pi, sqrt(2), e, and so on are all irrational numbers, and floating point (and Excel/Solver) represents those numbers just fine (to 15 digits anyway).

    Usually when I can't find the root of an equation using Solver, it is because of a couple of reasons:

    1) Probably the most common reason is because of a programming error in my spreadsheet. Double check all formulas to make sure they are entered correctly.

    2) Probably the 2nd most common reason a poor choice in my "initial guess." Solver by default uses the Newton-Raphson method, which requires that the user supply some kind of "initial guess" for the algorithm to start with. A poor choice in the initial guess can cause the algorithm to diverge, or converge on the wrong root, or get "caught" looping around a point of symmetry or local minimum/maximum.

    3) Occasionally I will have a case where I've set the spreadsheet up "correctly," but, because of some less than optimum condition in the specific problem, Solver has a hard time calculating the numerical derivatives and getting to a solution. In these cases, I need to adjust the logic of the spreadsheet or the problem (such as rearranging the equation to something the Newton Raphson algorithm can work better with).
    Where you are getting an error value as Solver runs, you might look into this one specifically. I get this a lot when, for example, f(x) includes logarithms, and the algorithm at some point decides to try a negative number for x. If this is the case, a better "initial guess" or a better arrangement of the equation might allow it to converge on a solution.

    4) Don't neglect the possibility that there isn't a solution to be found.

    A lot of times with a problem like this, I like to plot the equation and visually search for the roots. This lets me see where the roots are, and see what situations are present that are difficult for the NR method to deal with. This allows me to make good guesses for x(initial) and set up the spreadsheet and constraints to allow Solver the best chance of finding a solution.

    I might suggest, if you are unfamiliar with the Newton Raphson method and its strengths and weaknesses, you might research it some so you'll be better equipped at solving these kinds of problems.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: solving for x - f(x) = 0 in excel 2007

    Poorly stated on my part. Your computer accommodates irrational numbers just fine, but it stores rational approximations; pi, for example, is stored as 7074237752028440/2^51
    Last edited by shg; 10-10-2011 at 11:50 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1