I have a polynomial that is determined using a linear least-squares fit through a bunch of data points of the form:
P1(z)= A0+A1z+A2z2+A3z3...Anzn
The polynomial does a good job representing the data within the range of the data (z1..z2), but beyond the ends of the data the P1(z) values tend to take off rapidly in the positive or negative direction.
For my application I need the data values that "straightens out" beyond the ends of the polynomial P1.
I am attempting to define a function P(z) as a "piece wise" spline where:
P(z) = P0 when z0 <= z <= z1
P(z) = P1 when z1 <= z <= z2
P(z) = P2 when z2 <= z <= z3
Where P(z) and all of it's derivatives must be continuous over the range z0..z3.
My difficulty is in finding P0 such that:
P0(n)(z1) = P1(n)(z1) for all n, where P0(n) is the nth derivative of P0
and
P0(n)(z0) = 0 for all n > 1
A parallel in the real-world is to be traveling on a straight path, go through some curves that are represented by a polynomial, then end on a straight path.
I tried using:
P0(z) = A0+A1z+((z - z1)/(z2-z1))(A2z2+A3z3...Anzn)
Which meets the conditions for value, unfortunately the P0'(z1) does not equal P1'(z1) etc (derivatives don't match). I also tried creating a polynomial by assuming I want the n'th derivative of P0 to be of the form B0 + B1z, solving for B0 and B1 using the value for P1 at z1, then integrating to arrive at additional polynomial coefficients, but that didn't work either.
FYI: I haven't been a student since 84' and my calculus and differential equations are a bit rusty.
It seems like this might be a common problem, but I don't know what to call it for an internet search.
Can anyone point me in the right direction?
P1(z)= A0+A1z+A2z2+A3z3...Anzn
The polynomial does a good job representing the data within the range of the data (z1..z2), but beyond the ends of the data the P1(z) values tend to take off rapidly in the positive or negative direction.
For my application I need the data values that "straightens out" beyond the ends of the polynomial P1.
I am attempting to define a function P(z) as a "piece wise" spline where:
P(z) = P0 when z0 <= z <= z1
P(z) = P1 when z1 <= z <= z2
P(z) = P2 when z2 <= z <= z3
Where P(z) and all of it's derivatives must be continuous over the range z0..z3.
My difficulty is in finding P0 such that:
P0(n)(z1) = P1(n)(z1) for all n, where P0(n) is the nth derivative of P0
and
P0(n)(z0) = 0 for all n > 1
A parallel in the real-world is to be traveling on a straight path, go through some curves that are represented by a polynomial, then end on a straight path.
I tried using:
P0(z) = A0+A1z+((z - z1)/(z2-z1))(A2z2+A3z3...Anzn)
Which meets the conditions for value, unfortunately the P0'(z1) does not equal P1'(z1) etc (derivatives don't match). I also tried creating a polynomial by assuming I want the n'th derivative of P0 to be of the form B0 + B1z, solving for B0 and B1 using the value for P1 at z1, then integrating to arrive at additional polynomial coefficients, but that didn't work either.
FYI: I haven't been a student since 84' and my calculus and differential equations are a bit rusty.
It seems like this might be a common problem, but I don't know what to call it for an internet search.
Can anyone point me in the right direction?