tag:blogger.com,1999:blog-83856149351848169852024-03-12T17:16:10.074-06:00Please Make A NotePlease Make a Note is a collection of science & technology tips and derivations that will make it easier for research scientists & engineers to perform the various tasks they are faced with. These notes cover a wide range of scientific topics, software, media, and data analysis utilities.yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.comBlogger150125tag:blogger.com,1999:blog-8385614935184816985.post-82700489060834480152017-05-31T11:19:00.001-06:002017-05-31T11:19:15.519-06:00C++ – CALLING OVERLOADED OPERATOR () FROM POINTER<div dir="ltr" style="text-align: left;" trbidi="on">
http://www.tonysaad.net/category/notes/<br /></div>
yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com0tag:blogger.com,1999:blog-8385614935184816985.post-36082174653393552692016-04-11T12:39:00.002-06:002016-04-11T12:39:29.659-06:00Find and Sort Files Recursively by Size on Linux<div dir="ltr" style="text-align: left;" trbidi="on">
<blockquote class="tr_bq">
find . -size +5M -exec du -h {} \; | sort -nr </blockquote>
</div>
yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com0tag:blogger.com,1999:blog-8385614935184816985.post-65986790627938357222015-09-28T15:26:00.001-06:002015-09-28T16:02:11.276-06:00How to Release all PBS Jobs with qrls<div dir="ltr" style="text-align: left;" trbidi="on">
I have problems using qrls all on the Titan supercomputer. You can use the following little script as an alternative<br />
<br />
First create a small script file<br />
<blockquote class="tr_bq">
emacs qrlsall</blockquote>
<br />
<div>
In qrlsall, type the following<br />
<blockquote>
<div class="p1">
<span class="s1">#!/bin/</span><span class="s2">bash</span></div>
<div class="p2">
<span class="s3">jobids</span><span class="s4">=$(</span><span class="s5">showq</span><span class="s4"> -u tsaad | awk </span><span class="s1">'{if ($3 == "UserHold") print $1;}'</span><span class="s4">)</span><br />
<span class="s6">echo</span><span class="s4"> $</span><span class="s1">jobids</span></div>
<div class="p4">
<span class="s1">qrls $</span><span class="s3">jobid</span><br />
</blockquote>
Now make qrlsall executable </div>
</div>
<blockquote class="tr_bq">
chmod +x qrlsall</blockquote>
Voila!</div>
yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com0tag:blogger.com,1999:blog-8385614935184816985.post-35124444138456204842015-03-09T11:01:00.000-06:002015-03-19T13:25:50.553-06:00Latex v Symbol MathJax Wordpress<div dir="ltr" style="text-align: left;" trbidi="on">
The default latex math symbol for v looks like a nu. I usually use \varv to avoid that stupid letter. However, MathJax does not support \varv. Here's what I did for my wordpress site www.cfdmath.com. In my header scripts (or where ever you put your mathjax script) add the following:<br />
<blockquote class="tr_bq">
<script type="text/x-mathjax-config"><br />MathJax.Hub.Config({<br /> "HTML-CSS": {<br /> availableFonts: []<br /> }<br />});<br /></script></blockquote>
According to MathJax documentation, this essentially enforces MathJax to use web-based or image fonts. It seems to do the trick and all my v's look pretty now.</div>
yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com0tag:blogger.com,1999:blog-8385614935184816985.post-29632400107021522922015-03-05T13:37:00.001-07:002015-03-05T13:37:06.338-07:00SVN List Modified Files Only<div dir="ltr" style="text-align: left;" trbidi="on">
Try:<br />
<blockquote class="tr_bq">
svn status | grep '^M'</blockquote>
</div>
yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com0tag:blogger.com,1999:blog-8385614935184816985.post-82489534326017511672015-03-03T13:05:00.000-07:002015-03-03T13:05:19.227-07:00Git Remote Branches not showing/not listed<div dir="ltr" style="text-align: left;" trbidi="on">
Try<br />
<blockquote class="tr_bq">
<blockquote class="tr_bq">
git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*</blockquote>
<blockquote class="tr_bq">
git fetch</blockquote>
</blockquote>
</div>
yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com0tag:blogger.com,1999:blog-8385614935184816985.post-54835455425458130112014-07-16T11:19:00.000-06:002014-07-16T11:19:00.066-06:00Using GitStat to Generate Commit Statistics for Git Repositories<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
You will nee python and a working installation of gnuplot.<br />
<blockquote class="tr_bq">
<ol style="text-align: left;">
<li>cd ~/pkg/</li>
<li>git clone git://github.com/hoxu/gitstats.git</li>
<li>cd gitstats</li>
<li>./gitstats path-to-repository path-to-html-output</li>
</ol>
</blockquote>
<div>
Done!</div>
<div>
Here's what I do for my code</div>
<div>
<blockquote class="tr_bq">
<ol>
<li>cd ~/pkg/</li>
<li>git clone git://github.com/hoxu/gitstats.git</li>
<li>cd gitstats</li>
<li>./gitstats -c start_date=1/1/2014 ~/development/uintah-work/src ~/uintah-stats-2014/</li>
</ol>
</blockquote>
For more information on the options provided by gitstat, use<br />
<blockquote class="tr_bq">
./gitstats --help</blockquote>
Note that you will always need to use -c flag to change the gitstats configuration.</div>
</div>
yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com0tag:blogger.com,1999:blog-8385614935184816985.post-54894994888596480192014-06-24T22:53:00.001-06:002015-04-07T22:25:18.724-06:00Maximum Entropy PDF Reconstruction Code<div dir="ltr" style="text-align: left;" trbidi="on">
<div>
<div style="font-family: 'trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; text-align: justify;">
Many of you have asked me to share my Maximum Entropy Method code for the reconstruction of density distributions. Unfortunately, I am unable to do that at the moment. In an effort to stop the email campaign that is asking me for the code, I decided to create a cgi interface for it and put it online. So here it goes...<br />
<br />
<a href="http://tonysaad.net/wp/wp-content/uploads/2015/04/tsaad-maximum-entropy-method.pdf" style="color: #cc0000; text-decoration: none;">Here is a summary</a> of the maximum entropy method. You can access my code through the interface below. At the bottom of this page, you will find a example moments from known distributions. Use those to experiment with the code.</div>
<div style="font-family: 'trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; text-align: justify;">
Usage:</div>
<ul style="font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; line-height: 21.450000762939453px;">
<li style="font-family: 'trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;">Known Moments: The set of all known moments for the unknown distribution. Enter one moment per line in the textarea below. Moments are assumed to be integer moments and are given as m0, m1, m2, etc...</li>
<li style="font-family: 'trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;">Number of Moments: Specify how many moments you wish to use (from the set of known moments) to reconstruct the distribution</li>
<li style="font-family: 'trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;">Lower Bound: Specify the lower bound on the reconstructed distribution</li>
<li style="font-family: 'trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;">Upper Bound: Specify the upper bound on the reconstructed distribution</li>
<li style="font-family: 'trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;">Number of Integration Points: Has to do with the numerical quadrature algorithm. Defaults to 80,000</li>
<li style="font-family: 'trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;">Maximum number of Iterations: specifies the number of internal iterations of the nonlinear solver</li>
<li style="font-family: 'trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;">Tolerance: Specifies the nonlinear solver tolerance</li>
<li style="font-family: 'trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;">Finite Difference Jacobian: Use finite difference to compute the Jacobian matrix</li>
<li style="font-family: 'trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;">Discrete Distribution: Use to reconstruct Discrete distribution. NOTE: Make sure you use a realistic number of integration points!</li>
</ul>
</div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<form action="http://phoenix.crsim.utah.edu/cgi-bin/maxent.cgi" method="post">
<table style="width: 100%;"><tbody>
<tr><td style="width: 34%;"><span style="font-family: Trebuchet MS, sans-serif;"><br /></span>
<span style="font-family: Trebuchet MS, sans-serif;">Known Moments</span></td>
<td class="auto-style1" style="width: 25%;"><span style="font-family: Trebuchet MS, sans-serif;">Number of Moments</span></td>
<td style="width: 25%;"><span style="font-family: Trebuchet MS, sans-serif;"><input name="nm" type="text" value="5" /></span></td>
</tr>
<tr>
<td rowspan="7" style="width: 34%;" valign="top"><textarea class="content-inline" name="moments" style="height: 192px; width: 289px;">0.9998836854604251
0.3750020886041817
0.160050949117657
0.07410076879576808
0.03608317866501874
0.01814662349371375
0.009328794519215932
0.004873918250461322
0.002579361412073578
0.001379983287926058
0.0007454798810168075
0.0004063088335238112
0.0002233058703649383
0.0001237078257975948
0.00006905842203738
0.00003883766693391672
0.00002199975642576323
0.0000125497061679911
7.208269696836164e-6
4.168186705863649e-6
2.42618273531166e-6</textarea></td>
<td class="auto-style1" style="width: 25%;"><span style="font-family: Trebuchet MS, sans-serif;">Lower Bound</span></td>
<td style="width: 25%;"><span style="font-family: Trebuchet MS, sans-serif;"><input name="lb" type="text" value="0" /></span></td>
</tr>
<tr>
<td class="auto-style1" style="width: 25%;"><span style="font-family: Trebuchet MS, sans-serif;">Upper Bound</span></td>
<td style="width: 25%;"><span style="font-family: Trebuchet MS, sans-serif;"><input name="ub" type="text" value="1" /></span></td>
</tr>
<tr>
<td class="auto-style1" style="width: 25%;"><span style="font-family: Trebuchet MS, sans-serif;"># of Integration Points</span></td>
<td style="width: 25%;"><span style="font-family: Trebuchet MS, sans-serif;"><input name="ip" type="text" value="80000" /></span></td>
</tr>
<tr>
<td class="auto-style1" style="height: 45px; width: 25%;"><span style="font-family: Trebuchet MS, sans-serif;">Maximum # of
Iterations</span></td>
<td style="height: 45px; width: 25%;"><span style="font-family: Trebuchet MS, sans-serif;"><input name="it" type="text" value="10000" /></span></td>
</tr>
<tr>
<td class="auto-style1" style="width: 25%;"><span style="font-family: Trebuchet MS, sans-serif;">Tolerance</span></td>
<td style="width: 25%;"><span style="font-family: Trebuchet MS, sans-serif;"><input name="tol" type="text" value="1e-6" /></span></td>
</tr>
<tr>
<td class="auto-style1" style="width: 25%;"><span style="font-family: Trebuchet MS, sans-serif;"><input name="fd" type="checkbox" value="-fd" /> Finite Difference Jacobian </span></td>
<td class="auto-style3" style="width: 25%;"></td>
</tr>
<tr>
<td class="auto-style1" style="width: 25%;"><span style="font-family: Trebuchet MS, sans-serif;"><input name="disc" type="checkbox" value="-disc" />Discrete Distribution</span></td>
<td class="auto-style3" style="width: 25%;"><span style="font-family: Trebuchet MS, sans-serif;"><input name="Button1" type="submit" value="Submit" /></span></td></tr>
</tbody></table>
</form>
</div>
</div>
yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com0tag:blogger.com,1999:blog-8385614935184816985.post-86601758166807471132013-07-23T09:25:00.003-06:002013-07-23T09:25:35.600-06:00how to move keynote from one mac to another<div dir="ltr" style="text-align: left;" trbidi="on">
See:<br />
<br />
<blockquote class="tr_bq">
<a href="http://geekinc.ca/moving-iwork-pages-keynote-and-numbers-from-an-old-apple-to-a-new-one/">http://geekinc.ca/moving-iwork-pages-keynote-and-numbers-from-an-old-apple-to-a-new-one/</a></blockquote>
I basically moved the following files:<br />
<br />
<blockquote class="tr_bq">
<ul style="text-align: left;">
<li>Macintosh HD:Library:Preferences:com.apple.iWork09.Installer.plist</li>
</ul>
<ul style="text-align: left;">
<li>Macintosh HD:Library:Preferences:com.apple.iWork09.plist </li>
</ul>
</blockquote>
<blockquote class="tr_bq">
<ul style="text-align: left;">
<li> Macintosh HD:Library:Application Support:Keynote</li>
</ul>
</blockquote>
<blockquote class="tr_bq">
<ul style="text-align: left;">
<li>Macintosh HD:Library:Application Support:iWork ’09</li>
</ul>
<ul style="text-align: left;">
<li>Macintosh HD:Applications:iWork ’09</li>
</ul>
</blockquote>
<br />
</div>
yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com0tag:blogger.com,1999:blog-8385614935184816985.post-70659622176587695292013-07-06T17:05:00.002-06:002013-07-06T17:05:42.443-06:00My New Project: Show Me the Math<div dir="ltr" style="text-align: left;" trbidi="on">
Please join me in celebrating the launch of my new project "Show Me the Math", a journal purely dedicated to mathematical derivations of physical and numerical stuff. I will no longer post derivations on pleasemakeanote as those will go to <a href="http://showmethemath.wordpress.com/">showmethemath</a>. I will start porting and improving the current derivations to the new blog as time goes by.<br />
<br />
Thank you all for your support,<br />
yNot</div>
yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com0tag:blogger.com,1999:blog-8385614935184816985.post-42279315558689631822013-07-06T10:45:00.002-06:002013-07-20T00:36:48.376-06:00latex2html Underline Equations and Formulas<div dir="ltr" style="text-align: left;" trbidi="on">
I recently tried to use latex2html to export a few of my tex documents to html. I simply used<br />
<blockquote class="tr_bq">
latex2html main.tex</blockquote>
but I ended up with a bunch of unsavory lines under all of my equations. Upon googling things a bit, I found the following solution that worked for me:<br />
<blockquote class="tr_bq">
https://ccrma.stanford.edu/~jos/webpub/Eliminating_Black_Rules_Equation.html</blockquote>
On my mac, here's what I did:<br />
<br />
<ol style="text-align: left;">
<li>search for the file alt-rule.pro (on my Mac, I opened the folder /usr and searched for it there. the file was located under: /usr/local/texlive/2012/texmf/dvips/config/</li>
<li>edit the file as suggested by the link above. i.e., replace<br />gsave newpath /ruleY X /ruleX X<br />with<br />gsave newpath <br />transform round exch round exch itransform<br />/ruleY X /ruleX X</li>
</ol>
<div>
and Voila!</div>
<br />
<blockquote class="tr_bq">
</blockquote>
</div>
yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com0tag:blogger.com,1999:blog-8385614935184816985.post-19753552829716551472013-06-13T12:43:00.001-06:002013-06-13T12:43:26.515-06:00How to change username and password in git-svn?<div dir="ltr" style="text-align: left;" trbidi="on">
See this:<br />
<blockquote class="tr_bq">
<a href="http://jamiemonserrate.wordpress.com/2010/01/11/how-to-change-username-and-password-in-git-svn/">http://jamiemonserrate.wordpress.com/2010/01/11/how-to-change-username-and-password-in-git-svn/</a></blockquote>
</div>
yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com0tag:blogger.com,1999:blog-8385614935184816985.post-91978156222493877012013-05-02T09:21:00.000-06:002013-05-02T09:21:40.101-06:00SVN revert recursively<div dir="ltr" style="text-align: left;" trbidi="on">
<blockquote class="tr_bq">
svn revert -R .</blockquote>
</div>
yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com0tag:blogger.com,1999:blog-8385614935184816985.post-16347034759468906152013-04-10T09:37:00.001-06:002013-04-10T09:37:22.281-06:00git autocomplete on Mac OS X<div dir="ltr" style="text-align: left;" trbidi="on">
I use a variety both Linux and OSX in my work. Since my recent adoption of git, I have been mostly logged in to our Linux box and had been enjoying the awesome git autocomplete features in bash. When I switched to my Mac though, I couldn't get this work - but my pinky refused to stop pressing the tab key.<br />
<div>
<br /></div>
<div>
Luckily, the folks at git have an <a href="https://github.com/git/git/blob/master/contrib/completion/git-completion.bash">autocomplete script</a> ready to install on your machine. Here's what you have to do:<br />
<blockquote class="tr_bq">
<pre style="white-space: pre-wrap; word-wrap: break-word;">curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
echo "source ~/.git-completion.bash" >> ~/.bash_profile</pre>
</blockquote>
<br />
and Voila!<br />
<br />
Thanks to Mike Pottyn for this: <a href="http://railslove.com/blog/2011/11/25/git-autocomplete-in-bash-on-a-mac">http://railslove.com/blog/2011/11/25/git-autocomplete-in-bash-on-a-mac</a></div>
</div>
yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com1tag:blogger.com,1999:blog-8385614935184816985.post-17871140363549669362013-01-31T09:59:00.001-07:002013-01-31T09:59:47.879-07:00Generate List of Publications from bib File<div dir="ltr" style="text-align: left;" trbidi="on">
http://www.monperrus.net/martin/bibtex2latex</div>
yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com0tag:blogger.com,1999:blog-8385614935184816985.post-79024203809579780762012-09-17T14:37:00.001-06:002012-09-17T14:37:32.051-06:00XCode 4 Build Locations (Lion, Mountain Lion)<div dir="ltr" style="text-align: left;" trbidi="on">
Apparently, the "most advanced" operating system in the world is not very friendly for power-users and developers.<br />
<br />
The new xcode 4 has had a major rehaul. I just updated to mountain lion and the latest xcode (4.4.1). The first annoying feature that you will notice about xcode is the non-intuitive and complex user interface. I can't even find the console or the debugging tools... oh wait, they're placed at the bottom of the screen and they're practically invisible. Maybe it is time to read the documentation... but who has time for that?<br />
<br />
In any event, I went ahead and tested a "Bonjour y'all!" code and it worked. but I could not locate the executable file in the project's directory. Are you serious? It turns out that XCode defaults to some location in your library. Fortunately, I just found a way to go back to standard operation and place your executable where it BELONGS:<br />
<br />
<ol style="text-align: left;">
<li>Open XCODE</li>
<li>go to: Preferences</li>
<li>Click on the "Locations" tab</li>
<li>Change the path for "Derived Data" to relative and that should do it.</li>
<li>If you want to be a bit more picky, click on Advanced</li>
<ol>
<li>select "Custom"</li>
<ol>
<li>Select "Relative to Workspace"</li>
</ol>
</ol>
</ol>
<div>
That last step will place your executable in its normal location.</div>
<div>
<br /></div>
<div>
Hope that helps.</div>
</div>
yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com0tag:blogger.com,1999:blog-8385614935184816985.post-3870171004266172692012-09-14T13:18:00.003-06:002012-09-14T13:18:53.273-06:00Calling gnuplot from C/C++ on Mac OS X<div dir="ltr" style="text-align: left;" trbidi="on">
Here's another way of calling gnuplot from Mac OS X.<br />
<br />
First install gnuplot either from their website or using macports. I like the macports model because it installs all dependencies for you automatically.<br />
<ol style="text-align: left;">
<li>Install macports from: <a href="http://www.macports.org/">http://www.macports.org/</a> </li>
<li>Open up your terminal</li>
<li>type: sudo port selfupdate (to update port names)</li>
<li>type: sudo port install gnuplot</li>
</ol>
<div>
and Voila! you now have gnuplot installed on your mac. To test it type: gnuplot and you should enter the gnuplot environment. Another caveat that you have to bear in mind when using gnuplot on mac is that you have to tell gnuplot to use x11. You do this as follows:</div>
<div>
<ol style="text-align: left;">
<li>Open up your terminal</li>
<li>type: gnuplot</li>
<li>type: set terminal x11</li>
</ol>
<div>
Now to the fun stuff. Here's the code that I used before to call gnuplot for windows, but modified to work on Unix based systems such as Mac.</div>
</div>
<br />
<pre class="Cpp" name="code">#include <stdio.h>
#include <stdlib.h>
#include <math.h>
void plotResults(double* xData, double* yData, int dataSize);
int main() {
int i = 0;
int nIntervals = 100;
double intervalSize = 1.0;
double stepSize = intervalSize/nIntervals;
double* xData = (double*) malloc((nIntervals+1)*sizeof(double));
double* yData = (double*) malloc((nIntervals+1)*sizeof(double));
xData[0] = 0.0;
double x0 = 0.0;
for (i = 0; i < nIntervals; i++) {
x0 = xData[i];
xData[i+1] = x0 + stepSize;
}
for (i = 0; i <= nIntervals; i++) {
x0 = xData[i];
yData[i] = sin(x0)*cos(10*x0);
}
plotResults(xData,yData,nIntervals);
return 0;
}
void plotResults(double* xData, double* yData, int dataSize) {
FILE *gnuplotPipe,*tempDataFile;
char *tempDataFileName;
double x,y;
int i;
tempDataFileName = "tempData";
gnuplotPipe = popen("gnuplot","w");
if (gnuplotPipe) {
fprintf(gnuplotPipe,"plot \"%s\" with lines\n",tempDataFileName);
fflush(gnuplotPipe);
tempDataFile = fopen(tempDataFileName,"w");
for (i=0; i <= dataSize; i++) {
x = xData[i];
y = yData[i];
fprintf(tempDataFile,"%lf %lf\n",x,y);
}
fclose(tempDataFile);
printf("press enter to continue...");
getchar();
remove(tempDataFileName);
fprintf(gnuplotPipe,"exit \n");
} else {
printf("gnuplot not found...");
}
} </pre>
<br />
<br />
This code should run as is. Of course, feel free to take the plot function and use it in your own codes.</div>
yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com1tag:blogger.com,1999:blog-8385614935184816985.post-34187721983761978492011-06-23T19:35:00.001-06:002011-06-24T12:28:07.122-06:00The Maximum Entropy Method for Reconstructing Density Distriubtions<div dir="ltr" style="text-align: left;" trbidi="on"><div style="text-align: left;"><span class="Apple-style-span" style="background-color: rgba(250, 250, 250, 0.292969);"><span class="Apple-style-span" style="font-family: 'trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; font-size: 15px;">A summary of using the maximum entropy principle from information theory to reconstruct a PDF (or other distributions) given a finite number of moments. This is quite useful especially when using the method of moments in population balances or related stochastic transport processes. The document also includes some results from my code for reconstructing some bimodal and trimodal Gaussian distributions, beta, and log-normal distributions.</span></span></div><div style="text-align: left;"><span class="Apple-style-span" style="background-color: rgba(250, 250, 250, 0.292969);"><span class="Apple-style-span" style="font-family: 'trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; font-size: 15px;"><br />
</span></span></div><a href="http://www.tsaad.net/docs/tsaad-maximum-entropy-method.pdf">Download PDF</a></div>yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com4tag:blogger.com,1999:blog-8385614935184816985.post-40288950174485962132011-04-11T16:27:00.001-06:002011-05-24T16:58:51.102-06:00Quadrature Methods for Numerical Integration<div dir="ltr" style="text-align: left;" trbidi="on">A review of Gaussian quadrature for numerical integration. Discusses Lagrange's interpolation and the theory of orthogonal polynomials. <br />
<br />
<a href="http://www.tsaad.net/docs/tsaad-quadrature-methods.pdf">Download PDF</a>.<br />
</div>yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com1tag:blogger.com,1999:blog-8385614935184816985.post-52138920821098626002011-04-02T00:27:00.000-06:002011-04-02T00:27:24.733-06:00Endnote Auto-formatting parentheses<div dir="ltr" style="text-align: left;" trbidi="on">I do not use EndNote. And most likely never will. But here's an annoyance that you may have encountered while working on your word documents.<br />
<br />
Sometimes, in your word document, if you write certain acronyms between parentheses, EndNote may think that this is a reference. To prevent this from happening, in EndNote, do the following:<br />
<br />
Files->Preferences->Autoformat<br />
<br />
and change the delimiters from parentheses to something else.</div>yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com1tag:blogger.com,1999:blog-8385614935184816985.post-49724759305148753642011-02-17T22:18:00.000-07:002011-02-17T22:18:02.422-07:00LaTeX Footnote not at Bottom of Page<div dir="ltr" style="text-align: left;" trbidi="on">Try using this package:<br />
<br />
<blockquote>\usepackage[bottom]{footmisc}</blockquote></div>yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com0tag:blogger.com,1999:blog-8385614935184816985.post-10030341586745622922010-10-04T10:04:00.001-06:002013-02-09T10:20:16.249-07:00The Mathematics of f/stop Aperture Numbers<div dir="ltr" style="text-align: left;" trbidi="on">
A sequence is a set of numbers that can be constructed using a formula known as a recurrence relation. The most obvious of these is the set of natural numbers (integers). How? Start with any integer (positive or negative). To get the next integer, simply add 1! <br />
<br />
Some sequences are very obvious to decipher, while others require more mathematical manipulation, such as the <a href="http://en.wikipedia.org/wiki/Fibonacci_number">Fibonacci sequence</a>. Sequences often show up in pure mathematics, number theory, and computer science. [<a href="http://en.wikipedia.org/wiki/Sequence">More about sequences</a>].<br />
<br />
One of the most widely used sequences is the f-number or f-stop (f/stop) series of numbers in photography. No matter where you stand as a photographer, you will be faced with these numbers. Often times, you will have to rely on your calculations to determine how many stops there are between two stop numbers. You will have to memorize them or just rely on your camera - unless you know the mathematics behind these numbers.<br />
<br />
In this article, I will explain the method I use to remember the f-stop sequence. All that is needed is to remember the first two numbers. I will first quickly present the method so that you don't have to read this entire article. I will then present the mathematical formalism for the way f-stop numbers are constructed. <br />
<br />
<h1>
How to Remember the f/stop Numbers</h1>
I will start with the most common f-stop numbers. These are given by the following set of numbers<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%7B%5Ccolor%7Bred%7D%201%5Cquad1.4%5Cquad2%5Cquad2.8%5Cquad4%5Cquad5.6%5Cquad8%5Cquad11%5Cquad16%5Cquad22%5Cquad32%5Cquad45%5Cquad64%5Cquad90%5Cquad128%7D" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%7B%5Ccolor%7Bred%7D%201%5Cquad1.4%5Cquad2%5Cquad2.8%5Cquad4%5Cquad5.6%5Cquad8%5Cquad11%5Cquad16%5Cquad22%5Cquad32%5Cquad45%5Cquad64%5Cquad90%5Cquad128%7D" title="\bg_white \120dpi {\color{red} 1\quad1.4\quad2\quad2.8\quad4\quad5.6\quad8\quad11\quad16\quad22\quad32\quad45\quad64\quad90\quad128}" /></a></div>
<br />
Let us write these in the following way<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cbegin%7Bmatrix%7D%201%20%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%202%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%204%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%208%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%2016%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%2032%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%2064%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%20128%5C%5C%20%5C;%5Cquad%201.4%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%202.8%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%205.6%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%2011%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%2022%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%2045%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%2090%20%5Cend%7Bmatrix%7D" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cbegin%7Bmatrix%7D%201%20%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%202%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%204%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%208%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%2016%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%2032%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%2064%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%20128%5C%5C%20%5C;%5Cquad%201.4%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%202.8%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%205.6%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%2011%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%2022%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%2045%5Coverset%7B%20%7D%7B%5Clongrightarrow%7D%2090%20%5Cend%7Bmatrix%7D" title="\bg_white \120dpi \large \begin{matrix} 1 \overset{ }{\longrightarrow} 2\overset{ }{\longrightarrow} 4\overset{ }{\longrightarrow} 8\overset{ }{\longrightarrow} 16\overset{ }{\longrightarrow} 32\overset{ }{\longrightarrow} 64\overset{ }{\longrightarrow} 128\\ \;\quad 1.4\overset{ }{\longrightarrow} 2.8\overset{ }{\longrightarrow} 5.6\overset{ }{\longrightarrow} 11\overset{ }{\longrightarrow} 22\overset{ }{\longrightarrow} 45\overset{ }{\longrightarrow} 90 \end{matrix}" /></a></div>
<br />
Looking at each row separately, you will quickly notice that these form what is called a geometric sequence. A geometric sequence is a set of ordered numbers, in which any number is obtained by multiplying the previous number by a constant value. This constant value is known as the common ratio. Guess what the common ratio (in our case) is? It is 2 (see proof below). Here's another graphic for that<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cbegin%7Bmatrix%7D%201%20%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%202%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%204%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%208%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%2016%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%2032%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%2064%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%20128%5C%5C%20%5C;%5Cquad%201.4%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%202.8%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%205.6%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%2011%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%2022%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%2045%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%2090%20%5Cend%7Bmatrix%7D" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cbegin%7Bmatrix%7D%201%20%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%202%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%204%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%208%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%2016%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%2032%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%2064%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%20128%5C%5C%20%5C;%5Cquad%201.4%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%202.8%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%205.6%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%2011%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%2022%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%2045%5Coverset%7B%5Ctimes%202%7D%7B%5Clongrightarrow%7D%2090%20%5Cend%7Bmatrix%7D" title="\bg_white \120dpi \large \begin{matrix} 1 \overset{\times 2}{\longrightarrow} 2\overset{\times 2}{\longrightarrow} 4\overset{\times 2}{\longrightarrow} 8\overset{\times 2}{\longrightarrow} 16\overset{\times 2}{\longrightarrow} 32\overset{\times 2}{\longrightarrow} 64\overset{\times 2}{\longrightarrow} 128\\ \;\quad 1.4\overset{\times 2}{\longrightarrow} 2.8\overset{\times 2}{\longrightarrow} 5.6\overset{\times 2}{\longrightarrow} 11\overset{\times 2}{\longrightarrow} 22\overset{\times 2}{\longrightarrow} 45\overset{\times 2}{\longrightarrow} 90 \end{matrix}" /></a></div>
<br />
As you can see, you only need to remember the first two f-numbers, i.e. 1 and 1.4. Separate them into two sets: the even set (first row) and the odd set (bottom row). Then construct the entire f-stop range just by multiplying by 2.<br />
<br />
Remarks:<br />
<ol>
<li>Note that each set presents jumps in two stops, not one stop. f/1.4 lets in four times more light than f/2.8. Being multiplied by two should emphasize that fact - for f/1.4, the lens diameter is twice as much as that for f/2.8. (As will be explained below, to go one full stop at a time, you'd have to multiply by Sqrt(2)~1.4, e.g. 1.4*1.4 ~ 2 and so on...)</li>
<li>Looking at the odd set (bottom row), you can notice that 5.6x2 = 11.2, not 11. So why do we choose 11? To the best of my knowledge, it is just a convention to keep the numbers easy to remember. The actual f/stop used by the lens is 11.312).</li>
</ol>
<span style="font-size: x-small;">As will be shown below, if we start by f/1.0 as the smallest possible f/stop, the next full stop is 1.0xSqrt(2) = 1.414. This is the first f/stop that corresponds to the bottom row. Now<br />
1.414x2 = 2.828<br />
2.828x2 = 5.686<br />
5.686x2 = 11.312<br />
11.312x2 = 22.624<br />
22.624x2 = 45.248</span><br />
<span style="font-size: x-small;">and so on...</span><br />
<br />
<h1>
Mathematical Analysis</h1>
For those of you who are mathematically inclined, the analysis that follows provides the rationale behind the construction of the stop number.<br />
<br />
In photography, the lens aperture is that opening in the lens (or on the camera body) that determines the amount of light that is to be admitted to the light sensitive medium (film or CCD ...). The surface area of this opening can be adjusted by the use of a diaphragm. The action of closing or opening the diaphragm is called stopping down the lens (whether full or half). We define the f-stop number as<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20S=%5Cfrac%7Bf%7D%7BD%7D=%5Cfrac%7B%5Ctext%7BFocal%20Length%7D%7D%7B%5Ctext%7BAperture%20Diameter%7D%7D" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20S=%5Cfrac%7Bf%7D%7BD%7D=%5Cfrac%7B%5Ctext%7BFocal%20Length%7D%7D%7B%5Ctext%7BAperture%20Diameter%7D%7D" title="\bg_white \120dpi \large S=\frac{f}{D}=\frac{\text{Focal Length}}{\text{Aperture Diameter}}" /></a> </div>
<br />
In science & engineering, S is referred to as a dimensionless number, meaning that it does not have any units associated with it. In our case, since the focal length and the diameter both describe a length (m, cm, mm...), their ratio is dimensionless because the units can be simplified (just like simplification of numbers).<br />
<br />
The advantage of using a dimensionless quantity is that any results drawn form an experiment on a specific device (lens in this case) will equally apply to any other device with the same dimensionless number. For example, you've probably heard of the Mach number "M". The Mach number is a dimensionless quantity used in aerodynamics and describes how fast an object is moving in a medium (air) compared to the speed of sound in that medium. It is probably the most popular dimensionless number on the planet! (I think the f-stop number should be added to the list of dimensionless number). Now any experiment carried out on a model jet with M = 3 for example, will illustrate exactly what happens when the real jet is flying at M = 3 in the atmosphere (shockwave structure, pressure and temperature distributions ...).<br />
<br />
Here's an example in photography. The amount of light REACHES THE SENSOR using a 28 mm lens with S = 2 is exactly the same as that of an 80 mm lens with S = 2, although the diameters of both apertures are different (if all factors that affect image brightness are held constant). (If you can't prove this for yourself, let me know and I'll write up my proof).<br />
<br />
This dimensionless number is a very useful tool for determining properties of lenses (and therefore the light coming through) without referring to diameters or any other data.<br />
<br />
In cameras, when we set the f/stop number, we are essentially setting the Diameter of the lens aperture. This can be computed by knowledge of the focal length. Therefore, for a given stop S, the diameter opening of your lens is<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Cbg_white%20%5C120dpi%20%5Clarge%20%7B%5Crm%20D%7D%20=%20%5Cfrac%7Bf%7D%7BS%7D=%5Cfrac%7B%5Ctext%7BFocal%20Length%7D%7D%7B%5Ctext%7BStop%20Number%7D%7D" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Cbg_white%20%5C120dpi%20%5Clarge%20%7B%5Crm%20D%7D%20=%20%5Cfrac%7Bf%7D%7BS%7D=%5Cfrac%7B%5Ctext%7BFocal%20Length%7D%7D%7B%5Ctext%7BStop%20Number%7D%7D" title="\bg_white \120dpi \bg_white \120dpi \large {\rm D} = \frac{f}{S}=\frac{\text{Focal Length}}{\text{Stop Number}}" /></a></div>
<br />
For example, a lens set at a focal length of 70mm and a stop number of 5.6 has an aperture diameter of<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20%7B%5Crm%20D%7D%20=%20%5Cfrac%7B70%7D%7B5.6%7D%20=%2012.5%20%5C;%7B%5Crm%20mm%7D" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20%7B%5Crm%20D%7D%20=%20%5Cfrac%7B70%7D%7B5.6%7D%20=%2012.5%20%5C;%7B%5Crm%20mm%7D" title="\bg_white \120dpi \large {\rm D} = \frac{70}{5.6} = 12.5 \;{\rm mm}" /></a></div>
<br />
Note that S is inversely proportional to D which explains why as the stop number increases, less light enters the camera since D decreases (f/32 lets in less light than f/16).<br />
<br />
Let us now compute the stop number (S) required to let in Twice as much light, for a given lens set at a fixed focal length.<br />
<br />
We start by computing the diameter that will let in twice the amount of light. This is equivalent to saying that the aperture surface area has to be twice as much to let in twice as much light. For example, at the same focal length, an aperture with a surface area of 10 mm^2 will let in twice as much light as an aperture with a surface area of 5 mm^2. This is how it looks mathematically<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/_Qvo9maGtaUY/TKjQEX6L9_I/AAAAAAAAByI/JiIrfLPizig/s800/aperture-areas.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/_Qvo9maGtaUY/TKjQEX6L9_I/AAAAAAAAByI/JiIrfLPizig/s320/aperture-areas.png" /></a></div>
<br />
We now set <br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20%7B%5Crm%20A%7D_0%20=%202%20%7B%5Crm%20A%7D_1" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20%7B%5Crm%20A%7D_0%20=%202%20%7B%5Crm%20A%7D_1" title="\bg_white \120dpi \large {\rm A}_0 = 2 {\rm A}_1" /></a></div>
<br />
or<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cpi%20%5Cfrac%7B%7B%5Crm%20D%7D_0%5E2%7D%7B4%7D%20=%202%20%5Cpi%20%5Cfrac%7B%7B%5Crm%20D%7D_1%5E2%7D%7B4%7D" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cpi%20%5Cfrac%7B%7B%5Crm%20D%7D_0%5E2%7D%7B4%7D%20=%202%20%5Cpi%20%5Cfrac%7B%7B%5Crm%20D%7D_1%5E2%7D%7B4%7D" title="\bg_white \120dpi \large \pi \frac{{\rm D}_0^2}{4} = 2 \pi \frac{{\rm D}_1^2}{4}" /></a></div>
<br />
finally<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20%7B%5Crm%20D%7D_0%20=%20%5Csqrt%7B2%7D%5C,%7B%5Crm%20D%7D_1%20%5Capprox%20%7B%5Crm%20D%7D_1%20@plus;0.414%5C;%20%7B%5Crm%20D%7D_1" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20%7B%5Crm%20D%7D_0%20=%20%5Csqrt%7B2%7D%5C,%7B%5Crm%20D%7D_1%20%5Capprox%20%7B%5Crm%20D%7D_1%20+0.414%5C;%20%7B%5Crm%20D%7D_1" title="\bg_white \120dpi \large {\rm D}_0 = \sqrt{2}\,{\rm D}_1 \approx {\rm D}_1 +0.414\; {\rm D}_1" /></a></div>
<br />
In other words, for an aperture to let in twice as much light, its diameter must increase by approximately 41%.<br />
<br />
Now that we have a relation between the diameters of both apertures, we can use the f/stop equation to deduce the recurence relation between the stop numbers. This is done as follows:<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cleft.%20%5Cbegin%7Bmatrix%7D%20%7B%5Crm%20D%7D_0%20=%20%5Csqrt%7B2%7D%5C;%7B%5Crm%20D%7D_1%5C%5C[16pt]%20%7B%5Crm%20D%7D_0%20=%20%5Cdfrac%7Bf%7D%7BS_0%7D%20%5C%5C[16pt]%20%7B%5Crm%20D%7D_1%20=%20%5Cdfrac%7Bf%7D%7BS_1%7D%20%5Cend%7Bmatrix%7D%5Cright%5C%7D%20%5Cfrac%7Bf%7D%7BS_0%7D%20=%20%5Csqrt%7B2%7D%5Cfrac%7Bf%7D%7BS_1%7D%5CLeftrightarrow%20S_1%20=%20%5Csqrt%7B2%7DS_0" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cleft.%20%5Cbegin%7Bmatrix%7D%20%7B%5Crm%20D%7D_0%20=%20%5Csqrt%7B2%7D%5C;%7B%5Crm%20D%7D_1%5C%5C[16pt]%20%7B%5Crm%20D%7D_0%20=%20%5Cdfrac%7Bf%7D%7BS_0%7D%20%5C%5C[16pt]%20%7B%5Crm%20D%7D_1%20=%20%5Cdfrac%7Bf%7D%7BS_1%7D%20%5Cend%7Bmatrix%7D%5Cright%5C%7D%20%5Cfrac%7Bf%7D%7BS_0%7D%20=%20%5Csqrt%7B2%7D%5Cfrac%7Bf%7D%7BS_1%7D%5CLeftrightarrow%20S_1%20=%20%5Csqrt%7B2%7DS_0" title="\bg_white \120dpi \large \left. \begin{matrix} {\rm D}_0 = \sqrt{2}\;{\rm D}_1\\[16pt] {\rm D}_0 = \dfrac{f}{S_0} \\[16pt] {\rm D}_1 = \dfrac{f}{S_1} \end{matrix}\right\} \frac{f}{S_0} = \sqrt{2}\frac{f}{S_1}\Leftrightarrow S_1 = \sqrt{2}S_0" /></a></div>
<br />
Thus, to let in half as much light, we multiply the previous stop number by the square root of two ~ 1.4. Alternatively, to let in twice as much light, we multiply by the reciprocal of the square root of two ~ 0.7. In general, for a stop number Sn, we have<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cbegin%7Bcases%7D%20S_%7Bn@plus;1%7D=%5Csqrt%7B2%7D%5C;S_n%20%5C%5C%20S_%7Bn-1%7D=%5Cfrac%7B1%7D%7B%5Csqrt%7B2%7D%7DS_n%20%5Cend%7Bcases%7D" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cbegin%7Bcases%7D%20S_%7Bn+1%7D=%5Csqrt%7B2%7D%5C;S_n%20%5C%5C%20S_%7Bn-1%7D=%5Cfrac%7B1%7D%7B%5Csqrt%7B2%7D%7DS_n%20%5Cend%7Bcases%7D" title="\bg_white \120dpi \large \begin{cases} S_{n+1}=\sqrt{2}\;S_n \\ S_{n-1}=\frac{1}{\sqrt{2}}S_n \end{cases}" /></a></div>
<br />
where S{n+1} is the stop number that lets in HALF as much light as Sn, while S{n-1} is the stop number that lets in TWICE as much light as Sn. For example, if we are a stop number of Sn = 5.6, we have<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20S_n%20=%205.6:%20%5Cbegin%7Bcases%7D%20S_%7Bn@plus;1%7D=%5Csqrt%7B2%7D%5C;S_n%20%5Capprox%207.92%20%5Cquad%20%5Ctext%7B%28or%208%20on%20cameras%29%7D%20%5C%5C%20S_%7Bn-1%7D=%5Cfrac%7B1%7D%7B%5Csqrt%7B2%7D%7DS_n%20%5Capprox%203.96%20%5Cquad%20%5Ctext%7B%28or%204%20on%20cameras%29%7D%20%5Cend%7Bcases%7D" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20S_n%20=%205.6:%20%5Cbegin%7Bcases%7D%20S_%7Bn+1%7D=%5Csqrt%7B2%7D%5C;S_n%20%5Capprox%207.92%20%5Cquad%20%5Ctext%7B%28or%208%20on%20cameras%29%7D%20%5C%5C%20S_%7Bn-1%7D=%5Cfrac%7B1%7D%7B%5Csqrt%7B2%7D%7DS_n%20%5Capprox%203.96%20%5Cquad%20%5Ctext%7B%28or%204%20on%20cameras%29%7D%20%5Cend%7Bcases%7D" title="\bg_white \120dpi \large S_n = 5.6: \begin{cases} S_{n+1}=\sqrt{2}\;S_n \approx 7.92 \quad \text{(or 8 on cameras)} \\ S_{n-1}=\frac{1}{\sqrt{2}}S_n \approx 3.96 \quad \text{(or 4 on cameras)} \end{cases}" /></a></div>
<br />
In its present form, our recurrence formula depends on a fixed stop number. It would be useful if we can write our recurrence formula based on some initial reference stop number S0. For this, we do the following<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cbegin%7Balign*%7D%20&S_0%20&%20&%20%5Ctext%7BA%20given%20initial%20stop%20number%7D%20%5C%5C%20&S_1%20=%20%5Csqrt%7B2%7D%20S_0%20&%20&%20%5Ctext%7B1%20stop%20from%7DS_0%20%5C%5C%20&%20S_1%20=%20%5Csqrt%7B2%7D%20S_1%20=%20%5Csqrt%7B2%7D%5Ctimes%5Csqrt%7B2%7DS_0%20&%20&%20%5Ctext%7B2%20stops%20from%7D%20S_0%5C%5C%20&%20S_3%20=%20%5Csqrt%7B2%7D%20S_2%20=%20%5Csqrt%7B2%7D%5Ctimes%5Csqrt%7B2%7D%5Ctimes%5Csqrt%7B2%7DS_0%20&%20&%20%5Ctext%7B3%20stops%20from%7D%20S_0%20%5C%5C%20&%20%5Cvdots%20&%20&%20%5Cvdots%5C%5C%20&%20S_n%20=%20%5Csqrt%7B2%7D%20S_%7Bn-1%7D%20=%20%5Cleft%28%5Csqrt%7B2%7D%20%5Cright%20%29%5En%20S_0%20&%20&%20%5Ctext%7Bn%20stops%20from%7D%20S_0%20%5Cend%7Balign*%7D" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cbegin%7Balign*%7D%20&S_0%20&%20&%20%5Ctext%7BA%20given%20initial%20stop%20number%7D%20%5C%5C%20&S_1%20=%20%5Csqrt%7B2%7D%20S_0%20&%20&%20%5Ctext%7B1%20stop%20from%7DS_0%20%5C%5C%20&%20S_1%20=%20%5Csqrt%7B2%7D%20S_1%20=%20%5Csqrt%7B2%7D%5Ctimes%5Csqrt%7B2%7DS_0%20&%20&%20%5Ctext%7B2%20stops%20from%7D%20S_0%5C%5C%20&%20S_3%20=%20%5Csqrt%7B2%7D%20S_2%20=%20%5Csqrt%7B2%7D%5Ctimes%5Csqrt%7B2%7D%5Ctimes%5Csqrt%7B2%7DS_0%20&%20&%20%5Ctext%7B3%20stops%20from%7D%20S_0%20%5C%5C%20&%20%5Cvdots%20&%20&%20%5Cvdots%5C%5C%20&%20S_n%20=%20%5Csqrt%7B2%7D%20S_%7Bn-1%7D%20=%20%5Cleft%28%5Csqrt%7B2%7D%20%5Cright%20%29%5En%20S_0%20&%20&%20%5Ctext%7Bn%20stops%20from%7D%20S_0%20%5Cend%7Balign*%7D" title="\bg_white \120dpi \large \begin{align*} &S_0 & & \text{A given initial stop number} \\ &S_1 = \sqrt{2} S_0 & & \text{1 stop from}S_0 \\ & S_1 = \sqrt{2} S_1 = \sqrt{2}\times\sqrt{2}S_0 & & \text{2 stops from} S_0\\ & S_3 = \sqrt{2} S_2 = \sqrt{2}\times\sqrt{2}\times\sqrt{2}S_0 & & \text{3 stops from} S_0 \\ & \vdots & & \vdots\\ & S_n = \sqrt{2} S_{n-1} = \left(\sqrt{2} \right )^n S_0 & & \text{n stops from} S_0 \end{align*}" /></a></div>
<br />
With this general recurrence formula, we can calculate the stop number at any given number of stops from a starting number S0. For example, if our lens is set at S0 = 5.6 and we want to calculate the stop number corresponding to 3 stops (i.e. letting in 3 times as much LESS light), we have<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cleft.%5Cbegin%7Balign*%7D%20&%20S_0%20=%205.6%20%5C%5C%20&%203%20%5C;%20%5Ctext%7Bstops%7D%5Cimplies%20n%20=%203%20%5Cend%7Balign*%7D%5Cright%5C%7D%20S_3%20=%20%5Cleft%28%5Csqrt%7B2%7D%20%5Cright%20%29%5E3%20S_0=15.83%5Capprox%2016" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cleft.%5Cbegin%7Balign*%7D%20&%20S_0%20=%205.6%20%5C%5C%20&%203%20%5C;%20%5Ctext%7Bstops%7D%5Cimplies%20n%20=%203%20%5Cend%7Balign*%7D%5Cright%5C%7D%20S_3%20=%20%5Cleft%28%5Csqrt%7B2%7D%20%5Cright%20%29%5E3%20S_0=15.83%5Capprox%2016" title="\bg_white \120dpi \large \left.\begin{align*} & S_0 = 5.6 \\ & 3 \; \text{stops}\implies n = 3 \end{align*}\right\} S_3 = \left(\sqrt{2} \right )^3 S_0=15.83\approx 16" /></a></div>
<br />
This means that n is in fact the number of stops from S0. It is simply a counter of stops. <br />
<br />
<h1>
Smallest Stop Number</h1>
<br />
The question now arises as to what is the smallest stop number that a lens can achieve and how difficult is it to manufacture such lenses. I do not have any experience with lens manufacturing (although I have been contemplating learning that skill lately), but the mathematics could give us a hint. Looking at the equation for the aperture diameter<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Cbg_white%20%5C120dpi%20%5Clarge%20%7B%5Crm%20D%7D%20=%20%5Cfrac%7Bf%7D%7BS%7D=%5Cfrac%7B%5Ctext%7BFocal%20Length%7D%7D%7B%5Ctext%7BStop%20Number%7D%7D" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Cbg_white%20%5C120dpi%20%5Clarge%20%7B%5Crm%20D%7D%20=%20%5Cfrac%7Bf%7D%7BS%7D=%5Cfrac%7B%5Ctext%7BFocal%20Length%7D%7D%7B%5Ctext%7BStop%20Number%7D%7D" title="\bg_white \120dpi \bg_white \120dpi \large {\rm D} = \frac{f}{S}=\frac{\text{Focal Length}}{\text{Stop Number}}" /></a></div>
<br />
one could argue that the longer the focal lens of a camera, the more difficult it is to achieve small stop number. Here is why. Let's say that you have a 50mm lens, for a stop number S=1, this means that the aperture diameter is equal to the focal length, i.e. 50 mm. Threfore, the actual diameter of your lens MUST be at least 50mm! If you add the barrel and the internal mechanisms, the actual diameter will be even larger than 50mm.<br />
<br />
Look at the Nikon 50mm F1.4D lens for example. Its maximum aperture diameter is D = 50mm/1.4 = 35.7mm while the lens' actual diameter is a whopping 64.5mm!<br />
<br />
Let's take another extreme. For a lens with a focal length of 500mm, a stop number of 1 means that the aperture diameter is 500mm! Imagine carrying a lens that's half a meter in diameter (of 1.65 ft!). These become impractical (unless you're dealing with a telescope). For example, the maximum aperture diameter for the Nikon 600mm f4.0 is D = 600/2 = 150mm. The lens has a diameter of 165mm and weight of about 5kg!<br />
<br />
Bottom line is that the longer the focal length of a lens, the more difficult it is to manufacture it with wide apertures. That is also why fast lenses are very expensive! And that's why fast TELEPHOTO lenses are even more expensive! There are important design considerations to take into account in that case...<br />
<br />
It is however convenient to choose S = 1 as the smallest stop number and start from there. In this case, our recurrence formula becomes<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20S_n%20=%20%5Cleft%28%5Csqrt%7B2%7D%20%5Cright%20%29%5En%20=%202%5E%7B%5Cfrac%7Bn%7D%7B2%7D%7D" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20S_n%20=%20%5Cleft%28%5Csqrt%7B2%7D%20%5Cright%20%29%5En%20=%202%5E%7B%5Cfrac%7Bn%7D%7B2%7D%7D" title="\bg_white \120dpi \large S_n = \left(\sqrt{2} \right )^n = 2^{\frac{n}{2}}" /></a></div>
<br />
and here's how the famous f/stop numbers are generated:<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%201%20%5Coverset%7B%5Ctimes%20%5Csqrt%7B2%7D%7D%7B%5Clongrightarrow%7D%201.4%20%5Coverset%7B%5Ctimes%20%5Csqrt%7B2%7D%7D%7B%5Clongrightarrow%7D%202%20%5Coverset%7B%5Ctimes%20%5Csqrt%7B2%7D%7D%7B%5Clongrightarrow%7D%202.8%20%5Coverset%7B%5Ctimes%20%5Csqrt%7B2%7D%7D%7B%5Clongrightarrow%7D%204%20%5Coverset%7B%5Ctimes%20%5Csqrt%7B2%7D%7D%7B%5Clongrightarrow%7D%205.6%20%5Ccdots" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%201%20%5Coverset%7B%5Ctimes%20%5Csqrt%7B2%7D%7D%7B%5Clongrightarrow%7D%201.4%20%5Coverset%7B%5Ctimes%20%5Csqrt%7B2%7D%7D%7B%5Clongrightarrow%7D%202%20%5Coverset%7B%5Ctimes%20%5Csqrt%7B2%7D%7D%7B%5Clongrightarrow%7D%202.8%20%5Coverset%7B%5Ctimes%20%5Csqrt%7B2%7D%7D%7B%5Clongrightarrow%7D%204%20%5Coverset%7B%5Ctimes%20%5Csqrt%7B2%7D%7D%7B%5Clongrightarrow%7D%205.6%20%5Ccdots" title="\bg_white \120dpi \large 1 \overset{\times \sqrt{2}}{\longrightarrow} 1.4 \overset{\times \sqrt{2}}{\longrightarrow} 2 \overset{\times \sqrt{2}}{\longrightarrow} 2.8 \overset{\times \sqrt{2}}{\longrightarrow} 4 \overset{\times \sqrt{2}}{\longrightarrow} 5.6 \cdots" /></a></div>
<br />
Remember, each full stop lets in twice as much or half as less light. The above equation is for reducing the aperture size, i.e. letting in less light. (the converse recurrence relation can be easily derived).<br />
<br />
<h1>
Intermediate Stops</h1>
Now what about half stops, one-third stops or one-fourth stops? How are these numbers constructed? If a full stop lets in half as much light, does a half stop let in 75% light? Let's look at that.<br />
<br />
Keeping in mind that the f-stop sequence is a geometric sequence (multiplicative), any value sought within an interval has to obey the rules of a geometric sequence. Let us insert a "partial stop" in the middle of a full stop interval<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cbegin%7Bmatrix%7D%20S_%7Bn-1%7D%20%5Cxrightarrow[%5Ctext%7B1%20stop%7D]%7B%5Ctimes%20%5Csqrt%7B2%7D%7D%20S_n%20%5C%5C[12pt]%20S_n%20=%20%5Csqrt%7B2%7DS_%7Bn-1%7D%20%5C%5C[12pt]%20S_%7Bn-1%7D%20%5Cxrightarrow[%5Ctext%7Bhalf%20stop%7D]%7B%5Ctimes%20P%7D%5Cphi%20%5Cxrightarrow[%5Ctext%7Bhalf%20stop%7D]%7B%5Ctimes%20P%7D%20S_n%20%5Cend%7Bmatrix%7D" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cbegin%7Bmatrix%7D%20S_%7Bn-1%7D%20%5Cxrightarrow[%5Ctext%7B1%20stop%7D]%7B%5Ctimes%20%5Csqrt%7B2%7D%7D%20S_n%20%5C%5C[12pt]%20S_n%20=%20%5Csqrt%7B2%7DS_%7Bn-1%7D%20%5C%5C[12pt]%20S_%7Bn-1%7D%20%5Cxrightarrow[%5Ctext%7Bhalf%20stop%7D]%7B%5Ctimes%20P%7D%5Cphi%20%5Cxrightarrow[%5Ctext%7Bhalf%20stop%7D]%7B%5Ctimes%20P%7D%20S_n%20%5Cend%7Bmatrix%7D" title="\bg_white \120dpi \large \begin{matrix} S_{n-1} \xrightarrow[\text{1 stop}]{\times \sqrt{2}} S_n \\[12pt] S_n = \sqrt{2}S_{n-1} \\[12pt] S_{n-1} \xrightarrow[\text{half stop}]{\times P}\phi \xrightarrow[\text{half stop}]{\times P} S_n \end{matrix}" /></a></div>
<br />
or<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cleft.%20%5Cbegin%7Bmatrix%7D%20%5Cphi%20=%20S_%7Bn-1%7D%5Ctimes%20P%20%5C%5C[12pt]%20S_%7Bn%7D=%5Cphi%20%5Ctimes%20P%20%5Cend%7Bmatrix%7D%20%5Cright%20%5C%7D%20S_n%20=%20P%5E2%20S_%7Bn-1%7D" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cleft.%20%5Cbegin%7Bmatrix%7D%20%5Cphi%20=%20S_%7Bn-1%7D%5Ctimes%20P%20%5C%5C[12pt]%20S_%7Bn%7D=%5Cphi%20%5Ctimes%20P%20%5Cend%7Bmatrix%7D%20%5Cright%20%5C%7D%20S_n%20=%20P%5E2%20S_%7Bn-1%7D" title="\bg_white \120dpi \large \left. \begin{matrix} \phi = S_{n-1}\times P \\[12pt] S_{n}=\phi \times P \end{matrix} \right \} S_n = P^2 S_{n-1}" /></a></div>
<br />
but, we know that<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20S_n%20=%20%5Csqrt%7B2%7D%5C,S_%7Bn-1%7D" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20S_n%20=%20%5Csqrt%7B2%7D%5C,S_%7Bn-1%7D" title="\bg_white \120dpi \large S_n = \sqrt{2}\,S_{n-1}" /></a></div>
<br />
form which we can computer P, the common ratio for the half-stop sequence<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20P%5E2%20=%20%5Csqrt%7B2%7D;%5Cquad%20%5Ctext%7Bor%7D%20%5Cquad%20P%20=%20%5Csqrt%7B%5Csqrt%7B2%7D%7D=2%5E%7B%5Cfrac%7B1%7D%7B4%7D%7D" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20P%5E2%20=%20%5Csqrt%7B2%7D;%5Cquad%20%5Ctext%7Bor%7D%20%5Cquad%20P%20=%20%5Csqrt%7B%5Csqrt%7B2%7D%7D=2%5E%7B%5Cfrac%7B1%7D%7B4%7D%7D" title="\bg_white \120dpi \large P^2 = \sqrt{2};\quad \text{or} \quad P = \sqrt{\sqrt{2}}=2^{\frac{1}{4}}" /></a></div>
<br />
The same principles applies for deriving one-third, one-fourth,... one-mth stops (divide the interval into m sub intervals). In general, for a one-mth stop increment, we will have<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20P%5Em%20=%20%5Csqrt%7B2%7D;%5Cquad%20%5Ctext%7Bor%7D%20%5Cquad%20P%20=%202%5E%7B%5Cfrac%7B1%7D%7B2m%7D%7D" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20P%5Em%20=%20%5Csqrt%7B2%7D;%5Cquad%20%5Ctext%7Bor%7D%20%5Cquad%20P%20=%202%5E%7B%5Cfrac%7B1%7D%7B2m%7D%7D" title="\bg_white \120dpi \large P^m = \sqrt{2};\quad \text{or} \quad P = 2^{\frac{1}{2m}}" /></a></div>
<br />
For example, for a 1/3 stop increment from S0=1, we have<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cleft.%20%5Cbegin%7Balign*%7D%20&S_0%20=%201%20%5C%5C%20&%5Cfrac%7B1%7D%7B3%7D%20%5Cquad%20%5Ctext%7Bstop%20%7D%5Cimplies%20m%20=%203%20%5Cend%7Balign*%7D%20%5Cright%5C%7D%20S_%7B%5Cfrac%7B1%7D%7B3%7D%7D%20=%202%5E%7B%5Cfrac%7B1%7D%7B6%7D%7D=1.122%5Capprox1.1" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cleft.%20%5Cbegin%7Balign*%7D%20&S_0%20=%201%20%5C%5C%20&%5Cfrac%7B1%7D%7B3%7D%20%5Cquad%20%5Ctext%7Bstop%20%7D%5Cimplies%20m%20=%203%20%5Cend%7Balign*%7D%20%5Cright%5C%7D%20S_%7B%5Cfrac%7B1%7D%7B3%7D%7D%20=%202%5E%7B%5Cfrac%7B1%7D%7B6%7D%7D=1.122%5Capprox1.1" title="\bg_white \120dpi \large \left. \begin{align*} &S_0 = 1 \\ &\frac{1}{3} \quad \text{stop }\implies m = 3 \end{align*} \right\} S_{\frac{1}{3}} = 2^{\frac{1}{6}}=1.122\approx1.1" /></a></div>
<br />
There is an even easier way to derive non-integer stop formulas. Using <br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20S_n%20=%20%5Cleft%28%5Csqrt%7B2%7D%20%5Cright%20%29%5En%20=%202%5E%7B%5Cfrac%7Bn%7D%7B2%7D%7D" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20S_n%20=%20%5Cleft%28%5Csqrt%7B2%7D%20%5Cright%20%29%5En%20=%202%5E%7B%5Cfrac%7Bn%7D%7B2%7D%7D" title="\bg_white \120dpi \large S_n = \left(\sqrt{2} \right )^n = 2^{\frac{n}{2}}" /></a></div>
<br />
we notice that there is no restriction on "n" being an integer. As discussed previously, n is simply a stop counter. So, for example, if you want 1/3 stops, you simply substitute n = 1/3. If you want 2.4 stops, use n = 2.4 etc...<br />
<br />
<h1>
Number of Stops Between Two Stop Numbers</h1>
One can derive an equation for the number of stops between two stop numbers using the formula<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cbg_white%20%5C120dpi%20%5Clarge%20S_n%20=%20%5Cleft%28%5Csqrt%7B2%7D%20%5Cright%20%29%5En%20S_0" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20%5Cbg_white%20%5C120dpi%20%5Clarge%20S_n%20=%20%5Cleft%28%5Csqrt%7B2%7D%20%5Cright%20%29%5En%20S_0" title="\bg_white \120dpi \large \bg_white \120dpi \large S_n = \left(\sqrt{2} \right )^n S_0" /></a></div>
<br />
By taking the natural logarithm of both sides of the equation, we get<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20n%20=%20%5Cfrac%7B%5Clog%5Cleft%28%5Cfrac%7BS_n%7D%7BS_0%7D%20%5Cright%20%29%7D%7B%5Clog%5Cleft%28%5Csqrt%7B2%7D%20%5Cright%20%29%7D%20=%20%5Clog_%7B%5Csqrt%7B2%7D%7D%5Cleft%28%5Cfrac%7BS_n%7D%7BS_0%7D%20%5Cright%20%29" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20n%20=%20%5Cfrac%7B%5Clog%5Cleft%28%5Cfrac%7BS_n%7D%7BS_0%7D%20%5Cright%20%29%7D%7B%5Clog%5Cleft%28%5Csqrt%7B2%7D%20%5Cright%20%29%7D%20=%20%5Clog_%7B%5Csqrt%7B2%7D%7D%5Cleft%28%5Cfrac%7BS_n%7D%7BS_0%7D%20%5Cright%20%29" title="\bg_white \120dpi \large n = \frac{\log\left(\frac{S_n}{S_0} \right )}{\log\left(\sqrt{2} \right )} = \log_{\sqrt{2}}\left(\frac{S_n}{S_0} \right )" /></a></div>
<br />
For example, to calculate the number of stops between f/22 and f/1.4, we set<br />
<br />
<div style="text-align: center;">
<a href="http://www.codecogs.com/eqnedit.php?latex=%5Cbg_white%20%5C120dpi%20%5Clarge%20n%20=%20%5Clog_%7B%5Csqrt%7B2%7D%7D%5Cleft%28%5Cfrac%7B22%7D%7B1.4%7D%20%5Cright%20%29=7.98%20%5Capprox%208%20%5C;%20%5Ctext%7Bstops%7D" target="_blank"><img src="http://latex.codecogs.com/png.latex?%5Cbg_white%20%5C120dpi%20%5Clarge%20n%20=%20%5Clog_%7B%5Csqrt%7B2%7D%7D%5Cleft%28%5Cfrac%7B22%7D%7B1.4%7D%20%5Cright%20%29=7.98%20%5Capprox%208%20%5C;%20%5Ctext%7Bstops%7D" title="\bg_white \120dpi \large n = \log_{\sqrt{2}}\left(\frac{22}{1.4} \right )=7.98 \approx 8 \; \text{stops}" /></a></div>
<br />
so that f/1.4 lets is 8 stops away from f/22 and lets in ~ 256 times more light than f/22! (at the same focal length. At other focal lengthes, the amount of light that reaches the sensor is ~ 256 times more).<br />
<br />
Voila!</div>
yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com15tag:blogger.com,1999:blog-8385614935184816985.post-88285633931682294062010-08-18T08:18:00.000-06:002010-08-18T08:18:00.062-06:00How to Enable PHP Inside HTML Pagesphp code can be embedded within html pages within the tags:<br />
<blockquote><?php echo "my php code"; ?> </blockquote><br />
However, and depending on the server that you are using, this must be enabled. On apache2, you can edit the .htaccess file to include:<br />
<blockquote>AddType application/x-httpd-php .htm .html </blockquote><br />
I added this line to the .htaccess on my website's root directory.<br />
<br />
Voila!yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com6tag:blogger.com,1999:blog-8385614935184816985.post-13055558890402789952010-08-16T08:16:00.001-06:002010-08-17T20:02:16.967-06:00Picasa Installation Error on UbuntuSo Picasa has failed to install on my Ubuntu box. The caveat is that it also prevented me to install any other packages and gave the following error whenever i tried to install something:<br />
<blockquote>ubuntu previous installation hasn't been completed</blockquote>I suspected it was Picasa, but to verify, I opened up a terminal and typed the following:<br />
<blockquote>sudo apt-get -f install</blockquote>and I got the following error message:<br />
<blockquote>The package Picasa needs to be reinstalled, but I can’t find an archive for it.</blockquote>The solution to this is to cleanup the incorrectly installed package (Picasa or else) via the following:<br />
<blockquote>dpkg --remove --force-remove-reinstreq picasa</blockquote>That solved the problem for me. I haven't tried reinstalling Picasa though.yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com2tag:blogger.com,1999:blog-8385614935184816985.post-88524503136422643672010-08-13T08:13:00.001-06:002010-08-13T08:13:00.663-06:00How to Change Computer Name or Hostname in LinuxThe hostname is stored in the file<br />
<blockquote>/etc/hostname</blockquote>You can edit that with your favorite editor. I use emacs:<br />
<blockquote>sudo emacs /etc/hostname</blockquote>You will also need to match that in<br />
<blockquote>/etc/hosts</blockquote>yNothttp://www.blogger.com/profile/00927814737369584226noreply@blogger.com1