# How to solve system of nonlinear equations (A-x1)*x2=B?

3 views (last 30 days)

Show older comments

A and x1 are 300*1 vectors, x2 is a 1*2000 vector, B is a 300*2000 sparse matrix.

(A-x1)*x2=B

we know A, B, then how can we calculate both vector x1 and x2?

##### 0 Comments

### Answers (1)

Hugo
on 9 Jun 2015

Notice that (A-x)*y=B (I changed the names of the variables for simplicity) can be written component-wise as (Ai-xi)*yj = Bij, where i and j denote the indexes. This equation is then showing that, for i constant, Bij / yj does not depends on j. In other words, Bij = ki * yj, where ki is a constant that depends on i. Thus, B must be the result of an outer product between two vectors for the equation to be solvable. To find the vectors that generate B, you can use singular value decomposition, which gives you B = U * D * V^T, being D a diagonal matrix. If D has only one value different from zero, then B is effectively an outer product. You can then construct the vectors k and y as k = alpha * u and y = beta * v, where u and v are the columns of U and V associated with the nonzero singular value, and alpha and beta are constants which product must equal the nonzero singular value. x can then be found by computing x = A-k. Notice that there are infinite solutions, since you can choose alpha arbitrarily (beta being bound by the relation to the nonzero singular value).

Hope this helps.

##### 5 Comments

Hugo
on 10 Jun 2015

Torsten
on 10 Jun 2015

I guess Bruno's response under

answers the OP's question.

Best wishes

Torsten.

### See Also

### Categories

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!