Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed.cs.wisc.edu!uwm.edu!elk.ncren.net!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: particle interaction
Date: Tue, 12 Feb 2008 18:56:59 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 40
Message-ID: <fosq5r$jup$1@canopus.cc.umanitoba.ca>
References: <fo6o84$mcu$1@fred.mathworks.com> <fopbv1$7p$1@fred.mathworks.com> <foqbqr$h35$1@canopus.cc.umanitoba.ca> <fornaa$e3h$1@fred.mathworks.com>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1202842619 20441 192.70.172.160 (12 Feb 2008 18:56:59 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Tue, 12 Feb 2008 18:56:59 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:450911


In article <fornaa$e3h$1@fred.mathworks.com>,
matias nordin <matias.nordin@gmail.com> wrote:

>Yes, the potential is an external field. So we do not change
>the internal forces of the springs.

>And yes, the potential rising from the springs is
>proportional to the square of distance between them.

>Total potential from the springs:
>U_s=Sum_i(  (X_i-X_(i+1))^2 )

As a side note: you could vectorize that. If you calculate
xs = X.^2 then the squares portion would be
xs(1) + xs(end) + 2*sum(xs(2:end-1))
from which you would subtract 2*sum(X(2:end)*X(1:end-1))
to get U_s .


>external potential:

>U_e=g(X)

>..gives the total potential

>U_tot(X_1,X_2,...,X_N)=Us_+U_e

However, if g(X) is constant, then the positions the particles
would adopt would be the same as if g(X) were everywhere 0; does
it make sense in that case to say that the total energy of the
system is higher than if there were no external field? Perhaps
it does, in that the field itself has energy, but in that case,
it should be the integral of g(X) that you add rather than
g(X) itself. The main competing alternative would be
to calculate U_s and subtract from that the U_s that would occur
if there was no field: the different between the two would be the
total work that the field was exerting on the system.
-- 
  "Tired minds don't plan well. Sleep first, plan later."
                                              -- Walter Reisch