MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to treat this false singular point?


simon yang wrote:
> Dear everyone,
> I have a function:
> f[x_]:=(x-x1)Log[Abs[x-x1]] + (x-x2)Log[Abs[x-x2]] + ... +
> (x-xn)Log[Abs[x-xn]],
> {x1,x2,...,xn}={100,200,300,...} for instance
> How to get value: f[x] as there are different singular at different x?
> I know at x=xn, f[x]==1, But Mathematica return: "Indeterminate", What
> should I do?
>  what others do in C++, Fortran ?

The easiest way would be

  Unprotect[Log]; Log[0] = 0; Log[0.] = 0; Protect[Log];

That would do what you want here, but might cause problems elsewhere.

Another way would be to define a new function

  xLog[0] = 0; xLog[0.] = 0; xLog[x_] := x*Log[Abs[x]]

Then

  f[x_] := Tr@Map[xLog,x-{100,200,...}]


  • Prev by Date: near Planck's mass
  • Next by Date: Re: How to treat this false singular point?
  • Previous by thread: Re: How to treat this false singular point?
  • Next by thread: Re: How to treat this false singular point?