7.3. ComponentValue and TensorValues with independent values
Until now, the second list of the FoldedRules contained only trivial replacement rules such as → . It is very simple to specify values for the LHS, we just have to call ComponentValue with two arguments:
In[345]:=
Out[345]=
In[346]:=
Out[346]=
Notice what happens if we specify a dependent component
In[347]:=
Out[347]=
First the dependent rule is added and then the value (with a possible sign) is assigned to the corresponding independent component:
In[348]:=
Out[348]=
ComponentValue does not allow the user to introduce an inconsistent value
In[349]:=
Out[349]=
We switch the rule generation messages off
In[350]:=
ComponentValue is threaded on pairs of lists when it has two arguments. This allows us to generate all independent rules with just one command.
In[351]:=
Out[351]=
In[352]:=
Out[352]=
In[353]:=
Out[353]=
Created by Mathematica (May 16, 2008) |