Say I have a function that I've obtained as a fit of a certain data set. I want to make that function go through two different points that it doesn't currently go through, while making it so the rest of the function adapts to that change and keeps its shape. Something like this:
Right now I have a rational fit with 9 coefficients (5th power numerator and 5th power denominator, 5 coefficients in the numerator and 4 coefficients in the denominator while the coefficient of x^5 in the denominator is 1). I can, however, choose a different fit (polynomial, sum of sines etc.) if it would help here.
I have tried changing two coefficients at random to force the function to fit the two new points, but it produces something that doesn't make sense.
Here's what I have:
This is a rational fit to a set of Excel data produced with Matlab cftool:
p1 = 0.09503;
p2 = 0.8033;
p3 = 2.654;
p4 = 4.375;
p5 = 3.691;
p6 = 1.221;
q1 = 6.399;
q2 = 21.65;
q3 = 34.98;
q4 = 29.02;
q5 = 9.704;
m = (x - 0.9857)./0.1235;
y = (p1*m.^5 + p2*m.^4 + p3*m.^3 + p4*m.^2 + p5*m + p6) ./ (m.^5 + q1*m.^4 + q2*m.^3 + q3*m.^2 + q4*m + q5);
I need to make the function go through points (0.78; 0.002) and (1.05473536553; 9.869964329717e-2), while keeping the shape.


