问题描述
我知道我可以使用数学,但遗憾的是我没有之一。
我只是想找到A,B,C,D
形矩阵
| X1 ^ 3 ^ X1 X1 2 1 | | A | | Y0 |
| X2 ^ 3 ^ X2 X2 2 1 | | B | | Y1 |
| X3 ^ 3 ^ X3 X3 2 1 | X | B | = | Y2 |
| X4 ^ 3 ^ X4 X4 2 1 | | D | | Y3 |
我只是想找到A,B,C和D的简化公式。
其实我试图做一个程序的的Arduino ,需要使用曲线4分接头,这样我可以predict未来百分点。我见过this帖子,但抛物线是不是我需要足够的精确。
我已经尝试。
linearSolve [{{(X1)^ 3,(X1)^ 2,X1,1},
{(X2)^ 3,(×2)^ 2,X 2,1},
{(X3)^ 3,(X3)^ 2,X3,1},
{(4个)^ 3,(X4)^ 2,×4,1}},{{Y1},{Y2},{Y3},{Y 4}}]
它返回一个长的结果,这可以被简化。但是,我不能进入全面结果,以简化搜索栏(它给我的错误:输入太长)。
任何想法?嗯,我想这将有可能在桌面版本。
甚至在此之后,如果结果是相当长的,请代X1 = 0,让我知道最简化的结果。
//输入数据:数组x []和y []
// X [1],X [2]中,x [3]中,x [4] - 的X值
// Y [1],Y [2],Y [3],Y [4] - Y值//计算
A = 0
B = 0
C = 0
D = 0
S1 = X [1] + X [2] + X [3] + X [4]
S2 = X [1] * X [2] + X [1] * X [3] + X [1] * X [4] + X [2] * X [3] + X [2] * X [4 ] + X [3] * X [4]
S3 = X [1] * X [2] * X [3] + X [1] * X [2] * X [4] + X [1] * X [3] * X [4] + X [2 ] * X [3] * X [4]
对于i = 1至4环
C0 =值Y [i] /(((4 * X [i]于-3 * S 1)* X [I] + 2 * S 2)* X [i]于-S3)
C1 = C0 *(S1 - X [I])
C2 = S2 * C0 - C1 * X [I]
C3 = S3 * C0 - C2 * X [I]
A = A + C0
B = - C1
C = C + C2
Ð= D - C3
结束循环//结果:A,B,C,D
I know I can use Mathematica, but sadly I dont have one.I just want to find the A,B,C,Dform matrix
| X1^3 x1^2 X1 1 | |A| |y0|
| X2^3 x2^2 X2 1 | |B| |y1|
| X3^3 x3^2 X3 1 | X |C| = |y2|
| X4^3 x4^2 X4 1 | |D| |y3|
I just want to find the simplified equations for A, B, C and D.
Actually I am trying to do a program in arduino that requires curve fitting using 4 points, so that I can predict the future points. I have seen this post , but parabola isn't accurate enough for my need.
I have already tried http://www.wolframalpha.com/.
linearSolve [{{(x1)^3, (x1)^2, x1, 1},
{(x2)^3, (x2)^2, x2, 1},
{(x3)^3, (x3)^2, x3, 1},
{(x4)^3, (x4)^2, x4, 1}}, {{y1},{y2},{y3},{y4}}]
It returns a long result, which can be simplified. But, I cannot enter the full result in the search bar for simplifying (It gives me the error :Input Too Long!).
Any Ideas? Well I guess it would be possible in desktop versions.
Even after that, if the result is quite long, please substitute x1 = 0 and let me know the simplified result.
// Input data: arrays x[] and y[]
// x[1],x[2],x[3],x[4] - X values
// y[1],y[2],y[3],y[4] - Y values
// Calculations
A = 0
B = 0
C = 0
D = 0
S1 = x[1] + x[2] + x[3] + x[4]
S2 = x[1]*x[2] + x[1]*x[3] + x[1]*x[4] + x[2]*x[3] + x[2]*x[4] + x[3]*x[4]
S3 = x[1]*x[2]*x[3] + x[1]*x[2]*x[4] + x[1]*x[3]*x[4] + x[2]*x[3]*x[4]
for i = 1 to 4 loop
C0 = y[i]/(((4*x[i]-3*S1)*x[i]+2*S2)*x[i]-S3)
C1 = C0*(S1 - x[i])
C2 = S2*C0 - C1*x[i]
C3 = S3*C0 - C2*x[i]
A = A + C0
B = B - C1
C = C + C2
D = D - C3
end-loop
// Result: A, B, C, D
这篇关于sombody可以简化这个等式给我吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!