I have two functions as numeric[x, t] and exact[x, t]. I want to create a table including 5 columns as follows and to export it to LATEX: (table formatting doesn't matter)
I use TeXForm
or ExportString[.., "TeX"]
but I can't get good results since the table includes exponential terms:
\[Rho] = 0.5;
numeric[x_, t_] :=
0.03125 (1 - 4 Sech[0.25 x]^2) +
0.0078125 t Sech[0.25 x]^4 Tanh[0.25 x] +
0.0078125 t Sech[0.25 x]^2 Tanh[0.25 x]^3 +
0.00012207 t^2 (-2.25 Sech[0.25 x]^4 + 2.25 Sech[0.25 x]^6 +
1. Sech[0.25 x]^8 + 4.5 Sech[0.25 x]^2 Tanh[0.25 x]^2 +
20.25 Sech[0.25 x]^4 Tanh[0.25 x]^2 -
22.5 Sech[0.25 x]^6 Tanh[0.25 x]^2 -
13.5 Sech[0.25 x]^2 Tanh[0.25 x]^4 -
16.5 Sech[0.25 x]^4 Tanh[0.25 x]^4 +
7. Sech[0.25 x]^2 Tanh[0.25 x]^6);
exact[x_, t_] :=
1/8 \[Rho]^2 (1 - 4*Sech[\[Rho]/2 (x + 1/2 (\[Rho]^2)*t)]^2);
t1 := Table[numeric[x, t] - exact[x, t], {x, 0, 2, .5}, {t, 0, 2, .5}]
TeXForm[t1]
ExportString[t1, "TeX"]