CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Wiki > CFD-Wiki talk:Format and style guide

CFD-Wiki talk:Format and style guide

From CFD-Wiki

(Difference between revisions)
Jump to: navigation, search
(Vector/Matrix formating)
m (Reverted edits by ElchiBocoa (Talk) to last version by Jasond)
 
(6 intermediate revisions not shown)
Line 1: Line 1:
 +
== Proposed addition to Mathematical formulas section ==
 +
* Three-dimensional vectors should be written either in tensor notation (e.g. "u_i" gives <math>u_i</math>) or in vector notation (e.g. "\vec{u}" gives <math>\vec{u}</math>).
 +
* Matrices should be written in bold math (\mathbf) to differentiate them from other variables (e.g. "\mathbf{A}" gives <math>\mathbf{A}</math>).  Matrices should be given upper case symbols, and vectors (matrices with one column or row) should be given lower case.  The elements of matrices should be written in lower case with subscripts.  For example:
 +
 +
:<math>\mathbf{A}\mathbf{x}=\mathbf{b}</math>
 +
 +
or
 +
 +
:<math>
 +
\left[
 +
\begin{matrix}
 +
  {a_{11} } & {a_{12} } & . & {a_{1n} }  \\
 +
  {a_{21} } & {a_{22} } & . & {a_{21} }  \\
 +
  . & . & . & .  \\
 +
  {a_{n1} } & {a_{n1} } & . & {a_{nn} }  \\
 +
\end{matrix}
 +
\right]
 +
\left[
 +
\begin{matrix}
 +
  {x_1 }  \\
 +
  {x_2 }  \\
 +
  .  \\
 +
  {x_n }  \\
 +
\end{matrix}
 +
\right]
 +
=
 +
\left[
 +
\begin{matrix}
 +
  {b_1 }  \\
 +
  {b_2 }  \\
 +
  .  \\
 +
  {b_n }  \\
 +
\end{matrix}
 +
\right]
 +
</math>
 +
 +
== Vector/Matrix formating ==
== Vector/Matrix formating ==
I (JasonD) propose that we edit a paragraph/blurb here on this until it comes to some steady state and then either go the forum with it or just move it to the style guide.
I (JasonD) propose that we edit a paragraph/blurb here on this until it comes to some steady state and then either go the forum with it or just move it to the style guide.
Line 6: Line 43:
* n-tuples (nx1 arrays) need to differentiated from matrices
* n-tuples (nx1 arrays) need to differentiated from matrices
* Elements of arrays/vectors are lower case with subscripts
* Elements of arrays/vectors are lower case with subscripts
 +
* matrices are upper case
Here are some open questions:
Here are some open questions:
-
* Exact way to differentiate n-tuples:
+
* Differentiation of n-tuples:
** \vec
** \vec
** \mathbf - this will avoid confusion with vectors in <math>R^3</math>
** \mathbf - this will avoid confusion with vectors in <math>R^3</math>
 +
** \mathrm - same as above
 +
* Differentiation of matrices
 +
** plain math (current)
 +
** \mathbf
 +
** \mathrm
* "Best" (for sake of consistency) letter to use as solution n-tuple
* "Best" (for sake of consistency) letter to use as solution n-tuple
** x is used in most of the linear algebra literature, so I (JasonD) think this would be best for the linear systems section.
** x is used in most of the linear algebra literature, so I (JasonD) think this would be best for the linear systems section.
Line 22: Line 65:
*<math> A\mathbf{x} = \mathbf{b} </math><br>
*<math> A\mathbf{x} = \mathbf{b} </math><br>
*<math> A\,\mathbf{x} = \mathbf{b} </math><br>
*<math> A\,\mathbf{x} = \mathbf{b} </math><br>
 +
*<math> A\mathrm{x} = \mathrm{b} </math><br>
 +
*<math> A\,\mathrm{x} = \mathrm{b} </math><br>
 +
*<math> \mathrm{A}\mathrm{x} = \mathrm{b} </math><br>
 +
*<math> \mathrm{A}\,\mathrm{x} = \mathrm{b} </math><br>
 +
*<math> \mathrm{A}\,\mathbf{x} = \mathbf{b} </math><br>
 +
*<math> \mathbf{A}\mathbf{x} = \mathbf{b} </math><br>
 +
*<math> \mathbf{A}\,\mathbf{x} = \mathbf{b} </math><br>
 +
*<math> \mathrm{A}\mathbf{x} = \mathbf{b} </math><br>
 +
* <math> \mathrm{A}\,\mathbf{x} = \mathbf{b}</math>  --[[User:Jola|Jola]] 17:18, 17 December 2005 (MST)
 +
 +
---------------------------------------------------------
 +
I would go with <br>
 +
<math> A\,\mathbf{x} = \vec{b} </math>. <br>
 +
Just kidding. although it seems a good combination of the above variations :P (Jonas, can we have some smileys in the forums?) <br>
 +
Okey, I see that the explicit vector notation is pretty good because the boldface doesn't appear really bold on the webpage (or something is messed up with my screen), in addition to the fact that we will most likely use this form of the equation two or three times (in the introduction, in the introduction again, and in the conclusion). So there will be no harm in presenting it in vector form. I always have a newbie in my mind, and we don't want them to get confused between vectors, matrices, and real numbers.
 +
*<math> A\,\vec{x} = \vec{b} </math><br>
 +
