Linear Algebra/Topic: Computer Algebra Systems/Solutions
Jump to navigation
Jump to search
Solutions
Answers for this Topic use Maple as the computer algebra system. In particular, all of these were tested on Maple V running under MS-DOS NT version 4.0. (On all of them, the preliminary command to load the linear algebra package along with Maple's responses to the Enter key, have been omitted.) Other systems have similar commands.
Other answers will be added for Wolfram Mathematica 13.0
{{TextBox|1=
- Problem 1
Use the computer to solve the two problems that opened this chapter.
- This is the Statics problem.
- This is the Chemistry problem.
- Answer
- The commands
> A:=array( [[40,15],
[-50,25]] );
> u:=array([100,50]);
> linsolve(A,u);
yield the answer . Mathematica answerreturns a vector of {1,4} for {c,h}.eqns = {40 h + 15 c == 100, 25 c == 50 + 50 h}; {b, m} = CoefficientArrays[eqns, {c, h}] LinearSolve[m, -b] {c, h} /. Solve[eqns, {c, h}]
- Here there is a free variable:
> A:=array( [[7,0,-7,0],
[8,1,-5,2],
[0,1,-3,0],
[0,3,-6,-1]] );
> u:=array([0,0,0,0]);
> linsolve(A,u);
prompts the reply . Mathematica code:returns {0,0,0,0} for LinearSolve and for the last lineeqns = {7 h == 7 j, 8 h + i == 5 j + 2 k, 1 i == 3 j, 3 i == 6 j + 1 k}; {b, m} = CoefficientArrays[eqns, {h, i, j, k}] LinearSolve[m, -b] {h, i, j, k} /. Solve[eqns, {h, i, j, k}]