       Re: how to set initial values to symbolic variable array?

• To: mathgroup at smc.vnet.net
• Subject: [mg129973] Re: how to set initial values to symbolic variable array?
• From: Tomas Garza <tgarza10 at msn.com>
• Date: Thu, 28 Feb 2013 21:28:02 -0500 (EST)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• Delivered-to: l-mathgroup@wolfram.com
• Delivered-to: mathgroup-newout@smc.vnet.net
• Delivered-to: mathgroup-newsend@smc.vnet.net
• References: <20130228044555.115C46877@smc.vnet.net>

```Perhaps something like this:
In:= Clear[a,r]
In:= Array[a,4]
Out= {a,a,a,a}
In:= f=a+a+a+a
Out= a+a+a+a
In:= r=Table[a[j]->1,{j,1,4}]
Out= {a->1,a->1,a->1,a->1}
In:= f/.r
Out= 4
-Tomas

> From: devout1977 at gmail.com
> Subject: how to set initial values to symbolic variable array?
> To: mathgroup at smc.vnet.net
> Date: Wed, 27 Feb 2013 23:45:55 -0500
>
>
> Dear All,
>
> Suppose I defined a symbolic variable array as
>
> Array[a,4]
>
> and defined a function as
>
> f = a + a + a + a
>
> I need to evaluate the value of f in the following way,
>
> f/.{a->1,a->1, ...}
>
> but specify each element of the array one by one is very troublesome, and I
> wonder whether there is something like a group definition like
>
> f/.{a[1:4]->1}
>
> to define the four variables at the same time with the same value.
>