+ Reply to Thread
Results 1 to 12 of 12

Solve Many equations

  1. #1
    Registered User
    Join Date
    05-14-2014
    MS-Off Ver
    Excel 2013
    Posts
    13

    Solve Many equations

    Hi everybody
    How can I do this in excel??
    y is my funtion and x is variable , I have y values in A2:A101 and x is Unknown
    my formula is a bit complex but just Suppose that formula is y=sin(x) for simplicity

    How can I solve all 100 equations easily in excel?

    Example: Problem.xlsx

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Solve Many equations

    In B2 type =Sin(A2) and then copy it down
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Solve Many equations

    Assuming y=sin(x) is truly representative of the actual formula, I would first suggest that the problem is a math problem rather than an Excel problem. The first thing I would do is to solve the problem algebraically/trigonometrically -- then program the result into Excel:
    y=sin(x) -> x=arcsin(y)
    Look up any needed Excel functions (see http://office.microsoft.com/en-us/ex...#_Toc309306715)
    Formula for x become =ASIN(A2) and copy/fill down.

    Since there are plenty of functions which do not have an easy inverse (such as 3rd order and larger polynomials), some cases will require numerical methods (like the Newton-Raphson method) to solve. If you are not familiar with these algorithms, it will probably be easiest (even though a bit tedious) to use the built in Goal Seek/Solver utility to find the result.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Registered User
    Join Date
    05-14-2014
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: Solve Many equations

    Quote Originally Posted by alansidman View Post
    In B2 type =Sin(A2) and then copy it down
    No , you dont understand my quetion , I told x is unknown

  5. #5
    Registered User
    Join Date
    05-14-2014
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: Solve Many equations

    Quote Originally Posted by MrShorty View Post
    Assuming y=sin(x) is truly representative of the actual formula, I would first suggest that the problem is a math problem rather than an Excel problem. The first thing I would do is to solve the problem algebraically/trigonometrically -- then program the result into Excel:
    y=sin(x) -> x=arcsin(y)
    Look up any needed Excel functions (see http://office.microsoft.com/en-us/ex...#_Toc309306715)
    Formula for x become =ASIN(A2) and copy/fill down.

    Since there are plenty of functions which do not have an easy inverse (such as 3rd order and larger polynomials), some cases will require numerical methods (like the Newton-Raphson method) to solve. If you are not familiar with these algorithms, it will probably be easiest (even though a bit tedious) to use the built in Goal Seek/Solver utility to find the result.
    My formula is not y=sin(x) I just told this equation for simplicity , my formula is
    y = 1/2pi*(1-sin(x)/x)^(1/3)*tan(x*cos(x))

    So when y=1 what is x? when y=2 what is x?
    So when y is A:A what is B:B ??

    I now Goal Seeker can do this just for single cell , I want do this for many cells
    I know numerical methods can solve problem but I think I dont need to define these methods and excel can do this

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Solve Many equations

    I know numerical methods can solve problem but I think I dont need to define these methods and excel can do this
    Solver/Goal Seek is how Excel implements (at least pre-programmed for us) numerical method.

    One possible approach might be to treat it like a "curve fitting" or "regression" type problem:

    1) Where you have "unkown", enter an initial guess for each x.
    2) Add a column where you calculate y using your equation for each of those X's
    3) Add a cell (or group of cells, depending on your style) that will calculate the "error" in the "regression" (=sumxmy2() is a good function for this http://office.microsoft.com/en-us/ex...in=HA102752955).
    4) Call Solver and tell it to set target cell with your "error" term to a minimum by changing your X values.
    5) Evaluate the result to see if Solver converged on a suitable solution.

  7. #7
    Registered User
    Join Date
    05-14-2014
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: Solve Many equations

    Quote Originally Posted by MrShorty View Post
    Solver/Goal Seek is how Excel implements (at least pre-programmed for us) numerical method.

    One possible approach might be to treat it like a "curve fitting" or "regression" type problem:

    1) Where you have "unkown", enter an initial guess for each x.
    2) Add a column where you calculate y using your equation for each of those X's
    3) Add a cell (or group of cells, depending on your style) that will calculate the "error" in the "regression" (=sumxmy2() is a good function for this http://office.microsoft.com/en-us/ex...in=HA102752955).
    4) Call Solver and tell it to set target cell with your "error" term to a minimum by changing your X values.
    5) Evaluate the result to see if Solver converged on a suitable solution.
    Yes , I know but this approach is good for few unknown if I want to do this 5 step for all 100 cell's this approach is Boring
    I need a way to extend this approach , but I dont know how ? because I cannot drag&drop to extend or use Array in Goal Seek

  8. #8
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Solve Many equations

    it is a long time since I dealt with equations but if it were me, i'd treat it like any equation i'd have to solve for X.
    so if, for example I have a series of values in col A that represent y, and I know that the equation for this is y=x-2 and col B is where I want my values calculated for x, then I would solve my first equation for x, so in this case it would be that for every value i have in col A, col B should be A2+2. Then I'd copy down. So if you are looking for the variables in col B to solve for y in col A, then solve it on paper if you have to then write that formula in B2 then copy down. (and i'm sure given time and the desire I suppose I could try to solve your equation for x but not really feeling that energetic .)
    Last edited by Sam Capricci; 05-25-2014 at 01:54 PM.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  9. #9
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Solve Many equations

    Quote Originally Posted by p30tec View Post
    Yes , I know but this approach is good for few unknown if I want to do this 5 step for all 100 cell's this approach is Boring
    I need a way to extend this approach , but I dont know how ? because I cannot drag&drop to extend or use Array in Goal Seek
    I am sorry if you find this approach boring. What kind of approach would you like that would be less boring? According to Frontline and Microsoft, Solver should be able to handle up to 200 "by changing" cells. Properly structured, it seems possible to structure a single Solver model to solve, in one step, for all 100 unkowns.

    I have frequently written my own NR (or other root finding algorithm) directly into the spreadsheet. This can be fun, though it would be significanlty more work -- especially if this will be your first attempt at writing a spreadsheet with intentional circular references and iteration enabled.

    Sometimes, I find it easier to write these kind of iterative algorithms into a programming language like VBA. Code the root finding algorithm into a user-defined function, then call the function from the spreadsheet. Would you be interested in this kind of approach?

    While I personally generally find it easier to code my own NR type algorithm, some users here prefer to write a loop in VBA that will call Solver for each row and solve each row separately.

    There are several different approaches we can use for a problem like this, let us know how you want to approach it, and we should be able to help you with programming that approach into Excel.

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

    Re: Solve Many equations

    The easiest way would probably be to write a loop for GoalSeek.

    Please Login or Register  to view this content.
    B
    C
    D
    E
    F
    2
    y
    x
    target
    3
    0.100
    1.511
    0.1
    B3: = PI()/2 * (1 - SIN(x) / x) ^ (1/3) * TAN(x * COS(x))
    4
    0.200
    1.442
    0.2
    C3 (from GoalSeek): Input
    5
    0.300
    1.361
    0.3
    D3: Input
    6
    0.400
    1.258
    0.4
    7
    0.501
    1.069
    0.5
    8
    0.600
    -1.824
    0.6
    9
    0.700
    -1.854
    0.7
    10
    0.800
    -1.880
    0.8
    11
    0.900
    -1.905
    0.9
    12
    1.000
    -1.927
    1.0
    Last edited by shg; 05-25-2014 at 06:17 PM.
    Entia non sunt multiplicanda sine necessitate

  11. #11
    Registered User
    Join Date
    05-14-2014
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: Solve Many equations

    Ok ,Problem Solved , thanks excel forum's members

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

    Re: Solve Many equations

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Using excel to solve a value in 2 equations
    By jackleesteere in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2014, 11:03 PM
  2. [SOLVED] Using 2 equations to solve a value
    By jackleesteere in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-05-2014, 10:55 PM
  3. Solve for variables using multiple equations
    By yashgupta25 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-08-2012, 06:17 AM
  4. Replies: 2
    Last Post: 10-10-2011, 09:42 AM
  5. how do I use the solver to solve polynomial equations?
    By Cameron PE in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-20-2006, 05:25 PM

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