193 lines
8.5 KiB
HTML
193 lines
8.5 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
|
<meta name="generator" content="Doxygen 1.9.6"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>Simulating the Schrödinger wave equation using the Crank-Nicolson method in 2+1 dimensions: Simulating the Schrödinger wave equation using the Crank-Nicolson method in 2+1 dimensions</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<script type="text/x-mathjax-config">
|
|
MathJax.Hub.Config({
|
|
extensions: ["tex2jax.js"],
|
|
jax: ["input/TeX","output/HTML-CSS"],
|
|
});
|
|
</script>
|
|
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr id="projectrow">
|
|
<td id="projectalign">
|
|
<div id="projectname">Simulating the Schrödinger wave equation using the Crank-Nicolson method in 2+1 dimensions
|
|
</div>
|
|
<div id="projectbrief">Simulating the Schrödinger wave equation using the Crank-Nicolson method in 2+1 dimensions</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.9.6 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(document).ready(function(){initNavTree('index.html',''); initResizable(); });
|
|
/* @license-end */
|
|
</script>
|
|
<div id="doc-content">
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<div id="MSearchResults">
|
|
<div class="SRPage">
|
|
<div id="SRIndex">
|
|
<div id="SRResults"></div>
|
|
<div class="SRStatus" id="Loading">Loading...</div>
|
|
<div class="SRStatus" id="Searching">Searching...</div>
|
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div><div class="header">
|
|
<div class="headertitle"><div class="title">Simulating the Schrödinger wave equation using the Crank-Nicolson method in 2+1 dimensions </div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="textblock"><p><a class="anchor" id="md_README"></a> <a href="https://gitea.balaton.dev/FYS3150/Project-5">Gitea repo</a></p>
|
|
<p><a href="https://github.uio.no/FYS3150-G2-2023/Project-5">GitHub repo</a></p>
|
|
<p><a href="https://pages.github.uio.no/FYS3150-G2-2023/Project-5/">Documentation</a></p>
|
|
<div class="image">
|
|
<img src="animation.gif" alt=""/>
|
|
<div class="caption">
|
|
Double slit animation</div></div>
|
|
<h1><a class="anchor" id="autotoc_md1"></a>
|
|
Requirements</h1>
|
|
<h2><a class="anchor" id="autotoc_md2"></a>
|
|
Operating systems</h2>
|
|
<ul>
|
|
<li>Linux<ul>
|
|
<li>Has been tested on <a href="https://fedoraproject.org/">Fedora 38</a></li>
|
|
<li>Will most likely work on other Linux distributions</li>
|
|
</ul>
|
|
</li>
|
|
<li>macOS<ul>
|
|
<li>Will most likely not work due to the use of getopt, which is GNU specific.</li>
|
|
</ul>
|
|
</li>
|
|
<li>Windows<ul>
|
|
<li>Will most likely not work</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h2><a class="anchor" id="autotoc_md3"></a>
|
|
Libraries</h2>
|
|
<ul>
|
|
<li>Python<ul>
|
|
<li><a href="https://matplotlib.org/">matplotlib</a></li>
|
|
<li><a href="https://numpy.org/">numpy</a></li>
|
|
<li><a href="https://seaborn.pydata.org/">seaborn</a></li>
|
|
</ul>
|
|
</li>
|
|
<li>C++<ul>
|
|
<li><a href="https://arma.sourceforge.net/">Armadillo</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h1><a class="anchor" id="autotoc_md4"></a>
|
|
Compiling</h1>
|
|
<p>The commands shown here should be run from the root of this project.</p>
|
|
<h2><a class="anchor" id="autotoc_md5"></a>
|
|
Normal binaries</h2>
|
|
<p>Compiling regular binaries is as easy as running this command:</p>
|
|
<div class="fragment"><div class="line">make</div>
|
|
</div><!-- fragment --><p>The binaries will then be inside the <b>bin</b> directory.</p>
|
|
<h2><a class="anchor" id="autotoc_md6"></a>
|
|
Debugging binaries</h2>
|
|
<p>If you want to debug the code, then use this command:</p>
|
|
<div class="fragment"><div class="line">make debug</div>
|
|
</div><!-- fragment --><p>The binaries will then be inside the <b>debug</b> directory.</p>
|
|
<h1><a class="anchor" id="autotoc_md7"></a>
|
|
Running programs</h1>
|
|
<h2><a class="anchor" id="autotoc_md8"></a>
|
|
C++ binaries</h2>
|
|
<p>To run any of the programs, just use the following command:</p>
|
|
<div class="fragment"><div class="line">./<bin|debug>/<program-name> <args></div>
|
|
</div><!-- fragment --><p>For the <b>wave_simulation</b> program, you can use a file where each line contains a configuration for the <a class="el" href="classWaveSimulation.html" title="Simulate the evolution of a wave packet in 2 + 1 domensions.">WaveSimulation</a> class and what to output to a file. This different values should be separated by semicolons. Here is the order of what variables should be in one line: </p><pre class="fragment">h; dt; T; x_c; y_c; sigma_x; sigma_y; p_x; p_y; <thickness; pos_x; ap_sep; ap; slits>; <write_each step || the steps to write to file>
|
|
</pre><p> where <> is optional.</p>
|
|
<p>An example of a file can be found under the args directory.</p>
|
|
<h2><a class="anchor" id="autotoc_md9"></a>
|
|
Python scripts</h2>
|
|
<h3><a class="anchor" id="autotoc_md10"></a>
|
|
Install libraries</h3>
|
|
<p>Before running the scripts, make sure that all libraries are installed. Using pip, you can install all requirements like this:</p>
|
|
<div class="fragment"><div class="line">pip install -r requirements.txt</div>
|
|
</div><!-- fragment --><p>This recursively install all the packages that are listed in <b>requirements.txt</b>.</p>
|
|
<h3><a class="anchor" id="autotoc_md11"></a>
|
|
Running scripts</h3>
|
|
<p>For the Python scripts, run them from the root of the project:</p>
|
|
<div class="fragment"><div class="line">python python_scripts/<script-name></div>
|
|
</div><!-- fragment --><p>If you have any problems running the scripts, you might have to run this instead:</p>
|
|
<div class="fragment"><div class="line">python3 python_scripts/<script-name></div>
|
|
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md12"></a>
|
|
Credits</h1>
|
|
<p>The Doxygen theme used here is <a href="https://github.com/jothepro/doxygen-awesome-css">doxygen-awesome-css</a>. </p>
|
|
</div></div><!-- PageDoc -->
|
|
</div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|