数值分析作业用过的Latex模板
常用的环境和格式已注释
\documentclass[]{article}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{geometry}
\usepackage{theorem}
\usepackage{graphicx} %插入图片的宏包
\usepackage{enumitem}
\usepackage{makecell}
\usepackage{url}
\usepackage{float}
\usepackage{booktabs}
\usepackage[hidelinks]{hyperref}
\usepackage{listings}
\setlist[description]{font=\bfseries, leftmargin=2cm, style=nextline}
\usepackage{graphicx}
\usepackage{pythonhighlight}
\usepackage{clrscode3e}
\theorembodyfont{\normalfont} %修改定理内部字体类型
\geometry{a4paper,top=3cm,left=3cm,right=3cm}
%opening
\title{\Huge Initial-Value Problems for Ordinary Differential Equations}
\author{\Large Shi Xiangsheng \quad 201817090163}
\date{}
%设置定理类环境
\newtheorem{thm}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem{definition}{Definition}
\newtheorem{proof}{Proof}
\bibliographystyle{plain}
%begin document,导言区结束。
\begin{document}\large
\maketitle
\renewcommand{\abstractname}{\large Abstract\\}
\begin{abstract}
\large
%摘要位置
\end{abstract}
\tableofcontents %制作索引
\newpage %新的一页命令
\section{Induction}
%\begin{equation*} %数学公式环境
%
%\end{equation*}
%\[
%\]
%\begin{definition} %定义环境
%\end{definition}
%\begin{thm} %定理环境
%\end{thm}
%\begin{enumerate} %枚举环境
%\end{enumerate}
\section{Codes and Numerical Experiments}
\subsection{Exercise 1:}
Given the initial-value prooblem $y'=y-t^2+1$, $0\leq t \leq 2,$ $y(0)=0.5,$ $N = 10,h=(2-0)/N=0.2$ Applying Taylor's method of order four, Runge-Kutta of order four, Fourth-order Adams-Bashforth method and Adams Fourth-order Predictor-Corrector method relatively to this problem. Then comparing the accuracy and computations.
\noindent\textbf{Note: The differentiation equotion in this exercise is exactly the example on textbook. I selected it just for convenience and the following codes can be adopted for general questions.}
% 代码环境
%\lstset{columns = flexible,numbers=left,numberstyle=\footnotesize,frame=shadowbox}
%\begin{lstlisting}[language = Python]
%import numpy as np
%h,N = 0.2,10
%def T4(t,w):
% return (1+h/2+h**2/6+h**3/24)*(w-t**2)-(1+h/3+h**2/12)*h*t+
% 1+h/2-h**2/6-h**3/24
%omiga = np.zeros(11)
%omiga[0] = 0.5
%t = np.arange(0,2,0.2)
%for i in range(N):
% omiga[i+1] = omiga[i] + h*T4(t[i],omiga[i])
%print(omiga)
%\end{lstlisting}
%% 表格环境
%\begin{table}[h]
%\begin{center}
%\resizebox{150mm}{!}{
%\begin{tabular}{cccccc}
%\hline
%$t_i$ & \makecell[c]{Exact \\ $y_i$} & \makecell[c]{Taylor \\ $w_i$} & \makecell[c]{Error \\ $| y_i - w_i |$} & \makecell[c]{Runge-Kutta \\ $w_i$} & \makecell[c]{Error \\ $| y_i - w_i |$} \\
%\hline
%0.0 & 0.5000000 & 0.5000000 & 0 & 0.5000000 & 0\\
%0.2 & 0.8292986 & 0.8293 & 1.4×$10^{-6}$ & 0.8292933 & 5.27×$10^{-6}$ \\
%0.4 & 1.2140877 & 1.21409102 & 3.32×$10^{-6}$ & 1.2140762 & 1.15×$10^{-5}$ \\
%0.6 & 1.6489406 & 1.64894677 & 6.17×$10^{-6}$ & 1.6489220 & 1.86×$10^{-5}$ \\
%\hline
%\end{tabular}
%}
%\end{center}
%\end{table}
\bibliography{refer.bib}
\end{document}

浙公网安备 33010602011771号