Message Boards Message Boards

0
|
2666 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Creating a table and exporting to LATEX

Posted 3 years ago

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) enter image description here 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"]
POSTED BY: rbrt cppr
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract