suppose I have a long list of many variables: alist = { u, v, w, ... }. At some point, I have another combination of variables depending on { u, v, w, etc.},e.g., alpha = 2 * u + v beta = v + w^2. And now I want to substitute u, v, and w with the following expressions: u = 3 - x + y; v = Exp[y] + z; etc., where the right hand side ( say 3 - x + y ) is contained in another list of expressions, say blist[[1]] = 3 - x + y.
For the task stated above, I naively input alist[[i]] = blist[[i]], but obviously this will do the job. what it merely does is to assign 3 - x + y to alist[[1]] ( when i == 1 ).
I want to know if it is possible to treat alist[[1]] = 3 - x + y as a pattern rule: u = 3 - x + y rather than assign 3 - x + y to alist. Thank you !
array = {u, v, w}
Out[362]= {a, b, c}
alpha = 2 * u + v
array[[1]] = 2 x + y
In[367]:= u
u (* meant to be 2 u + y *)
In[368]:= alpha
alpha (* meant to be 4 x + 2 y + v *)
```
Rule
. $\endgroup$