<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://e6.ijs.si/medusa/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Agrebenc</id>
		<title>Medusa: Coordinate Free Mehless Method implementation - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://e6.ijs.si/medusa/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Agrebenc"/>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php/Special:Contributions/Agrebenc"/>
		<updated>2026-04-07T17:26:39Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.1</generator>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Maximum_value.png&amp;diff=2879</id>
		<title>File:Maximum value.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Maximum_value.png&amp;diff=2879"/>
				<updated>2019-09-17T10:21:37Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: Agrebenc uploaded a new version of File:Maximum value.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2878</id>
		<title>Heat equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2878"/>
				<updated>2019-09-17T09:59:29Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
This example shows how explicit method of solving partial differential equations is used within the Medusa library. Firstly, this example compares explicit solutions to analytical, then it shows how it can be used to solve heat transfer equation.&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Domain==&lt;br /&gt;
&lt;br /&gt;
In this example, a square domain with a cut-out hole in the middle is used. The hole has radius equal to 1/3 of length of a square. Domain nodes are placed randomly with about dx length distance between them. Domain boundary is separated in to 5 areas: up, down, left, right and center. The idea is to have Dirichlet boundary condition on the square (up, down, left and right) and Neumann boundary conditions in the middle (center). &lt;br /&gt;
&lt;br /&gt;
==Fuction==&lt;br /&gt;
&lt;br /&gt;
The function used for this example is $u(x,y) = \sin(\pi x)\sin(\pi y)$. Laplace operator of this function is $\Delta u(x,y)=-2\pi^2\sin(\pi x)\sin(\pi y)$. &lt;br /&gt;
For comparing explicit solution to analytical, we solve function for each node and save solution to $u\_analytic$. With this we also calculate Dirichlet boundary conditions. Then we set domain interior and nodes with Neumann bondary conditions to arbitrary value, in this case 0. We proceed to explicitly solve the domain. In the domain interior we are solving the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         u (x,y,t+1) = dt*\bigg(\Delta u(x,y,t) + 2\pi^2\sin(\pi x)\sin(\pi y)\bigg)+u(x,y,t)&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For Neumann bondary conditions we set $u(x,y,t+1)$ in a way that it satisfies the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\partial u(x,y,t+1)}{\partial n}=n_x \pi \cos(\pi x) \sin(\pi y)+n_y \pi \sin(\pi x) \cos(\pi y)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the simulation is finished, we can easily calculate relative error. Values of nodes are saved in a vector $u1$, so we can use norm of $|u1 - u\_analytic|$ to calculate error, then divide it by norm of $u1$ to calculate relative error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
           relative\_error = \frac{\sqrt{\sum{|u1-u\_analytic|^2}}}{\sqrt{\sum{|u1|^2}}}&lt;br /&gt;
           \end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Weighted Least Squares (WLS)==&lt;br /&gt;
