1
$\begingroup$

I have a formula like this

x1 * Vector1 + x2 * Vector2 + ... + xn * Vectorn = NewVector

where Vectorn and NewVector contain three numbers each and xn a single scalar. Vectorn and NewVector are given.

How do I compute x1...xn numerically in c#?

$\endgroup$
3
  • $\begingroup$ What does this have to do with differential equations? $\endgroup$ – amd May 16 '18 at 0:00
  • $\begingroup$ @amd I corrected it $\endgroup$ – Aurelius Schnitzler May 16 '18 at 0:02
  • $\begingroup$ What is the value of $n$ comparing with 3? $\endgroup$ – user May 16 '18 at 9:10
0
$\begingroup$

The equation is $Ax = b$, or $$ \pmatrix{ u_1 & u_2 & \cdots & u_n \\ v_1 & v_2 & \cdots & v_n \\ w_1 & w_2 & \cdots & w_n \\ } \pmatrix{ x_1 \\ x_2 \\ \vdots \\ x_n \\ } = \pmatrix{ u \\ v \\ w \\ } $$ Since $A$ is $3 \times n$ and so rectangular, this is a linear least squares and reduces to solving the normal equations $A^T A x = A^T b$.

$\endgroup$
1
  • $\begingroup$ In how far does that answer "How do I compute x1...xn numerically in c#?"? $\endgroup$ – Zurechtweiser May 16 '18 at 2:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.