<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>zeabrah's lair</title>
	<atom:link href="http://zeabrah.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://zeabrah.wordpress.com</link>
	<description>make science fun, and fun -- a science</description>
	<lastBuildDate>Tue, 08 Feb 2011 18:04:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='zeabrah.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>zeabrah's lair</title>
		<link>http://zeabrah.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://zeabrah.wordpress.com/osd.xml" title="zeabrah&#039;s lair" />
	<atom:link rel='hub' href='http://zeabrah.wordpress.com/?pushpress=hub'/>
		<item>
		<title>A&#8217;trous 2D wavelet decomposition in python using SciPy</title>
		<link>http://zeabrah.wordpress.com/2011/02/07/atrous-2d-wavelet-decomposition-in-python-using-scipy/</link>
		<comments>http://zeabrah.wordpress.com/2011/02/07/atrous-2d-wavelet-decomposition-in-python-using-scipy/#comments</comments>
		<pubDate>Mon, 07 Feb 2011 16:21:08 +0000</pubDate>
		<dc:creator>alexeybrazhe</dc:creator>
				<category><![CDATA[dev]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[wavelet]]></category>

		<guid isPermaLink="false">http://zeabrah.wordpress.com/?p=28</guid>
		<description><![CDATA[Simple 2D A&#8217;trous wavelet decomposition using B3 spline in python with SciPy: _b3spline1d = np.array([1./16, 1./4, 3./8, 1./4, 1./16]) __x = _b3spline1d.reshape(1,-1) _b3spl2d = np.dot(__x.T,__x) def atrous2d(arr, lev, kernel=_b3spl2d, boundary='symm'): "Do 2d a'trous wavelet transform with B3-spline scaling function" approx = signal.convolve2d(arr, kernel, mode='same', boundary=boundary) # approximation w = arr - approx # wavelet details [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeabrah.wordpress.com&amp;blog=3231472&amp;post=28&amp;subd=zeabrah&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Simple 2D A&#8217;trous wavelet decomposition using B3 spline in python with SciPy:</p>
<pre>_b3spline1d = np.array([1./16, 1./4, 3./8, 1./4, 1./16])
__x = _b3spline1d.reshape(1,-1)
_b3spl2d = np.dot(__x.T,__x)

<span class="keyword">def</span> <span class="function-name">atrous2d</span>(arr, lev, kernel=_b3spl2d, boundary=<span class="string">'symm'</span>):
    <span class="string">"Do 2d a'trous wavelet transform with B3-spline scaling function"</span>
    approx = signal.convolve2d(arr, kernel,
                               mode=<span class="string">'same'</span>,
                               boundary=boundary)  <span class="comment-delimiter"># </span><span class="comment">approximation
</span>    w = arr - approx                               <span class="comment-delimiter"># </span><span class="comment">wavelet details
</span>    <span class="keyword">if</span> lev &lt;= 0: <span class="keyword">return</span> arr
    <span class="keyword">if</span> lev == 1: <span class="keyword">return</span> [w, approx]
    <span class="keyword">else:</span>        <span class="keyword">return</span> [w] + atrous1(approx,lev-1, upscale(kernel), boundary)</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeabrah.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeabrah.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeabrah.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeabrah.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zeabrah.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zeabrah.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zeabrah.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zeabrah.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeabrah.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeabrah.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeabrah.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeabrah.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeabrah.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeabrah.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeabrah.wordpress.com&amp;blog=3231472&amp;post=28&amp;subd=zeabrah&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zeabrah.wordpress.com/2011/02/07/atrous-2d-wavelet-decomposition-in-python-using-scipy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8347660c9b0d6e93027550350095a15f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alexeybrazhe</media:title>
		</media:content>
	</item>
		<item>
		<title>image-funcut</title>
		<link>http://zeabrah.wordpress.com/2010/03/05/image-funcut/</link>
		<comments>http://zeabrah.wordpress.com/2010/03/05/image-funcut/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 09:41:23 +0000</pubDate>
		<dc:creator>alexeybrazhe</dc:creator>
				<category><![CDATA[dev]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zeabrah.wordpress.com/?p=20</guid>
		<description><![CDATA[I have started and been developing a software project for image series analysis, called image-funcut. I now realise that the name for it is quite unfortunate, as it is too prone for rather bad spoonerisms. Or may be it&#8217;s a virtue?<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeabrah.wordpress.com&amp;blog=3231472&amp;post=20&amp;subd=zeabrah&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have started and been developing a software project for image series<br />
analysis, called image-funcut. I now realise that the name for it is<br />
quite unfortunate, as it is too prone for rather bad spoonerisms. Or may<br />
be it&#8217;s a virtue?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeabrah.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeabrah.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeabrah.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeabrah.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zeabrah.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zeabrah.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zeabrah.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zeabrah.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeabrah.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeabrah.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeabrah.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeabrah.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeabrah.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeabrah.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeabrah.wordpress.com&amp;blog=3231472&amp;post=20&amp;subd=zeabrah&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zeabrah.wordpress.com/2010/03/05/image-funcut/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8347660c9b0d6e93027550350095a15f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alexeybrazhe</media:title>
		</media:content>
	</item>
		<item>
		<title>leakage in R-chain</title>
		<link>http://zeabrah.wordpress.com/2008/06/14/leakage-in-r-chain/</link>
		<comments>http://zeabrah.wordpress.com/2008/06/14/leakage-in-r-chain/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 20:01:25 +0000</pubDate>
		<dc:creator>alexeybrazhe</dc:creator>
				<category><![CDATA[dev]]></category>
		<category><![CDATA[code snippets]]></category>
		<category><![CDATA[lisp]]></category>

		<guid isPermaLink="false">http://zeabrah.wordpress.com/2008/06/14/leakage-in-r-chain/</guid>
		<description><![CDATA[From time to time I will post here some little code snippets from what I write. All code is under GPL This time it is a leakage resitance calculator: (defun make-R-elem (R1 R2) (list R1 R2)) (defun axial-R (elem) (car elem)) (defun leak-R (elem) (cadr elem)) (defun make-R-chain (axial leak &#38;key (number 10)) (do ((chain [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeabrah.wordpress.com&amp;blog=3231472&amp;post=19&amp;subd=zeabrah&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>From time to time I will post here some little code snippets from what I write.<br />
All code is under GPL <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>This time it is a leakage resitance calculator:</p>
<pre>

(defun make-R-elem (R1 R2)
  (list R1 R2))

(defun axial-R (elem)
  (car elem))

(defun leak-R (elem)
  (cadr elem))

(defun make-R-chain (axial leak &amp;key (number 10))
  (do ((chain nil)
       (n 0  (1+ n)))
      ((&gt; n number) (nreverse chain))
    (push (make-R-elem axial leak) chain)))

(defun leak-resistance (chain)
 "Leakage resistanse of the repeated  circut:
       o---/\/\/\---+------o
         R1 (axial) |
                    /
                    \
                    / R2 (leakage)
                    \
                    /
                    |
                   --- Gnd
   elements are in a list: ((R1 R2) (R1 R2))
  "
  (let ((elem (car chain)))
   (if (null (cdr chain))
    (+ (axial-R elem) (leak-R elem))
    (+ (axial-R elem)
       (/ 1.0 (+ (/ 1.0 (leak-R elem))
                 (/ 1.0 (leak-resistance (cdr chain)))))))))
</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/zeabrah.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/zeabrah.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeabrah.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeabrah.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeabrah.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeabrah.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zeabrah.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zeabrah.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zeabrah.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zeabrah.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeabrah.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeabrah.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeabrah.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeabrah.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeabrah.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeabrah.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeabrah.wordpress.com&amp;blog=3231472&amp;post=19&amp;subd=zeabrah&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zeabrah.wordpress.com/2008/06/14/leakage-in-r-chain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8347660c9b0d6e93027550350095a15f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alexeybrazhe</media:title>
		</media:content>
	</item>
		<item>
		<title>New test</title>
		<link>http://zeabrah.wordpress.com/2008/06/05/new-test/</link>
		<comments>http://zeabrah.wordpress.com/2008/06/05/new-test/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 12:51:45 +0000</pubDate>
		<dc:creator>alexeybrazhe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[weblogger.el]]></category>

		<guid isPermaLink="false">http://zeabrah.wordpress.com/2008/06/05/new-test/</guid>
		<description><![CDATA[Let&#8217;s try it once again. At least, tags work now. That&#8217;s something.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeabrah.wordpress.com&amp;blog=3231472&amp;post=18&amp;subd=zeabrah&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s try it once again.</p>
<p>At least, tags work now. That&#8217;s something.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/zeabrah.wordpress.com/18/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/zeabrah.wordpress.com/18/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeabrah.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeabrah.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeabrah.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeabrah.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zeabrah.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zeabrah.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zeabrah.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zeabrah.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeabrah.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeabrah.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeabrah.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeabrah.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeabrah.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeabrah.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeabrah.wordpress.com&amp;blog=3231472&amp;post=18&amp;subd=zeabrah&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zeabrah.wordpress.com/2008/06/05/new-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8347660c9b0d6e93027550350095a15f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alexeybrazhe</media:title>
		</media:content>
	</item>
		<item>
		<title>Blogging from emacs</title>
		<link>http://zeabrah.wordpress.com/2008/06/05/blogging-from-emacs/</link>
		<comments>http://zeabrah.wordpress.com/2008/06/05/blogging-from-emacs/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 08:48:16 +0000</pubDate>
		<dc:creator>alexeybrazhe</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[weblogger.el]]></category>

		<guid isPermaLink="false">http://zeabrah.wordpress.com/2008/06/05/blogging-from-emacs/</guid>
		<description><![CDATA[Let&#8217;s see if it works. Update: It does. However, the tags/categories do not work and I don&#8217;t know how to fix it. I added tags and categories from the browser now. Pity<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeabrah.wordpress.com&amp;blog=3231472&amp;post=12&amp;subd=zeabrah&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s see if it works.</p>
<p>Update: It does. However, the tags/categories do not work and I don&#8217;t know how to fix it.</p>
<p>I added tags and categories from the browser now. Pity</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/zeabrah.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/zeabrah.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeabrah.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeabrah.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeabrah.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeabrah.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zeabrah.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zeabrah.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zeabrah.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zeabrah.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeabrah.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeabrah.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeabrah.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeabrah.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeabrah.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeabrah.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeabrah.wordpress.com&amp;blog=3231472&amp;post=12&amp;subd=zeabrah&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zeabrah.wordpress.com/2008/06/05/blogging-from-emacs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8347660c9b0d6e93027550350095a15f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alexeybrazhe</media:title>
		</media:content>
	</item>
		<item>
		<title>On how to define an ODE system in matplotlib</title>
		<link>http://zeabrah.wordpress.com/2008/05/23/on-how-to-define-an-ode-system-in-matplotlib/</link>
		<comments>http://zeabrah.wordpress.com/2008/05/23/on-how-to-define-an-ode-system-in-matplotlib/#comments</comments>
		<pubDate>Fri, 23 May 2008 17:27:35 +0000</pubDate>
		<dc:creator>alexeybrazhe</dc:creator>
				<category><![CDATA[dev]]></category>
		<category><![CDATA[closure]]></category>
		<category><![CDATA[functional]]></category>
		<category><![CDATA[matplotlib]]></category>
		<category><![CDATA[ode]]></category>
		<category><![CDATA[pylab]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://zeabrah.wordpress.com/?p=10</guid>
		<description><![CDATA[Recently, I needed to make some plots with the solution of a system of ordinary differential equations (ODE) for a textbook. I know a great tool to easily make beautiful scientific plots &#8212; matplotlib/pylab (www.matplotlib.sf.net). A very simplistic function for integrating ODE comes with it &#8212; rk4. I know, that there are better tools for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeabrah.wordpress.com&amp;blog=3231472&amp;post=10&amp;subd=zeabrah&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently, I needed to make some plots with the solution of a system of ordinary differential equations (ODE) for a textbook. I know a great tool to easily make beautiful scientific plots  &#8212; matplotlib/pylab (www.matplotlib.sf.net). A very simplistic function for integrating ODE comes with it &#8212; rk4. I know, that there are better tools for python  provided with scipy, but it is not installed on my workstation (which I don&#8217;t have root access to), I am too lazy to compile it locally.</p>
<p>OK, so we have this rk4 function. It takes 3 arguments: a function dx/dt = f(x,t), x0 (x at time zero) and time points, t. In the case of a system of ODEs, y x, x0 and t are vectors of floats. First argument, a function, can take only two arguments: x and current time. Not that much flexibility, eh?</p>
<p>Naturally, one would want to set some parameters for the ODE system. How to capture/pass them? First, I saw the solution to make a class, which would store parameters and provide a method for integration:</p>
<pre>## -- `Dumb class style' --
## Call example:
##
##&gt;&gt; fhn_slow_instance = FH_N_slow()
##&gt;&gt; rk4(fhn_slow_instance.system, state_zero, time_vector)
##
## where rk4 is a simple ODE integrator from pylab/matplotlib

class FH_N_slow:
    def __init__(self, I = 0.6, p=(1.0, 1.7, 0.5)):
        self.I = I
        self.p = p
    def dv(v,w): return v - v**3/3. - w + self.I
    def dw(v,w): return 0.08*(polyval(self.p,v) - w)
    def system(self, state, time):
        v,w = state
        return self.dv(v,w), self.dw(v,w)
</pre>
<p>FH_N_slow &#8212; is a modification of the FitzHugh-Nagumo  model of a firing neuron which allows for long interspike intervals thanks to parabolic nullcline for w and a `narrow&#8217; channel between the two nullclines. The original idea of that was coined by Hindmarsh and Rose some 20+ years before, but they had a strange form of the FitzHugh equations (not like the canonical representation).</p>
<p>This example seems to be OK, but can we simplify it? It seems natural to define a function within a closure of parameters to capture them. So, we need closures. I ended up with something like this:</p>
<pre>## -- `Functional style' --
## Doesn't it look like a closure in Lisps?
## Call example:
##
##&gt;&gt; rk4(fhn_slow1(), state_zero, time_vector)

def fhn_slow1(I=0.6, p = (1.0,  1.7,  0.5)):
    def dv(v,w): return v - v**3/3. - w + I
    def dw(v,w): return 0.08*(polyval(p,v) - w)
    def system(state, time):
        v,w = state
        return dv(v,w), dw(v,w)
    return wrapper
</pre>
<p>Our function fhn_slow1 returns another function, closed over the values for I and p.<br />
This looks neat to me.</p>
<p>And here is the phase portrait and the  time realisation of the v (membrane potential) variable:</p>
<p><a href="http://zeabrah.files.wordpress.com/2008/05/fitzhugh-slow1-1.png"><img class="alignnone size-medium wp-image-11" src="http://zeabrah.files.wordpress.com/2008/05/fitzhugh-slow1-1.png?w=300&#038;h=131" alt="Phase portrait (left) and time realisation (right). Note the `narrow channel\' between the two nullclines" width="300" height="131" /></a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/zeabrah.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/zeabrah.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeabrah.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeabrah.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeabrah.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeabrah.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zeabrah.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zeabrah.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zeabrah.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zeabrah.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeabrah.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeabrah.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeabrah.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeabrah.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeabrah.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeabrah.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeabrah.wordpress.com&amp;blog=3231472&amp;post=10&amp;subd=zeabrah&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zeabrah.wordpress.com/2008/05/23/on-how-to-define-an-ode-system-in-matplotlib/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8347660c9b0d6e93027550350095a15f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alexeybrazhe</media:title>
		</media:content>

		<media:content url="http://zeabrah.files.wordpress.com/2008/05/fitzhugh-slow1-1.png?w=300" medium="image">
			<media:title type="html">Phase portrait (left) and time realisation (right). Note the `narrow channel\' between the two nullclines</media:title>
		</media:content>
	</item>
		<item>
		<title>BO test</title>
		<link>http://zeabrah.wordpress.com/2008/05/09/bo-test/</link>
		<comments>http://zeabrah.wordpress.com/2008/05/09/bo-test/#comments</comments>
		<pubDate>Fri, 09 May 2008 09:30:16 +0000</pubDate>
		<dc:creator>alexeybrazhe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zeabrah.wordpress.com/?p=9</guid>
		<description><![CDATA[The mostly robust statistical test is a &#8216;BO&#8217; test. BO stands for &#8216;bloody obvious&#8217;.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeabrah.wordpress.com&amp;blog=3231472&amp;post=9&amp;subd=zeabrah&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The mostly robust statistical test is a &#8216;BO&#8217; test. BO stands for &#8216;bloody obvious&#8217;.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/zeabrah.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/zeabrah.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeabrah.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeabrah.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeabrah.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeabrah.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zeabrah.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zeabrah.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zeabrah.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zeabrah.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeabrah.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeabrah.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeabrah.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeabrah.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeabrah.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeabrah.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeabrah.wordpress.com&amp;blog=3231472&amp;post=9&amp;subd=zeabrah&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zeabrah.wordpress.com/2008/05/09/bo-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8347660c9b0d6e93027550350095a15f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alexeybrazhe</media:title>
		</media:content>
	</item>
		<item>
		<title>An interesting interview with D. Knuth</title>
		<link>http://zeabrah.wordpress.com/2008/04/26/an-interesting-interview-with-d-knuth/</link>
		<comments>http://zeabrah.wordpress.com/2008/04/26/an-interesting-interview-with-d-knuth/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 17:21:35 +0000</pubDate>
		<dc:creator>alexeybrazhe</dc:creator>
				<category><![CDATA[interviews]]></category>
		<category><![CDATA[Knuth]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://zeabrah.wordpress.com/2008/04/26/an-interesting-interview-with-d-knuth/</guid>
		<description><![CDATA[I&#8217;ve recently read a very interesting interview with D. Knuth at http://www.informit.com/articles/article.aspx?p=1193856 A thing to think about: literate programming.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeabrah.wordpress.com&amp;blog=3231472&amp;post=8&amp;subd=zeabrah&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently read a very interesting interview with D. Knuth at</p>
<p>http://www.informit.com/articles/article.aspx?p=1193856</p>
<p>A thing to think about: literate programming.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/zeabrah.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/zeabrah.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeabrah.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeabrah.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeabrah.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeabrah.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zeabrah.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zeabrah.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zeabrah.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zeabrah.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeabrah.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeabrah.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeabrah.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeabrah.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeabrah.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeabrah.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeabrah.wordpress.com&amp;blog=3231472&amp;post=8&amp;subd=zeabrah&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zeabrah.wordpress.com/2008/04/26/an-interesting-interview-with-d-knuth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8347660c9b0d6e93027550350095a15f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alexeybrazhe</media:title>
		</media:content>
	</item>
		<item>
		<title></title>
		<link>http://zeabrah.wordpress.com/2008/04/09/7/</link>
		<comments>http://zeabrah.wordpress.com/2008/04/09/7/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 13:52:57 +0000</pubDate>
		<dc:creator>alexeybrazhe</dc:creator>
				<category><![CDATA[citations]]></category>
		<category><![CDATA[sayings]]></category>

		<guid isPermaLink="false">http://zeabrah.wordpress.com/2008/04/09/7/</guid>
		<description><![CDATA[&#8220;sometimes it takes a tough man to make a tender chicken&#8221;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeabrah.wordpress.com&amp;blog=3231472&amp;post=7&amp;subd=zeabrah&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>&#8220;sometimes it takes a tough man to make a tender chicken&#8221;</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/zeabrah.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/zeabrah.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeabrah.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeabrah.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeabrah.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeabrah.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zeabrah.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zeabrah.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zeabrah.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zeabrah.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeabrah.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeabrah.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeabrah.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeabrah.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeabrah.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeabrah.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeabrah.wordpress.com&amp;blog=3231472&amp;post=7&amp;subd=zeabrah&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zeabrah.wordpress.com/2008/04/09/7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8347660c9b0d6e93027550350095a15f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alexeybrazhe</media:title>
		</media:content>
	</item>
		<item>
		<title>A test note from n800</title>
		<link>http://zeabrah.wordpress.com/2008/03/25/a-test-note-from-n800/</link>
		<comments>http://zeabrah.wordpress.com/2008/03/25/a-test-note-from-n800/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 11:19:30 +0000</pubDate>
		<dc:creator>alexeybrazhe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[n800]]></category>

		<guid isPermaLink="false">http://zeabrah.wordpress.com/?p=6</guid>
		<description><![CDATA[I have recently acquired a n800 tablet. Lots of fun!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeabrah.wordpress.com&amp;blog=3231472&amp;post=6&amp;subd=zeabrah&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have recently acquired a n800 tablet. Lots of fun!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/zeabrah.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/zeabrah.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeabrah.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeabrah.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeabrah.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeabrah.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zeabrah.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zeabrah.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zeabrah.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zeabrah.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeabrah.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeabrah.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeabrah.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeabrah.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeabrah.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeabrah.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeabrah.wordpress.com&amp;blog=3231472&amp;post=6&amp;subd=zeabrah&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zeabrah.wordpress.com/2008/03/25/a-test-note-from-n800/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8347660c9b0d6e93027550350095a15f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alexeybrazhe</media:title>
		</media:content>
	</item>
	</channel>
</rss>
