Write2

Description

Write2[file, val1 = expr1, val2 = expr2, ...] writes the settings val1 = expr1, val2 = expr2 in sequence followed by a newline, to the specified output file. Setting the option FormatType of Write2 to FortranForm results in FORTRAN syntax output.

The continuation character for FORTRAN output can be controlled by changing $FortranContinuationCharacter.

[Graphics:Images/index_gr_1.gif]
[Graphics:Images/index_gr_2.gif]
[Graphics:Images/index_gr_3.gif]
[Graphics:Images/index_gr_4.gif]
[Graphics:Images/index_gr_5.gif]
[Graphics:Images/index_gr_6.gif]

See also: Isolate, PaVeReduce.

Examples
[Graphics:Images/index_gr_7.gif]
[Graphics:Images/index_gr_8.gif]
[Graphics:Images/index_gr_9.gif]

This writes the assignment r=t to a file.

[Graphics:Images/index_gr_10.gif]

This shows the contents of the file.

[Graphics:Images/index_gr_11.gif]
r = ( 4*a^4 - 8*a^3*(b + c) - 4*a*(b + c)*(b^2 + c^2) +
  (b^2 + c^2)^2 + 8*a^2*(b^2 + b*c + c^2)
       );
[Graphics:Images/index_gr_12.gif]
[Graphics:Images/index_gr_13.gif]
[Graphics:Images/index_gr_14.gif]
[Graphics:Images/index_gr_15.gif]
[Graphics:Images/index_gr_16.gif]
W[1] = (b + c
       );
W[2] = (b^2 + c^2
       );
W[3] = (b^2 + b*c + c^2
       );
r = ( 4*a^4 + x - 8*a^3*HoldForm[W[1]] -
  4*a*HoldForm[W[1]]*HoldForm[W[2]] + HoldForm[W[2]]^2 +
  8*a^2*HoldForm[W[3]]
       );
[Graphics:Images/index_gr_17.gif]

This is how to write out the expression t2 in Fortran format.

[Graphics:Images/index_gr_18.gif]
[Graphics:Images/index_gr_19.gif]
        W(1)= b + c
        W(2)= b**2 + c**2
        W(3)= b**2 + b*c + c**2
        r = 4*a**4 + x - 8*a**3*W(1) - 4*a*W(1)*W(2) + W(2)**2 +
     &  8*a**2*W(3)
                  
[Graphics:Images/index_gr_20.gif]


The FeynCalc Book   previousUnDeclareNonCommutative   nextZeta2

Converted from the Mathematica notebook Write2.nb