Friday, December 30, 2011

Moving the legend location in Maxima/Gnuplot

I had a plot where the function graph intersected the legend at its default position in the upper right hand corner.  I finally found a command which will move it to the lower right instead.  I'm sure you can move it to where you like, but this is the only one I found so far.  The command is:

[gnuplot_preamble,"set key bottom"]

For example,

plot2d([legendre_p(0, x), legendre_p(1, x), legendre_p(2, x),legendre_p(3, x), legendre_p(4, x), legendre_p(5, x)], [x, 0, 2], [y, -2, 5], [legend,"P_0 (x) = 1","P_1 (x) = x","P_2 (x) = (1/2)*(3*x^2 - 1)", "P_3 (x) = (1/2)*x*(5*x^2 - 3)","P_4 (x) = (1/8)*(35*x^4 - 30*x^2 + 3)","P_5 (x) = (1/8)*x*(63*x^4 - 70*x^2 + 15)" ], [ylabel,"P_n (x)"], [gnuplot_preamble,"set key bottom"]);

Found this here:

Editing axis and legend labels in Maxima/Gnuplot

The commands for editing the labels for the x and y axes in Maxima are:




where expr is the argument holder where you place your text for whatever label you are wanting.  The quotes " " are necessary.

The command for the legend label is:


where expr1, expr2, etc. are the argument holders where you place your text for whatever labels you are wanting depending on the number of legend labels.

These commands go inside your overall plot command.  For example,

plot2d(func, x, [xlabel,"expr"], [ylabel,"expr"], [legend,"expr1","expr2"])

Found these commands here:

Thursday, December 29, 2011

OpenFOAM and installation of ver. 2.1.0 in Ubuntu 11.10

I've been wanting to install and try this software for awhile now.  It is called OpenFOAM and is a free and open source CFD and numerical software.  While ANSYS Fluent and others are great and heavily developed, they are quite expensive and un-readily available to many users.  I've done some research and OpenFOAM seems to be the leader of the free world.  They seem to be very open and constantly updated and developed.

About the OpenFOAM Foundation
The OpenFOAM® Foundation is a non-stock corporation, incorporated on 5th August 2011 in Delaware, USA. It is a nonprofit organization whose “specific objectives and purposes... shall be to promote and manage the free open source distribution of the OpenFOAM software” (Bylaws, Article II). The Foundation has taken on the guardianship of the OpenFOAM software, previously undertaken by OpenCFD Ltd. Through its bylaws, it formalises the commitment, begun by OpenCFD in 2004, to ensure OpenFOAM is free and open source only. It is supported by SGI and lists Mark Barrenechea (CEO, SGI) and Henry Weller (creator of OpenFOAM) amongst its Board of Directors. 
The Foundation distributes the current repository version of OpenFOAM (and will distribute future ‘version’ releases of OpenFOAM) under the GNU general public licence (GPL). The GPL gives users the freedom to modify and redistribute the software and a guarantee of continued free use — as long as the terms of the GPL are adhered to. There are two elements to the GPL that provide protection against exploitation by companies including OpenFOAM within non-free and/or closed source software products. First, when any modified version of the software is redistributed, the source code must also be made available by the distributor. Secondly, any modified version can only legally be distributed open source under the GPL and software that links intimately enough to OpenFOAM has to be distributed under the GPL as well. 
People and organisations contribute to OpenFOAM on the understanding that their contributions become part of the public commons of free software and are not exploited by producers of non-free software. The Foundation exists to ensure this, adopting a suitably strong, open source license, i.e. the GPL. It will manage the software code base and promote the software, e.g. through its website, whose content will grow over time. OpenFOAM Foundation 15th August 2011

About OpenFOAM
The OpenFOAM® (Open Field Operation and Manipulation) CFD Toolbox is a free, open source CFD software package produced by OpenCFD Ltd. It has a large user base across most areas of engineering and science, from both commercial and academic organisations. OpenFOAM has an extensive range of features to solve anything from complex fluid flows involving chemical reactions, turbulence and heat transfer, to solid dynamics and electromagnetics. It includes tools for meshing, notably snappyHexMesh, a parallelised mesher for complex CAD geometries, and for pre- and post-processing. Almost everything (including meshing, and pre- and post-processing) runs in parallel as standard, enabling users to take full advantage of computer hardware at their disposal. 
By being open, OpenFOAM offers users complete freedom to customise and extend its existing functionality, either by themselves or through support from OpenCFD. It follows a highly modular code design in which collections of functionality (e.g. numerical methods, meshing, physical models, …) are each compiled into their own shared library. Executable applications are then created that are simply linked to the library functionality. OpenFOAM includes over 80 solver applications that simulate specific problems in engineering mechanics and over 170 utility applications that perform pre- and post-processing tasks, e.g. meshing, data visualisation, etc.

