<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/163106</link>
    <title>MATLAB Central Newsreader - particle interaction</title>
    <description>Feed for thread: particle interaction</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2008 by The MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 04 Feb 2008 10:09:08 -0500</pubDate>
      <title>particle interaction</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/163106#412778</link>
      <author>matias nordin</author>
      <description>Hi everyone!&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I would like to distribute N particles on a line (symmetric&lt;br&gt;
boundaries) by a function, say f(x)=sin(x), so that a small&lt;br&gt;
value gives a small spatial distances while a large value&lt;br&gt;
gives a big spatial distance. In example if f(x)= constant,&lt;br&gt;
the spatial distance between all particles is the same. So&lt;br&gt;
f(x) acts as a potential and the particles repell each other.&lt;br&gt;
&lt;br&gt;
How to do?&lt;br&gt;
&lt;br&gt;
Thanks for reading and helping!&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;Matias&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Mon, 04 Feb 2008 17:52:32 -0500</pubDate>
      <title>Re: particle interaction</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/163106#412874</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;fo6o84$mcu$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
matias nordin &amp;lt;matias.nordin@gmail.com&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt;I would like to distribute N particles on a line (symmetric&lt;br&gt;
&amp;gt;boundaries) by a function, say f(x)=sin(x), so that a small&lt;br&gt;
&amp;gt;value gives a small spatial distances while a large value&lt;br&gt;
&amp;gt;gives a big spatial distance. In example if f(x)= constant,&lt;br&gt;
&amp;gt;the spatial distance between all particles is the same. So&lt;br&gt;
&amp;gt;f(x) acts as a potential and the particles repell each other.&lt;br&gt;
&lt;br&gt;
Hmmm, so let f(x) = 0. That's a constant. But 0 would seem&lt;br&gt;
to be a small value, so that would imply small spacial distances&lt;br&gt;
rather than the possibly-large spatial distances you would get&lt;br&gt;
if you had a small number of particles equidistant in the interval&lt;br&gt;
("the spatial distance between all particles is the same").&lt;br&gt;
&lt;br&gt;
Or let f(x) be -1. That's a constant too. But since f(x) acts&lt;br&gt;
as a repelling potential, a negative value would imply attraction,&lt;br&gt;
which would imply clumping rather than equidistance.&lt;br&gt;
&lt;br&gt;
Recall that you said "say f(x) = sin(x)" and recall that sin(x)&lt;br&gt;
can be negative.&lt;br&gt;
&lt;br&gt;
Sooo.. your problem does not yet appear to me to be well-defined.&lt;br&gt;
(The plausibility of the half-formed solutions that I have in mind&lt;br&gt;
will depend upon how you refine the problem.)&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;"Any sufficiently advanced bug is indistinguishable from a feature."&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;-- Rich Kulawiec&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Mon, 04 Feb 2008 18:31:05 -0500</pubDate>
      <title>Re: particle interaction</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/163106#412884</link>
      <author>Roger Stafford</author>
      <description>"matias nordin" &amp;lt;matias.nordin@gmail.com&amp;gt; wrote in message &amp;lt;fo6o84&lt;br&gt;
