Items tagged with matrix matrix Tagged Items Feed

Hello people in maple primes

I have a question, which is about the matrix shown in http://www.mapleprimes.com/questions/217852-HOW-I-Convert-Root-Of-In-To-Another-Common-Form

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]]);
B:=subs(l*b*c*(j+k)=alpha,A);
C:=subs(j*alpha^(1/2) = beta,B);
e:=subs(alpha^(1/2) = gamma,B);

Best wishes.

taro

 

 

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]

...

V[n]

with type of V[i] is a array.

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

V_matrix:=<V[1],V[2],V[3]>

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?

 

with(algcurves):
f:=y^3+2*x^7-x^3*y;
pm:=periodmatrix(f,x,y);
evalf(pm, 5);
rm:=evalf(periodmatrix(f,x,y,Riemann),10);
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!

 

Regards,

Erik

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 !

restart:

A:=Matrix(5,[[-0.9800,0,0,-0.0160,0],[1.0000,0,0,0,0],[-2.1900,-9.7800,-0.0280,0.0740,0],[77.3600,-0.7700,-0.2200,-0.6700,0],[0,-79.9700,-0.0300,0.9900,0]]);

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})

(1)

B:=Matrix((5,2),[[-2.44,0.58],[0,0],[0.18,19.62],[-6.48,0],[0,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})

(2)

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

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

(3)

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

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

(4)

M:=A.b+B.X

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]})

(5)

eval(M,y[1]=0)

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]]])

(6)

 

 

 

Download solve.mw


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

ReducedRowEchelonForm(R);

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

Like this https://snag.gy/BQniuR.jpg

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.

Attached: RHR.mw

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???

 

Thanks

     

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?

Thanks.

Hi there,

            I am new to maple. I want to ask a simple question.

            If I have a array, and I want its each component to take natural logarithm. How can I do?

            Eg:[2 3 4]->[ln(2) ln(3) ln(4)]

            Thanks in advance.

Dirichlet

Simple test of GaussianElimination function

Why doesn't this work? 

Also can I just confirm that for GaussianElimination (according to the help this uses LUDecomposition function with the output=['U'] option) the input is the augmented matrix of the system, the coefficient matrix augmented with the RHS)

In a separate test I got an example working using this code, but I've never seen this syntax before for A Matrix (using << it seems?)

 

Thank you for your help.

 

 

ORIGINAL ATTEMPT

with(LinearAlgebra):

A := matrix(3, 3, [-3, 2, 1, 1, -2, 1, 1, 2, -3]);

Matrix(3, 3, {(1, 1) = -3, (1, 2) = 2, (1, 3) = 1, (2, 1) = 1, (2, 2) = -2, (2, 3) = 1, (3, 1) = 1, (3, 2) = 2, (3, 3) = -3})

(1)

GaussianElimination(A)

Error, (in LinearAlgebra:-GaussianElimination) invalid input: LinearAlgebra:-GaussianElimination expects its 1st argument, A, to be of type Matrix() but received A

 

``

 

Download gauss_elimination_2.mw

I want to analyze the runtimes on certain Linear Algebra functions in Maple, so I need a (large) set of matrices to input into these functions.

I have written the below code, which does succesfully generate a file of matrices:

The resulting file looks like:

However, I am unable to read the matrices from this file back into Maple. When using the code below, I get an error.


I think the error is that %a in fscanf scans up to the next whitespace, so the spacing in Matrix(3, 3, [[9,1,-4],[-5,6,-10],[-10,-4,-4]]) is throwing fscanf off. Do you guys know of any way I can fix this?

 

Or, is there a better way for me to generate these matrices so that they can be easily read into Maple? I've considered using ImportMatrix/ExportMatrix, but I believe that they only work for a single matrix, not the numerous ones that I would need. 

1 2 3 4 5 6 7 Last Page 1 of 43