The OpenFOAM Team
The OpenFOAM Team produces the OpenFOAM® open source CFD toolbox and distributes it through the OpenFOAM Foundation. The OpenFOAM Team was formed at OpenCFD Ltd, a company established in 2004 to coincide with the release of its OpenFOAM software under general public licence. The company was founded by: Henry Weller, the creator of OpenFOAM and its chief developer from inception to the present day; Chris Greenshields; and, Mattijs Janssens. In 2011, the team moved to SGI Corp, following its acquisition of OpenCFD Ltd.

OpenFOAM Services:
The OpenFOAM Team has unrivalled experience with OpenFOAM. Over the past 7 years they have successfully provided services to numerous science/engineering companies, consultancies and universities. Developments: written over half a million of lines of code. Support: delivered over 10,000 hours of support. Training: delivered over 100 training courses to over 1000 OpenFOAM users. The OpenFOAM Team is Henry Weller, Chris Greenshields, Mattijs Janssens, Andy Heather, Sergio Ferraris, Jenya Collings, Gijs Wierink and Laurence McGlashan.

I recommend you check this out if you are interested in a free CFD simulator.  While it may not have all the bells and whistles of Fluent or other similar software, but I bet you can get just as much done and in the process understand what you are doing much better as it can be the tendency to treat more fancy software as a black box.  OpenFOAM has meshing and post processing capabilities (ParaView), supports many imports of meshes from other software, has many solvers, many models, and many libraries, it also has great documentation, tutorials, and community support.  Training and customer support is also offered.

To install OpenFOAM simply go to where they have choices of the Ubuntu Deb Pack, SuSE RPM Pack, the Source Pack, and the Git Repository.  Luckily for us, I am using Ubuntu 11.10 so I simply went to their page for that installation here:

I followed the instructions and had no problems until I got to the end where it says Getting Started.  It seems to assume that a directory exist in your home directory called OpenFOAM.  However, this is not where OpenFOAM was installed as you can see it is installed in /opt/openfoam210 instead.  So you need to first create the directory OpenFOAM in your home folder then everything else should be fine in the directions.

This is the link for the documentation (tutorials and more):

One downside to OpenFOAM is that it is not cross platform.  It only works on Linux such as Ubuntu, Fedora, SuSE, etc.

Here is a screen shot showing that OpenFOAM installed into the opt directory.

Here is a screen shot showing the /home/timbarber/OpenFoam/timbarber-2.1.0/run/tutorial tree.  This is the step where the tutorial material is copied from the /opt/openfoam210 directory.

Here is the message I get after editing the .bashrc file then either typing source $HOME/.bashrc and then typing icoFoam -help or opening a new terminal window then typing icoFoam -help

Screen shot after running blockMesh in the cavity directory.

Viewing the mesh in ParaView by typing paraFoam in the terminal.

After following the instructions on OpenFOAM's user document web page, this is a view of the mesh.

Monday, December 26, 2011

Differentiation in Maxima

Mathematica is a great piece of software.  You can do many things with it mathematically.  However, it is not free and not always available.  I am trying to find some replacements that are free, cross-platform, readily available, relatively easy to use.

I have been trying at Maxima using the wxMaxima interface and have been quite pleased with it.  So far I have been able to graph functions related to my research.  However, Mathematica is pretty powerful as you can do differentiation, integration, etc. with ease.  Just recently, I tried the differentiation ability of Maxima.  It is possible to do differentiation in Maxima.  So far I have only tried a simple polynomial.  The command for differentiation is:

diff(expr, x)

Here is a screen shot of some examples I did.

Now if I could figure out if and how to simplify the last expression.  If Maxima can do that, then it is a very viable option to Mathematica for several things.

I found this differentiation command at

Update:  So as you might have noticed I got a great tip in the comments on how to simplify this fraction.  The tip comes from Mike Croucher who has a great, insightful blog which I must admit I don't read often enough due to time but check it out anyways.  It is well established and post similar topics yet more advanced and involved examples.

Sunday, December 25, 2011

