1
$\begingroup$

Let a, b, c be vectors obtained with the function N and x, y be scalars. I have the equation:

Solve[a == x b + y c, {x, y}]

Since I have used N, I get an empty solution, but I know that a solution exists.

Is there any way to find some sort of approximation such that the equation is satisfied?

I don't know how to do it. but maybe a solution with an interval for x and y?

$x \pm c1$ and $y \pm c2$

$\endgroup$
  • 2
    $\begingroup$ xb is not the same thing as x*b or x b. $\endgroup$ – Daniel Lichtblau Oct 21 '18 at 14:42
  • $\begingroup$ Take a loot at LeastSquares $\endgroup$ – Lukas Lang Nov 4 '18 at 12:26
2
$\begingroup$

This is a linear equation, and you are probably looking for a least squares solution. So,

LeastSquares[Transpose[{b, c}], a] 

should work.

To problem here is that there are either no or infinitely many (a line of) solutions.

| improve this answer | |
$\endgroup$
0
$\begingroup$

By using Solve, you are asking Mathematica to solve for $x$ and $y$, which is not possible, as the system of equations is under defined. You can either solve for one of the unkowns

Solve[a == x b + y c, {x}]

enter image description here

or reduce the equations into simpler conditions

Reduce[a == x b + y c, {x, y}]

enter image description here

| improve this answer | |
$\endgroup$

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