用Mathematica函数复合:
- (*Define the mappings R1,R2,R3*)
- R1[{x_,y_,z_}]:=x y/(x+z+x y z);
- R2[{x_,y_,z_}]:=x+z+x y z;
- R3[{x_,y_,z_}]:=y z/(x+z+x y z);
- (*Define the mapping Rijk*)
- R[i_,j_,k_]:=Function[coords,Module[{result},result=coords;
- result[[i]]=R1[{coords[[i]],coords[[j]],coords[[k]]}];
- result[[j]]=R2[{coords[[i]],coords[[j]],coords[[k]]}];
- result[[k]]=R3[{coords[[i]],coords[[j]],coords[[k]]}];
- result]]
- (*verify R_{123}\circ R_{145}\circ R_{246}\circ R_{356}=R_{356}\circ R_{246}\circ R_{145}\circ R_{123} holds:*)
- Composition[R[3,5,6],R[2,4,6],R[1,4,5],R[1,2,3]][Table[Subscript[a,i],{i,6}]]==Composition[R[3,5,6],R[2,4,6],R[1,4,5],R[1,2,3]][Table[Subscript[a,i],{i,6}]]//Simplify
复制代码
|