2
$\begingroup$

I have the following equation:

eq 1:

$f=100 \left(\left(\frac{z^{c/252}}{y^{b/252}}\right)^{\frac{252}{c-b}}-1\right)-100 \left(\left(\frac{y^{b/252}}{x^{a/252}}\right)^{\frac{252}{b-a}}-1\right)$

Given [a, b, c, x, y, z], solving for f is trivial, e.g.:

eq 2:

$100 \left(\left(\frac{1.1030^{1188/252}}{1.1015^{937/252}}\right)^{\frac{252}{1188-937}}-1\right)-100 \left(\left(\frac{1.1015^{937/252}}{1.0979^{687/252}}\right)^{\frac{252}{937-687}}-1\right) = -0.283604$

The problem is solving for y given [a, b, c, x, z, f].

I tried WolframAlpha and inputing the values does give me a numerical solution for y so I know it's possible. The following for example returns y $\approx$ 1.10150000054474...

eq 3:

$100 \left(\left(\frac{1.1030^{1188/252}}{y^{937/252}}\right)^{\frac{252}{1188-937}}-1\right)-100 \left(\left(\frac{y^{937/252}}{1.0979^{687/252}}\right)^{\frac{252}{937-687}}-1\right) = -0.283604$

I've read about Newton–Raphson but I'm not sure how to implement it since I can't isolate y and neither can WolframAlpha aparently. Asking it to solve for y results in a timeout.

Any ideas on an alternative method or maybe some way to isolate the y variable on eq 1?

UPDATE Limitless' comments below seem to confirm that there is no closed-form way to solve for y, so the focus is on finding an appropriate numerical method to achieve that.

UPDATE 2:

a,b,c are non-zero positive integers

x,z may be positive or negative, but not zero. Though I will accept solutions that assume they are positive only.

  • 0
    The best I can get is the following simplification: $$\frac{f}{100}=z^{\frac{c}{c-b}}y^{\frac{b}{b-c}}-x^{\frac{a}{a-b}}y^{\frac{b}{b-a}}$$2012-04-17
  • 0
    By making substitutions, it seems $y$ does not have a solution in terms of $a,b,c,x,z,\text{ and } \vec{f}$. See [Wolfram Alpha's wisdom](http://www.wolframalpha.com/input/?i=m%3Dny^m-uy^k).2012-04-17
  • 0
    Well, WA did solve it though. See eq3 where I have all terms but y. It resulted in "Numerical Solution: y $\approx$ 1.10150000054474..."2012-04-17
  • 0
    Just because WA solved it does not mean it has a solution in terms of the variables. (That's akin to saying sextics have a general solution because WA can solve them. ;)) Most likely, it is a numerical method (that I do not know, as none of the obvious possibilities are coming to mind as likely. . .) that is being employed.2012-04-17
  • 0
    To be fair, my question does ask specifically for a numerical method to solve this, as I realize it can't be solved analytically.2012-04-17
  • 0
    Yeah, I realize that. I'm not trying to bite; I'm actually just displeased at the fact there isn't an analytical solution. I wanted to make sure 1) you were aware and 2) that the simplest form I could find does not look helpful.2012-04-17
  • 0
    Ok, thanks, I updated the question to reflect that.2012-04-17
  • 0
    Are $a,b,c$ positive integers?2012-04-17
  • 0
    Yes, a,b, c are non-zero positive integers.2012-04-17
  • 0
    @indiosmo: Then you can consider it as a polynomial in $\sqrt[m]{y}$ for an appropriate $m$ depending on $a,b,c$.2012-04-17

1 Answers 1

0

Since Newton Raphson requires the first derivative of this equation (hard to compute symbolically), here is a Regula-Falsi implementation that converges to 1.101500000544740 written in C (compile with gcc and run).

http://pastebin.com/hQ3JYLCC

  • 0
    You could also post a copy of that [here](https://gist.github.com/).2012-04-17
  • 0
    Done. I prefer using pastebin though.2012-04-17
  • 0
    I'll study the method to understand it better but I tested with several values and it works, so I'm accepting your answer.2012-04-17
  • 0
    The Regula-Falsi method is actually an alternative of the Newton-Raphson. Instead of using the first derivative it uses an approximation of the form $f'(x_n)\approx \frac{f(x_n)-f(x_{n-1})}{x_n-x_{n-1}}$ and therefore doesn't require the calculation of the first derivative. Anyway,glad i could help.2012-04-17