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
    @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
    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