CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Site Help, Feedback & Discussions (http://www.cfd-online.com/Forums/site-help-feedback-discussions/)
-   -   Guide: Writing Equations in LaTeX on the CFD Online Forums (http://www.cfd-online.com/Forums/site-help-feedback-discussions/62625-guide-writing-equations-latex-cfd-online-forums.html)

 pete March 15, 2009 15:58

Guide: Writing Equations in LaTeX on the CFD Online Forums

This is a brief introduction about how to write equations in the CFD Online discussion forums. The equation functionality is based on LaTeX, a versatile mathematical typesetting system which is often used to write scientific papers and books. With LaTeX mathematical equations are written using normal text and this makes it very suitable for a text-based forum like this. The forum will automatically generate images of the LaTeX codes it finds and display them properly. LaTeX often gives very nice looking formulas. LaTeX can be a bit difficult to get started with, but those who know it tend to like it very much. Here is a simple example to illustrate how it works:
• If you in your message write: $a = \sqrt{\gamma R T}$

• The forum will display:
A usefull feature in the forum is that the LaTeX code used to write an equation can be seen when you hoover with the pointer over it. If you click on an equation a window will be opened displaying the LaTeX code used to write it. This makes it easy to learn from other people and to copy-and-paste equations from other posts.

You can see how all equations on this page have been written either by hoovering over them with the pointer or by clicking on them!

LaTeX can be used in two ways:
• Normal equations written separately away from normal text: $LaTeX code$

• Inlined equations or symbols to be used inside a text: [imath]LaTeX code[/imath]
The difference is that inlined equations are scaled to fit better in normal text whereas normal equations are scaled to look good when written separately.

There is a special LaTeX reference tool avalable in the advanced editor which helps you to find the codes needed to write symbols, relations, operators etc. in LaTeX. To open the LaTeX reference click on the symbol to the right just above the editor window.

Below follows a summary of the most commonly used symbols, relations, operators and functions as well as a few other frequently asked questions. To see how these symbols or equations were created just click on the one you are interested in and a window will be opened showing the code used to create it:

Symbols

Lowercase Greek letters:

Capital Greek letters:

Operators and relations:

Misc:

Bracketing - () {} []

You can simply write the brackets you want. To get the correct size of the brackets you sometimes have to use the \left and \right keywords in front of the bracket.
For example, just writing parentheses gives , but with \left and \right keywords you would get .

Exponents and Subscripts

- $a_i^n$

- $x_{i+1}^{2^{n+1}}$

Functions - Fractions, Radicals, Integrals, Sums, Limits, ...

- $\frac{1}{2}$

- $\sqrt{x+y}$

- $\sqrt[n]{x}$

- $\int^\infty_0 f(x) \, dx$

- $\oint_\Gamma f(x) \, ds$

- $\sum_{i=1}^{\infty}\frac{1}{i}$

- $\lim_{x\to\infty}\frac{1}{x}$

Trigonometric and Logarithmic Functions

Please use these instead of simply typing in "sin". That ensures that the function is typeset properly with the right font and spacing.

- $\cos^2 x + \sin^2 x = 1$

- $\tanh(c)$

- $\log n^2$

- $\ln(e)$

Spacing

Sometime you may want to add extra horizontal space between characters. The following codes can be used to add extra space:
• a whitespace or no space at all gives a normal space ()
• \quad - a large space to separate equations or write conditions (i = 1, 2, 3) on the same line ()
• \; - a thick space ()
• \: - a medium space ()
• \, - a thin space ()
• \! - a negative thin space ()
Fluid Dynamics and CFD Related Examples
• Navier-Stokes Equations using Tensor Notation:

• Equations:

• Reynolds Averaging:

• Boussinesq Eddy Viscosity Assumption:
, or written more explicitly:

• Rhie-Chow Interpolation:

• Realisability and Schwarz' Inequality:

 lordmohit October 30, 2009 02:51

test

testing

 lordmohit October 30, 2009 03:03

 lordmohit October 30, 2009 03:04

 lordmohit October 30, 2009 03:06

 ComputerGuy December 31, 2010 02:03

Useful website for generating LaTeX equations

Enjoy: http://www.codecogs.com/latex/eqneditor.php

ComputerGuy

 Sha Liu November 6, 2011 23:56

cool. i often use mathematica to write equations. then they can be transform to latex form.

 stefanbj April 14, 2013 16:11

test test

 abbott.hn May 2, 2013 22:15

let me have a try:

and this " "inline equation

 sharonyue June 4, 2013 20:49

test

 jimbean October 24, 2013 12:58

test

 Betta May 6, 2014 21:18

why can't I use \^{\circ}C?

 Betta May 6, 2014 21:22

Quote:
 Originally Posted by Betta (Post 490228) why can't I use \^{\circ}C?
sorry. it works now.

 babakflame December 9, 2014 07:38

 Gary51075607 January 26, 2015 10:21

 Jerry L.D. Cheng January 29, 2015 21:51

Just to have a try

 flowAlways May 25, 2015 13:49

 DA6righthand June 13, 2015 10:18

I cannot figure this out. Where is my syntax error?

Here's what I typed between the bracketed math and /math:

\alpha\frac{\partial^2x}{\partial \xi^2}-2\beta \frac{\partial ^2x}{\partial \xi \partial \eta}+\gamma \frac{\partial ^2x}{\partial\eta^2}=0

\alpha\frac{\partial^2y}{\partial\xi^2}-2\beta\frac{\partial^2y}{\partial\xi\partial\eta}+ \gamma\frac{\partial^2y}{\partial\eta^2}=0

Here the images of what displays on the codehogs.com online eqn editor:

http://latex.codecogs.com/gif.latex?...rtial\eta^2}=0

http://latex.codecogs.com/gif.latex?...rtial\eta^2}=0

I don't understand why I'm getting an error on the forum. It's frustrating.

 pete June 15, 2015 16:39

Seems like the LaTeX functionality is broken after the server move on June 5. We will investigate and post a message in this thread once LaTeX is working again.

 DA6righthand June 15, 2015 16:58

Quote:
 Originally Posted by pete (Post 550474) Seems like the LaTeX functionality is broken after the server move on June 5. We will investigate and post a message in this thread once LaTeX is working again.
Thanks! I ended up posting equations as images obtained from the online LaTeX editor on codecogs.com but I found out I can post a maximum of 10 images.

All times are GMT -4. The time now is 20:27.