Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2007

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

Search the Archive

Re: A Problem with x[i_]:=

  • To: mathgroup at smc.vnet.net
  • Subject: [mg82988] Re: [mg82969] A Problem with x[i_]:=
  • From: DrMajorBob <drmajorbob at bigfoot.com>
  • Date: Tue, 6 Nov 2007 03:41:51 -0500 (EST)
  • References: <19456693.1194259250204.JavaMail.root@m35>
  • Reply-to: drmajorbob at bigfoot.com

Clear[x]
x[i_] := Total[-2 Log[(npdpd/v[i])^v[i]]]
list = x /@ Range[10]

{-2 + Log[(npdpd/v[1])^v[1]], -2 + Log[(npdpd/v[2])^v[2]], -2 +
   Log[(npdpd/v[3])^v[3]], -2 + Log[(npdpd/v[4])^v[4]], -2 +
   Log[(npdpd/v[5])^v[5]], -2 + Log[(npdpd/v[6])^v[6]], -2 +
   Log[(npdpd/v[7])^v[7]], -2 + Log[(npdpd/v[8])^v[8]], -2 +
   Log[(npdpd/v[9])^v[9]], -2 + Log[(npdpd/v[10])^v[10]]}

Total does nothing here unless npdpd and/or v[i] is a List.

Bobby

On Mon, 05 Nov 2007 04:03:05 -0600, John <jwa0 at lehigh.edu> wrote:

> The assignment, x=N[Total[-2Log[((n)(pdpd)/v[I])^v[i]]],10], executes
> for i=1,2,..,10, and I can make a list of the 10 outcomes by repeating
> the assignment 10 times.
>
> I thought that the assignment, x[i_]:=N{Total[-2Log[((n)(pdpd)/
> v[i])^v[i]]],10], would make a list of the 10 outcomes, without the
> necessity of manual repetitions, but Mathematica rejected it.
>
> The error message tells me that my assignment won't execute because
> times is protected.
>
> There must be some way to do what I want to do, but I can't figure it
> out.
>
> I am using Mathematica 6.
>
> John
>
>
>



-- 

DrMajorBob at bigfoot.com


  • Prev by Date: Re: Plot boundaries not respected
  • Next by Date: Re: NDSolve with functions of vectors
  • Previous by thread: Re: A Problem with x[i_]:=
  • Next by thread: Re: A Problem with x[i_]:=