Legendre functions (also associated) of the first and second kind in Maxima

In order to do Legendre functions in Maxima the command is

legendre_p(n, x)

where n is the degree of the polynomial.  For example, for the Legendre polynomial of the first kind of the 5th degree simply type legendre_p(5, x).

For the Legendre function of the second kind the command is

legendre_q(n, x)

For the associated Legendre functions where there is also an order, m, in addition to the degree, n, to specify. Remember that regular Legendre functions are just associated Legendre functions of order 0.

assoc_legendre_q(n, m, x)

assoc_legendre_q(n, m, x)

Here are some links to these commands and more special functions and orthogonal functions/polynomials.

Although this link^ has the regular Legendre function with an order which is not needed.  It is listed as

legendre_p(n, m, x)

where it should just be like it is posted above.

Friday, December 23, 2011

Legendre polynomials of the first kind, plots of degrees n = 0, 1, 2, 3, 4, 5

\( P_0 \left( x \right) = 1 \)

\( P_1 \left( x \right) = x \)

\( P_2 \left( x \right) = \dfrac{1}{2} \left( 3 x^2 - 1 \right) \)

\( P_3 \left( x \right) = \dfrac{1}{2} x \left( 5 x^2 - 3 \right) \)

\( P_4 \left( x \right) = \dfrac{1}{8} \left( 35 x^4 - 30 x^2 + 3 \right) \)

\( P_5 \left( x \right) = \dfrac{1}{8} x \left( 63 x^4 - 70 x^2 + 15 \right) \)

\( P_0 \left( x \right), P_1 \left( x \right), P_2 \left( x \right), P_3 \left( x \right), P_4 \left( x \right), P_5 \left( x \right) \)

Code for last graph in wxMaxima:

plot2d([legendre_p(0, x), legendre_p(1, x), legendre_p(2, x),legendre_p(3, x), 
legendre_p(4, x), legendre_p(5, x)], [x, -2, 2], [y, -2, 2], 
[legend,"P_0 (x) = 1","P_1 (x) = x","P_2 (x) = (1/2)*(3*x^2 - 1)",
"P_3 (x) = (1/2)*x*(5*x^2 - 3)","P_4 (x) = (1/8)*(35*x^4 - 30*x^2 + 3)",
"P_5 (x) = (1/8)*x*(63*x^4 - 70*x^2 + 15)" ], [ylabel,"P_n (x)"], [gnuplot_preamble,"set key bottom"]);

Legendre - DE, functions and polynomials of the first and second kind, associated Legendre functions

Legendre equation, function, and polynomial links (also contains properties and more).

The Legendre differential equation is of the form:

\[ \dfrac{\mathrm{d}}{\mathrm{d}x} \left[ \left( 1 - x^2 \right) \dfrac{\mathrm{d} F}{\mathrm{d}x} \right] + n \left( n + 1 \right) F \]


