-1

I have experimental data points (x1, x2, ..., xn), (y1, y2, ..., yn) of turbocharger pressure map and want to get trendline equation. In result of my research it's something like:

y = (ax^5 + bx^4 + cx^3 + dx^2 + ex + f)/(x+g)    # my equation

Tell me please, are there any ready-made functions for this? I tried using np.polyfit, but it works with usual polynoms and I must guess "g" in this way:

# y*(x-g) = ax^5 + bx^4 + cx^3 + dx^2 + ex + f
pc  = np.polyfit(x, y*(x+g), 5)
y = (pc[0]*x**5 + pc[1]*x**4 + pc[2]*x**3 + pc[3]*x**2 + pc[4]*x + pc[5])/(x + g)

It would be nice if someone could help to get coefficiens of my equation.

ray_med
  • 1
  • 2

1 Answers1

0

Though this will lead to a slightly different minimization, you can linearize the equation as

x y = ax^5 + bx^4 + cx^3 + dx^2 + ex + f - g y

and solve by linear least-squares.

  • It doesn`t work, because we have constant term = `f + g y`. Even if f =0, we have g=pc[5]/y and it is not computable – ray_med Oct 18 '19 at 18:02
  • @ray_med: it does work, it is an overdetermined system in 7 unknowns. But you are not obliged to believe me. –  Oct 19 '19 at 11:48