Very confusing problem in Mathematica

In summary, Lucian was trying to solve a linear system of equations but got different results depending on which program he used. He was also confused because the documentation was not clear about which matrix was row and which was column.
  • #1
LucianImago
6
0
Hi everybody,

Last time I was here I was asking about finding roots but many things have progressed. Anyway I have another problem now.

I have a linear system of equations which I'd like to solve: A.X==B

And I tried two things: get the inverse of A and multiply it with B and also use LinearSolve. Both gave me the same result so far so good.

The weird part happened when I did the same thing in MathCad. I used the same system of equations and the same everything. I tried the two methods and I got different solutions for X.

But the only way to get the two programs to agree (I did this as a fluke) is if in Mathematica I do: X=B.Inverse[A] and in MathCad i have X=Inverse[A].B.

I don't get it. What is this? What is it that I don't see?

I would very much appreciate if someone can clarify this for me.

Cheers,

Lucian
 
Physics news on Phys.org
  • #2
Check the documentation on MathCad's version of LinearSolve -- I bet it's written to solve xA=b.

Many (all?) interactive computer algebra systems don't distinguish between row and column vectors -- it infers what you wanted from context.
 
  • #3
This is what MathCad says about their lsolve:

lsolve(M, v) Returns the solution x for the linear system of equations M·x = v, using LU decomposition. The BLAS/LAPACK libraries (http://www.intel.com/software/products/mkl/features/lin_alg.htm ) from Intel are used.

Arguments:
M is a real or complex matrix. If the matrix is square, it must be non-singular.
v is a real or complex vector or matrix having the same number of rows as M.

And the same thing is said about LinearSolve in mathematica. No if what you are saying is true then how can I tell the program which is a row and which is a column or what am I suppose to do because I need to solve this system. If I have: B.Inverse[A] in mathematica I get the same as in Mathcad where I have Inverse[A].B, if I have B.Inverse[A] I get an answer in mathematica but not in MathCad where I get an error because this operation cannot be performed there.

So this is still confusing.
 
Last edited by a moderator:
  • #4
Hrm. I still expect the answer is to be had in the documentation -- maybe something unexpected is going on with matrix multiply, or inverse, or maybe even how you enter the matrix.

Alas, the extent of my familiarity with your situation is that I find Mathematica awkward for linear algebra, so I can't be any further help. :frown:


Is A an orthogonal matrix? Try solving AT x = b and see what happens... since AT is the inverse of A in this case, that would make your initial observations misleading.
 
  • #5
Yeah, I looked everywhere in the documentation. There is nothing about special cases or anything like that. If there is something going on then I don't know what to do. I hope someone on this forum knows.
 

1. What is Mathematica and what is its purpose?

Mathematica is a software program used for mathematical and scientific calculations. It is designed to perform complex computations, visualize data, and create interactive simulations.

2. How do I solve a confusing problem in Mathematica?

The first step is to clearly define the problem and break it down into smaller, more manageable parts. Then, use the built-in functions and programming capabilities of Mathematica to tackle each part individually. It may also be helpful to consult online resources or seek assistance from other Mathematica users.

3. Can Mathematica handle real-world data and applications?

Yes, Mathematica has powerful data analysis and visualization capabilities, making it suitable for handling real-world data and applications. It also has a vast library of built-in functions and the ability to import and export data from various file formats.

4. Is it necessary to have a strong background in mathematics to use Mathematica?

While a basic understanding of mathematics is helpful, it is not necessary to have a strong background in order to use Mathematica. The program has a user-friendly interface and provides helpful documentation and tutorials for beginners.

5. Can I customize the output of Mathematica?

Yes, Mathematica allows for customization of output through the use of formatting and styling options. Users can also create customized functions and graphs to meet their specific needs.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • Precalculus Mathematics Homework Help
Replies
6
Views
605
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
Back
Top