## 1. A Numerical Solution to The Heat Equation
*By Parnian Kassraie*
***
***

*For solving this problem you don't need to know anything outside the course's syllabus. But if you are interested and you haven't passed Engineering Mathematics yet, you can read about the Heat Equation from [here.](https://en.wikipedia.org/wiki/Heat_equation)*


```latex
%%latex
\begin{equation}
\frac{\partial^{2} T}{\partial x^{2}}+\frac{\partial^{2} T}{\partial y^{2}}=0 \\
x,y\in[0,10] \\
T(x,10)=100,\space T(x,0)=T(0,y)=T(10,y)=0 \\
\end{equation}
```


\begin{equation}
\frac{\partial^{2} T}{\partial x^{2}}+\frac{\partial^{2} T}{\partial y^{2}}=0 \\
x,y\in[0,10] \\
T(x,10)=100,\space T(x,0)=T(0,y)=T(10,y)=0 \\
\end{equation}


In this problem, we want to solve the heat equation for a square metal plate. As stated above, the edges are kept at constant tempretures and we are solving the problem in the steady state.

### 1.1 Discretizing the Equation
***

We have to choose a finite number of points inside the metal square and calculate the tempreture for each of these points. In other words, we break the continues intervals, $x,y\in[0,10]$ and set $x,y$ to be :
$$x=n\Delta x, \space y = m \Delta y: \space  \space n,m\in \mathbb{N},\space \text{and} \space n,m \leq K$$

* a) Set $\Delta x, \Delta y$.


```python
Deltax = 
Deltay =
```

* b) Write the heat equation for discrete coordinates. 


```latex
%%latex
\begin{equation}
....
\end{equation}
```

* c) We define $T_i,_j = T(x_i,y_j)$ Where $x_i = i\Delta x,\space y_j=j\Delta y$. Write $T_i,_j$ using only: $ T_{i+1,j}, T_{i-1,j},T_{i,j+1},T_{i,j-1}$


```latex
%%latex
\begin{equation}
....
\end{equation}
```

### 1.2 Solving The Discrete Equation
***
*  a) We should choose an intial value for each of the points to solve the equation iteratively. Wisely choose constant value for all the points inside the metal square!


```python
T0 = 
```

* b) State why you chose the value above. (Bonus point for wiser choices)



* c) Using what you have calculated, write a program that solves the given PDE.


```python
# Import Packages:


#Initialize the rest of the variables:


# Write the iterative code that solves the equation:

```

### 1.3 Ploting The Results
---
* a) Plot the steady state solution using a heatmap. Your result should look like [this](https://github.com/svarthafnyra/Numercial-Methods-for-Understanding-Stock-Market/blob/master/untitled.png), with a higher resolution of course.


```python

```

4854c52a575babc8fd894768ba2f71d8d0876844
ipynb
Jupyter Notebook
PyHW.ipynb
svarthafnyra/Fun-with-Data
3a7b49f49f1e7aad6587bdac47b6bb315b54dc20
MIT
PyHW.ipynb
svarthafnyra/Fun-with-Data
3a7b49f49f1e7aad6587bdac47b6bb315b54dc20
MIT
PyHW.ipynb
svarthafnyra/Fun-with-Data
3a7b49f49f1e7aad6587bdac47b6bb315b54dc20
MIT
Qwen/Qwen-72B
1. YES
2. YES