Re: Can Mathematica construct a set of equations?
- To: mathgroup at smc.vnet.net
- Subject: [mg119329] Re: Can Mathematica construct a set of equations?
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Tue, 31 May 2011 07:45:01 -0400 (EDT)
n = 10; Using symbolic values so that you can see what is going on; the list of n points: pts = Table[{x[m], y[m]}, {m, n}]; The fifth point pts[[5]] {x[5], y[5]} The x value of the eighth point pts[[8, 1]] x[8] The y value of the ninth point pts[[9, 2]] y[9] All of the x values pts[[All, 1]] {x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10]} All of the y values pts[[All, 2]] {y[1], y[2], y[3], y[4], y[5], y[6], y[7], y[8], y[9], y[10]} The inequalities for pts are given by ineq = Thread[(Norm /@ (Subtract @@@ Subsets[pts, {2}])) <= d]; For any element of the above that you aren't familiar with, select it and press F1 Length[ineq] == Binomial[n, 2] True Looking at the seventh inequality ineq[[7]] Sqrt[Abs[x[1] - x[8]]^2 + Abs[y[1] - y[8]]^2] <= d Bob Hanlon ---- Ralph Dratman <ralph.dratman at gmail.com> wrote: ============= Given a set of N points Pn in the real plane, all within a distance d of each other, In vector notation, || Pj - Pk || <= d, 1 <= j,k <= N or written out, say for N=3, || P1 - P2 || <= d, || P2 - P3 || <= d, || P3 - P1 || <= d. That is fine for 3 points, but suppose I have 10. Then the long version is Choose[10,2] = 45 equations, and I don't particularly want to write them out by hand. Can Mathematica do that for me, and give me the equations in a notebook? I'm not even sure how to represent the position vectors so I can refer to xj or yk later on. How do I set up vector-sub-j and its components x-sub-j and y-sub-j ? Would that be a list of N lists of length 2? Or is there a more specific vector notation? Sorry to be so clueless. Thank you. Ralph