Re: An unknown Greek matrix
- To: mathgroup at smc.vnet.net
- Subject: [mg129984] Re: An unknown Greek matrix
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Sat, 2 Mar 2013 03:44:51 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-newout@smc.vnet.net
- Delivered-to: mathgroup-newsend@smc.vnet.net
On 2/28/13 at 9:26 PM, marshfeldman at gmail.com wrote: >Forgive me if this is obvious, but I'm a Mathematica newbie and have >given up trying to figure this out any other way. >I have the following defined matrices: >A = {{5, 0}, {0, 10}} B = {{6, 3}, {1, 12}} >and a row vector: >L = {{1, 1}}. >I don't know how to use Greek here, so I'll use "Lambda" as the name >of a row vector whose name is really the Greek letter lambda >capitalized and "lambda" for as the name of the elements of Lambda >subscripted, with the elements really being lower-case versions of >the Greek letter lambda and subscripts indicated by appending _n, >where n is the subscript (e.g. lambda_1 is lowercase lambda >subscripted with 1). In other words, You can enter Greek letters in one of two ways. Either by using the full name, i.e., \[Lambda] or by using the esc key as follows esc l esc Subscripts can also be entered using simple key strokes. But I am not going to do that here. Mathematica can be made to use subscripted variables as you would see in a text book. But IMO, usage of subscripted variables is more of an advanced Mathematica technique and more trouble than it is worth. >Lambda = {{lambda_1, lambda_2}}. >Now given the following equation, solve for Lambda: >Lambda B = Lambda A + L. >Also, display the elements of Lambda as >lambda_1 = -1 lambda_2 = 2. >Can one do this in Mathematica? How? So, I will show a solution without the subscripted variables. Also, it is highly recommended not to use a single upper case letter as a variable name. There are a several built-in functions which are named with a single upper case letter. Avoiding the use of single upper case letters as variable names ensures you will not have conflicts with built-in symbols and save you a lot of grief in the long run. So, here are your matrices In[1]:= a = {{5, 0}, {0, 10}}; b = {{6, 3}, {1, 12}}; In[3]:= l = {{1, 1}}; In[4]:= lambda = {{x, y}}; Now to set up the equation In[5]:= eq = lambda.b == lambda.a + l Out[5]= {{6*x + y, 3*x + 12*y}} == {{5*x + 1, 10*y + 1}} note the use of a double = which defines an equation in Mathemtica and the usage of '.' to tell Mathematica I want to perform a matrix multiplication rather than and element by element multiplication and the solution can be found with In[6]:= Solve[eq, {x, y}] Out[6]= {{x -> -1, y -> 2}}