Reputation: 65
The simple example of the problem is:
In my case:
Any idea/suggestion is highly appreciated.
Upvotes: 0
Views: 383
Reputation: 19760
As long as the dimensions conform, A is actually "just" a matrix, even if it is built out of smaller matrices. Here's a relatively general example showing how the dimensions must go:
import numpy
import numpy.linalg
l, m, n, k = 2, 3, 4, 5
# if these are known, obviously just define them here.
A11 = numpy.random.random((l, m))
A12 = numpy.random.random((l, n))
A21 = numpy.random.random((k, m))
A22 = numpy.random.random((k, n))
x1 = numpy.random.random((m,))
x2 = numpy.random.random((n,))
A = numpy.bmat([[A11, A12],
[A21, A22]])
x = numpy.concatenate([x1, x2])
b = numpy.linalg.solve(A, x)
Upvotes: 2