&lt;br /&gt;
In this simulation, we use Gaussians for our WLS. Because of scattred nodes in our domain, we have to use 9 basis. The support size we chose is 27. For weight we have chosen 1.0 and for Gaussian weight (sigma) 75. Later we will look how change of sigma and weight effects relative error.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Gaussians&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; wls({9, 75.0}, 1.0);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Finding steady state==&lt;br /&gt;
&lt;br /&gt;
To finish simulation we save values of nodes and compare them after some time steps. Next graph shows us how relative error changes, when we increase number of steps, after which we compare values.&lt;br /&gt;
&lt;br /&gt;
[[File:ending_conditions.png|800px]]&lt;br /&gt;
&lt;br /&gt;
In this graph we can see, that using 8000 time steps is sufficient for the size of our domain, which we will use in further simulations.&lt;br /&gt;
&lt;br /&gt;
==Effect of sigma and weight==&lt;br /&gt;
&lt;br /&gt;
To see the effect of sigma, we ran the same simulation twice and got following graphs:&lt;br /&gt;
&lt;br /&gt;
[[File:different_sigma_1.png|800px]]&lt;br /&gt;
[[File:different_sigma_3.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Graphs aren't identical. This is probably due to a slightly different domain. This happens because domain is generated with a bit of randomness.&lt;br /&gt;
&lt;br /&gt;
We can see is that value of sigma has a big effect on relative error. &lt;br /&gt;
&lt;br /&gt;
Weight has simmilar effect on simulation as well.&lt;br /&gt;
&lt;br /&gt;
[[File:different_weights_1.png|800px]]&lt;br /&gt;
[[File:different_weights_2.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat transfer==&lt;br /&gt;
&lt;br /&gt;
Now we use sigma 75 and weight 1.0 to solve heat transfer problem. In this case, we don't have analytical sollution. For our boundary condition, we will set up to 0.0, down to 1.0, right to 0.35 and left to 0.75. For the center hole we will use Neumann boundary conditions. We are solving following equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         \frac{\partial u (x,y,t)}{\partial t} = \Delta u(x,y,t)&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the domain interior and for domain center we use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         \frac{\partial u (x,y,t)}{\partial n} = 0&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We get the following picture.&lt;br /&gt;
&lt;br /&gt;
[[File:heat_trasfer.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Same simulation with smaller dx value gives us.&lt;br /&gt;
[[File:heat_trasfer_2.png|800px]]&lt;br /&gt;
&lt;br /&gt;
We can expect this to have the same error as the simulation with previous function. We can evaluate this by checking what the maximum value is within the domain. Doing so at different numbers of nodes gives us next graph. &lt;br /&gt;
&lt;br /&gt;
[[File:maximum_value.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Maximum value does't exceed 1.0, which it shouldn't.&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Heat_trasfer_2.png&amp;diff=2877</id>
		<title>File:Heat trasfer 2.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Heat_trasfer_2.png&amp;diff=2877"/>
				<updated>2019-09-17T09:58:31Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Heat_trasfer.png&amp;diff=2876</id>
		<title>File:Heat trasfer.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Heat_trasfer.png&amp;diff=2876"/>
				<updated>2019-09-17T09:58:13Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: Agrebenc uploaded a new version of File:Heat trasfer.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2875</id>
		<title>Heat equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2875"/>
				<updated>2019-09-17T09:55:27Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
This example shows how explicit method of solving partial differential equations is used within the Medusa library. Firstly, this example compares explicit solutions to analytical, then it shows how it can be used to solve heat transfer equation.&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Domain==&lt;br /&gt;
&lt;br /&gt;
In this example, a square domain with a cut-out hole in the middle is used. The hole has radius equal to 1/3 of length of a square. Domain nodes are placed randomly with about dx length distance between them. Domain boundary is separated in to 5 areas: up, down, left, right and center. The idea is to have Dirichlet boundary condition on the square (up, down, left and right) and Neumann boundary conditions in the middle (center). &lt;br /&gt;
&lt;br /&gt;
==Fuction==&lt;br /&gt;
&lt;br /&gt;
The function used for this example is $u(x,y) = \sin(\pi x)\sin(\pi y)$. Laplace operator of this function is $\Delta u(x,y)=-2\pi^2\sin(\pi x)\sin(\pi y)$. &lt;br /&gt;
For comparing explicit solution to analytical, we solve function for each node and save solution to $u\_analytic$. With this we also calculate Dirichlet boundary conditions. Then we set domain interior and nodes with Neumann bondary conditions to arbitrary value, in this case 0. We proceed to explicitly solve the domain. In the domain interior we are solving the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         u (x,y,t+1) = dt*\bigg(\Delta u(x,y,t) + 2\pi^2\sin(\pi x)\sin(\pi y)\bigg)+u(x,y,t)&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For Neumann bondary conditions we set $u(x,y,t+1)$ in a way that it satisfies the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\partial u(x,y,t+1)}{\partial n}=n_x \pi \cos(\pi x) \sin(\pi y)+n_y \pi \sin(\pi x) \cos(\pi y)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the simulation is finished, we can easily calculate relative error. Values of nodes are saved in a vector $u1$, so we can use norm of $|u1 - u\_analytic|$ to calculate error, then divide it by norm of $u1$ to calculate relative error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
           relative\_error = \frac{\sqrt{\sum{|u1-u\_analytic|^2}}}{\sqrt{\sum{|u1|^2}}}&lt;br /&gt;
           \end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Weighted Least Squares (WLS)==&lt;br /&gt;
&lt;br /&gt;
In this simulation, we use Gaussians for our WLS. Because of scattred nodes in our domain, we have to use 9 basis. The support size we chose is 27. For weight we have chosen 1.0 and for Gaussian weight (sigma) 75. Later we will look how change of sigma and weight effects relative error.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Gaussians&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; wls({9, 75.0}, 1.0);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Finding steady state==&lt;br /&gt;
&lt;br /&gt;
To finish simulation we save values of nodes and compare them after some time steps. Next graph shows us how relative error changes, when we increase number of steps, after which we compare values.&lt;br /&gt;
&lt;br /&gt;
[[File:ending_conditions.png|800px]]&lt;br /&gt;
&lt;br /&gt;
In this graph we can see, that using 8000 time steps is sufficient for the size of our domain, which we will use in further simulations.&lt;br /&gt;
&lt;br /&gt;
==Effect of sigma and weight==&lt;br /&gt;
&lt;br /&gt;
To see the effect of sigma, we ran the same simulation twice and got following graphs:&lt;br /&gt;
&lt;br /&gt;
[[File:different_sigma_1.png|800px]]&lt;br /&gt;
[[File:different_sigma_3.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Graphs aren't identical. This is probably due to a slightly different domain. This happens because domain is generated with a bit of randomness.&lt;br /&gt;
&lt;br /&gt;
We can see is that value of sigma has a big effect on relative error. &lt;br /&gt;
&lt;br /&gt;
Weight has simmilar effect on simulation as well.&lt;br /&gt;
&lt;br /&gt;
[[File:different_weights_1.png|800px]]&lt;br /&gt;
[[File:different_weights_2.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat transfer==&lt;br /&gt;
&lt;br /&gt;
Now we use sigma 75 and weight 1.0 to solve heat transfer problem. In this case, we don't have analytical sollution. For our boundary condition, we will set up to 0.0, down to 1.0, right to 0.35 and left to 0.75. For the center hole we will use Neumann boundary conditions. We are solving following equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         \frac{\partial u (x,y,t)}{\partial t} = \Delta u(x,y,t)&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the domain interior and for domain center we use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         \frac{\partial u (x,y,t)}{\partial n} = 0&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We get the following picture.&lt;br /&gt;
&lt;br /&gt;
[[File:heat_trasfer.png|800px]]&lt;br /&gt;
&lt;br /&gt;
We can expect this to have the same error as the simulation with previous function. We can evaluate this by checking what the maximum value is within the domain. Doing so at different numbers of nodes gives us next graph. &lt;br /&gt;
&lt;br /&gt;
[[File:maximum_value.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Maximum value does't exceed 1.0, which it shouldn't.&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Maximum_value.png&amp;diff=2874</id>
		<title>File:Maximum value.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Maximum_value.png&amp;diff=2874"/>
				<updated>2019-09-17T09:55:10Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: Agrebenc uploaded a new version of File:Maximum value.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2873</id>
		<title>Heat equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2873"/>
				<updated>2019-09-17T09:22:49Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
This example shows how explicit method of solving partial differential equations is used within the Medusa library. Firstly, this example compares explicit solutions to analytical, then it shows how it can be used to solve heat transfer equation.&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Domain==&lt;br /&gt;
&lt;br /&gt;
In this example, a square domain with a cut-out hole in the middle is used. The hole has radius equal to 1/3 of length of a square. Domain nodes are placed randomly with about dx length distance between them. Domain boundary is separated in to 5 areas: up, down, left, right and center. The idea is to have Dirichlet boundary condition on the square (up, down, left and right) and Neumann boundary conditions in the middle (center). &lt;br /&gt;
&lt;br /&gt;
==Fuction==&lt;br /&gt;
&lt;br /&gt;
The function used for this example is $u(x,y) = \sin(\pi x)\sin(\pi y)$. Laplace operator of this function is $\Delta u(x,y)=-2\pi^2\sin(\pi x)\sin(\pi y)$. &lt;br /&gt;
For comparing explicit solution to analytical, we solve function for each node and save solution to $u\_analytic$. With this we also calculate Dirichlet boundary conditions. Then we set domain interior and nodes with Neumann bondary conditions to arbitrary value, in this case 0. We proceed to explicitly solve the domain. In the domain interior we are solving the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         u (x,y,t+1) = dt*\bigg(\Delta u(x,y,t) + 2\pi^2\sin(\pi x)\sin(\pi y)\bigg)+u(x,y,t)&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For Neumann bondary conditions we set $u(x,y,t+1)$ in a way that it satisfies the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\partial u(x,y,t+1)}{\partial n}=n_x \pi \cos(\pi x) \sin(\pi y)+n_y \pi \sin(\pi x) \cos(\pi y)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the simulation is finished, we can easily calculate relative error. Values of nodes are saved in a vector $u1$, so we can use norm of $|u1 - u\_analytic|$ to calculate error, then divide it by norm of $u1$ to calculate relative error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
           relative\_error = \frac{\sqrt{\sum{|u1-u\_analytic|^2}}}{\sqrt{\sum{|u1|^2}}}&lt;br /&gt;
           \end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Weighted Least Squares (WLS)==&lt;br /&gt;
&lt;br /&gt;
In this simulation, we use Gaussians for our WLS. Because of scattred nodes in our domain, we have to use 9 basis. The support size we chose is 27. For weight we have chosen 1.0 and for Gaussian weight (sigma) 75. Later we will look how change of sigma and weight effects relative error.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Gaussians&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; wls({9, 75.0}, 1.0);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Finding steady state==&lt;br /&gt;
&lt;br /&gt;
To finish simulation we save values of nodes and compare them after some time steps. Next graph shows us how relative error changes, when we increase number of steps, after which we compare values.&lt;br /&gt;
&lt;br /&gt;
[[File:ending_conditions.png|800px]]&lt;br /&gt;
&lt;br /&gt;
In this graph we can see, that using 8000 time steps is sufficient for the size of our domain, which we will use in further simulations.&lt;br /&gt;
&lt;br /&gt;
==Effect of sigma and weight==&lt;br /&gt;
&lt;br /&gt;
To see the effect of sigma, we ran the same simulation twice and got following graphs:&lt;br /&gt;
&lt;br /&gt;
[[File:different_sigma_1.png|800px]]&lt;br /&gt;
[[File:different_sigma_3.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Graphs aren't identical. This is probably due to a slightly different domain. This happens because domain is generated with a bit of randomness.&lt;br /&gt;
&lt;br /&gt;
We can see is that value of sigma has a big effect on relative error. &lt;br /&gt;
&lt;br /&gt;
Weight has simmilar effect on simulation as well.&lt;br /&gt;
&lt;br /&gt;
[[File:different_weights_1.png|800px]]&lt;br /&gt;
[[File:different_weights_2.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat transfer==&lt;br /&gt;
&lt;br /&gt;
Now we use sigma 75 and weight 1.0 to solve heat transfer problem. In this case, we don't have analytical sollution. For our boundary condition, we will set up to 0.0, down to 1.0, right to 0.35 and left to 0.75. For the center hole we will use Neumann boundary conditions. We are solving following equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         \frac{\partial u (x,y,t)}{\partial t} = \Delta u(x,y,t)&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the domain interior and for domain center we use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         \frac{\partial u (x,y,t)}{\partial n} = 0&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We get the following picture.&lt;br /&gt;
&lt;br /&gt;
[[File:heat_trasfer.png|800px]]&lt;br /&gt;
&lt;br /&gt;
We can expect this to have the same error as the simulation with previous function. We can evaluate this by checking what the maximum value is within the domain. Doing so at different numbers of nodes gives us next graph. &lt;br /&gt;
&lt;br /&gt;
[[File:maximum_value.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Maximum value does't exceed 1.0. &lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_weights_2.png&amp;diff=2872</id>
		<title>File:Different weights 2.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_weights_2.png&amp;diff=2872"/>
				<updated>2019-09-17T09:05:30Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_weights_1.png&amp;diff=2871</id>
		<title>File:Different weights 1.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_weights_1.png&amp;diff=2871"/>
				<updated>2019-09-17T09:05:22Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2870</id>
		<title>Heat equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2870"/>
				<updated>2019-09-17T08:42:47Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
This example shows how explicit method of solving partial differential equations is used within the Medusa library. Firstly, this example compares explicit solutions to analytical, then it shows how it can be used to solve heat transfer equation.&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Domain==&lt;br /&gt;
&lt;br /&gt;
In this example, a square domain with a cut-out hole in the middle is used. The hole has radius equal to 1/3 of length of a square. Domain nodes are placed randomly with about dx length distance between them. Domain boundary is separated in to 5 areas: up, down, left, right and center. The idea is to have Dirichlet boundary condition on the square (up, down, left and right) and Neumann boundary conditions in the middle (center). &lt;br /&gt;
&lt;br /&gt;
==Fuction==&lt;br /&gt;
&lt;br /&gt;
The function used for this example is $u(x,y) = \sin(\pi x)\sin(\pi y)$. Laplace operator of this function is $\Delta u(x,y)=-2\pi^2\sin(\pi x)\sin(\pi y)$. &lt;br /&gt;
For comparing explicit solution to analytical, we solve function for each node and save solution to $u\_analytic$. With this we also calculate Dirichlet boundary conditions. Then we set domain interior and nodes with Neumann bondary conditions to arbitrary value, in this case 0. We proceed to explicitly solve the domain. In the domain interior we are solving the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         u (x,y,t+1) = dt*\bigg(\Delta u(x,y,t) + 2\pi^2\sin(\pi x)\sin(\pi y)\bigg)+u(x,y,t)&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For Neumann bondary conditions we set $u(x,y,t+1)$ in a way that it satisfies the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\partial u(x,y,t+1)}{\partial n}=n_x \pi \cos(\pi x) \sin(\pi y)+n_y \pi \sin(\pi x) \cos(\pi y)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the simulation is finished, we can easily calculate relative error. Values of nodes are saved in a vector $u1$, so we can use norm of $|u1 - u\_analytic|$ to calculate error, then divide it by norm of $u1$ to calculate relative error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
           relative\_error = \frac{\sqrt{\sum{|u1-u\_analytic|^2}}}{\sqrt{\sum{|u1|^2}}}&lt;br /&gt;
           \end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Weighted Least Squares (WLS)==&lt;br /&gt;
&lt;br /&gt;
In this simulation, we use Gaussians for our WLS. Because of scattred nodes in our domain, we have to use 9 basis. The support size we chose is 27. For weight we have chosen 1.0 and for Gaussian weight (sigma) 75. Later we will look how change of sigma and weight effects relative error.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Gaussians&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; wls({9, 75.0}, 1.0);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Finding steady state==&lt;br /&gt;
&lt;br /&gt;
To finish simulation we save values of nodes and compare them after some time steps. Next graph shows us how relative error changes, when we increase number of steps, after which we compare values.&lt;br /&gt;
&lt;br /&gt;
[[File:ending_conditions.png|800px]]&lt;br /&gt;
&lt;br /&gt;
In this graph we can see, that using 8000 time steps is sufficient for the size of our domain, which we will use in further simulations.&lt;br /&gt;
&lt;br /&gt;
==Effect of sigma and weight==&lt;br /&gt;
&lt;br /&gt;
To see the effect of sigma, we ran the same simulation twice and got following graphs:&lt;br /&gt;
&lt;br /&gt;
[[File:different_sigma_1.png|800px]]&lt;br /&gt;
[[File:different_sigma_3.png|800px]]&lt;br /&gt;
&lt;br /&gt;
(Graphs aren't identical. This is probably due to a slightly different domain. This happens becouse domain is generated with a bit of randomness.)?&lt;br /&gt;
&lt;br /&gt;
We can see is that value of sigma has a big effect on relative error. &lt;br /&gt;
&lt;br /&gt;
Weight - TODO.&lt;br /&gt;
&lt;br /&gt;
==Heat transfer==&lt;br /&gt;
&lt;br /&gt;
Now we use sigma 75 and weight 1.0 to solve heat transfer problem. In this case, we don't have analytical sollution. For our boundary condition, we will set up to 0.0, down to 1.0, right to 0.35 and left to 0.75. For the center hole we will use Neumann boundary conditions. We are solving following equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         \frac{\partial u (x,y,t)}{\partial t} = \Delta u(x,y,t)&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the domain interior and for domain center we use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         \frac{\partial u (x,y,t)}{\partial n} = 0&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We get the following picture.&lt;br /&gt;
&lt;br /&gt;
[[File:heat_trasfer.png|800px]]&lt;br /&gt;
&lt;br /&gt;
We can expect this to have the same error as the simulation with previous function. We can evaluate this by checking what the maximum value is within the domain. Doing so at different numbers of nodes gives us next graph. &lt;br /&gt;
&lt;br /&gt;
[[File:maximum_value.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Maximum value does't exceed 1.0. &lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_3.png&amp;diff=2869</id>
		<title>File:Different sigma 3.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_3.png&amp;diff=2869"/>
				<updated>2019-09-17T08:42:41Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_2.png&amp;diff=2868</id>
		<title>File:Different sigma 2.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_2.png&amp;diff=2868"/>
				<updated>2019-09-17T08:41:11Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: Agrebenc uploaded a new version of File:Different sigma 2.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2867</id>
		<title>Heat equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2867"/>
				<updated>2019-09-17T08:40:04Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
This example shows how explicit method of solving partial differential equations is used within the Medusa library. Firstly, this example compares explicit solutions to analytical, then it shows how it can be used to solve heat transfer equation.&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Domain==&lt;br /&gt;
&lt;br /&gt;
In this example, a square domain with a cut-out hole in the middle is used. The hole has radius equal to 1/3 of length of a square. Domain nodes are placed randomly with about dx length distance between them. Domain boundary is separated in to 5 areas: up, down, left, right and center. The idea is to have Dirichlet boundary condition on the square (up, down, left and right) and Neumann boundary conditions in the middle (center). &lt;br /&gt;
&lt;br /&gt;
==Fuction==&lt;br /&gt;
&lt;br /&gt;
The function used for this example is $u(x,y) = \sin(\pi x)\sin(\pi y)$. Laplace operator of this function is $\Delta u(x,y)=-2\pi^2\sin(\pi x)\sin(\pi y)$. &lt;br /&gt;
For comparing explicit solution to analytical, we solve function for each node and save solution to $u\_analytic$. With this we also calculate Dirichlet boundary conditions. Then we set domain interior and nodes with Neumann bondary conditions to arbitrary value, in this case 0. We proceed to explicitly solve the domain. In the domain interior we are solving the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         u (x,y,t+1) = dt*\bigg(\Delta u(x,y,t) + 2\pi^2\sin(\pi x)\sin(\pi y)\bigg)+u(x,y,t)&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For Neumann bondary conditions we set $u(x,y,t+1)$ in a way that it satisfies the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\partial u(x,y,t+1)}{\partial n}=n_x \pi \cos(\pi x) \sin(\pi y)+n_y \pi \sin(\pi x) \cos(\pi y)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the simulation is finished, we can easily calculate relative error. Values of nodes are saved in a vector $u1$, so we can use norm of $|u1 - u\_analytic|$ to calculate error, then divide it by norm of $u1$ to calculate relative error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
           relative\_error = \frac{\sqrt{\sum{|u1-u\_analytic|^2}}}{\sqrt{\sum{|u1|^2}}}&lt;br /&gt;
           \end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Weighted Least Squares (WLS)==&lt;br /&gt;
&lt;br /&gt;
In this simulation, we use Gaussians for our WLS. Because of scattred nodes in our domain, we have to use 9 basis. The support size we chose is 27. For weight we have chosen 1.0 and for Gaussian weight (sigma) 75. Later we will look how change of sigma and weight effects relative error.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Gaussians&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; wls({9, 75.0}, 1.0);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Finding steady state==&lt;br /&gt;
&lt;br /&gt;
To finish simulation we save values of nodes and compare them after some time steps. Next graph shows us how relative error changes, when we increase number of steps, after which we compare values.&lt;br /&gt;
&lt;br /&gt;
[[File:ending_conditions.png|800px]]&lt;br /&gt;
&lt;br /&gt;
In this graph we can see, that using 8000 time steps is sufficient for the size of our domain, which we will use in further simulations.&lt;br /&gt;
&lt;br /&gt;
==Effect of sigma and weight==&lt;br /&gt;
&lt;br /&gt;
To see the effect of sigma, we ran the same simulation twice and got following graphs:&lt;br /&gt;
&lt;br /&gt;
[[File:different_sigma_1.png|800px]]&lt;br /&gt;
[[File:different_sigma_2.png|800px]]&lt;br /&gt;
&lt;br /&gt;
(Graphs aren't identical. This is probably due to a slightly different domain. This happens becouse domain is generated with a bit of randomness.)?&lt;br /&gt;
&lt;br /&gt;
We can see is that value of sigma has a big effect on relative error. &lt;br /&gt;
&lt;br /&gt;
Weight - TODO.&lt;br /&gt;
&lt;br /&gt;
==Heat transfer==&lt;br /&gt;
&lt;br /&gt;
Now we use sigma 75 and weight 1.0 to solve heat transfer problem. In this case, we don't have analytical sollution. For our boundary condition, we will set up to 0.0, down to 1.0, right to 0.35 and left to 0.75. For the center hole we will use Neumann boundary conditions. We are solving following equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         \frac{\partial u (x,y,t)}{\partial t} = \Delta u(x,y,t)&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the domain interior and for domain center we use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         \frac{\partial u (x,y,t)}{\partial n} = 0&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We get the following picture.&lt;br /&gt;
&lt;br /&gt;
[[File:heat_trasfer.png|800px]]&lt;br /&gt;
&lt;br /&gt;
We can expect this to have the same error as the simulation with previous function. We can evaluate this by checking what the maximum value is within the domain. Doing so at different numbers of nodes gives us next graph. &lt;br /&gt;
&lt;br /&gt;
[[File:maximum_value.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Maximum value does't exceed 1.0. &lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_1.png&amp;diff=2866</id>
		<title>File:Different sigma 1.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_1.png&amp;diff=2866"/>
				<updated>2019-09-17T08:39:12Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: Agrebenc uploaded a new version of File:Different sigma 1.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_2.png&amp;diff=2865</id>
		<title>File:Different sigma 2.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_2.png&amp;diff=2865"/>
				<updated>2019-09-17T08:39:03Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: Agrebenc uploaded a new version of File:Different sigma 2.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_2.png&amp;diff=2864</id>
		<title>File:Different sigma 2.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_2.png&amp;diff=2864"/>
				<updated>2019-09-17T08:37:14Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: Agrebenc uploaded a new version of File:Different sigma 2.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_1.png&amp;diff=2863</id>
		<title>File:Different sigma 1.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_1.png&amp;diff=2863"/>
				<updated>2019-09-17T08:37:03Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: Agrebenc uploaded a new version of File:Different sigma 1.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_2.png&amp;diff=2862</id>
		<title>File:Different sigma 2.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_2.png&amp;diff=2862"/>
				<updated>2019-09-17T08:35:47Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: Agrebenc uploaded a new version of File:Different sigma 2.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_1.png&amp;diff=2861</id>
		<title>File:Different sigma 1.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_1.png&amp;diff=2861"/>
				<updated>2019-09-17T08:35:38Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: Agrebenc uploaded a new version of File:Different sigma 1.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_2.png&amp;diff=2860</id>
		<title>File:Different sigma 2.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_2.png&amp;diff=2860"/>
				<updated>2019-09-17T07:10:02Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: Agrebenc uploaded a new version of File:Different sigma 2.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_1.png&amp;diff=2859</id>
		<title>File:Different sigma 1.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_1.png&amp;diff=2859"/>
				<updated>2019-09-17T07:09:54Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: Agrebenc uploaded a new version of File:Different sigma 1.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_1.png&amp;diff=2858</id>
		<title>File:Different sigma 1.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_1.png&amp;diff=2858"/>
				<updated>2019-09-17T07:09:43Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: Agrebenc uploaded a new version of File:Different sigma 1.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2857</id>
		<title>Heat equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2857"/>
				<updated>2019-09-13T11:29:05Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
This example shows how explicit method of solving partial differential equations is used within the Medusa library. Firstly, this example compares explicit solutions to analytical, then it shows how it can be used to solve heat transfer equation.&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Domain==&lt;br /&gt;
&lt;br /&gt;
In this example, a square domain with a cut-out hole in the middle is used. The hole has radius equal to 1/3 of length of a square. Domain nodes are placed randomly with about dx length distance between them. Domain boundary is separated in to 5 areas: up, down, left, right and center. The idea is to have Dirichlet boundary condition on the square (up, down, left and right) and Neumann boundary conditions in the middle (center). &lt;br /&gt;
&lt;br /&gt;
==Fuction==&lt;br /&gt;
&lt;br /&gt;
The function used for this example is $u(x,y) = \sin(\pi x)\sin(\pi y)$. Laplace operator of this function is $\Delta u(x,y)=-2\pi^2\sin(\pi x)\sin(\pi y)$. &lt;br /&gt;
For comparing explicit solution to analytical, we solve function for each node and save solution to $u\_analytic$. With this we also calculate Dirichlet boundary conditions. Then we set domain interior and nodes with Neumann bondary conditions to arbitrary value, in this case 0. We proceed to explicitly solve the domain. In the domain interior we are solving the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         u (x,y,t+1) = dt*\bigg(\Delta u(x,y,t) + 2\pi^2\sin(\pi x)\sin(\pi y)\bigg)+u(x,y,t)&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For Neumann bondary conditions we set $u(x,y,t+1)$ in a way that it satisfies the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\partial u(x,y,t+1)}{\partial n}=n_x \pi \cos(\pi x) \sin(\pi y)+n_y \pi \sin(\pi x) \cos(\pi y)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the simulation is finished, we can easily calculate relative error. Values of nodes are saved in a vector $u1$, so we can use norm of $|u1 - u\_analytic|$ to calculate error, then divide it by norm of $u1$ to calculate relative error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
           relative\_error = \frac{\sqrt{\sum{|u1-u\_analytic|^2}}}{\sqrt{\sum{|u1|^2}}}&lt;br /&gt;
           \end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Weighted Least Squares (WLS)==&lt;br /&gt;
&lt;br /&gt;
In this simulation, we use Gaussians for our WLS. Because of scattred nodes in our domain, we have to use 9 basis. The support size we chose is 27. For weight we have chosen 1.0 and for Gaussian weight (sigma) 75. Later we will look how change of sigma and weight effects relative error.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Gaussians&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; wls({9, 75.0}, 1.0);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Finding steady state==&lt;br /&gt;
&lt;br /&gt;
To finish simulation we save values of nodes and compare them after some time steps. Next graph shows us how relative error changes, when we increase number of steps, after which we compare values.&lt;br /&gt;
&lt;br /&gt;
[[File:ending_conditions.png|800px]]&lt;br /&gt;
&lt;br /&gt;
In this graph we can see, that using 8000 time steps is sufficient for the size of our domain, which we will use in further simulations.&lt;br /&gt;
&lt;br /&gt;
==Effect of sigma and weight==&lt;br /&gt;
&lt;br /&gt;
To see the effect of sigma, we ran the same simulation twice and got following graphs:&lt;br /&gt;
&lt;br /&gt;
[[File:different_sigma_1.png|800px]] [[File:different_sigma_2.png|800px]]&lt;br /&gt;
&lt;br /&gt;
(Graphs aren't identical. This is probably due to a slightly different domain. This happens becouse domain is generated with a bit of randomness.)?&lt;br /&gt;
&lt;br /&gt;
We can see is that value of sigma has a big effect on relative error. &lt;br /&gt;
&lt;br /&gt;
Weight - TODO.&lt;br /&gt;
&lt;br /&gt;
==Heat transfer==&lt;br /&gt;
&lt;br /&gt;
Now we use sigma 75 and weight 1.0 to solve heat transfer problem. In this case, we don't have analytical sollution. For our boundary condition, we will set up to 0.0, down to 1.0, right to 0.35 and left to 0.75. For the center hole we will use Neumann boundary conditions. We are solving following equations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         \frac{\partial u (x,y,t)}{\partial t} = \Delta u(x,y,t)&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the domain interior and for domain center we use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         \frac{\partial u (x,y,t)}{\partial n} = 0&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We get the following picture.&lt;br /&gt;
&lt;br /&gt;
[[File:heat_trasfer.png|800px]]&lt;br /&gt;
&lt;br /&gt;
We can expect this to have the same error as the simulation with previous function. We can evaluate this by checking what the maximum value is within the domain. Doing so at different numbers of nodes gives us next graph. &lt;br /&gt;
&lt;br /&gt;
[[File:maximum_value.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Maximum value does't exceed 1.0. &lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Maximum_value.png&amp;diff=2856</id>
		<title>File:Maximum value.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Maximum_value.png&amp;diff=2856"/>
				<updated>2019-09-13T09:50:44Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Heat_trasfer.png&amp;diff=2855</id>
		<title>File:Heat trasfer.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Heat_trasfer.png&amp;diff=2855"/>
				<updated>2019-09-13T09:45:36Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2854</id>
		<title>Heat equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2854"/>
				<updated>2019-09-12T09:23:57Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
This example shows how explicit method of solving partial differential equations is used within the Medusa library. Firstly, this example compares explicit solutions to analytical, then it shows how it can be used to solve heat transfer equation.&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Domain==&lt;br /&gt;
&lt;br /&gt;
In this example, a square domain with a cut-out hole in the middle is used. The hole has radius equal to 1/3 of length of a square. Domain nodes are placed randomly with about dx length distance between them. Domain boundary is separated in to 5 areas: up, down, left, right and center. The idea is to have Dirichlet boundary condition on the square (up, down, left and right) and Neumann boundary conditions in the middle (center). &lt;br /&gt;
&lt;br /&gt;
==Fuction==&lt;br /&gt;
&lt;br /&gt;
The function used for this example is $u(x,y) = \sin(\pi x)\sin(\pi y)$. Laplace operator of this function is $\Delta u(x,y)=-2\pi^2\sin(\pi x)\sin(\pi y)$. &lt;br /&gt;
For comparing explicit solution to analytical, we solve function for each node and save solution to $u\_analytic$. With this we also calculate Dirichlet boundary conditions. Then we set domain interior and nodes with Neumann bondary conditions to arbitrary value, in this case 0. We proceed to explicitly solve the domain. In the domain interior we are solving the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         u (x,y,t+1) = dt*\bigg(\Delta u(x,y,t) + 2\pi^2\sin(\pi x)\sin(\pi y)\bigg)+u(x,y,t)&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For Neumann bondary conditions we set $u(x,y,t+1)$ in a way that it satisfies the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\partial u(x,y,t+1)}{\partial n}=n_x \pi \cos(\pi x) \sin(\pi y)+n_y \pi \sin(\pi x) \cos(\pi y)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the simulation is finished, we can easily calculate relative error. Values of nodes are saved in a vector $u1$, so we can use norm of $|u1 - u\_analytic|$ to calculate error, then divide it by norm of $u1$ to calculate relative error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
           relative\_error = \frac{\sqrt{\sum{|u1-u\_analytic|^2}}}{\sqrt{\sum{|u1|^2}}}&lt;br /&gt;
           \end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Weighted Least Squares (WLS)==&lt;br /&gt;
&lt;br /&gt;
In this simulation, we use Gaussians for our WLS. Because of scattred nodes in our domain, we have to use 9 basis. The support size we chose is 27. For weight we have chosen 1.0 and for Gaussian weight (sigma) 75. Later we will look how change of sigma and weight effects relative error.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Gaussians&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; wls({9, 75.0}, 1.0);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Finding steady state==&lt;br /&gt;
&lt;br /&gt;
To finish simulation we save values of nodes and compare them after some time steps. Next graph shows us how relative error changes, when we increase number of steps, after which we compare values.&lt;br /&gt;
&lt;br /&gt;
[[File:ending_conditions.png|800px]]&lt;br /&gt;
&lt;br /&gt;
In this graph we can see, that using 8000 time steps is sufficient for the size of our domain, which we will use in further simulations.&lt;br /&gt;
&lt;br /&gt;
==Effect of sigma and weight==&lt;br /&gt;
&lt;br /&gt;
To see the effect of sigma, we ran the same simulation twice and got following graphs:&lt;br /&gt;
&lt;br /&gt;
[[File:different_sigma_1.png|800px]] [[File:different_sigma_2.png|800px]]&lt;br /&gt;
&lt;br /&gt;
(Graphs aren't identical. This is probably due to a slightly different domain. This happens becouse domain is generated with a bit of randomness.)?&lt;br /&gt;
&lt;br /&gt;
We can see is that value of sigma has a big effect on relative error. &lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2853</id>
		<title>Heat equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2853"/>
				<updated>2019-09-12T09:23:37Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
This example shows how explicit method of solving partial differential equations is used within the Medusa library. Firstly, this example compares explicit solutions to analytical, then it shows how it can be used to solve heat transfer equation.&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Domain==&lt;br /&gt;
&lt;br /&gt;
In this example, a square domain with a cut-out hole in the middle is used. The hole has radius equal to 1/3 of length of a square. Domain nodes are placed randomly with about dx length distance between them. Domain boundary is separated in to 5 areas: up, down, left, right and center. The idea is to have Dirichlet boundary condition on the square (up, down, left and right) and Neumann boundary conditions in the middle (center). &lt;br /&gt;
&lt;br /&gt;
==Fuction==&lt;br /&gt;
&lt;br /&gt;
The function used for this example is $u(x,y) = \sin(\pi x)\sin(\pi y)$. Laplace operator of this function is $\Delta u(x,y)=-2\pi^2\sin(\pi x)\sin(\pi y)$. &lt;br /&gt;
For comparing explicit solution to analytical, we solve function for each node and save solution to $u\_analytic$. With this we also calculate Dirichlet boundary conditions. Then we set domain interior and nodes with Neumann bondary conditions to arbitrary value, in this case 0. We proceed to explicitly solve the domain. In the domain interior we are solving the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         u (x,y,t+1) = dt*\bigg(\Delta u(x,y,t) + 2\pi^2\sin(\pi x)\sin(\pi y)\bigg)+u(x,y,t)&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For Neumann bondary conditions we set $u(x,y,t+1)$ in a way that it satisfies the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\partial u(x,y,t+1)}{\partial n}=n_x \pi \cos(\pi x) \sin(\pi y)+n_y \pi \sin(\pi x) \cos(\pi y)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the simulation is finished, we can easily calculate relative error. Values of nodes are saved in a vector $u1$, so we can use norm of $|u1 - u\_analytic|$ to calculate error, then divide it by norm of $u1$ to calculate relative error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
           relative\_error = \frac{\sqrt{\sum{|u1-u\_analytic|^2}}}{\sqrt{\sum{|u1|^2}}}&lt;br /&gt;
           \end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Weighted Least Squares (WLS)==&lt;br /&gt;
&lt;br /&gt;
In this simulation, we use Gaussians for our WLS. Because of scattred nodes in our domain, we have to use 9 basis. The support size we chose is 27. For weight we have chosen 1.0 and for Gaussian weight (sigma) 75. Later we will look how change of sigma and weight effects relative error.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Gaussians&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; wls({9, 75.0}, 1.0);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Finding steady state==&lt;br /&gt;
&lt;br /&gt;
To finish simulation we save values of nodes and compare them after some time steps. Next graph shows us how relative error changes, when we increase number of steps, after which we compare values.&lt;br /&gt;
&lt;br /&gt;
[[File:ending_conditions.png|800px]]&lt;br /&gt;
&lt;br /&gt;
In this graph we can see, that using 8000 time steps is sufficient for the size of our domain, which we will use in further simulations.&lt;br /&gt;
&lt;br /&gt;
==Effect of sigma and weight==&lt;br /&gt;
&lt;br /&gt;
To see the effect of sigma, we ran the same simulation twice and got following graphs:&lt;br /&gt;
&lt;br /&gt;
[[File:different_sigma_1.png|800px]] [[File:different_sigma_2.png|800px]]&lt;br /&gt;
&lt;br /&gt;
(Graphs aren't identical. This is probably due to a slightly different domain. This happens becouse domain is generated with a bit of randomness.)?&lt;br /&gt;
We can see is that value of sigma has a big effect on relative error. &lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_2.png&amp;diff=2852</id>
		<title>File:Different sigma 2.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_2.png&amp;diff=2852"/>
				<updated>2019-09-12T09:19:32Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_1.png&amp;diff=2851</id>
		<title>File:Different sigma 1.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Different_sigma_1.png&amp;diff=2851"/>
				<updated>2019-09-12T09:19:19Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2850</id>
		<title>Heat equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2850"/>
				<updated>2019-09-12T08:37:11Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
This example shows how explicit method of solving partial differential equations is used within the Medusa library. Firstly, this example compares explicit solutions to analytical, then it shows how it can be used to solve heat transfer equation.&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Domain==&lt;br /&gt;
&lt;br /&gt;
In this example, a square domain with a cut-out hole in the middle is used. The hole has radius equal to 1/3 of length of a square. Domain nodes are placed randomly with about dx length distance between them. Domain boundary is separated in to 5 areas: up, down, left, right and center. The idea is to have Dirichlet boundary condition on the square (up, down, left and right) and Neumann boundary conditions in the middle (center). &lt;br /&gt;
&lt;br /&gt;
==Fuction==&lt;br /&gt;
&lt;br /&gt;
The function used for this example is $u(x,y) = \sin(\pi x)\sin(\pi y)$. Laplace operator of this function is $\Delta u(x,y)=-2\pi^2\sin(\pi x)\sin(\pi y)$. &lt;br /&gt;
For comparing explicit solution to analytical, we solve function for each node and save solution to $u\_analytic$. With this we also calculate Dirichlet boundary conditions. Then we set domain interior and nodes with Neumann bondary conditions to arbitrary value, in this case 0. We proceed to explicitly solve the domain. In the domain interior we are solving the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         u (x,y,t+1) = dt*\bigg(\Delta u(x,y,t) + 2\pi^2\sin(\pi x)\sin(\pi y)\bigg)+u(x,y,t)&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For Neumann bondary conditions we set $u(x,y,t+1)$ in a way that it satisfies the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\partial u(x,y,t+1)}{\partial n}=n_x \pi \cos(\pi x) \sin(\pi y)+n_y \pi \sin(\pi x) \cos(\pi y)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the simulation is finished, we can easily calculate relative error. Values of nodes are saved in a vector $u1$, so we can use norm of $|u1 - u\_analytic|$ to calculate error, then divide it by norm of $u1$ to calculate relative error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
relative\_error = \frac{\sqrt{\sum{|u1-u\_analytic|^2}}}{\sqrt{\sum{|u1|^2}}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Weighted Least Squares (WLS)==&lt;br /&gt;
&lt;br /&gt;
In this simulation, we use Gaussians for our WLS. Because of scattred nodes in our domain, we have to use 9 basis. The support size we chose is 27. For weight we have chosen 1.0 and for Gaussian weight (sigma) 75. Later we will look how change of sigma and weight effects relative error.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Gaussians&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; wls({9, 75.0}, 1.0);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Finding steady state==&lt;br /&gt;
&lt;br /&gt;
To finish simulation we save values of nodes and compare them after some time steps. Next graph shows us how relative error changes, when we increase number of steps, after which we compare values.&lt;br /&gt;
&lt;br /&gt;
[[File:ending_conditions.png|800px]]&lt;br /&gt;
&lt;br /&gt;
In this graph we can see, that using 8000 time steps is sufficient for the size of our domain, which we will use in further simulations.&lt;br /&gt;
&lt;br /&gt;
==Effect of sigma and weight==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Ending_conditions.png&amp;diff=2849</id>
		<title>File:Ending conditions.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Ending_conditions.png&amp;diff=2849"/>
				<updated>2019-09-12T08:06:26Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2706</id>
		<title>Heat equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2706"/>
				<updated>2019-08-19T13:16:12Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Purpose of Heat equation example==&lt;br /&gt;
&lt;br /&gt;
This example shows how explicit method of solving partial differential equations is used within the medusa library. Firstly, this example compares explicit solutions to analytical, then it shows how it can be used to solve heat transfer equation.&lt;br /&gt;
&lt;br /&gt;
==Domain==&lt;br /&gt;
&lt;br /&gt;
In this example, a square domain with a cut-out hole in the middle is used. The hole has radius equal to 1/3 of length of a square. Domain nodes are placed randomly with about dx length distance between them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
BoxShape&amp;lt;Vec2d&amp;gt; box(-3.0, 3.0);&lt;br /&gt;
DomainDiscretization&amp;lt;Vec2d&amp;gt; domain=box.discretizeBoundaryWithStep(dx);&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; ball(0,1.0);&lt;br /&gt;
DomainDiscretization&amp;lt;Vec2d&amp;gt; domain_empty=ball.discretizeBoundaryWithStep(dx,-5);&lt;br /&gt;
domain -=domain_empty;&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill_engine;&lt;br /&gt;
fill_engine(domain, dx);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Domain boundary is separated in to 5 areas: up, down, left, right and center.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
auto internal = domain.interior();&lt;br /&gt;
auto up = domain.types().filter([](int i) { return i == -4 ; });&lt;br /&gt;
auto down = domain.types().filter([](int i) { return i == -3 ; });&lt;br /&gt;
auto right = domain.types().filter([](int i) { return  i == -2; });&lt;br /&gt;
auto left = domain.types().filter([](int i) { return  i == -1; });&lt;br /&gt;
auto center=domain.types().filter([](int i){ return i == -5;});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The idea of this domain is to have Dirichlet boundary condition on the square. Furthermore, they are constant over the course of simulation. In the center, the boundary conditions are Neumann. &lt;br /&gt;
&lt;br /&gt;
==Fuction, solution and comparison==&lt;br /&gt;
&lt;br /&gt;
The function used for this example is $u(x,y) = \sin(\pi x)\sin(\pi y)$. Laplace operator of this function is $\Delta u(x,y)=-2\pi^2\sin(\pi x)\sin(\pi y)$. &lt;br /&gt;
For comparing explicit solution to analytical, we solve function for each node and save solution to u1_analytic. With this we also calculate Dirichlet boundary conditions. Then we set interior and center of domain to arbitrary value, in this case 0. Then we proceed to explicitly solve the domain interior and center. In the domain interior we are solving the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         u (x,y,t+1) = dt*\bigg(\Delta u(x,y,t) + 2\pi^2\sin(\pi x)\sin(\pi y)\bigg)+u(x,y,t)&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For domain center we set value of $u(x,y,t+1)$ in a way that it satisfies the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\partial u(x,y,t+1)}{\partial n}=n_x \pi \cos(\pi x) \sin(\pi y)+n_y \pi \sin(\pi x) \cos(\pi y)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While doing this, we also compare previous values u1 to new ones u2. If there are differences bigger than dt*1E-5, we continue the simulation. Otherwise, we stop it and compare values in nodes to analytical ones.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
while (ending){&lt;br /&gt;
        if (iteracije%izpis==0) {&lt;br /&gt;
            std::cout &amp;lt;&amp;lt; iteracije &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
        }&lt;br /&gt;
        iteracije++;&lt;br /&gt;
#pragma omp parallel for&lt;br /&gt;
        for (int j = 0; j &amp;lt; internal.size(); ++j) {&lt;br /&gt;
            int i = internal[j];&lt;br /&gt;
            u2[i] = dt *( op.lap(u1, i) +2*PI*PI*function(domain.pos(i,0),domain.pos(i, 1)))+ u1[i];&lt;br /&gt;
        }&lt;br /&gt;
#pragma omp parallel for&lt;br /&gt;
        for (int j = 0; j &amp;lt; center.size(); ++j) {&lt;br /&gt;
            int i = center[j];&lt;br /&gt;
            auto vec=domain.normal(i);&lt;br /&gt;
            double x=domain.pos(i,0);&lt;br /&gt;
            double y=domain.pos(i, 1);&lt;br /&gt;
            u2[i]=op.neumann(u1,i,vec,vec[0]*PI*cos(PI*x)*sin(PI*y)+vec[1]*PI*cos(PI*y)*sin(PI*x));&lt;br /&gt;
        }&lt;br /&gt;
        for (int i:internal+center){&lt;br /&gt;
            double razlika=abs(u1[i]-u2[i]);&lt;br /&gt;
            if (razlika&amp;gt;konec){&lt;br /&gt;
                break;&lt;br /&gt;
            }&lt;br /&gt;
            ending = false;&lt;br /&gt;
        }&lt;br /&gt;
        u1.swap(u2);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We ran simulation a couple of times using different dx values. Changing dx value changed number of total nodes as well. We made logarithmic graph of relative error per number of nodes. &lt;br /&gt;
&lt;br /&gt;
[[File:error_total_nodes.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Error_total_nodes.png&amp;diff=2705</id>
		<title>File:Error total nodes.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Error_total_nodes.png&amp;diff=2705"/>
				<updated>2019-08-19T12:43:44Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2704</id>
		<title>Heat equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2704"/>
				<updated>2019-08-19T12:42:39Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Purpose of Heat equation example==&lt;br /&gt;
&lt;br /&gt;
This example shows how explicit method of solving partial differential equations is used within the medusa library. Firstly, this example compares explicit solutions to analytical, then it shows how it can be used to solve heat transfer equation.&lt;br /&gt;
&lt;br /&gt;
==Domain==&lt;br /&gt;
&lt;br /&gt;
In this example, a square domain with a cut-out hole in the middle is used. The hole has radius equal to 1/3 of length of a square. Domain nodes are placed randomly with about dx length distance between them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
BoxShape&amp;lt;Vec2d&amp;gt; box(-3.0, 3.0);&lt;br /&gt;
DomainDiscretization&amp;lt;Vec2d&amp;gt; domain=box.discretizeBoundaryWithStep(dx);&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; ball(0,1.0);&lt;br /&gt;
DomainDiscretization&amp;lt;Vec2d&amp;gt; domain_empty=ball.discretizeBoundaryWithStep(dx,-5);&lt;br /&gt;
domain -=domain_empty;&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill_engine;&lt;br /&gt;
fill_engine(domain, dx);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Domain boundary is separated in to 5 areas: up, down, left, right and center.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
auto internal = domain.interior();&lt;br /&gt;
auto up = domain.types().filter([](int i) { return i == -4 ; });&lt;br /&gt;
auto down = domain.types().filter([](int i) { return i == -3 ; });&lt;br /&gt;
auto right = domain.types().filter([](int i) { return  i == -2; });&lt;br /&gt;
auto left = domain.types().filter([](int i) { return  i == -1; });&lt;br /&gt;
auto center=domain.types().filter([](int i){ return i == -5;});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The idea of this domain is to have Dirichlet boundary condition on the square. Furthermore, they are constant over the course of simulation. In the center, the boundary conditions are Neumann. &lt;br /&gt;
&lt;br /&gt;
==Fuction, solution and comparison==&lt;br /&gt;
&lt;br /&gt;
The function used for this example is $u(x,y) = \sin(\pi x)\sin(\pi y)$. Laplace operator of this function is $\Delta u(x,y)=-2\pi^2\sin(\pi x)\sin(\pi y)$. &lt;br /&gt;
For comparing explicit solution to analytical, we solve function for each node and save solution to u1_analytic. With this we also calculate Dirichlet boundary conditions. Then we set interior and center of domain to arbitrary value, in this case 0. Then we proceed to explicitly solve the domain interior and center. In the domain interior we are solving the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         u (x,y,t+1) = dt*\bigg(\Delta u(x,y,t) + 2\pi^2\sin(\pi x)\sin(\pi y)\bigg)+u(x,y,t)&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For domain center we set value of $u(x,y,t+1)$ in a way that it satisfies the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\partial u(x,y,t+1)}{\partial n}=n_x \pi \cos(\pi x) \sin(\pi y)+n_y \pi \sin(\pi x) \cos(\pi y)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While doing this, we also compare previous values u1 to new ones u2. If there are differences bigger than dt*1E-5, we continue the simulation. Otherwise, we stop it and compare values in nodes to analytical ones.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
while (ending){&lt;br /&gt;
        if (iteracije%izpis==0) {&lt;br /&gt;
            std::cout &amp;lt;&amp;lt; iteracije &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
        }&lt;br /&gt;
        iteracije++;&lt;br /&gt;
#pragma omp parallel for&lt;br /&gt;
        for (int j = 0; j &amp;lt; internal.size(); ++j) {&lt;br /&gt;
            int i = internal[j];&lt;br /&gt;
            u2[i] = dt *( op.lap(u1, i) +2*PI*PI*function(domain.pos(i,0),domain.pos(i, 1)))+ u1[i];&lt;br /&gt;
        }&lt;br /&gt;
#pragma omp parallel for&lt;br /&gt;
        for (int j = 0; j &amp;lt; center.size(); ++j) {&lt;br /&gt;
            int i = center[j];&lt;br /&gt;
            auto vec=domain.normal(i);&lt;br /&gt;
            double x=domain.pos(i,0);&lt;br /&gt;
            double y=domain.pos(i, 1);&lt;br /&gt;
            u2[i]=op.neumann(u1,i,vec,vec[0]*PI*cos(PI*x)*sin(PI*y)+vec[1]*PI*cos(PI*y)*sin(PI*x));&lt;br /&gt;
        }&lt;br /&gt;
        for (int i:internal+center){&lt;br /&gt;
            double razlika=abs(u1[i]-u2[i]);&lt;br /&gt;
            if (razlika&amp;gt;konec){&lt;br /&gt;
                break;&lt;br /&gt;
            }&lt;br /&gt;
            ending = false;&lt;br /&gt;
        }&lt;br /&gt;
        u1.swap(u2);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We ran simulation a couple of times using different dx values. Changing dx value changed number of total nodes as well. We made logarithmic graph of relative error per number of nodes. &lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2703</id>
		<title>Heat equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2703"/>
				<updated>2019-08-19T12:21:54Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Purpose of Heat equation example==&lt;br /&gt;
&lt;br /&gt;
This example shows how explicit method of solving partial differential equations is used within the medusa library. Firstly, this example compares explicit solutions to analytical, then it shows how it can be used to solve heat transfer equation.&lt;br /&gt;
&lt;br /&gt;
==Domain==&lt;br /&gt;
&lt;br /&gt;
In this example, a square domain with a cut-out hole in the middle is used. The hole has radius equal to 1/3 of length of a square. Domain nodes are placed randomly with about dx length distance between them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
BoxShape&amp;lt;Vec2d&amp;gt; box(-3.0, 3.0);&lt;br /&gt;
DomainDiscretization&amp;lt;Vec2d&amp;gt; domain=box.discretizeBoundaryWithStep(dx);&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; ball(0,1.0);&lt;br /&gt;
DomainDiscretization&amp;lt;Vec2d&amp;gt; domain_empty=ball.discretizeBoundaryWithStep(dx,-5);&lt;br /&gt;
domain -=domain_empty;&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill_engine;&lt;br /&gt;
fill_engine(domain, dx);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Domain boundary is separated in to 5 areas: up, down, left, right and center.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
auto internal = domain.interior();&lt;br /&gt;
auto up = domain.types().filter([](int i) { return i == -4 ; });&lt;br /&gt;
auto down = domain.types().filter([](int i) { return i == -3 ; });&lt;br /&gt;
auto right = domain.types().filter([](int i) { return  i == -2; });&lt;br /&gt;
auto left = domain.types().filter([](int i) { return  i == -1; });&lt;br /&gt;
auto center=domain.types().filter([](int i){ return i == -5;});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The idea of this domain is to have Dirichlet boundary condition on the square. Furthermore, they are constant over the course of simulation. In the center, the boundary conditions are Neumann. &lt;br /&gt;
&lt;br /&gt;
==Fuction, solution and comparison==&lt;br /&gt;
&lt;br /&gt;
The function used for this example is $u(x,y) = \sin(\pi x)\sin(\pi y)$. Laplace operator of this function is $\Delta u(x,y)=-2\pi^2\sin(\pi x)\sin(\pi y)$. &lt;br /&gt;
For comparing explicit solution to analytical, we solve function for each node and save solution to u1_analytic. With this we also calculate Dirichlet boundary conditions. Then we set interior and center of domain to arbitrary value, in this case 0. Then we proceed to explicitly solve the domain interior and center. In the domain interior we are solving the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         u (x,y,t+1) = dt*\bigg(\Delta u(x,y,t) + 2\pi^2\sin(\pi x)\sin(\pi y)\bigg)+u(x,y,t)&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For domain center we set value of $u(x,y,t+1)$ in a way that it satisfies the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\partial u(x,y,t+1)}{\partial n}=n_x \pi \cos(\pi x) \sin(\pi y)+n_y \pi \sin(\pi x) \cos(\pi y)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While doing this, we also compare previous values u1 to new ones u2. If there are differences bigger than dt*1E-5, we continue the simulation. Otherwise, we stop it and compare values in nodes to analytical ones.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
while (ending){&lt;br /&gt;
        if (iteracije%izpis==0) {&lt;br /&gt;
            std::cout &amp;lt;&amp;lt; iteracije &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
        }&lt;br /&gt;
        iteracije++;&lt;br /&gt;
#pragma omp parallel for&lt;br /&gt;
        for (int j = 0; j &amp;lt; internal.size(); ++j) {&lt;br /&gt;
            int i = internal[j];&lt;br /&gt;
            u2[i] = dt *( op.lap(u1, i) +2*PI*PI*function(domain.pos(i,0),domain.pos(i, 1)))+ u1[i];&lt;br /&gt;
        }&lt;br /&gt;
#pragma omp parallel for&lt;br /&gt;
        for (int j = 0; j &amp;lt; center.size(); ++j) {&lt;br /&gt;
            int i = center[j];&lt;br /&gt;
            auto vec=domain.normal(i);&lt;br /&gt;
            double x=domain.pos(i,0);&lt;br /&gt;
            double y=domain.pos(i, 1);&lt;br /&gt;
            u2[i]=op.neumann(u1,i,vec,vec[0]*PI*cos(PI*x)*sin(PI*y)+vec[1]*PI*cos(PI*y)*sin(PI*x));&lt;br /&gt;
        }&lt;br /&gt;
        for (int i:internal+center){&lt;br /&gt;
            double razlika=abs(u1[i]-u2[i]);&lt;br /&gt;
            if (razlika&amp;gt;konec){&lt;br /&gt;
                break;&lt;br /&gt;
            }&lt;br /&gt;
            ending = false;&lt;br /&gt;
        }&lt;br /&gt;
        u1.swap(u2);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2702</id>
		<title>Heat equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2702"/>
				<updated>2019-08-19T11:07:57Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Purpose of Heat equation example==&lt;br /&gt;
&lt;br /&gt;
This example shows how explicit method of solving partial differential equations is used within the medusa library. Firstly, this example compares explicit solutions to analytical, then it shows how it can be used to solve heat transfer equation.&lt;br /&gt;
&lt;br /&gt;
==Domain==&lt;br /&gt;
&lt;br /&gt;
In this example, a square domain with a cut-out hole in the middle is used. The hole has radius equal to 1/3 of length of a square. Domain nodes are placed randomly with about dx length distance between them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
BoxShape&amp;lt;Vec2d&amp;gt; box(-3.0, 3.0);&lt;br /&gt;
DomainDiscretization&amp;lt;Vec2d&amp;gt; domain=box.discretizeBoundaryWithStep(dx);&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; ball(0,1.0);&lt;br /&gt;
DomainDiscretization&amp;lt;Vec2d&amp;gt; domain_empty=ball.discretizeBoundaryWithStep(dx,-5);&lt;br /&gt;
domain -=domain_empty;&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill_engine;&lt;br /&gt;
fill_engine(domain, dx);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Domain boundary is separated in to 5 areas: up, down, left, right and center.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
auto internal = domain.interior();&lt;br /&gt;
auto up = domain.types().filter([](int i) { return i == -4 ; });&lt;br /&gt;
auto down = domain.types().filter([](int i) { return i == -3 ; });&lt;br /&gt;
auto right = domain.types().filter([](int i) { return  i == -2; });&lt;br /&gt;
auto left = domain.types().filter([](int i) { return  i == -1; });&lt;br /&gt;
auto center=domain.types().filter([](int i){ return i == -5;});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The idea of this domain is to have Dirichlet boundary condition on the square. Furthermore, they are constant over the course of simulation. In the center, the boundary conditions are Neumann. &lt;br /&gt;
&lt;br /&gt;
==Fuction, solution and comparison==&lt;br /&gt;
&lt;br /&gt;
The function used for this example is $u(x,y) = \sin(\pi x)\sin(\pi y)$. Laplace operator of this function is $\Delta u(x,y)=-2\pi^2\sin(\pi x)\sin(\pi y)$. &lt;br /&gt;
For comparing explicit solution to analytical, we solve function for each node and save solution to u1_analytic. With this we also calculate Dirichlet boundary conditions. Then we set interior and center of domain to arbitrary value, in this case 0. Then we proceed to explicitly solve the domain interior and center. In the domain interior we are solving the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         u (x,y,t+1) = dt*(\Delta u(x,y,t) + 2\pi^2\sin(\pi x)\sin(\pi y))+u(x,y,t)&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For domain center we set value of $u(x,y,t+1)$ in a way that it satisfies the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\partial u(x,y,t+1)}{\partial n}=n_x \pi \cos(\pi x) \sin(\pi y)+n_y \pi \sin(\pi x) \cos(\pi y)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While doing this, we also compare previous values u1 to new ones u2. If there are differences bigger than dt*1E-5, we continue the simulation. Otherwise, we stop it and compare values in nodes to analytical ones.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
while (ending){&lt;br /&gt;
        if (iteracije%izpis==0) {&lt;br /&gt;
            std::cout &amp;lt;&amp;lt; iteracije &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
        }&lt;br /&gt;
        iteracije++;&lt;br /&gt;
#pragma omp parallel for&lt;br /&gt;
        for (int j = 0; j &amp;lt; internal.size(); ++j) {&lt;br /&gt;
            int i = internal[j];&lt;br /&gt;
            u2[i] = dt *( op.lap(u1, i) +2*PI*PI*function(domain.pos(i,0),domain.pos(i, 1)))+ u1[i];&lt;br /&gt;
        }&lt;br /&gt;
#pragma omp parallel for&lt;br /&gt;
        for (int j = 0; j &amp;lt; center.size(); ++j) {&lt;br /&gt;
            int i = center[j];&lt;br /&gt;
            auto vec=domain.normal(i);&lt;br /&gt;
            double x=domain.pos(i,0);&lt;br /&gt;
            double y=domain.pos(i, 1);&lt;br /&gt;
            u2[i]=op.neumann(u1,i,vec,vec[0]*PI*cos(PI*x)*sin(PI*y)+vec[1]*PI*cos(PI*y)*sin(PI*x));&lt;br /&gt;
        }&lt;br /&gt;
        for (int i:internal+center){&lt;br /&gt;
            double razlika=abs(u1[i]-u2[i]);&lt;br /&gt;
            if (razlika&amp;gt;konec){&lt;br /&gt;
                break;&lt;br /&gt;
            }&lt;br /&gt;
            ending = false;&lt;br /&gt;
        }&lt;br /&gt;
        u1.swap(u2);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2701</id>
		<title>Heat equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2701"/>
				<updated>2019-08-19T11:07:40Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
Page in progress!&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Purpose of Heat equation example==&lt;br /&gt;
&lt;br /&gt;
This example shows how explicit method of solving partial differential equations is used within the medusa library. Firstly, this example compares explicit solutions to analytical, then it shows how it can be used to solve heat transfer equation.&lt;br /&gt;
&lt;br /&gt;
==Domain==&lt;br /&gt;
&lt;br /&gt;
In this example, a square domain with a cut-out hole in the middle is used. The hole has radius equal to 1/3 of length of a square. Domain nodes are placed randomly with about dx length distance between them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
BoxShape&amp;lt;Vec2d&amp;gt; box(-3.0, 3.0);&lt;br /&gt;
DomainDiscretization&amp;lt;Vec2d&amp;gt; domain=box.discretizeBoundaryWithStep(dx);&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; ball(0,1.0);&lt;br /&gt;
DomainDiscretization&amp;lt;Vec2d&amp;gt; domain_empty=ball.discretizeBoundaryWithStep(dx,-5);&lt;br /&gt;
domain -=domain_empty;&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill_engine;&lt;br /&gt;
fill_engine(domain, dx);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Domain boundary is separated in to 5 areas: up, down, left, right and center.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
auto internal = domain.interior();&lt;br /&gt;
auto up = domain.types().filter([](int i) { return i == -4 ; });&lt;br /&gt;
auto down = domain.types().filter([](int i) { return i == -3 ; });&lt;br /&gt;
auto right = domain.types().filter([](int i) { return  i == -2; });&lt;br /&gt;
auto left = domain.types().filter([](int i) { return  i == -1; });&lt;br /&gt;
auto center=domain.types().filter([](int i){ return i == -5;});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The idea of this domain is to have Dirichlet boundary condition on the square. Furthermore, they are constant over the course of simulation. In the center, the boundary conditions are Neumann. &lt;br /&gt;
&lt;br /&gt;
==Fuction, solution and comparison==&lt;br /&gt;
&lt;br /&gt;
The function used for this example is $u(x,y) = \sin(\pi x)\sin(\pi y)$. Laplace operator of this function is $\Delta u(x,y)=-2\pi^2\sin(\pi x)\sin(\pi y)$. &lt;br /&gt;
For comparing explicit solution to analytical, we solve function for each node and save solution to u1_analytic. With this we also calculate Dirichlet boundary conditions. Then we set interior and center of domain to arbitrary value, in this case 0. Then we proceed to explicitly solve the domain interior and center. In the domain interior we are solving the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         u (x,y,t+1) = dt*(\Delta u(x,y,t) + 2\pi^2\sin(\pi x)\sin(\pi y))+u(x,y,t)&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For domain center we set value of $u(x,y,t+1)$ in a way that it satisfies the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\partial u(x,y,t+1)}{\partial n}=n_x \pi \cos(\pi x) \sin(\pi y)+n_y \pi \sin(\pi x) \cos(\pi y)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While doing this, we also compare previous values u1 to new ones u2. If there are differences bigger than dt*1E-5, we continue the simulation. Otherwise, we stop it and compare values in nodes to analytical ones.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
while (ending){&lt;br /&gt;
        if (iteracije%izpis==0) {&lt;br /&gt;
            std::cout &amp;lt;&amp;lt; iteracije &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
        }&lt;br /&gt;
        iteracije++;&lt;br /&gt;
#pragma omp parallel for&lt;br /&gt;
        for (int j = 0; j &amp;lt; internal.size(); ++j) {&lt;br /&gt;
            int i = internal[j];&lt;br /&gt;
            u2[i] = dt *( op.lap(u1, i) +2*PI*PI*function(domain.pos(i,0),domain.pos(i, 1)))+ u1[i];&lt;br /&gt;
        }&lt;br /&gt;
#pragma omp parallel for&lt;br /&gt;
        for (int j = 0; j &amp;lt; center.size(); ++j) {&lt;br /&gt;
            int i = center[j];&lt;br /&gt;
            auto vec=domain.normal(i);&lt;br /&gt;
            double x=domain.pos(i,0);&lt;br /&gt;
            double y=domain.pos(i, 1);&lt;br /&gt;
            u2[i]=op.neumann(u1,i,vec,vec[0]*PI*cos(PI*x)*sin(PI*y)+vec[1]*PI*cos(PI*y)*sin(PI*x));&lt;br /&gt;
        }&lt;br /&gt;
        for (int i:internal+center){&lt;br /&gt;
            double razlika=abs(u1[i]-u2[i]);&lt;br /&gt;
            if (razlika&amp;gt;konec){&lt;br /&gt;
                break;&lt;br /&gt;
            }&lt;br /&gt;
            ending = false;&lt;br /&gt;
        }&lt;br /&gt;
        u1.swap(u2);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2700</id>
		<title>Heat equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2700"/>
				<updated>2019-08-19T10:34:22Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Purpose of Heat equation example==&lt;br /&gt;
&lt;br /&gt;
This example shows how explicit method of solving partial differential equations is used within the medusa library. Firstly, this example compares explicit solutions to analytical, then it shows how it can be used to solve heat transfer equation.&lt;br /&gt;
&lt;br /&gt;
==Domain==&lt;br /&gt;
&lt;br /&gt;
In this example, a square domain with a cut-out hole in the middle is used. The hole has radius equal to 1/3 of length of a square. Domain nodes are placed randomly with about dx length distance between them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
BoxShape&amp;lt;Vec2d&amp;gt; box(-3.0, 3.0);&lt;br /&gt;
DomainDiscretization&amp;lt;Vec2d&amp;gt; domain=box.discretizeBoundaryWithStep(dx);&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; ball(0,1.0);&lt;br /&gt;
DomainDiscretization&amp;lt;Vec2d&amp;gt; domain_empty=ball.discretizeBoundaryWithStep(dx,-5);&lt;br /&gt;
domain -=domain_empty;&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill_engine;&lt;br /&gt;
fill_engine(domain, dx);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Domain boundary is separated in to 5 areas: up, down, left, right and center.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
auto internal = domain.interior();&lt;br /&gt;
auto up = domain.types().filter([](int i) { return i == -4 ; });&lt;br /&gt;
auto down = domain.types().filter([](int i) { return i == -3 ; });&lt;br /&gt;
auto right = domain.types().filter([](int i) { return  i == -2; });&lt;br /&gt;
auto left = domain.types().filter([](int i) { return  i == -1; });&lt;br /&gt;
auto center=domain.types().filter([](int i){ return i == -5;});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The idea of this domain is to have Dirichlet boundary condition on the square. Furthermore, they are constant over the course of simulation. In the center, the boundary conditions are Neumann. &lt;br /&gt;
&lt;br /&gt;
==Fuction for comparison of solutions==&lt;br /&gt;
&lt;br /&gt;
The function used for this example is $u(x,y) = \sin(\pi x)\sin(\pi y)$. Laplace operator of this function is $\Delta u(x,y)=-2\pi^2\sin(\pi x)\sin(\pi y)$. &lt;br /&gt;
For comparing explicit solution to analytical, we solve function for each node and save solution to u1_analytic. With this we also calculate Dirichlet boundary conditions. Then we set interior and center of domain to arbitrary value, in this case 0. Then we proceed to explicitly solve the domain interior and center. In the domain interior we are solving the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
         u (x,y,t+1) = dt*(\Delta u(x,y,t) + 2\pi^2\sin(\pi x)\sin(\pi y))+u(x,y,t)&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For domain center we set value of $u(x,y,t+1)$ in a way that it satisfies the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\partial u(x,y,t+1)}{\partial n}=n_x \pi \cos(\pi x) \sin(\pi y)+n_y \pi \sin(\pi x) \cos(\pi y)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While doing this, we also compare previous values u1 to new ones u2. If there are differences bigger than dt*1E-5, we continue the simulation. Otherwise, we stop it and compare values in nodes to analytical ones.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
while (ending){&lt;br /&gt;
        if (iteracije%izpis==0) {&lt;br /&gt;
            std::cout &amp;lt;&amp;lt; iteracije &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
        }&lt;br /&gt;
        iteracije++;&lt;br /&gt;
#pragma omp parallel for&lt;br /&gt;
        for (int j = 0; j &amp;lt; internal.size(); ++j) {&lt;br /&gt;
            int i = internal[j];&lt;br /&gt;
            u2[i] = dt *( op.lap(u1, i) +2*PI*PI*function(domain.pos(i,0),domain.pos(i, 1)))+ u1[i];&lt;br /&gt;
        }&lt;br /&gt;
#pragma omp parallel for&lt;br /&gt;
        for (int j = 0; j &amp;lt; center.size(); ++j) {&lt;br /&gt;
            int i = center[j];&lt;br /&gt;
            auto vec=domain.normal(i);&lt;br /&gt;
            double x=domain.pos(i,0);&lt;br /&gt;
            double y=domain.pos(i, 1);&lt;br /&gt;
            u2[i]=op.neumann(u1,i,vec,vec[0]*PI*cos(PI*x)*sin(PI*y)+vec[1]*PI*cos(PI*y)*sin(PI*x));&lt;br /&gt;
        }&lt;br /&gt;
        for (int i:internal+center){&lt;br /&gt;
            double razlika=abs(u1[i]-u2[i]);&lt;br /&gt;
            if (razlika&amp;gt;konec){&lt;br /&gt;
                break;&lt;br /&gt;
            }&lt;br /&gt;
            ending = false;&lt;br /&gt;
        }&lt;br /&gt;
        u1.swap(u2);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2699</id>
		<title>Heat equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Heat_equation&amp;diff=2699"/>
				<updated>2019-08-19T09:55:05Z</updated>
		
		<summary type="html">&lt;p&gt;Agrebenc: Created page with &amp;quot;Go back to Examples.  __FORCETOC__  ==Purpose of Heat equation example==  This example shows how explicit method of solving partial differential equations...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Purpose of Heat equation example==&lt;br /&gt;
&lt;br /&gt;
This example shows how explicit method of solving partial differential equations is used within the medusa library. Firstly, this example compares explicit solutions to analytical, then it shows how it can be used to solve heat transfer equation.&lt;br /&gt;
&lt;br /&gt;
==Domain==&lt;br /&gt;
&lt;br /&gt;
In this example, a square domain with a cut-out hole in the middle is used. The hole has radius equal to 1/3 of length of a square. Domain nodes are placed randomly with about dx length distance between them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>Agrebenc</name></author>	</entry>

	</feed>