$mcu$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi everyone!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I would like to distribute N particles on a line (symmetric&lt;br&gt;
&amp;gt; boundaries) by a function, say f(x)=sin(x), so that a small&lt;br&gt;
&amp;gt; value gives a small spatial distances while a large value&lt;br&gt;
&amp;gt; gives a big spatial distance. In example if f(x)= constant,&lt;br&gt;
&amp;gt; the spatial distance between all particles is the same. So&lt;br&gt;
&amp;gt; f(x) acts as a potential and the particles repell each other.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; How to do?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks for reading and helping!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;   Matias&lt;br&gt;
-----------&lt;br&gt;
&amp;nbsp;&amp;nbsp;Perhaps you are saying something like this - that the density of the particles &lt;br&gt;
is to be inversely proportional to the given function, f(x).  Or in other words, &lt;br&gt;
that the integral of the reciprocal of the function is to be proportional to the &lt;br&gt;
accumulated particle count.  Would that be an accurate statement?&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;If so, that would precisely define the problem, but, depending on the &lt;br&gt;
function, it might not be easily solved.  For the sin(x) function you mentioned, &lt;br&gt;
it can be solved.  Assume that a and b are the left and right boundaries of &lt;br&gt;
your line and that 0 &amp;lt; a &amp;lt; b &amp;lt; pi.  If we also assume there is to be a particle &lt;br&gt;
at each boundary, you would want the x-value, xp, of the p-th particle to &lt;br&gt;
satisfy:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;(N-1)*int('csc(t)','t',a,xp) = (p-1)*int('csc(t)','t',a,b)&lt;br&gt;
&lt;br&gt;
where "int('csc(t)','t',a,b)" means the integral of the cosecant of t (which is the &lt;br&gt;
reciprocal of sin(t)) with respect to t from a to b.  Note that for xp = a this &lt;br&gt;
would give 0 on both sides, so p would be 1.  If xp = b, then p would be N.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;If I remember my calculus correctly, the two sides of the equation evaluate &lt;br&gt;
to&lt;br&gt;
&lt;br&gt;
&amp;nbsp;(N-1)*(log(tan(xp/2))-log(tan(a/2))) =&lt;br&gt;
&amp;nbsp;(p-1)*(log(tan(b/2))-log(tan(a/2)))&lt;br&gt;
&lt;br&gt;
We can therefore solve for xp&lt;br&gt;
&lt;br&gt;
&amp;nbsp;xp = 2*atan(exp(((p-1)*log(tan(b/2))+(N-p)*log(tan(a/2)))/(N-1)))&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;This translates in matlab to:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;p = 1:N;&lt;br&gt;
&amp;nbsp;x = 2*atan(exp(((p-1)*log(tan(b/2))+(N-p)*log(tan(a/2)))/(N-1)));&lt;br&gt;
&lt;br&gt;
which should generate the desired point spacing with vector x.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;You will note that for many functions, f(x), such a solution can become very &lt;br&gt;
much more difficult to find.&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 05 Feb 2008 00:04:34 -0500</pubDate>
      <title>Re: particle interaction</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/163106#412941</link>
      <author>ImageAnalyst</author>
      <description>On Feb 4, 5:09=A0am, "matias nordin" &amp;lt;matias.nor...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hi everyone!&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I would like to distribute N particles on a line (symmetric&lt;br&gt;
&amp;gt; boundaries) by a function, say f(x)=3Dsin(x), so that a small&lt;br&gt;
&amp;gt; value gives a small spatial distances while a large value&lt;br&gt;
&amp;gt; gives a big spatial distance. In example if f(x)=3D constant,&lt;br&gt;
&amp;gt; the spatial distance between all particles is the same. So&lt;br&gt;
&amp;gt; f(x) acts as a potential and the particles repell each other.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; How to do?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thanks for reading and helping!&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; =A0 Matias&lt;br&gt;
&lt;br&gt;
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=&lt;br&gt;
=3D=3D=3D=3D=3D=3D&lt;br&gt;
Of course there's an infinite number of functions that can do that.&lt;br&gt;
One other key question I wondered about is: do you want the points to&lt;br&gt;
be uniformly spaced, or have some noise in the spacing?&lt;br&gt;
Regards,&lt;br&gt;
ImageAnalyst&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Fri, 08 Feb 2008 15:31:03 -0500</pubDate>
      <title>Re: particle interaction</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/163106#413818</link>
      <author>matias nordin</author>
      <description>&lt;br&gt;
