<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Presented Without Proof &#187; pstricks</title>
	<atom:link href="http://301south.net/tag/pstricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://301south.net</link>
	<description>(an exercise for the reader)</description>
	<lastBuildDate>Fri, 23 Jul 2010 22:15:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Curve-fit with zero offset</title>
		<link>http://301south.net/2010/02/curve-fit-with-zero-offset/</link>
		<comments>http://301south.net/2010/02/curve-fit-with-zero-offset/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 05:38:04 +0000</pubDate>
		<dc:creator>brandon</dc:creator>
				<category><![CDATA[engineering]]></category>
		<category><![CDATA[research]]></category>
		<category><![CDATA[calcium]]></category>
		<category><![CDATA[curve fitting]]></category>
		<category><![CDATA[ionomycin]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[pstricks]]></category>

		<guid isPermaLink="false">http://301south.net/?p=175</guid>
		<description><![CDATA[Say you are measuring some signal, which you expect to show an exponential decay, but you are unsure of the zero-point on your measuring device.  If you want to measure the time constant of the decay you need to know what it&#8217;s decaying to.  For a signal s,

In order to do conventional least-squares [...]]]></description>
			<content:encoded><![CDATA[<p>Say you are measuring some signal, which you expect to show an exponential decay, but you are unsure of the zero-point on your measuring device.  If you want to measure the time constant of the decay you need to know what it&#8217;s decaying to.  For a signal s,</p>
<p><img src='http://s.wordpress.com/latex.php?latex=s%3Ds_%7B0%7D%2BA_0%5Cexp%28-t%2F%5Ctau%29&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='s=s_{0}+A_0\exp(-t/\tau)' title='s=s_{0}+A_0\exp(-t/\tau)' class='latex' /></p>
<p>In order to do conventional least-squares fitting to <img src='http://s.wordpress.com/latex.php?latex=A_0%5Cexp%28-t%2F%5Ctau%29&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='A_0\exp(-t/\tau)' title='A_0\exp(-t/\tau)' class='latex' /> you need to determine <img src='http://s.wordpress.com/latex.php?latex=s_0&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='s_0' title='s_0' class='latex' />.</p>
<p><div id="attachment_180" class="wp-caption aligncenter" style="width: 650px"><a href="http://301south.net/files/2010/02/step-response.png"><img class="size-medium wp-image-180" title="step-response" src="http://301south.net/files/2010/02/step-response-640x400.png" alt="Step response of NIH 3T3 fibroblasts to ionomycin" width="640" height="400" /></a><br />
<p class="wp-caption-text">Step response of NIH 3T3 fibroblasts to ionomycin</p></div><br />
<span id="more-175"></span></p>
<p>For instance, the figure above shows the fluorescent intensity of some 3T3 cells to ionomycin.   The traces are normalized to the initial values.  Notice that the cells don&#8217;t recover to the levels at which they began.  I wanted to know the time constant of the decay on the tail of the trace.</p>
<p>I solved this problem by performing the fit inside an iterative minimum-finding function.  First I identified the point of fastest decline and selected that as the <img src='http://s.wordpress.com/latex.php?latex=t%3D0&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='t=0' title='t=0' class='latex' /> point.  Then I iterated to find the value for <img src='http://s.wordpress.com/latex.php?latex=y_0&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='y_0' title='y_0' class='latex' /> which minimized the norm of the error:</p>
<p><img src='http://s.wordpress.com/latex.php?latex=%7C%7C%20%28y%20-%20y_0%29%20-%20A%5Cexp%28-t%2F%5Ctau%29%20%7C%7C&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='|| (y - y_0) - A\exp(-t/\tau) ||' title='|| (y - y_0) - A\exp(-t/\tau) ||' class='latex' /></p>
<p>for best-fit A and <img src='http://s.wordpress.com/latex.php?latex=%5Ctau&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\tau' title='\tau' class='latex' />.</p>
<pre>
y0_fit = fminbnd( @(y0) ...
                 norm( y-y0 - exp( polyval( polyfit( x, log(y-y0), 1), x))) ,...
                 -10*y(1), y(1) );
</pre>
<p>This, along with other analysis:</p>
<p><a href="http://301south.net/files/2010/02/step-analysis.png"><img src="http://301south.net/files/2010/02/step-analysis-640x378.png" alt="step-analysis" title="step-analysis" width="640" height="378" class="aligncenter size-medium wp-image-183" /></a></p>
<p>For a population of cells (Showing mean and standard deviation for each test point.  numbers in parentheses indicate number of cells in the sample.):</p>
<p><a href="http://301south.net/files/2010/02/step-statistics.png"><img src="http://301south.net/files/2010/02/step-statistics-640x300.png" alt="step-statistics" title="step-statistics" width="640" height="300" class="aligncenter size-medium wp-image-187" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://301south.net/2010/02/curve-fit-with-zero-offset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alternatives Analysis</title>
		<link>http://301south.net/2010/01/alternatives-analysis/</link>
		<comments>http://301south.net/2010/01/alternatives-analysis/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 11:57:26 +0000</pubDate>
		<dc:creator>brandon</dc:creator>
				<category><![CDATA[research]]></category>
		<category><![CDATA[alternatives analysis]]></category>
		<category><![CDATA[chemistry]]></category>
		<category><![CDATA[dtsc]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[pstricks]]></category>

		<guid isPermaLink="false">http://301south.net/?p=156</guid>
		<description><![CDATA[Finishing up a report for DTSC on &#8220;Alternatives Analysis&#8221;.. switched from writing to layout on Thursday and now it&#8217;s almost done.  Here are some figures I created for the work (in pstricks, of course).

TeX source
Figure [above] shows how hazards, risks, and costs are considered together in an alternatives analysis.  A successful alternatives analysis should develop [...]]]></description>
			<content:encoded><![CDATA[<p>Finishing up a report for <a href="http://www.dtsc.ca.gov/">DTSC</a> on &#8220;Alternatives Analysis&#8221;.. switched from writing to layout on Thursday and now it&#8217;s almost done.  Here are some figures I created for the work (in <a href="http://www.tug.org/PSTricks/main.cgi/">pstricks</a>, of course).</p>
<p><a href="http://301south.net/files/2010/01/overview.png"><img class="aligncenter size-large wp-image-163" src="http://301south.net/files/2010/01/overview-800x786.png" alt="overview" width="800" height="786" /></a></p>
<p><span id="more-156"></span><a href="http://ocean.301south.net/stuff/overview.fig">TeX source</a></p>
<p>Figure [above] shows how hazards, risks, and costs are considered together in an alternatives analysis.  A successful alternatives analysis should develop and evaluate several different approaches for solving the problem at hand.  The analysis should make conspicuous consideration of hazards, the sources of hazards, and opportunities to avoid hazards, thus ensuring a precautionary footing.  The risks presented by unavoidable hazards should be analyzed using conventional methods.  Decision analytic tools should be used to compare the resulting options and weight the relevant criteria.  The results of the analysis should be reported to the public in a manner that enables informed decision making by consumers while encouraging responsible innovation by industry.  The process should be ongoing and the analysis should be improved continuously.</p>
<p><a href="http://301south.net/files/2010/01/fu-scope.png"><img class="aligncenter size-large wp-image-158" src="http://301south.net/files/2010/01/fu-scope-800x389.png" alt="fu-scope" width="800" height="389" /></a></p>
<p><a href="http://ocean.301south.net/stuff/fu-scope.fig">TeX source</a></p>
<p>Since large-scale manufacturing processes are highly integrative, with each stage depending on the output from the prior stage, the functional requirements of a single manufacturing stage can be extremely specific and large changes can be disruptive to the manufacturing chain.  An analyst considering a single manufacturing process (limited scope) may have limited flexibility in selecting alternatives.  On the other hand, an analyst considering an entire product system (broad scope) may be able to envision a much wider array of alternatives. Figure [above] shows a generic product life cycle and compares the minimal scope for an alternatives analysis to the maximal scope, which is the entire product system.</p>
]]></content:encoded>
			<wfw:commentRss>http://301south.net/2010/01/alternatives-analysis/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Convert LaTeX figures to stand-alone graphics</title>
		<link>http://301south.net/2009/08/convert-latex-figures-to-stand-alone-graphics/</link>
		<comments>http://301south.net/2009/08/convert-latex-figures-to-stand-alone-graphics/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 00:02:12 +0000</pubDate>
		<dc:creator>brandon</dc:creator>
				<category><![CDATA[null]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[file oriented programming]]></category>
		<category><![CDATA[pstricks]]></category>
		<category><![CDATA[TeX]]></category>

		<guid isPermaLink="false">http://301south.net/?p=88</guid>
		<description><![CDATA[As I am wont to do, I&#8217;ve been frittering away the hours poking and prodding TeX to make beautiful graphics.  This is my way of giving myself the impression of working hard, and actually accomplishing things, though not things that necessarily advance my career.
I&#8217;m quite fond of PSTricks, a LaTeX package which allows the author [...]]]></description>
			<content:encoded><![CDATA[<p>As I am wont to do, I&#8217;ve been frittering away the hours poking and prodding TeX to make beautiful graphics.  This is my way of giving myself the impression of working hard, and actually accomplishing things, though not things that necessarily advance my career.</p>
<p>I&#8217;m quite fond of <a href="http://www.tug.org/PSTricks/main.cgi?file=examples">PSTricks</a>, a LaTeX package which allows the author to make use of PostScript&#8217;s extensive computational and graphical capabilities from within a TeX document.  My project for this week was to come up with a way to give these figures to my advisor, who works exclusively in MS Word.  So what I needed was a way to export TeX figures to graphics files.  Here&#8217;s what I came up with.<br />
<span id="more-88"></span><br />
Essentially, I create a file which includes the <code>\pspicture</code> environment and all the graphics commands, which I call <code>somepicture.fig</code>.  I then <code>\input{somepicture.fig}</code> into my main document when I want the picture to appear.  When I then want to convert the picture into a standalone graphic, I run a script called <code>figuretops.sh</code><a href="http://301south.net/~b/doc/figuretops.sh">(link to file)</a> which performs the conversion by making use of the very neat &#8220;file here&#8221; notation in bash:</p>
<pre>cat &gt;&gt; filename.tex &lt;&lt;EOF
\documentclass{article}
\usepackage{pstricks-add}
\usepackage{calc}

\begin{document}
\thispagestyle{empty}
\color{white}
\fbox{
\color{black}
\input{}
}
\end{document}
EOF</pre>
<p>When I run LaTeX on this file, it gets to the blank <code>\input{}</code> directive and asks the user for the filename.  I solve this by <code>echo</code>ing the filename into the LaTeX invocation in the bash script.  I then clean up temporary files and use</p>
<pre>convert -density 300 somefigure.eps somefigure.png</pre>
<p>to convert the eps image to a 300-DPI image.</p>
<p>Here&#8217;s a <a href="http://301south.net/~b/doc/displacement-annotated.fig">source figure</a>, the <a href="http://301south.net/~b/doc/figuretops.sh">bash script</a>, and an image it produced:</p>
<p style="text-align: center"><a href="http://301south.net/files/2009/08/displacement.png"><img class="size-medium wp-image-89 aligncenter" src="http://301south.net/files/2009/08/displacement-400x195.png" alt="displacement" width="400" height="195" /></a></p>
<p>Here&#8217;s another (naively crafted: <a href="http://301south.net/~b/doc/basic-mfa-model.fig">TeX source</a>) but more interesting figure:</p>
<p style="text-align: center">
<a href="http://301south.net/files/2009/08/basic-mfa-model.png"><img class="aligncenter size-large wp-image-95" src="http://301south.net/files/2009/08/basic-mfa-model-800x417.png" alt="basic-mfa-model" width="560" height="292" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://301south.net/2009/08/convert-latex-figures-to-stand-alone-graphics/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
