0

I have 3 points [x0 y0], [x1 y1], [x2 y2] with strict conditional x0<x1<x2, y0<y1<y2. All this points lay on some exponentional functions y=ae^(bx)+c. I need to find a,b,c... It's not possible to solve system of 3 equations precisely, therefore I need to approximate it. Is there some math library in java that will help me solve this problem? I find something similar on mathcad

https://help.ptc.com/mathcad/en/index.html#page/PTC_Mathcad_Help/exponential_regression.html but not find in java.

Other way - how to solve system of 3 equations and 3 values approximately.

ae^(bx_0)+c=y_0 ae^(bx_1)+c=y_1 ae^(bx_2)+c=y_2

Airat
  • 53
  • 6

1 Answers1

0

You have to solve a system of non-linear equations, for which only an approximate solution is possible but can be done using the Newton Raphson's Multivariate method.

The algorithm is, quite frankly, a notational pain but you can go through it here - http://fourier.eng.hmc.edu/e176/lectures/NM/node21.html. What is happening essentially is you have a function whose derivative lead you to an 'equilibrium' from an initial random point (which you guess as a possible root)

If you are not willing to write the code yourself this repo can give you a starter of sorts - https://github.com/prasser/newtonraphson. But AFAIK, no ready library exists for this purpose. You can use Wolfram's Mathematica or MATLAB/OCTAVE for ready libraries though.

That said, here are a few other (more complicated) things you can look into

  1. https://en.wikipedia.org/wiki/Levenberg%E2%80%93Marquardt_algorithm
  2. https://www1.fpl.fs.fed.us/optimization.html
  3. http://icl.cs.utk.edu/f2j/
  4. http://optalgtoolkit.sourceforge.net/
  5. http://scribblethink.org/Computer/Javanumeric/index.html
  6. https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.fmin_l_bfgs_b.html

Hope this helps!