&amp;gt; Hmmm, so let f(x) = 0. That's a constant. But 0 would seem&lt;br&gt;
&amp;gt; to be a small value, so that would imply small spacial&lt;br&gt;
distances&lt;br&gt;
&amp;gt; rather than the possibly-large spatial distances you would get&lt;br&gt;
&amp;gt; if you had a small number of particles equidistant in the&lt;br&gt;
interval&lt;br&gt;
&amp;gt; ("the spatial distance between all particles is the same").&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Or let f(x) be -1. That's a constant too. But since f(x) acts&lt;br&gt;
&amp;gt; as a repelling potential, a negative value would imply&lt;br&gt;
attraction,&lt;br&gt;
&amp;gt; which would imply clumping rather than equidistance.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Recall that you said "say f(x) = sin(x)" and recall that&lt;br&gt;
sin(x)&lt;br&gt;
&amp;gt; can be negative.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Sooo.. your problem does not yet appear to me to be&lt;br&gt;
well-defined.&lt;br&gt;
&amp;gt; (The plausibility of the half-formed solutions that I have&lt;br&gt;
in mind&lt;br&gt;
&amp;gt; will depend upon how you refine the problem.)&lt;br&gt;
&amp;gt; -- &lt;br&gt;
&amp;gt;    "Any sufficiently advanced bug is indistinguishable&lt;br&gt;
from a feature."&lt;br&gt;
&amp;gt;    -- Rich Kulawiec&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Sorry, what I mean is the following.&lt;br&gt;
&lt;br&gt;
Assume you have N particles.&lt;br&gt;
Spread the particles equally on a line (with symmetrical&lt;br&gt;
boundaries).&lt;br&gt;
&lt;br&gt;
Then apply a function (some well defined function) that&lt;br&gt;
distorts the distance between the particles. The function is&lt;br&gt;
scaled so that particles don't come too close or too far&lt;br&gt;
apart. So you can choose that "in that area  the particles&lt;br&gt;
are at this distance from each other". So I want this:&lt;br&gt;
&lt;br&gt;
equally spread on [1 25] as [1  5  10 15 20]&lt;br&gt;
&lt;br&gt;
apply a function ---&amp;gt;&lt;br&gt;
&lt;br&gt;
not equally spread on [1 25] as for example [1 2 3 15 20].&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;Matias&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Fri, 08 Feb 2008 15:45:40 -0500</pubDate>
      <title>Re: particle interaction</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/163106#413823</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;fohsjn$4pu$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