\[ \left( 1 - x^2 \right) F'' - 2 x F' + n \left( n + 1 \right) F = 0  \]

which has the general solution of

\[ C_1 P_n \left( x \right) + C_2 Q_n \left( x \right) \]

where \( P_n \left( x \right) \) is the Legendre function of the first kind, \( Q_n \left( x \right) \), and \( n \) is a non-negative integer which is also the degree of the Legendre polynomial.

A more general equation is the associated Legendre differential equation in the form of:

\[ \left( 1 - x^2 \right) F'' - 2 x F' + \left[ n \left( n + 1 \right) - \dfrac{m^2}{1 - x^2} \right] F = 0 \]

which has the general solution of

\[ C_1 P_n^m \left( x \right) + C_2 Q_n^m \left( x \right) \]

where \( P_n \left( x \right) \) is the associated Legendre function of the first kind, \( Q_n \left( x \right) \) is the associated Legendre function of the second kind, \( n \) is a non-negative integer, the degree of the Legendre polynomial, and \( m \) is also a non-negative integer which determines the degree of the Legendre functions/polynomials.

When the degree is zero, \( m = 0 \), the associated Legendre functions,  \( P_n^0 \left( x \right) \) and \( Q_n^0 \left( x \right) \), return the regular Legendre functions, \( P_n \left( x \right) \) and \( Q_n \left( x \right) \)

The Legendre DE can be solved by a power series expansion method also called the Frobenius method.

The difference between Legendre polynomials and functions is that when the \( n \)th-degree is an integer the Legendre function converges to a polynomial on the interval \( -1 \le x \le 1 \).

For associated Legendre functions of odd integers where \( m \le n \), the function contains \( \sqrt{1 - x^2} \) which demotes the function from a polynomial.

The Legendre equation usually arises in physics problems when the separation of variables method is applied the PDE Laplace's equation in spherical polar coordinates.

\[ \dfrac{1}{\sin \phi} \dfrac{\mathrm{d}}{\mathrm{d}\phi} \left( \sin \phi \dfrac{\mathrm{d} F}{\mathrm{d}\phi} \right) +  \left[ n \left( n + 1 \right) - \dfrac{m^2}{\sin^2 \phi} \right] F = 0 \]

Where \( \phi \) is the colatitudinal angle and the substitution \( x = \cos \phi \) recovers the previous Legendre equation version.

Derivative Tables and Properties - links

Here are some useful links when you need that derivative you always forget.

6 Best BURG Themes and How to Install BURG Themes in Ubuntu 11.10? | Tech Drive-in

I thought I'd share this. It seems pretty cool and I'd thought it would be nice to spread since this is a good way for us to learn about new and different things.
BURG is basically a boot loader for Linux based on GRUB. Burg has a highly configurable menu system which works in both text and graphic mode. Simply put, BURG can be extensively customized and there are a number of good quality BURG themes available all over the web for free. Lets find out the best among them and also see how to install BURG and the following BURG themes in Ubuntu 11.10.
I like this because it looks like a nice way to handle multiple installations of Linux and other OSs such as Mac and Windows.

6 Best BURG Themes and How to Install BURG Themes in Ubuntu 11.10? | Tech Drive-in

Wednesday, November 30, 2011

Bessel function and equation properties (links)

Some useful links on Bessel functions, the equation, and their properties.  Later on down the road, I will try to post the properties and discuss the Bessel equation and the Bessel functions for archiving purposes.

For now, here are the links:

Integration tables (links)

Some sites that have integration tables (I will manually post them later):

Some helpful links on differential equations (DE)

Here are some links to sites which I find helpful when I need a refresher in differential equations.  Hopefully, one day I can post about some of these things for archival purposes.

Second Order Differential Equations -

DE page -

^ This site is pretty good in general and covers many mathematical topics such as trig, algebra, DE, Calculus, etc.

Second-Order Linear Ordinary Differential Equations -

Web Study Guide for Ordinary Differential Equations -

^ Also a good general DE site from Oregon State University.

Differential Equations (Math 3301) -

^ Paul's Online Math Notes - a very good math site too -

Of course MathWorld by Wolfram -

Saturday, November 26, 2011

Editing caption options in LaTeX using the caption package

So I am submitting some of my work to a journal, and the journal has certain stipulations for their format style.  On example is the caption labels had to have subfloat lables left justified instead of the default centered and the caption label needs to be FIGURE 1. instead of Figure 1:

First initialize the caption package in the preamble:


See the CTAN link for the pdf and more information on the caption package.

In order to left justify the subfloat label "a)" use the command:


(I forgot where I found this).

In order to use this per figure, place the following command in the float like:


In order to change the colon to a period use:


and in order to change to the small caps format use:


and within the figure place:

\captionsetup{labelsep=period, labelfont=sc}

You can also place the options in the preamble so that all figures take the changes:

\usepackage[labelsep=period, labelfont=sc]{caption}

Although I don't know how to implement the subfloat changes like this in the preamble.

Here is the code and image examples:

\subfloat[]{\label{fig:fig_10a_axial_velocity_for_alpha_30_at_4_z_loc_w_1_over_1} \includegraphics[scale = 0.8]{fig_10a_axial_velocity_for_alpha_30_at_4_z_loc_w_1_over_1.png}}
\subfloat[]{\label{fig:fig_10b_axial_velocity_for_alpha_45_at_4_z_loc_w_1_over_1} \includegraphics[scale = 0.8]{fig_10b_axial_velocity_for_alpha_45_at_4_z_loc_w_1_over_1.png}}
\caption{Axial velocity distribution shown at several axial positions and divergence angles of (a) $ 30^{\circ} $ and (b) $ 45^{\circ} $.} \label{fig:fig_10_axial_vel}




\subfloat[]{\label{fig:fig_10a_axial_velocity_for_alpha_30_at_4_z_loc_w_1_over_1} \includegraphics[scale = 0.8]{fig_10a_axial_velocity_for_alpha_30_at_4_z_loc_w_1_over_1.png}}

\subfloat[]{\label{fig:fig_10b_axial_velocity_for_alpha_45_at_4_z_loc_w_1_over_1} \includegraphics[scale = 0.8]{fig_10b_axial_velocity_for_alpha_45_at_4_z_loc_w_1_over_1.png}}

\captionsetup{labelsep=period, labelfont=sc}

\caption{Axial velocity distribution shown at several axial positions and divergence angles of (a) $ 30^{\circ} $ and (b) $ 45^{\circ} $.} \label{fig:fig_10_axial_vel}


sin(x) + cos(x)

\( \sin x + \cos x \)

Code for Maxima:

f(x) := sin(x) + cos(x)
plot2d(f(x), [x, 0, 7], [y, -2, 2]);

sin(x) - cos(x)

\( \sin x - \cos x \)

Code for Maxima:

f(x) := sin(x) - cos(x)
plot2d(f(x), [x, 0, 7], [y, -2, 2]);

Friday, November 25, 2011


\( \tan x \)

Code for Maxima:

plot2d(tan(x), [x, 0, 7], [y, -2, 2]);

sin(x) + cos(x)

\( \sin x + \cos x \)

Code for Maxima:

plot2d(sin(x)+cos(x), [x, 0, 7]);

Bessel function of the second kind, orders 0, 1, 2

\( Y_0 \left( x \right) \)

Code to plot in wxMaxima:
plot2d(bessel_y (0, x), [x, 0, 20], [y, -2, 1]);

\( Y_1 \left( x \right) \)

Code to plot in wxMaxima:
plot2d(bessel_y (1, x), [x, 0, 20], [y, -2, 1]);

\( Y_2 \left( x \right) \)

Code to plot in wxMaxima:
plot2d(bessel_y (2, x), [x, 0, 20], [y, -2, 1]);

\( Y_0 \left( x \right), \quad Y_1 \left( x \right), \quad Y_2 \left( x \right) \)

Code to plot in wxMaxima:
plot2d([bessel_y (0, x), bessel_y (1, x), bessel_y (2, x)], [x, 0, 20]);

Bessel functions of the first kind, orders 0, 1, 2

Since Lybniz only recognizes the python standard math library, I used wxMaxima to plot the Bessel functions.

\( J_0 \left( x \right) \)

Code to plot in wxMaxima:
plot2d(bessel_j (0, x), [x, 0, 20]);

\( J_1 \left( x \right) \)

Code to plot in wxMaxima:
plot2d(bessel_j (1, x), [x, 0, 20]);

\( J_2 \left( x \right) \)

Code to plot in wxMaxima:
plot2d(bessel_j (1, x), [x, 0, 20]);

\( J_0 \left( x \right), \quad J_1 \left( x \right), \quad J_2 \left( x \right) \)

Code to plot in wxMaxima:
plot2d([bessel_j (0, x), bessel_j (1, x), bessel_j (2, x)], [x, 0, 20]);

Bessel function syntax in Maxima

The commands for Bessel functions in Maxima are:

Bessel function 1st kind: \( J_n \left( x \right) \)
bessel_j (index, expr)

Bessel function 2nd kind: \( Y_n \left( x \right) \)
bessel_y (index, expr)

Modified Bessel function 1st kind: \( I_n \left( x \right) \)
bessel_i (index, expr)

Modified Bessel function 2nd kind: \( K_n \left( x \right) \)
bessel_k (index, expr)

Thursday, November 24, 2011


\( \sinh x \)


\( \cosh x \)


\( x^2 \ln x \)


I'm going to make some post about some functions for reference.  This one is on the function combo

\( \sin^2 x \; \cos^2 x \)

Lybniz - functions sytax

Here is the website for the Lybniz plotting program.  Apparently it uses the Python programming syntax.

Here is the link to the Python math library for the explanation of what the function syntax does.

Increasing the division bar length for a fraction in LaTeX math mode

I couldn't find any specific command to increase the length of the division bar when displaying fractions in LaTeX.  My problem was this

\dfrac{\dfrac{\partial^2 C_1}{\partial R^2}}{\dfrac{\partial C_1}{\partial R}}

\[ \dfrac{\dfrac{\partial^2 C_1}{\partial R^2}}{\dfrac{\partial C_1}{\partial R}} \]

So I just manually added some space around the function like this.  You don't have to do it for the bottom (it doesn't work vice versa with the top if you have the space on the bottom).  I just did because I am somewhat OCD, :P.

\dfrac{\hspace{0.25 cm}\dfrac{\partial^2 C_1}{\partial R^2} \hspace{0.25 cm}}{\hspace{0.25 cm} \dfrac{\partial C_1}{\partial R} \hspace{0.25 cm}}

\[ \dfrac{\hspace{0.25 cm}\dfrac{\partial^2 C_1}{\partial R^2} \hspace{0.25 cm}}{\hspace{0.25 cm} \dfrac{\partial C_1}{\partial R} \hspace{0.25 cm}} \]
\dfrac{\hspace{0.25 cm}\dfrac{\partial^2 C_1}{\partial R^2} \hspace{0.25 cm}}{\dfrac{\partial C_1}{\partial R}}

\[ \dfrac{\hspace{0.25 cm}\dfrac{\partial^2 C_1}{\partial R^2} \hspace{0.25 cm}}{\dfrac{\partial C_1}{\partial R}} \]
\dfrac{\dfrac{\partial^2 C_1}{\partial R^2}}{\hspace{0.25 cm} \dfrac{\partial C_1}{\partial R} \hspace{0.25 cm}}

\[ \dfrac{\dfrac{\partial^2 C_1}{\partial R^2}}{\hspace{0.25 cm} \dfrac{\partial C_1}{\partial R} \hspace{0.25 cm}} \]

Tuesday, November 22, 2011

Table of Trigonometric Identities

A website I frequent when looking for trigonometric identities and properties

Table of Trigonometric Identities

Some of the ones I often use:

\[ \sin^2 \phi + \cos^2 \phi = 1 \]

\[1 + \tan^2 \phi = \sec^2 \phi \]

\[ 1 + \cot^2 \phi = \csc^2 \phi \]

Lybniz vs KAlgebra for graph visualization/plotting

In my work I sometimes need to quickly visualize a simple function, and software like Mathematica and Maxima seem to be a bit of overkill so I decided to try some simple plotting programs in Ubuntu from the SC.

The first, which I have evaluated before, is KAlgebra.  It's not too bad and has an upside in that it can also do calculations.  However, I don't really like the plot style.   This is an example for \( \sin^2 x \cos^2 x \).

So I typed in "graph" or "plot" in the SC and cam across the Lybniz graph plotting software.  It only plots  so it doesn't calculate like KAlgebra can and then show you a graph.  I like how Lybniz looks better than KAlgebra.  It doesn't have many options.  I wish you could thicken the line a bit, but it does let you zoom in better than KAlgebra.  Same example.

Saturday, November 19, 2011

Complement vs Compliment - e Learn English Language

A little English language for this post. As a writer, albeit scientific, I have problems with some things and I try to try to stay on top of them. I will occasionally post about writing better. Of course, don't hold me to the fire because there is a time to be proper and other times when it is ok not to be (conversation such as chatting through a internet messenger, texting, blogs, etc).

This one is on the difference between complement and compliment.

Complement vs Compliment - e Learn English Language

Complement - to match well with something

Compliment - to flatter or praise

Tuesday, November 15, 2011

LaTeX - Formatting - Text size

Here is a quick list of possible font size commands in LaTeX:

For selective font sizing use for example: {\Large blah, blah, blah}

\( {\Large \text{Large}} \; \text{normal} \)


\( \tiny \text{tiny} \)


\( \scriptsize \text{scriptsize} \)


\( \footnotesize \text{footnotesize} \)


\( \small \text{small} \)


\( \normalsize \text{normalsize} \)


\( \large \text{large} \)


\( \Large \text{Large} \)


\( \LARGE \text{LARGE} \)


\( \huge \text{huge} \)


\( \Huge \text{Huge} \)

LaTeX - align environment and equation numbering including \nonumber

I also posted this in the original, yet older, post on where I introduced the align environment.

In order to have the equation number at the end of a long, multi-line equation use the command \nonumber right before you end the line with the double slashes

\dfrac{\partial^2 T \left( x, t + \dfrac{\Delta t}{2} \right)}{\partial x^2} = &\dfrac{1}{2} \left[ \dfrac{T \left( x + \Delta x, t + \Delta t \right) - 2 T \left( x, t + \Delta t \right) + T \left( x - \Delta x, t + \Delta t \right)}{\Delta x^2} \right. \nonumber \\ &\left. + \dfrac{T \left( x + \Delta x, t \right) - 2 T \left( x, t \right) + T \left( x - \Delta x, t \right)}{\Delta x^2} \right]  + O \left( \Delta x^2 \right)

In order to center the equation number, surround the array environment with an equation environment

\dfrac{\partial^2 T \left( x, t + \dfrac{\Delta t}{2} \right)}{\partial x^2} = &\dfrac{1}{2} \left[ \dfrac{T \left( x + \Delta x, t + \Delta t \right) - 2 T \left( x, t + \Delta t \right) + T \left( x - \Delta x, t + \Delta t \right)}{\Delta x^2} \right. \\ &\left. + \dfrac{T \left( x + \Delta x, t \right) - 2 T \left( x, t \right) + T \left( x - \Delta x, t \right)}{\Delta x^2} \right]  + O \left( \Delta x^2 \right)

Monday, November 14, 2011

LaTeX - Math Mode - Delimiter sizes

In order to control bracket sizes by command type


\( \big( \)


\( \Big( \)


\( \bigg( \)


\( \Bigg( \)

\( \big( \Big( \bigg( \Bigg( \)

LaTeX - Math Mode - Underbrace

To get an underbrace in LaTeX while in the math envrionment the command is

\underbrace{t + \dfrac{\Delta t}{2}}_{t_0}

\( \underbrace{t + \dfrac{\Delta t}{2}}_{t_0} \)

In order to use accents in math mode I have a post here which should help if you want to use accents within the underbrace:

I am not fully certain they (the accents) all show up in the LaTeX java script (MathJax) I am using for this blog to display LaTeX, but they should work in an actual LaTeX editor such as Texmaker and Kile.

For example,

\underbrace{t + \dfrac{\Delta t}{2}}_{\grave{t}_0}

\[ \underbrace{t + \dfrac{\Delta t}{2}}_{\grave{t}_0} \]

\underbrace{t + \dfrac{\Delta t}{2}}_{\acute{t}_0}

\[ \underbrace{t + \dfrac{\Delta t}{2}}_{\acute{t}_0} \]

 \underbrace{t + \dfrac{\Delta t}{2}}_{\text{\`{t}}_0}

\[ \underbrace{t + \dfrac{\Delta t}{2}}_{\text{\`{t}}_0} \]

\underbrace{t + \dfrac{\Delta t}{2}}_{\text{\'{t}}_0}

\[ \underbrace{t + \dfrac{\Delta t}{2}}_{\text{\'{t}}_0} \]

\underbrace{t + \dfrac{\Delta t}{2}}_{\textit{\`{t}}_0}

\[ \underbrace{t + \dfrac{\Delta t}{2}}_{\textit{\`{t}}_0} \]

\underbrace{t + \dfrac{\Delta t}{2}}_{\textit{\'{t}}_0}

\[ \underbrace{t + \dfrac{\Delta t}{2}}_{\textit{\'{t}}_0} \]

Yeah, the \text{} command isn't working in MathJax for some reason.  This is what it should do in an actual LaTeX editor:

Friday, November 11, 2011

Installing Windows 7 in Ubuntu 11.10 using VirtualBox

Alright, so no matter what you do, you will more than likely have to deal with Windows even if you have switched everything over to Ubuntu because, well, many people use Windows.  I needed an install since I have a few older filed I need to work with in Windows.  I mean Windows isn't terrible, I just prefer Ubuntu and all the options it gives me.

Anyways, I chose to go with a VirtualBox installation as I do not prefer multi-boot since I am on;y occasionally going to be using it.  I have messed around a bit with VirtualBox and have installed a Fedora 15 OS and Linux Mint 11 OS.

I began the installation like the others and kept everything default.  However, after I saw the Windows boot screen it never went to the installation screen but instead gave me a black screen with the "Windows failed to start" error message.

I googled "installing windows 7 on virtualbox get an error windows failed to start" and found this helpful site which solved the problem.

The issue is with

The cause of this problem is the APIC (Advanced Programmable Interrupt Controller), on which Windows depends. You must enable this feature in the virtual machine settings. 
Right click on the virtual machine in VirtualBox console window.

Select "Settings..." Click "System" tab on the left and check "Enable IO APIC" item.

YouTube video for installing Windows 7 on VirtualBox.  Sorry haven't watched it, but I assume it is good.

A couple of sites on the installation of Windows 7 in VirtualBox.