Results 1 to 12 of 12

Math Help - Solving Non-Linear equations

  1. #1
    Newbie
    Joined
    Jul 2010
    Posts
    6

    Solving Non-Linear equations

    Hi all,

    I am trying to solve a non-linear equation with the following format:

    f(x)=x/ (c+2^(x));

    where c is a constant, and x is my variable.
    Does anyone have any suggestion on how i can solve such equations?!
    I have already tried using the "fsolve" function in Matlab, which works, but is not very suitable for this type of equations.

    Any help is much appreciated.

    Amir
    Follow Math Help Forum on Facebook and Google+

  2. #2
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    I'm confused. Is this a differential equation? Or are you setting the RHS equal to a number and solving for x?
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Jul 2010
    Posts
    6
    Hi Adrian,

    Thanks for the reply.
    yes,,, actually your right

    I set the RHS equal to a fix number and solve for x.

    any suggestions ?
    Follow Math Help Forum on Facebook and Google+

  4. #4
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    Ok, so you're solving

    \displaystyle{\frac{x}{c+2^{x}}=y} for x.

    Are there any restrictions on c?

    You're dealing with a transcendental equation there. No exact method comes to mind. If c > 0, then the LHS is differentiable for all x. You could use Newton-Raphson on the function

    f(x)=\frac{x}{c+2^{x}}-y.

    Are you trying to find the solution for a particular c and y? Or are you more ambitious?
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Jul 2010
    Posts
    6
    Hi Adrian,

    That's correct, i am trying to solve x / (c+ 2^x) =y for x, where c>0 and y>0.
    I am trying to solve for a particular value of c and y. In fact, the actual equation that i have is slightly more complex, but
    i tried to keep it as simple as possible, to avoid any misunderstanding.
    the exact equation is:

    y=x / {c1+[(2^(x/c2)-1)/c3]}

    where c1,c2,c3,y >0
    Follow Math Help Forum on Facebook and Google+

  6. #6
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    I would still use Newton-Raphson. However, I would investigate the existence of solutions. For example, it doesn't look as though the equation with c1 = c2 = c3 = y = 1 has a real root. One avenue of thought here would be to find the maximum of your function, and find out when it's greater than zero. You might be able to use that to find conditions on your constants in order for a solution to exist. It makes no sense trying to find solutions that don't exist!
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Newbie
    Joined
    Jul 2010
    Posts
    6
    I have already verified the existence of solutions for this problem using the "fsolve" function in Matlab. However, i am trying to find alternative ways of tackling this problem, either using just maths or numerical methods.

    I am not sure how familiar you are with the "fsolve" function in Matlab, but it requires a starting point for x. Due to the nature of the equation, different starting points give different results, which is why i am trying to find an alternative way of solving this function.

    do you have any suggestions ?

    many thanks
    Follow Math Help Forum on Facebook and Google+

  8. #8
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    . Due to the nature of the equation, different starting points give different results, which is why i am trying to find an alternative way of solving this function.
    Well, from the graph, I think I would say that depending on the constants you have, more than one solution exists. It is in the nature of many numerical algorithms (e.g., Newton-Raphson) to converge to the closest solution. I don't think your problem is fsolve. I think your problem is knowing which solution you want. Or, if you want all of them, finding a way to pick your initial conditions so that you can capture all the solutions in multiple runs of fsolve. Do you follow me?
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Newbie
    Joined
    Jul 2010
    Posts
    6
    That is absolutely correct, my problem has 2 solutions and i need both of them. One of the issues is the starting point, which i can find by trial and error, or is there a more sophisticated method ?

    In fact, the function i am working on is the summation of two functions, which are both very similar, y=A+B ( where i have only given A). SO the shape i get by plotting it is a circular shape, which is why for some values of x, i have 2 solutions.

    do you think Newthon-Raphson is still the way forward?
    Follow Math Help Forum on Facebook and Google+

  10. #10
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    If you're sure that your function always has two solutions (and depending on the values of the constants, I can believe that quite easily), then here's a sophisticated way to find both solutions. There's a local maximum between the two solutions. (I'm going off the graph here of one of the representative curves). So take the derivative of your function, and set it equal to zero. Finding that root might itself require Newton-Raphson; however, I think that in general you'll find two solutions: one at +infinity, which is no use to you, and one small positive solution. Next, for the original function, pick one starting point that is less than the local max by, say, 1, and one starting point that is greater than the local max by 1. I think that would be a better method of picking starting points than random guessing. If you're to the right of the local max, then Newton-Raphson should converge to the right root. If your starting point is to the left of the local max, then Newton-Raphson should converge to the left root. Make sense?
    Follow Math Help Forum on Facebook and Google+

  11. #11
    Newbie
    Joined
    Jul 2010
    Posts
    6
    Thanks Adrian,

    I will give this a try, and hopefully get some result !

    Thanks for your support.
    Follow Math Help Forum on Facebook and Google+

  12. #12
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    You're welcome. Good luck!
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 6
    Last Post: November 30th 2011, 02:41 AM
  2. Solving linear equations.
    Posted in the Algebra Forum
    Replies: 1
    Last Post: March 27th 2011, 08:00 AM
  3. Solving Linear Equations
    Posted in the Advanced Applied Math Forum
    Replies: 1
    Last Post: September 22nd 2009, 05:38 AM
  4. Solving linear equations.
    Posted in the Algebra Forum
    Replies: 8
    Last Post: April 13th 2008, 07:04 AM
  5. Solving linear equations
    Posted in the Advanced Algebra Forum
    Replies: 1
    Last Post: June 13th 2007, 05:43 PM

Search Tags


/mathhelpforum @mathhelpforum