Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2829 > unrolled thread

Re: Can Mathematica construct a set of equations?

Started byBob Hanlon <hanlonr@cox.net>
First post2011-05-31 11:45 +0000
Last post2011-05-31 11:45 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: Can Mathematica construct a set of equations? Bob Hanlon <hanlonr@cox.net> - 2011-05-31 11:45 +0000

#2829 — Re: Can Mathematica construct a set of equations?

FromBob Hanlon <hanlonr@cox.net>
Date2011-05-31 11:45 +0000
SubjectRe: Can Mathematica construct a set of equations?
Message-ID<is2kcf$qle$1@smc.vnet.net>
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@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


[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web