Items tagged with matrix

Hello guys, i have some matrix equations.

A^(T)*X+X*A+Q = 0 , where A,Q - matrixs, X - unknown matrix, i need to solve this.

i tried to solve this from methods, but not successfully.

How can to solve this problem?


When I use the Determinant function on a matrix with (single variable) polynomial entries with real coefficients I often get an incorrect answer. I know the answers are incorrect because they have a higher degree or a lower lowest degree than is possible given the matrix elements.

However, when I replace the coefficients in the polynomials with rational numbers or I put in the option method=minor, I get the correct answer.

The problem seems to be roundoff error. However, the important error is not simply small changes in the resulting polynomial. The important error is the presence of entirely incorrect powers of the variable and not with very small coefficients.

How does this happen and why does the help page for Determinant( ) not warn of this behavior? In particuiar, why does the help page not say that using Gaussian elimination (i.e., the default) will often give incorrect answers in such cases, but using method=minor will work? Is this behavior known? I cannot find any reference to it on the internet.

Hello people in maple primes

I have a question, which is about the matrix shown in

Why can't C below be shown with beta?

A := Matrix(3, 3, [[-a, a, 0], [0, 0, -sqrt(l*b*c*(j+k))/(j+k)], [2*j*sqrt(l*b*c*(j+k))/((j+k)*l), 2*k*sqrt(l*b*c*(j+k))/((j+k)*l), -c]]);
C:=subs(j*alpha^(1/2) = beta,B);
e:=subs(alpha^(1/2) = gamma,B);

Best wishes.




Dear Pros, I'm a biginer so I have a question about my program.

I have a lot of arrays which are result from 2 while loop. Now, I want creat a matrix from them but i can't. So, could you help me to do it.

For detail: 

V[1]:=[ 1 2 3]

V[2]:=[2 3 4]

V[3]:=[3 4 5]

V[4]:=[2 6 7]

V[5]:=[7 8 9]



with type of V[i] is a array.

I searched and found a solution by manual to create a matrix as follow:


but in this case i can't but manual with n=100

please help me to have a Matrix.

Thank a lots.




I have tried to solve a matrix with the function "LinearSolve" as seen in the picture, but instead of solving it just gives me back the operation i wrote (3). My which is to solve an equation system a quick as possible - have a templet fill in the matrix and press enter. I thought this "LinearSolve" function was the easiest way of doing. I know that I can right click and choose the function, but I want it as a command.


Any solutions on how to use the "LinearSolve" command to solve an equation system?


how to use Riemann matrix to output Riemann surface?

and plot this surface?


evalf(pm, 5);
M := rm;
A := proc (x, y) options operator, arrow; RiemannTheta([x, y], M, [], 0.1e-1, output = list)[2] end proc;
plot3d(Re(A(x+I*y, 0)), x = 0 .. 1, y = 0 .. 4, grid = [40, 40]);

is this graph Riemann Surface?

if so, how to convert A into polynomials?

Dear Maple users

I have done some experiments with the new Workbook feature in Maple 2016. It is a very welcome addition, indeed. Earlier I have created Maple files in which data from an external Excel file was imported and being used for certain calculations. In order to make recalculations work properly, one need to let the Excel file follow the Maple file. That's where a Workbook come in handy! I tried placing those two files in a Workbook. It didn't work completely as advertised, I think. I moved the Workbook to another location on the harddrive to make sure it wouldn't interfere with the original files outside the Workbook. Then I recalculated the Maple document inside the Workbook. The good thing: The data from the Excel file was still present. The bad thing: If I changed some data in the Excel file inside the Workbook, it didn't register in the Maple file when updating it!

Maybe I should explain that I did import data from the Excel file into Maple via the menu: Tools > Assistants > Import Data... The data was retrieved as a matrix within the Maple file and assigned to a variable and used for plots ...

Why doesn't the above procedure work properly? I hope one don't need to use the Workbook URI to reference files within the workbook. It is not that userfriendly!




I am working on an iterative code where I need to save a matrix in an intermediate step. My code is long and it uses a separate data file. So, I am trying to state my problem taking a simple example.

At first, I define a column matrix A0. Using A0, I do some calculations and test some conditions. 
In the next step, I want  to do similar calculations and test some conditions but this time by changing the first element of A0. For the purpose of later use, I need to save the matrix A0 in its original form. I am trying to use the following method but both A0 and A1 (modified A0) turn out to be same.

> restart;
> n := 3;
> A0 := Matrix(n, 1, 1);
> #Do some calculation with A0
> A1 := A0;
> A1[1, 1] := A1[1, 1]+.1*A1[1, 1];
> A1;
> print(A0, A1);

This might be because I set A1:=A0 in the third line. But how do I save A0 in its original form?



i want to solve a system , A.b+B.X=0 , which A is 5*5 known matrix, B is 5*2 known matrix , and b is 5*1 and X is 2*1 unknown arbitary matrices ! i want to have solution for b and X . whatever they can be ! just equation to be solved !