matias nordin &amp;lt;matias.nordin@gmail.com&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt;Assume you have N particles.&lt;br&gt;
&amp;gt;Spread the particles equally on a line (with symmetrical&lt;br&gt;
&amp;gt;boundaries).&lt;br&gt;
&lt;br&gt;
&amp;gt;equally spread on [1 25] as [1  5  10 15 20]&lt;br&gt;
&lt;br&gt;
That is not equally spread on [1 25] with symmetrical boundaries.&lt;br&gt;
The distance from 20 to 1 is not the same as the distance from&lt;br&gt;
5 to 10, and the distance from 1 to 5 is not the same as the&lt;br&gt;
distance from 5 to 10. Try [1 6 11 16 21]&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;So you found your solution&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;What will be your last contribution?&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;-- Supertramp (Fool's Overture)&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Fri, 08 Feb 2008 17:17:16 -0500</pubDate>
      <title>Re: particle interaction</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/163106#413858</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;fohsjn$4pu$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
matias nordin &amp;lt;matias.nordin@gmail.com&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt;Assume you have N particles.&lt;br&gt;
&amp;gt;Spread the particles equally on a line (with symmetrical&lt;br&gt;
&amp;gt;boundaries).&lt;br&gt;
&lt;br&gt;
&amp;gt;Then apply a function (some well defined function) that&lt;br&gt;
&amp;gt;distorts the distance between the particles. The function is&lt;br&gt;
&amp;gt;scaled so that particles don't come too close or too far&lt;br&gt;
&amp;gt;apart. So you can choose that "in that area  the particles&lt;br&gt;
&amp;gt;are at this distance from each other". So I want this:&lt;br&gt;
&lt;br&gt;
&amp;gt;equally spread on [1 25] as [1  5  10 15 20]&lt;br&gt;
&lt;br&gt;
&amp;gt;apply a function ---&amp;gt;&lt;br&gt;
&lt;br&gt;
&amp;gt;not equally spread on [1 25] as for example [1 2 3 15 20].&lt;br&gt;
&lt;br&gt;
I still don't see how you are going to define this in terms&lt;br&gt;
of a function that could be positive or negative, such as&lt;br&gt;
in your example f(x) = sin(x) .&lt;br&gt;
&lt;br&gt;
If you restrict your function to non-negative values, and you&lt;br&gt;
ignore the boundaries for a moment, you could set the element&lt;br&gt;
positions at&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;X1 + (X1-X0) * Int(f(t),t=X0 to x) / Int(f(t),t=X0 to X1)&lt;br&gt;
&lt;br&gt;
where X0 and X1 are the boundary positions.&lt;br&gt;
&lt;br&gt;
Expressed in discrete terms,&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;X1 + (X1-X0) * (cumsum(f(x)) - f(X0)) / (sum(f(x)) - f(X0))&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;"History is a pile of debris"                     -- Laurie Anderson&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Fri, 08 Feb 2008 17:37:03 -0500</pubDate>
      <title>Re: particle interaction</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/163106#413863</link>
      <author>Roger Stafford</author>
      <description>"matias nordin" &amp;lt;matias.nordin@gmail.com&amp;gt; wrote in message &amp;lt;fohsjn$4pu&lt;br&gt;
$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Sorry, what I mean is the following.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Assume you have N particles.&lt;br&gt;
&amp;gt; Spread the particles equally on a line (with symmetrical&lt;br&gt;
&amp;gt; boundaries).&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Then apply a function (some well defined function) that&lt;br&gt;
&amp;gt; distorts the distance between the particles. The function is&lt;br&gt;
&amp;gt; scaled so that particles don't come too close or too far&lt;br&gt;
&amp;gt; apart. So you can choose that "in that area  the particles&lt;br&gt;
&amp;gt; are at this distance from each other". So I want this:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; equally spread on [1 25] as [1  5  10 15 20]&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; apply a function ---&amp;gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; not equally spread on [1 25] as for example [1 2 3 15 20].&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;   Matias&lt;br&gt;
---------&lt;br&gt;
&amp;nbsp;&amp;nbsp;Matias, you haven't yet told us precisely in what way your f(x) relates to the &lt;br&gt;
condition that "a small value gives a small spatial distances while a large &lt;br&gt;
value gives a big spatial distance".  In my previous article in this thread I &lt;br&gt;
speculated that in a sense the density of spacing of the particles is to be &lt;br&gt;
inversely proportional to f(x).  This leads to a problem that can be solved in a &lt;br&gt;
case such as your f(x) = sin(x).  The question is, was that a reasonable &lt;br&gt;
assumption?&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Mon, 11 Feb 2008 11:36:01 -0500</pubDate>
      <title>Re: particle interaction</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/163106#414202</link>
      <author>matias nordin</author>
      <description>"Roger Stafford" &amp;lt;ellieandrogerxyzzy@mindspring.com.invalid&amp;gt;&lt;br&gt;
wrote in message &amp;lt;foi3vv$ai6$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; "matias nordin" &amp;lt;matias.nordin@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fohsjn$4pu&lt;br&gt;
&amp;gt; $1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Sorry, what I mean is the following.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Assume you have N particles.&lt;br&gt;
&amp;gt; &amp;gt; Spread the particles equally on a line (with symmetrical&lt;br&gt;
&amp;gt; &amp;gt; boundaries).&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Then apply a function (some well defined function) that&lt;br&gt;
&amp;gt; &amp;gt; distorts the distance between the particles. The function is&lt;br&gt;
&amp;gt; &amp;gt; scaled so that particles don't come too close or too far&lt;br&gt;
&amp;gt; &amp;gt; apart. So you can choose that "in that area  the particles&lt;br&gt;
&amp;gt; &amp;gt; are at this distance from each other". So I want this:&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; equally spread on [1 25] as [1  5  10 15 20]&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; apply a function ---&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; not equally spread on [1 25] as for example [1 2 3 15 20].&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;   Matias&lt;br&gt;
&amp;gt; ---------&lt;br&gt;
&amp;gt;   Matias, you haven't yet told us precisely in what way&lt;br&gt;
your f(x) relates to the &lt;br&gt;
&amp;gt; condition that "a small value gives a small spatial&lt;br&gt;
distances while a large &lt;br&gt;
&amp;gt; value gives a big spatial distance".  In my previous&lt;br&gt;
article in this thread I &lt;br&gt;
&amp;gt; speculated that in a sense the density of spacing of the&lt;br&gt;
particles is to be &lt;br&gt;
&amp;gt; inversely proportional to f(x).  This leads to a problem&lt;br&gt;
that can be solved in a &lt;br&gt;
&amp;gt; case such as your f(x) = sin(x).  The question is, was&lt;br&gt;
that a reasonable &lt;br&gt;
&amp;gt; assumption?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Roger Stafford&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
yes Roger that assumption was what I was thinking of, that&lt;br&gt;
the density of spacing is inversely proportional to f(x).&lt;br&gt;
The function f(x) is also scaled so that it only takes&lt;br&gt;
positive values. So functions that takes negative values are&lt;br&gt;
&amp;nbsp;&amp;nbsp;simply lifted by a constant, in example for sin(x):&lt;br&gt;
f(x)=-sin(x)+constant.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
As a physicist I would like to treat the problem as follows:&lt;br&gt;
&lt;br&gt;
The particles are connected by springs all with the equal&lt;br&gt;
spring force so that in absence of f(x), they are equally&lt;br&gt;
distributed. And f(x) is introduced as a external potential&lt;br&gt;
&amp;nbsp;distorting the equal spacing. The dynamics is not of&lt;br&gt;
importance, only to find equilibrium. However as the number&lt;br&gt;
of particles can be altered I have a feeling that it would&lt;br&gt;
be cumbersome to do such a program (since the number of&lt;br&gt;
equations will change). So that stopped me from that idea.&lt;br&gt;
And now I am thinking of some easier way, as just&lt;br&gt;
multiplying the distance by 1/f(x)) and scale it until it&lt;br&gt;
fits within the boundaries. As you see the problem is not&lt;br&gt;
well defined yet, as I want to have an easy solution. Ideas&lt;br&gt;
would be of great interest.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;Matias&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Mon, 11 Feb 2008 20:39:55 -0500</pubDate>
      <title>Re: particle interaction</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/163106#414321</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;fopbv1$7p$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
