Stability Analysis For 
Thermal Convection

Plots the Rayleigh number R required to produce a growth rate s (or σ) for a given wavenumber k.  Free-slip, constant temperature boundaries are assumed.  The dimensionless depth of the convecting layer is 1.

R[k_,s_,P_]:=(Pi^2+k^2)*(s+P(Pi^2+k^2))*
		(s+Pi^2+k^2)/(P k^2)

LogLogPlot[{R[k,0,1],R[k,10,1],R[k,30,1],R[k,100,1]},{k,0.01`,100},PlotRange->{{0.01`,100},{100,(10^5)}},AxesLabel->{k,R}]

Well, that sucks.  I don't like those labels on the ticks.  Two hours latter, I found a way to fix it!

dammit[imin_,imax_,numform_]:=Module [{theexp,thenumber,ticklist},
		ticklist={};
		Do[	
			If[numform==0,
			  If[i<0,
					    thenumber=10.^i,thenumber=10^i],
			   theexp=ToString[i];
			   thenumber="\!\(10\^"<>theexp<>"\)";
			];
			ticklist=Append[ticklist,{10^i,thenumber,{.02,0}}];
			Do[
				ticklist=Append[ticklist,{10^i*j,"",{.01,0}}];,{j,2,9}
			]
		,{i,imin,imax}];
		ticklist
		]

stabplot=LogLogPlot[{R[k,0,1],R[k,10,1],R[k,30,1],R[k,100,1]},{k,0.01`,100},PlotRange->{{0.01`,100},{100,(10^5)}},AxesLabel->{k,R},Ticks->{dammit[-2,2,0],dammit[2,5,1]},Epilog->{Text["0",{0.2`,3}],Text["10",{0.3`,3.5`}],Text["30",{0.4`,4.`}],Text["100",{0.5`,4.7`}]}]

Export["stabplot.eps",stabplot,"EPS"];

Let's try the same plot with P=10:

stabplot2=LogLogPlot[{R[k,0,10],R[k,10,10],R[k,30,10],R[k,100,10]},{k,0.01`,100},PlotRange->{{0.01`,100},{100,(10^5)}},AxesLabel->{k,R},Ticks->{dammit[-2,2,0],dammit[2,5,1]}]