Start Maple 2016 from the desktop, Start Menu/All apps/M or using the icon in f:\"math 1204". Maple has two modes, Worksheet and Document. You can use either, but Document is more like a calculator rather than a word processor. To start one or the other use File/New Every Maple command should end with a semi-colon ";" for instance > 2+1; The answer will appear in the middle of the line following. If you forget Maple wont actually complain, usually, though. Every time I give you a command to use I will give the > symbol. You are free to copy the command from this file and paste into maple, this will ensure you don't make a mistake when typing it in. Multiplication of numbers uses *, division uses / and powers are ^. Pick several integers and combine them using these two symbols and brackets. Don't forget the semi colon! Notice that Maple does not use decimals by default, and neither will I, in class. We can use ":=" to assign a value to a name, usually a letter > a := -5; This is case sensitive, so we can set > A := 4; A common mistake is to forget the : since Maple will still show "A=11" but A will not be assigned the value 11. Verify that a-A and A-a are different. For an unknown variable, Maple will just report that name: > a+b; Now set b to be some randomly chosen integer and note that the line above doesn't change but when you again ask for > a+b; it should give a number now instead. Maple works sequentially so I encourage you to work down the worksheet without editing earlier lines so that the confusion is lessened. ( If you want to you can go back up the worksheet and insert new lines if necessary using control-j or control-k. You can reset a variable's value to unknown using > a:='a'; ) In the other labs I will use capital letters for matrices, sometimes with a number after them, and lower case letters for numbers, but it isn't mandatory. When I introduce a Maple function it is a good idea to read the help page for that function. You can do that for the function sqrt by visiting http://www.maplesoft.com/support/help/Maple/view.aspx?path=sqrt and can search for any other function in that webpage too. You can also do it by using the Maple "Help" menu or by typing > ?sqrt However, ? can be slow to work, and might crash your computer. To recover, press the octagonal red button marked "stop". To exit from the help page, close the subwindow, use alt-tab or the Window menu to move between them. Use sqrt to determine the square roots of A and 10. Notice that, similarly to fractions, square roots are left as is too, unless the number is a perfect square. We are now ready to do some matrix algebra... Load all of the linear algebra progams with the command: > with(LinearAlgebra); All the new commands listed are now known by Maple, we will use some. We can create a 3x3 matrix by using the following command > B:=<<3,-6,8>|<-1,-6,3>|<2,-5,6>|<0,-4,3>>; It gives the matrix in terms of its columns. Even though we are using this to represent a system of equations Maple doesn't give a dotted line, but we should try to remember it is there. Notice that we again use ":=" to assign a value to B. I recommend using a capital letter for all matrices, but Maple will not insist on that. Recall that Maple is case sensitive, so B is different from b. Note that all of the LinearAlgebra commands also begin with a capital letter, although "matrix" is also defined, it will not always work properly. We can do the three different row operations as follows: > B1:=RowOperation(B,[1,3]); will swap row 1 and row 3 of B and make it into a new matrix B1. > B2:=RowOperation(B1,3,-1); would take this new B1 and multiply row 3 by -1 and make B2 As we talked about in class, these two operations are not usually necessary. The following is the main row operation we will be using: > B3:=RowOperation(B2,[2,1],4); will replace row 2 of B2 by itself plus 4 times row 1 to make B3 I recommend using this scheme of naming each matrix sequentially, and try to not reuse any name, if you don't get the matrix you wanted, just use the next Bnumber matrix with the previous one. Note that the B3 operation will not give you the desired 0 in row 2 of column 2, so change the multiplier used to make a B4 with a 0, then find a new row operation for B4 which will make another 0 in column 2. Note that we have one column with only one 1 and all other elements 0. However, the other two columns do not have a 1 in. Find a series of row operations which creates a new 1 but which does not introduce fractions. Use the 1 created to create two more 0s and hence find the solution to the system of equations represented by B, and check your answer. Note that you can also use the "multiplication of a row" operation to create a 1 immediately, but at the expense of creating fractions. Maple can cope with fractions ok, but I find that it means that more errors will occur if you try them by hand... If you want to practise some more you can create a random matrix as follows: > Seed:=randomize(): C:=RandomMatrix(3,4,generator=rand(-6..5)); Define > J:=Matrix([[-3, 1, -4], [2, 4, 3], [2, -1, 0]]); and > w:=Matrix(3,1,[1,8,4]); We can augment a column to our matrix J (but not make a dotted line unfortunately) using the "|" symbol: > J0:=< J | w >; Use the command Pivot (use help to find out how it works) to produce two zeros in column 2, then continue using Pivot until you have six zeros on the left of the dotted line. Try to see what the answer to this system of equation was as > v:= < number, number, number >; and check that you get w with the command "Multiply" as follows: > Multiply(J,v); If it isn't right, try predicting again until it works. We can also use the same pivots to produce the inverse: Create > JI:=< J | IdentityMatrix(3) >; and use the same pivots and then Row Operations to produce the Identity Matrix on the left where J was. You should get the same matrix as from > Ji:=MatrixInverse(J); Check that > Multiply(Ji,w); gives v as expected. Repeat the above steps to try to find the inverse of a 4x4. > L:=RandomMatrix(4,4,generator=rand(-1..1)); First see if L has determinant 0. > Determinant(L); If it does, repeat until you get a new L that will work. Pivot and use row operations on > LI:=< L | IdentityMatrix(4) >; Now we will look at how Maple copes with multiple solutions. Create a random matrix K0 to represent a 3x4 matrix equation and its solution vector: > K0:=RandomMatrix(3,5,generator=rand(-4..4)); Use Pivot and/or RowOperation to produce as many zeros and ones as possible in the first four columns. Unless you have a row of zeros you will have just one column you couldn't pivot. Now use your brain and/or pen and paper to predict the particular and homogeneous solutions and input them using > h:= < number, number, number, number >; and > p:= < number, number, number, number >; with the "number"s being your found values. Note that you can extra the 3x4 matrix K as follows > K:=DeleteColumn(K0,5); Start again with the same K0 but leave a different column unpivoted this time. Continue until you again have a different particular solution and notice that the homogeneous solution involves the same ratios between numbers. Notice how similar answers appear with the commands: > ReducedRowEchelonForm(K0); and > LinearSolve(K0,free='t'); Now find two homogeneous solutions of > Q0:=RandomMatrix(2,5,generator=rand(-4..4)); and check them and the particular solution by multiplication. Once you are done, call me over and I'll make sure you've got all of your answers correct. You can save your work in your H: drive and it will be available for you to consult in future labs.