matias nordin &amp;lt;matias.nordin@gmail.com&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt;As a physicist I would like to treat the problem as follows:&lt;br&gt;
&lt;br&gt;
&amp;gt;The particles are connected by springs all with the equal&lt;br&gt;
&amp;gt;spring force so that in absence of f(x), they are equally&lt;br&gt;
&amp;gt;distributed. And f(x) is introduced as a external potential&lt;br&gt;
&amp;gt; distorting the equal spacing. The dynamics is not of&lt;br&gt;
&amp;gt;importance, only to find equilibrium.&lt;br&gt;
&lt;br&gt;
Is the potential associated with the position (i.e., a field),&lt;br&gt;
or is the potential associated with the particle (e.g.,&lt;br&gt;
by varying the spring forces) ?&lt;br&gt;
&lt;br&gt;
Should we read that "springs" as implying that (in the&lt;br&gt;
absence of the external force) the dynamic potential between&lt;br&gt;
any two adjacent particles is proportional to the square of the&lt;br&gt;
distance between them?&lt;br&gt;
&lt;br&gt;
If the density is inversely proportional to the function,&lt;br&gt;
then adjusting the function by a constant (to avoid negative&lt;br&gt;
numbers) introduces non-linear distortions and the value of&lt;br&gt;
the constant would become crucial in determining the distribution.&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;"I was very young in those days, but I was also rather dim."&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;-- Christopher Priest&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 12 Feb 2008 09:02:02 -0500</pubDate>
      <title>Re: particle interaction</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/163106#414404</link>
      <author>matias nordin</author>
      <description>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in&lt;br&gt;
