In[]:=
Clear["Global`*"];
In[]:=
a=Array[
as
##
&,{2}]
Out[]=
{
as
1
,
as
2
}
In[]:=
a[[1]]=1;a[[2]]=1;
In[]:=
y=Array[
yi
##
&,{5,2}]
Out[]=
{{
yi
1,1
,
yi
1,2
},{
yi
2,1
,
yi
2,2
},{
yi
3,1
,
yi
3,2
},{
yi
4,1
,
yi
4,2
},{
yi
5,1
,
yi
5,2
}}
In[]:=
Gid=0;​​te=Array[
tem
##
&,{2}];​​Do[te[[i]]=0,{i,1,2}];​​y[[1,2]]=y[[2,2]]=y[[3,2]]=0;​​y[[4,1]]=y[[5,1]]=0;​​
In[]:=
Do[If[y[[j,i]]≠0,te[[i]]=te[[i]]+y[[j,i]]Log[y[[j,i]]],te[[i]]=te[[i]]+0],{j,1,5},{i,1,2}]
In[]:=
Do[te[[i]]=te[[i]]+y[[j,i]]Log[y[[j,i]]],{j,1,5},{i,1,2}]
Infinity
:Indeterminate expression 0(-∞) encountered.
Infinity
:Indeterminate expression 0(-∞) encountered.
Infinity
:Indeterminate expression 0(-∞) encountered.
General
:Further output of Infinity::indet will be suppressed during this calculation.
In[]:=
Do[Gid=Gid+RT*a[[i]]te[[i]],{i,1,2}]
​
In[]:=
Gid
Out[]=
Indeterminate