MathGroup Archive 1998

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

Search the Archive

Re: Assigning a list to coefficients


"Toshiyuki Meshii" <tm60 at cornell.edu> writes

--------Begin message------
How can I assign a list to a coefficient with an index? That is, I have
a list A which has data A={a1, a2, a3, ....., an} all the components of
A is numerical value. And I want to assign the coefficients ci used in
f[x_]=Sum[ ci * x ,{i=1,n}] at the later stage to the list A.   How can
I do it?

I want to do some work such as differentiating f[x] symbolically, so I
do not want to use A[[i]] in the Sum.

-------End Message-------

Toshiyuki,
Here is an example of how to do what you want.

coefList = Table[Random[],{k,0,10}]
xList = Table[x^k,{k,0,10}]
f = Apply[Plus,coefList xList]
der1 = D[f,x]
der2 = D[f,{x,2}]

I arbitrarily have chosen the coefficients as a list of random numbers.
I hope this example helps. Best wishes!

Hugh Walker
University of Houston
Retired

Gnarly Oaks



  • Prev by Date: Re: Vectors
  • Next by Date: Re: Union question
  • Previous by thread: Assigning a list to coefficients
  • Next by thread: Re: Assigning a list to coefficients