message &amp;lt;foqbqr$h35$1@canopus.cc.umanitoba.ca&amp;gt;...&lt;br&gt;
&amp;gt; In article &amp;lt;fopbv1$7p$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
&amp;gt; matias nordin &amp;lt;matias.nordin@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;As a physicist I would like to treat the problem as follows:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;The particles are connected by springs all with the equal&lt;br&gt;
&amp;gt; &amp;gt;spring force so that in absence of f(x), they are equally&lt;br&gt;
&amp;gt; &amp;gt;distributed. And f(x) is introduced as a external potential&lt;br&gt;
&amp;gt; &amp;gt; distorting the equal spacing. The dynamics is not of&lt;br&gt;
&amp;gt; &amp;gt;importance, only to find equilibrium.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Is the potential associated with the position (i.e., a field),&lt;br&gt;
&amp;gt; or is the potential associated with the particle (e.g.,&lt;br&gt;
&amp;gt; by varying the spring forces) ?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Should we read that "springs" as implying that (in the&lt;br&gt;
&amp;gt; absence of the external force) the dynamic potential between&lt;br&gt;
&amp;gt; any two adjacent particles is proportional to the square&lt;br&gt;
of the&lt;br&gt;
&amp;gt; distance between them?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If the density is inversely proportional to the function,&lt;br&gt;
&amp;gt; then adjusting the function by a constant (to avoid negative&lt;br&gt;
&amp;gt; numbers) introduces non-linear distortions and the value of&lt;br&gt;
&amp;gt; the constant would become crucial in determining the&lt;br&gt;
distribution.&lt;br&gt;
&amp;gt; -- &lt;br&gt;
&amp;gt;    "I was very young in those days, but I was also rather&lt;br&gt;
dim."&lt;br&gt;
&amp;gt;    -- Christopher Priest&lt;br&gt;
&lt;br&gt;
Thanks for the attention Walter!&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Yes, the potential is an external field. So we do not change&lt;br&gt;
the internal forces of the springs.&lt;br&gt;
&lt;br&gt;
And yes, the potential rising from the springs is&lt;br&gt;
proportional to the square of distance between them.&lt;br&gt;
&lt;br&gt;
Total potential from the springs:&lt;br&gt;
U_s=Sum_i(  (X_i-X_(i+1))^2 )&lt;br&gt;
&lt;br&gt;
note: the last particle is connected to the first, so we&lt;br&gt;
adjust the summation for that chriteria.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
external potential:&lt;br&gt;
&lt;br&gt;
U_e=g(X)&lt;br&gt;
&lt;br&gt;
..gives the total potential&lt;br&gt;
&lt;br&gt;
U_tot(X_1,X_2,...,X_N)=Us_+U_e&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
for what choordinates, X_1...X_N, is U_tot minimized?&lt;br&gt;
How is this treated in MATLAB?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;Matias&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 12 Feb 2008 18:56:59 -0500</pubDate>
      <title>Re: particle interaction</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/163106#414577</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;fornaa$e3h$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
matias nordin &amp;lt;matias.nordin@gmail.com&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt;Yes, the potential is an external field. So we do not change&lt;br&gt;
&amp;gt;the internal forces of the springs.&lt;br&gt;
&lt;br&gt;
&amp;gt;And yes, the potential rising from the springs is&lt;br&gt;
&amp;gt;proportional to the square of distance between them.&lt;br&gt;
&lt;br&gt;
&amp;gt;Total potential from the springs:&lt;br&gt;
&amp;gt;U_s=Sum_i(  (X_i-X_(i+1))^2 )&lt;br&gt;
&lt;br&gt;
As a side note: you could vectorize that. If you calculate&lt;br&gt;
xs = X.^2 then the squares portion would be&lt;br&gt;
xs(1) + xs(end) + 2*sum(xs(2:end-1))&lt;br&gt;
from which you would subtract 2*sum(X(2:end)*X(1:end-1))&lt;br&gt;
to get U_s .&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;gt;external potential:&lt;br&gt;
&lt;br&gt;
&amp;gt;U_e=g(X)&lt;br&gt;
&lt;br&gt;
&amp;gt;..gives the total potential&lt;br&gt;
&lt;br&gt;
&amp;gt;U_tot(X_1,X_2,...,X_N)=Us_+U_e&lt;br&gt;
&lt;br&gt;
However, if g(X) is constant, then the positions the particles&lt;br&gt;
would adopt would be the same as if g(X) were everywhere 0; does&lt;br&gt;
it make sense in that case to say that the total energy of the&lt;br&gt;
system is higher than if there were no external field? Perhaps&lt;br&gt;
it does, in that the field itself has energy, but in that case,&lt;br&gt;
it should be the integral of g(X) that you add rather than&lt;br&gt;
g(X) itself. The main competing alternative would be&lt;br&gt;
to calculate U_s and subtract from that the U_s that would occur&lt;br&gt;
if there was no field: the different between the two would be the&lt;br&gt;
total work that the field was exerting on the system.&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;"Tired minds don't plan well. Sleep first, plan later."&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-- Walter Reisch&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
