Need help setting up a list of equations using "matrix notation"
- To: mathgroup at yoda.physics.unc.edu
- Subject: Need help setting up a list of equations using "matrix notation"
- From: jmm at umich.edu
- Date: Wed, 6 Jul 1994 13:25:52 -0700 (PDT)
I am trying to set up a model to solve a system of equations. There are three different types of equations. For clarity and generality I want to express each equation type in "matrix notation", that is, as x == y, where x and y are both column vectors. Thus, I think I want to represent the following { {x1 == y1}, {x2 == y2}, . . . , {xn == yn}} in compact matrix notation. I am not succeeding. When I try to put together the 3 sets of equations (say, to feed to FindRoot), I am getting a mess. Here is a sample of how I try it. (rho and dL are 2x1 vectors; mu is 3x1; dZ is 3x2. Through the magic of Mathematica's matrix algebra, Dot[mu,dZ] or mu . dZ is 2x1) In[140]:= prices = rho - (gamma * (1 + dL) + (mu . dZ)) == ZeroMatrix[2,1] Out[140]= -200 + g1 -2200 + g2 mu1 mu2 {-(gamma (1 + --------- + ----------)) - --- + --- + 18750 37500 3 3 2 mu3 ----- + rho1, -(gamma 3 -200 + g1 -2200 + g2 mu1 2 mu2 (1 + --------- + ----------)) + --- + ----- + 37500 18750 3 3 mu3 --- + rho2} == {{0}, {0}} 3 So, if x and y are 2x1 vectors, I am basically get the following list: {{x1,x2} == {y1,y2}} (type A) When I need something in the form {{x1 == y1}, {x2 == y2}}. (type B) Obviously, I am not a wizard at list processing. Can someone point me towards a clean, elegant way to set up this vector of equations so that I can still use matrix notation and end up with an equation list (of type B) that I can combine with another equation list? (Alternative, a way to combine two lists of type A to make a single list that FindRoot would be happy with?) -- Prof. Jeff MacKie-Mason Dept. of Economics Jan-July 28 '94: California Energy Institute Univ. of Michigan 2539 Channing Way Ann Arbor, MI 48109-1220 Berkeley, CA 94720 internet: jmm at umich.edu phone: 510-642-3570 fax: 510-642-3570