Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to solve the Linear Equation, $Ax=b$ in Mathematica using Kylov subspace solver method preferably BICGSTAB(

Suppose $A^{BE}_{\Delta,\Omega}$ is the following Laplacian+ Angular Momentum operator.enter image description here

Instead of using the finite difference matrices for evaluating $A^{BE}_{\Delta,\Omega}$, I am using the derivatives in Fourier space for higher accuracy. Derivatives where Description of operators

How can one solve this Linear equation $A^{BE}_{\Delta,\Omega}\psi=\phi$ equation where $A=A^{BE}_{\Delta,\Omega}$, $x=\psi$, and $b=\phi$ in $Ax=b$? How can one extract $A^{BE}_{\Delta,\Omega}$ to plug it in LinearSolve[A,b]when it clearly depends upon $\psi$?

I have used: LinearSolve[A,b]

but as A ($A^{BE}_{\Delta,\Omega}$) depends on x ($\psi$), I do not get the correct result.

One can solve this in MATLAB using the following function:

x = bicgstab(A,b)

Here it attempts to solve the system of linear equations A*x=b for x. A can be a function handle, afun, such that afun(x) returns A*x.

Is there an analog of this function handle operation in Mathematica, in LinearSolve, where it can deal with the matrix A that depends on its x, in Ax=b?

Any help is appreciated.

share|improve this question
This is pretty vague. A small concrete example, in Mathematica format, would be very useful here. – Daniel Lichtblau May 14 '14 at 18:18
In particular, how does $A$ depend upon $x$? If not linearly, then you no longer have a linear matrix equation. – murray May 14 '14 at 19:36
I have edited the contents to the question. I have given an example of a linear operator A, (laplacian+angular momentum) that is acting on x to give us b i.e. Ax=b. Please do have a look at it and suggest any solutions. – user14380 May 14 '14 at 19:41
Based on the title it sounds like your equation is not linear at all, so you won't be able to use linear algebra methods. – Szabolcs May 14 '14 at 19:45
@murray I'm a bit confused by your comment... How is it a linear equation if A depends on x at all? – sebhofer May 15 '14 at 7:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.