Is there still a hope for using <math>\phi</math> instead of x ? Both views are good. As Jason mentioned, it will be easier to check against some algorithmic implementations when using x, while on the other hand, phi is pretty well known in CFD circles denoting a generic scalar (to the extent that a professor once called me phi cos he didn't know my name! In this case, phi denoted a generic human!)<br>
 +
--[[User:Tsaad | Tony]]
 +
 +
---------------------------------------------------------
 +
I'd say "no" as to the uniform use of <math>\phi</math> - it'll cause too many problems with the iterative methods and greek letters.  I don't have a strong preference on the \vec or \mathbf issue.  I guess I'd lean towards \mathbf if I was forced to choose, mainly because looking at the various options, <math>\mathbf{A}\mathbf{x}=\mathbf{b}</math> looks best to me.  I moved Jonas's \mathrm matrix up with the others, and added a couple of others.  I think that we don't need the \, when all of the letters are romanized, but we do need it if either the matrix or the vector is in a font with a slant.  Did I miss any of the style permutations?  Shall we move in the general direction of a decision?
 +
 +
--[[User:Jasond|Jasond]] 11:24, 18 December 2005 (MST)

Latest revision as of 21:06, 17 December 2008

Proposed addition to Mathematical formulas section

  • Three-dimensional vectors should be written either in tensor notation (e.g. "u_i" gives u_i) or in vector notation (e.g. "\vec{u}" gives \vec{u}).
  • Matrices should be written in bold math (\mathbf) to differentiate them from other variables (e.g. "\mathbf{A}" gives \mathbf{A}). Matrices should be given upper case symbols, and vectors (matrices with one column or row) should be given lower case. The elements of matrices should be written in lower case with subscripts. For example:
\mathbf{A}\mathbf{x}=\mathbf{b}

or

 
\left[ 
\begin{matrix}
   {a_{11} } & {a_{12} } & . & {a_{1n} }  \\ 
   {a_{21} } & {a_{22} } & . & {a_{21} }  \\ 
   . & . & . & .  \\ 
   {a_{n1} } & {a_{n1} } & . & {a_{nn} }  \\ 
\end{matrix}
\right]
\left[ 
\begin{matrix}
   {x_1 }  \\ 
   {x_2 }  \\ 
   .  \\
   {x_n }  \\
\end{matrix}
\right]
=
\left[ 
\begin{matrix}
   {b_1 }  \\ 
   {b_2 }  \\ 
   .  \\
   {b_n }  \\
\end{matrix}
\right]


Vector/Matrix formating

I (JasonD) propose that we edit a paragraph/blurb here on this until it comes to some steady state and then either go the forum with it or just move it to the style guide.

Here's what we seem to agree on:

  • n-tuples (nx1 arrays) need to differentiated from matrices
  • Elements of arrays/vectors are lower case with subscripts
  • matrices are upper case

Here are some open questions:

  • Differentiation of n-tuples:
    • \vec
    • \mathbf - this will avoid confusion with vectors in R^3
    • \mathrm - same as above
  • Differentiation of matrices
    • plain math (current)
    • \mathbf
    • \mathrm
  • "Best" (for sake of consistency) letter to use as solution n-tuple
    • x is used in most of the linear algebra literature, so I (JasonD) think this would be best for the linear systems section.

Samples

  •  Ax = b
  •  A\,x = b
  •  A\vec{x} = \vec{b}
  •  A\,\vec{x} = \vec{b}
  •  A\mathbf{x} = \mathbf{b}
  •  A\,\mathbf{x} = \mathbf{b}
  •  A\mathrm{x} = \mathrm{b}
  •  A\,\mathrm{x} = \mathrm{b}
  •  \mathrm{A}\mathrm{x} = \mathrm{b}
  •  \mathrm{A}\,\mathrm{x} = \mathrm{b}
  •  \mathrm{A}\,\mathbf{x} = \mathbf{b}
  •  \mathbf{A}\mathbf{x} = \mathbf{b}
  •  \mathbf{A}\,\mathbf{x} = \mathbf{b}
  •  \mathrm{A}\mathbf{x} = \mathbf{b}
  •  \mathrm{A}\,\mathbf{x} = \mathbf{b} --Jola 17:18, 17 December 2005 (MST)

I would go with
 A\,\mathbf{x} = \vec{b} .
Just kidding. although it seems a good combination of the above variations :P (Jonas, can we have some smileys in the forums?)
Okey, I see that the explicit vector notation is pretty good because the boldface doesn't appear really bold on the webpage (or something is messed up with my screen), in addition to the fact that we will most likely use this form of the equation two or three times (in the introduction, in the introduction again, and in the conclusion). So there will be no harm in presenting it in vector form. I always have a newbie in my mind, and we don't want them to get confused between vectors, matrices, and real numbers.

  •  A\,\vec{x} = \vec{b}

Is there still a hope for using \phi instead of x ? Both views are good. As Jason mentioned, it will be easier to check against some algorithmic implementations when using x, while on the other hand, phi is pretty well known in CFD circles denoting a generic scalar (to the extent that a professor once called me phi cos he didn't know my name! In this case, phi denoted a generic human!)
-- Tony


I'd say "no" as to the uniform use of \phi - it'll cause too many problems with the iterative methods and greek letters. I don't have a strong preference on the \vec or \mathbf issue. I guess I'd lean towards \mathbf if I was forced to choose, mainly because looking at the various options, \mathbf{A}\mathbf{x}=\mathbf{b} looks best to me. I moved Jonas's \mathrm matrix up with the others, and added a couple of others. I think that we don't need the \, when all of the letters are romanized, but we do need it if either the matrix or the vector is in a font with a slant. Did I miss any of the style permutations? Shall we move in the general direction of a decision?

--Jasond 11:24, 18 December 2005 (MST)

My wiki