A := Matrix(5, 5, {(1, 1) = -.9800, (1, 2) = 0, (1, 3) = 0, (1, 4) = -0.160e-1, (1, 5) = 0, (2, 1) = 1.0000, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (3, 1) = -2.1900, (3, 2) = -9.7800, (3, 3) = -0.280e-1, (3, 4) = 0.740e-1, (3, 5) = 0, (4, 1) = 77.3600, (4, 2) = -.7700, (4, 3) = -.2200, (4, 4) = -.6700, (4, 5) = 0, (5, 1) = 0, (5, 2) = -79.9700, (5, 3) = -0.300e-1, (5, 4) = .9900, (5, 5) = 0})



B := Matrix(5, 2, {(1, 1) = -2.44, (1, 2) = .58, (2, 1) = 0, (2, 2) = 0, (3, 1) = .18, (3, 2) = 19.62, (4, 1) = -6.48, (4, 2) = 0, (5, 1) = 0, (5, 2) = 0})



b := Matrix(5, 1, {(1, 1) = y[1], (2, 1) = y[2], (3, 1) = y[3], (4, 1) = y[4], (5, 1) = y[5]})



X := Matrix(2, 1, {(1, 1) = x[1], (2, 1) = x[2]})



M := Matrix(5, 1, {(1, 1) = -.9800*y[1]-0.160e-1*y[4]-2.44*x[1]+.58*x[2], (2, 1) = 1.0000*y[1], (3, 1) = -2.1900*y[1]-9.7800*y[2]-0.280e-1*y[3]+0.740e-1*y[4]+.18*x[1]+19.62*x[2], (4, 1) = 77.3600*y[1]-.7700*y[2]-.2200*y[3]-.6700*y[4]-6.48*x[1], (5, 1) = -79.9700*y[2]-0.300e-1*y[3]+.9900*y[4]})



Matrix([[-0.160e-1*y[4]-2.44*x[1]+.58*x[2]], [0.], [-9.7800*y[2]-0.280e-1*y[3]+0.740e-1*y[4]+.18*x[1]+19.62*x[2]], [-.7700*y[2]-.2200*y[3]-.6700*y[4]-6.48*x[1]], [-79.9700*y[2]-0.300e-1*y[3]+.9900*y[4]]])






actually the problem to be solved is M=0 ! which directly goes to y[1]=0;
after that , how can i find other unknowns so that M=0 is ok. tnx

Hello awesome maple people

I have the following Matrix

R := Matrix([[1, -2, 2, 6, -6], [2, -3, 4, 9, -8]])

then i do


and i get an output, but is there any way to get it to give me the output in Parametric form?

Like this

Thanks in advance :)



In a recent blog post, I found a single rotation that was equivalent to a sequence of Givens rotations, the underlying message being that teaching, learning, and doing mathematics is more effective and efficient when implemented with a tool like Maple. This post has the same message, but the medium is now the Householder reflection.

Given the vector x = , the Householder matrix H = I - 2 uuT reflects x to y = Hx, where I is the appropriate identity matrix, u = (x - y) / ||x - y|| is a unit normal for the plane (or hyperplane) across which x is reflected, and y necessarily has the same norm as x. The matrix H is orthogonal but its determinant is -1, making it a reflection instead of a rotation.

Starting with x and uH can be constructed and the reflection y calculated. Starting with x and yu and H can be determined. But what does any of this look like? Besides, when the Householder matrix is introduced as a tool for upper triangularizing a matrix, or for putting it into upper Hessenberg form, a recipe such as the one stated in Table 1 is the starting point.

In other words, the recipe in Table 1 reflects x to a vector y in which all entries below the kth are zero. Again, can any of this be visualized and rendered more concrete? (The chair who hired me into my first job averred that there are students who can learn from the general to the particular. Maybe some of my classmates in graduate school could, but in 40 years of teaching, I've never met one such student. Could that be because all things are known through the eyes of the beholder?)

In the attached worksheet, Householder matrices that reflect x = <5, -2, 1> to vectors y along the coordinate axes are constructed. These vectors and the reflecting planes are drawn, along with the appropriate normals u. In addition, the recipe in Table 1 is implemented, and the recipe itself examined. If you look at the worksheet, I believe you will agree that without Maple, the explorations shown would have been exceedingly difficult to carry out by hand.


I was wondering if there is a way to represent a matrix in a reduced state.  By this I am talking about:

      | 1/3 1/3|

A:=| 1/3 1/3|  Where A is 2x2 matrix.  I would like represent it as:


           | 1 1|

A:=1/3| 1 1| is that possible with maple???




I am trying to do an hourly simulation of a solar-thermal system. The method I am using requires an inital guess for a value which is used in a series of equations. That variable is then back calculated, and checked against the initial guess. If it is too far off, the back calculated value is used as the new guess and so on...

My question is twofold. First, is there a way to create a sort of module that can execute a number of steps when called upon (i.e. the iterative process described above). Second, how can I run this for each hour of the year (the weather inputs for each hour will change) without manually executing each one, one at a time. So far my guess is to make a matrix with the weather inputs for each hour, and then have some sort of loop read the rows (hours) one at a time, pull the data from it, run the series of steps, and then store the output for that hour in a new matrix. Is this the best way to do this? If so, which functions/tools in Maple should I look into that can do this for me?


2 3 4 5 6 7 8 Last Page 4 of 46