<?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>The ILNumerics Blog &#187; 3d visualization</title>
	<atom:link href="https://ilnumerics.net/blog/tag/3d-visualization/feed/" rel="self" type="application/rss+xml" />
	<link>https://ilnumerics.net/blog</link>
	<description>The Productivity Machine  &#124;  A fresh attempt for scientific computing  &#124;  http://ilnumerics.net</description>
	<lastBuildDate>Thu, 05 Dec 2024 09:09:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.41</generator>
	<item>
		<title>ILNumerics for Science &#8211; How did you do the Visualization?</title>
		<link>https://ilnumerics.net/blog/ilnumerics-for-scientists-how-did-you-do-the-visualization/</link>
		<comments>https://ilnumerics.net/blog/ilnumerics-for-scientists-how-did-you-do-the-visualization/#comments</comments>
		<pubDate>Mon, 02 Feb 2015 16:35:03 +0000</pubDate>
		<dc:creator><![CDATA[Jonas]]></dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[ILNumerics]]></category>
		<category><![CDATA[Visualization]]></category>
		<category><![CDATA[3d visualization]]></category>
		<category><![CDATA[plots]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://ilnumerics.net/blog/?p=772</guid>
		<description><![CDATA[<p>In the third part of our series we focus on the visualization of scientific data. You learn how to easily display your data with ILNumerics and the ILPanels. Reactions I got a lot of emails after the last two posts (first, second) of people that liked the post and are interested in learning more. Most &#8230; <a href="https://ilnumerics.net/blog/ilnumerics-for-scientists-how-did-you-do-the-visualization/" class="more-link">Continue reading <span class="screen-reader-text">ILNumerics for Science &#8211; How did you do the Visualization?</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/ilnumerics-for-scientists-how-did-you-do-the-visualization/">ILNumerics for Science &#8211; How did you do the Visualization?</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>In the third part of our series we focus on the visualization of scientific data. You learn how to easily display your data with ILNumerics and the ILPanels.</p>
<p><span id="more-772"></span></p>
<h3>Reactions</h3>
<p style="text-align: justify;">I got a lot of emails after the last two posts (<a title="ILNumerics for Scientists – An easy start" href="http://ilnumerics.net/blog/ilnumerics-for-scientists-an-easy-start/">first</a>, <a title="ILNumerics for Scientists – Going 3D" href="http://ilnumerics.net/blog/ilnumerics-for-scientists/">second</a>) of people that liked the post and are interested in learning more. Most emails asked me to go into more details about how I did all that. Obviously, not too many people are interested in implementing the particle in a box, so the “what” is not as interesting as the “how”.</p>
<p style="text-align: justify;">In this post I want to focus on the visualization part of the previous two examples and how <a href="http://ilnumerics.net">ILNumerics </a>helped me. As many of our users are scientists and engineers they are typically experts in the computation part but appreciate a little help in the visualization. If you&#8217;re interested in the computation part, please be patient until the next post.</p>
<h3>The Form</h3>
<p style="text-align: justify;">I started by creating a new project in Visual Studio and chose Windows Forms Application. This gives me a vanilla Form1.cs. That’s the basis of all the visualization and helps me – being a scientist and not a coder – a lot, because I couldn’t do all that without the help of Visual Studio in the background.</p>
<p style="text-align: justify;">On the left-hand side in the Toolbox panel I picked TableLayoutPanel under Containers and dragged it into Form1.cs.</p>
<p style="text-align: justify;"><a href="http://ilnumerics.net/blog/wp-content/uploads/2015/02/firstimage.png"><img class="alignnone size-full wp-image-775" src="http://ilnumerics.net/blog/wp-content/uploads/2015/02/firstimage.png" alt="firstimage" width="421" height="379" /></a></p>
<p style="text-align: justify;">I adjusted the table to have three rows and a single column. In the Properties section under Dock I chose Fill so that everything scales when scaling the window later on.</p>
<p style="text-align: justify;"><a href="http://ilnumerics.net/blog/wp-content/uploads/2015/02/secondimage.png"><img class="alignnone size-full wp-image-777" src="http://ilnumerics.net/blog/wp-content/uploads/2015/02/secondimage.png" alt="secondimage" width="404" height="475" /></a></p>
<p style="text-align: justify;">A right click on Table -&gt; Edit Rows and Columns allows you to change the behavior of the three rows. I wanted the first and last row not to scale when changing the window. This is what I chose here.</p>
<p style="text-align: justify;"><a href="http://ilnumerics.net/blog/wp-content/uploads/2015/02/thirdimage.png"><img class="alignnone size-full wp-image-779" src="http://ilnumerics.net/blog/wp-content/uploads/2015/02/thirdimage.png" alt="thirdimage" width="730" height="481" /></a></p>
<p style="text-align: justify;">In the middle row we would like to see two ILNumerics panels. So I dragged another TableLayoutPanel in the middle row and chose two columns and one row. Choosing Dock = Fill for the new table and dragging two ILPanels into the respective columns (again with Dock = Fill) gives us the layout for our final Windows Form.</p>
<p style="text-align: justify;"><a href="http://ilnumerics.net/blog/wp-content/uploads/2015/02/fourthimage.png"><img class="alignnone size-full wp-image-776" src="http://ilnumerics.net/blog/wp-content/uploads/2015/02/fourthimage.png" alt="fourthimage" width="685" height="623" /></a></p>
<p style="text-align: justify;">In the header (the first row) I inserted a FlowLayoutPanel that makes sure that everything in there will be displayed rather neatly. Then I added the labels and the NumericUpDown according to my needs. Please make sure that you go through the properties of every item and choose the values according to your needs. In my case, for instance, the minimum value for the state is 1, since 0 would mean that there is no particle present. Here is the final picture of the form for the 1D particle in a box:</p>
<p><a href="http://ilnumerics.net/blog/wp-content/uploads/2015/02/fifthimage.png"><img class="alignnone size-full wp-image-774" src="http://ilnumerics.net/blog/wp-content/uploads/2015/02/fifthimage.png" alt="fifthimage" width="935" height="660" /></a></p>
<h3>The Wiring</h3>
<p style="text-align: justify;">After having the layout ready the interactivity needs to be implemented. In this case there is only one point of user interaction. The user can choose which eigenvector to display. Double-clicking on the NumericUpDown control opens a new tab with a predefined class and a function handling the event when a user changes the value of the eigenvector.</p>
<p style="text-align: justify;"><a href="http://ilnumerics.net/blog/wp-content/uploads/2015/02/sixthimage.png"><img class="alignnone size-full wp-image-778" src="http://ilnumerics.net/blog/wp-content/uploads/2015/02/sixthimage.png" alt="sixthimage" width="589" height="477" /></a></p>
<p style="text-align: justify;">All that’s needed now is to implement the function numericUpDown1_ValueChanged. This is particularly simple in our case. We just call the Update function (still to be implemented) with the new value for the eigenvector.</p>
<p style="text-align: justify;">In the case of the 2D particle in a box we have, in fact, four events that should trigger the Update function. This is easily done by introducing these lines of code in the public function Form1():</p>
<pre class="brush: csharp; title: ; notranslate">
     numericUpDown1.ValueChanged += Update;
     numericUpDown2.ValueChanged += Update;
     numericUpDown3.ValueChanged += Update;
     textBox1.TextChanged += Update;
</pre>
<h3 style="text-align: left;">The Implementation</h3>
<p style="text-align: justify;">Now, all we need to do is to implement the Update function and the initialization. The initialization makes sure that all the plotting objects are created when starting the program.</p>
<pre class="brush: csharp; title: ; notranslate">
     public Form1()
     {
        InitializeComponent();

        var EVID = 1;
        var MeshSize = 1000;

        InitializePanel1(EVID, MeshSize);
        InitializePanel2(EVID, MeshSize);

        label2.Text = string.Format(&quot;In appropriate units the energy is {0}&quot;, EVID * EVID);
     }

     private void InitializePanel1(int EVID, int MeshSize)
     {
        ILArray&lt;float&gt; XY = ILMath.tosingle(Computing_Module1.CalcWF(EVID, MeshSize));
        var color = Color.Black;
        ilPanel1.Scene =
          new ILScene {
            new ILPlotCube {
              new ILLinePlot (XY, lineColor : color)
            }
          };
     }
</pre>
<p style="text-align: justify;">The call to Computing_Module1.CalcWF will be explained in the next post. The piece of code above initializes the wave function plot and the density plot in their respective panels with the first eigenvector and a mesh size of 1000.</p>
<p>Finally, the Update function is implemented.</p>
<pre class="brush: csharp; title: ; notranslate">
     private void Update(int EVID, int MeshSize = 1000)
     {
       ILArray&lt;float&gt; XY = ILMath.tosingle(Computing_Module1.CalcWF(EVID, MeshSize));
       ilPanel1.Scene.First&lt;ILLinePlot&gt;().Update(XY);
       ilPanel1.Scene.First&lt;ILPlotCube&gt;().Reset();
       ilPanel1.Refresh();

       ILArray&lt;float&gt; XD = ILMath.tosingle(Computing_Module1.CalcDensity(EVID, MeshSize));
       ilPanel2.Scene.First&lt;ILLinePlot&gt;().Update(XD);
       ilPanel2.Scene.First&lt;ILPlotCube&gt;().Reset();
       ilPanel2.Refresh();
       label2.Text = string.Format(&quot;In appropriate units the energy is {0}&quot;, EVID * EVID);
     }
</pre>
<p style="text-align: justify;">Again, the CalcWF and CalcDensity calls will be explained in the next post. The Reset() function rescales the axes and the Refresh() function finally puts the new plot on screen.</p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/ilnumerics-for-scientists-how-did-you-do-the-visualization/">ILNumerics for Science &#8211; How did you do the Visualization?</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://ilnumerics.net/blog/ilnumerics-for-scientists-how-did-you-do-the-visualization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ILNumerics for Scientists &#8211; Going 3D</title>
		<link>https://ilnumerics.net/blog/ilnumerics-for-scientists/</link>
		<comments>https://ilnumerics.net/blog/ilnumerics-for-scientists/#comments</comments>
		<pubDate>Tue, 20 Jan 2015 15:38:39 +0000</pubDate>
		<dc:creator><![CDATA[Jonas]]></dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Features]]></category>
		<category><![CDATA[ILNumerics]]></category>
		<category><![CDATA[Interesting/ useless]]></category>
		<category><![CDATA[Scientific Computing]]></category>
		<category><![CDATA[Visualization]]></category>
		<category><![CDATA[3d visualization]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[Getting Started]]></category>
		<category><![CDATA[Quantum Mechanics]]></category>

		<guid isPermaLink="false">http://ilnumerics.net/blog/?p=761</guid>
		<description><![CDATA[<p>Recap Last time I started with one of the easiest problems in quantum mechanics: the particle in a box. This time I’ll add 1 dimension and we’ll see a particle in a 2D box. To visualize its wave function and density we need 3D surface plots. 2D Box This time we have a particle that &#8230; <a href="https://ilnumerics.net/blog/ilnumerics-for-scientists/" class="more-link">Continue reading <span class="screen-reader-text">ILNumerics for Scientists &#8211; Going 3D</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/ilnumerics-for-scientists/">ILNumerics for Scientists &#8211; Going 3D</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<h3>Recap</h3>
<p style="text-align: justify;"><a title="ILNumerics for Scientists – An easy start" href="http://ilnumerics.net/blog/ilnumerics-for-scientists-an-easy-start/">Last time </a>I started with one of the easiest problems in quantum mechanics: the particle in a box. This time I’ll add 1 dimension and we’ll see a particle in a 2D box. To visualize its wave function and density we need 3D surface plots.</p>
<h3>2D Box</h3>
<p style="text-align: justify;">This time we have a particle that is confined in a 2D box. The potential within the box is zero and outside the box infinity. Again the solution is well-known and can be found on <a href="https://en.wikipedia.org/wiki/Particle_in_a_box">Wikipedia</a>. This time the state of the wave function is determined by two numbers. These are typically called quantum numbers and refer to the X and the Y direction, respectively.</p>
<p style="text-align: justify;">The absolute size of the box doesn’t really matter and we didn’t worry about it in the 1D case. However, the relative size of the length and the width make a difference. The solution to our problem reads</p>
<p style="text-align: center;">$\Psi_{n,k}(x,y) = \sqrt{\frac{4}{L_x L_y}} \cdot \sin(n \cdot \pi \cdot x / L_x) \cdot \sin(k \cdot \pi \cdot y / L_y)$</p>
<h3>The Math</h3>
<p style="text-align: justify;">Very similar to the 1D case I quickly coded the wave function and the density for further plotting. I had to make sure that the arrays are fit for 3D plotting, so the code looks a little bit different compared to last post’s</p>
<pre class="brush: csharp; title: ; notranslate">
     public static ILArray&lt;double&gt; CalcWF(int EVXID, int EVYID, double LX, double LY, int MeshSize)
     {
        ILArray&lt;double&gt; X = linspace&lt;double&gt;(0, LX, MeshSize);
        ILArray&lt;double&gt; Y = linspace&lt;double&gt;(0, LY, MeshSize);

        ILArray&lt;double&gt; Y2d = 1;
        ILArray&lt;double&gt; X2d = meshgrid(X, Y, Y2d);

        ILArray&lt;double&gt; Z = sqrt(4.0 / LX / LY) * sin(EVXID * pi * X2d / LX) * sin(EVYID * pi * Y2d / LY);

        return Z.Concat(X2d,2).Concat(Y2d,2);
     }
</pre>
<p>Again, this took me like 10 minutes and I was done.</p>
<h3>The Visualization</h3>
<p>This time the user can choose the quantum numbers for X and Y direction, the ratio between the length and the width of the box and also the number of mesh points along each axis for plotting. This makes the visualization panel a little bit more involved. Nevertheless, it’s still rather simple and easy to use. This time it took me only 45 minutes – I guess I learned a lot from last time.</p>
<h3>The result</h3>
<p>Here is the result of my little program. You can click and play with it. If you’re interested, you can download the <a href="http://ilnumerics.net/blog/wp-content/uploads/2015/01/Particle2DBox.zip">Particle2DBox</a> source code. Have fun!</p>
<p style="text-align: justify;"><a href="http://ilnumerics.net/blog/wp-content/uploads/2015/01/Particle2DBox.jpg"><img class="aligncenter wp-image-767 size-full" src="http://ilnumerics.net/blog/wp-content/uploads/2015/01/Particle2DBox.jpg" alt="Particle2DBox" width="928" height="640" /></a>This is a screenshot of the application. I chose the second quantum number along the x axis and the fourth quantum number along the y axis. The box is twice as long in y direction as it is in x direction. The mesh size is 100 in each direction. On the left hand side you see the wave function and on the right hand side the probability density.</p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/ilnumerics-for-scientists/">ILNumerics for Scientists &#8211; Going 3D</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://ilnumerics.net/blog/ilnumerics-for-scientists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scientific Computing Online: IPython Notebook, Shiny (R) and ILNumerics</title>
		<link>https://ilnumerics.net/blog/scientific-computing-online-ipython-notebook-shiny-r-and-ilnumerics/</link>
		<comments>https://ilnumerics.net/blog/scientific-computing-online-ipython-notebook-shiny-r-and-ilnumerics/#comments</comments>
		<pubDate>Thu, 05 Sep 2013 08:28:09 +0000</pubDate>
		<dc:creator><![CDATA[Jonas]]></dc:creator>
				<category><![CDATA[Interesting/ useless]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[3d visualization]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[ILNumerics]]></category>
		<category><![CDATA[IPython Notebook]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[scientific plots]]></category>
		<category><![CDATA[Shiny]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://ilnumerics.net/blog/?p=430</guid>
		<description><![CDATA[<p>It seems that we&#8217;re facing a trend at the moment: scientific computing, math and visualization software for web browsers. With our interactive web examples we have taken a step into that direction, too: Visitors of our website can change the C# code of our plotting and visualization demos in order to create a new SVG, &#8230; <a href="https://ilnumerics.net/blog/scientific-computing-online-ipython-notebook-shiny-r-and-ilnumerics/" class="more-link">Continue reading <span class="screen-reader-text">Scientific Computing Online: IPython Notebook, Shiny (R) and ILNumerics</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/scientific-computing-online-ipython-notebook-shiny-r-and-ilnumerics/">Scientific Computing Online: IPython Notebook, Shiny (R) and ILNumerics</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>It seems that we&#8217;re facing a trend at the moment: scientific computing, math and visualization software for web browsers. With our <a href="http://ilnumerics.net/ilnumerics-interactive-web-component.html">interactive web examples</a> we have taken a step into that direction, too: Visitors of our website can change the C# code of our plotting and visualization demos in order to create a new SVG, PNG, JPG or EXE output. This allows people to easily try out the ILNumerics syntax and our powerful <a href="http://ilnumerics.net/Visualization-API.html">2d and 3d visualization features for .NET</a>. In addition to that, <a href="http://ilnumerics.net/introducing-ilview.html">ILView</a> allows a convenient way to interactively explore scenes that are created with ILNumerics.</p>
<p>There are two other web applications that cause a lot of excitement in the scientific community at the moment: The IPython Notebook and Shiny, a tool for creating web applications in R. Let&#8217;s have a closer look…</p>
<h2>IPython Notebook: &#8220;Interactive Computational Environment&#8221;</h2>
<p>The IPython Notebook adresses the huge amount of Python users in the scientific community. It basically offers a new way for writing papers: It&#8217;s a web based editor for code execution, math, text and visualization. Because the IPython Notebook combines all parts you normally need to write a scientific paper, you won&#8217;t have to import / export different elements from several domain specific software applications: &#8220;Everything related to my analysis is located in one unified place&#8221;, explains Philip J. Guo in his blog (<a href="http://www.pgbovine.net/ipython-notebook-first-impressions.htm" target="_blank">http://www.pgbovine.net/ipython-notebook-first-impressions.htm</a>). Once you have finished your paper, you can share your IPython Notebook as HTML and PDF with your colleagues, your professor etc.</p>
<h2>Shiny: &#8220;Easy web applications in R&#8221;</h2>
<p>Shiny stands for a different approach: It allows you to implement own analysis into web applications. While IPython obviously adresses Python users, Shiny is based on R, a still very popular programming language among statisticians. What makes Shiny interesting are its interactivity features: Most demos on the Shiny website offer the opportunity to choose input parameters from text fields or drop-downs to dynamically change the output visualization. The code seems to be quite similar to R, so users who are familiar with that language will easily be able to create interactive data visualization applications for their websites using Shiny.</p>
<h2>Disadvantages: Performance does matter</h2>
<p>Both approaches make web browsers accesable for specific needs of scientific visualization: The IPython Notebook offers a convenient tool to share the results of analytics related research; Shiny allows R developers to publish particular interactive plots on the web.</p>
<p>However, both projects are limited – namely because of technological issues. The level of performance that can be realized with both platforms is restricted: You&#8217;ll face that at the latest when you start creating complex 3d scenes with either Python or R. This holds true for the platforms&#8217; web applications, too…</p>
<h2>Outlook: Scientific Computing online</h2>
<p>For certain purposes web based scientific computing software offers new convenient solutions. But if you want to realize complex interactive 3d visualizations, you still won&#8217;t use any of them but an application on your local machine instead.</p>
<p>Our interactive web examples point the direction we want to go. In order to make scientific computing more powerful, we&#8217;re working on the next step of our approach: a full WebGL support for ILNumerics. Stay tuned…</p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/scientific-computing-online-ipython-notebook-shiny-r-and-ilnumerics/">Scientific Computing Online: IPython Notebook, Shiny (R) and ILNumerics</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://ilnumerics.net/blog/scientific-computing-online-ipython-notebook-shiny-r-and-ilnumerics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
