Contact Us!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

| Download
Project: My Project
Views: 25
Image: ubuntu2204
1
% LaTeX document was generated by GPT-4o
2
% Created 2024-10-20 19:24:52
3
4
\documentclass[letterpaper, 10pt, conference]{IEEEtran}
5
6
% Packages
7
\usepackage{amsmath, amssymb, amsfonts}
8
\usepackage{graphicx}
9
\usepackage{pythontex}
10
\usepackage{cite}
11
12
% Title and Author
13
\title{Title of Research Article}
14
\author{Author Name}
15
16
\begin{document}
17
\maketitle
18
19
\begin{abstract}
20
This abstract summarizes the research article. It provides an overview of the findings, methodology, and significance of the heat equation solved using finite differences in 2-D.
21
\end{abstract}
22
23
\section{Introduction}
24
This section introduces the historical context of the heat equation and its significance in mathematical physics and engineering.
25
26
\section{Mathematical Background}
27
The heat equation is a parabolic partial differential equation given by:
28
29
\begin{equation}
30
\frac{\partial u}{\partial t} = \alpha \nabla^2 u
31
\end{equation}
32
33
where \( u = u(x, y, t) \) represents the temperature distribution, \( t \) is time, and \( \alpha \) is the thermal diffusivity constant.
34
35
\section{Numerical Solution Using Finite Differences}
36
The finite difference method approximates derivatives by differences and provides a way to solve partial differential equations numerically.
37
38
\subsection{Discretization}
39
The 2-D spatial domain is discretized into a grid and finite difference approximations are applied.
40
41
\begin{equation}
42
u_{i, j}^{n+1} = u_{i, j}^n + \frac{\alpha \Delta t}{(\Delta x)^2} \left( u_{i+1, j}^n - 2u_{i, j}^n + u_{i-1, j}^n \right) + \frac{\alpha \Delta t}{(\Delta y)^2} \left( u_{i, j+1}^n - 2u_{i, j}^n + u_{i, j-1}^n \right)
43
\end{equation}
44
45
\section{Implementation in Python}
46
The problem is implemented using Python and visualized with PythonTeX.
47
48
\begin{pycode}
49
import numpy as np
50
import matplotlib.pyplot as plt
51
52
# Parameters
53
nx, ny = 50, 50
54
nt = 100
55
alpha = 0.1
56
dx, dy = 1/nx, 1/ny
57
dt = (dx*dy)/(2*alpha*(dx+dy))
58
59
# Initial Condition
60
u = np.zeros((ny, nx))
61
u[20:30, 20:30] = 100 # Initial hot spot
62
63
# Time-stepping
64
for n in range(nt):
65
u_new = u.copy()
66
for i in range(1, nx-1):
67
for j in range(1, ny-1):
68
u_new[j, i] = u[j, i] + alpha * dt * (
69
(u[j+1, i] - 2*u[j, i] + u[j-1, i]) / dy**2 +
70
(u[j, i+1] - 2*u[j, i] + u[j, i-1]) / dx**2 )
71
u = u_new
72
73
plt.imshow(u, cmap='hot', interpolation='none')
74
plt.title('Temperature Distribution')
75
plt.colorbar(label='Temperature')
76
plt.xlabel('x')
77
plt.ylabel('y')
78
79
plt.savefig('heat_equation.png')
80
\end{pycode}
81
82
\begin{figure}[h]
83
\centering
84
\includegraphics[width=\linewidth]{heat_equation.png}
85
\caption{Heat distribution after time evolution}
86
\label{fig:heat_dist}
87
\end{figure}
88
89
\section{Conclusion}
90
Summarizes the findings and discusses implications and future work in solving PDEs using finite differences.
91
92
\section*{Acknowledgments}
93
Acknowledgment of any assistance or funding.
94
95
\bibliographystyle{IEEEtran}
96
\bibliography{references}
97
98
\end{document}
99