//*************************************************************************/
//Count values interpolant at a given point
//*************************************************************************/
double Interpolate(double x)
{
//double result;
int i=0;
while (KnotArray[i].x < x)
i++;
i--;
return Coef[i][0] + Coef[i][1]*(x-KnotArray[i].x) + Coef[i][2]*powf((x-KnotArray[i].x),2) + Coef[i][3]*powf((x-KnotArray[i].x),3);
}
Find more questions by tags Linear algebraHigher mathematicsMathematics
Example:
Points got two functions. You need to find such points to 2 * |F2(x1) F1(x2)| = |F1(x2) F2(x3)|
Why gumannost does not interfere? f-ia will get a patch and then how to solve this problem? - Emiliano28 commented on June 8th 19 at 17:17
And brute force do not necessarily need to lead to some good value and in the correct order. - Courtney commented on June 8th 19 at 17:20
You need to make the system of equations. We have only 3 unknowns, respectively, should be 3 equations. One equation is already is a 2 * |F2(x1) F1(x2)| = |F1(x2) F2(x3)|. In order to keep the system full, you need to add 2 more equations. Will the iteration to pick up. I.e. for our example, But should be in 2 times less than B. Accordingly, in one system ur-iy A=1, B=2. Next selected znaczenia, where A=2, B=4; A=3, B=6 etc.
If there is a more optimal way solutions will be glad to hear - Emiliano28 commented on June 8th 19 at 17:23
I would have switched to the function F(x1,x2,x3) = 2 * |F2(x1) F1(x2)| - |F1(x2) F2(x3)|, and solve the equation F(x1,x2,x3)=0, any method for solving equations. For example, would be considered gradient, breaking the space (x1,x2,x3) in the region with a constant direction of the gradient, and check if the area for the presence of the root.
Well, or has used any additional information about functionality.
Again, if we expect the smooth functions can simply calculate the difference value of the function at the point, and look for a brute force close on smaller distances - the smoothness of the us ensures that the solution is somewhere nearby. - Courtney commented on June 8th 19 at 17:26
But I have deformylase the decision - not by complex transformations reduce the problem to the search of zeros of this function:
$$
F(x1,x2,x3) = (4 * (F2(x1) F1(x2))^2 - (F1(x2) F2(x3))^2)^2
$$
But the function is not negative, so you can just find her lows - and this is a standard task. I have to use scipy.optimize - Courtney commented on June 8th 19 at 17:38