这是 SEU 高等数学分析的 Mathematica 实验报告。


链接

【Mathematica】 Mathematica 的安装
【Mathematica】 数列极限的观察 - 实验一
【Mathematica】 函数性态的观察 - 实验二
【Mathematica】 函数的积分
【Mathematica】 泰勒展开 - 实验三
【Mathematica】 定积分的近似计算 - 实验四

代码

\documentclass{article}\usepackage{ctex} % 使用中文
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{listings}
\usepackage{appendix}
\usepackage{bm, amsmath, amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{multirow}
\usepackage{hyperref}
\usepackage{subfig}
\usepackage{url}
\usepackage{cite}
\usepackage[a4paper, left=2.5cm, right=2.5cm, top=2.65cm, bottom=2.54cm]{geometry}\pagestyle{fancy}
\fancyhf{}
\cfoot{\thepage}
\lhead{XX大学实验报告}% set the code style
\RequirePackage{listings}
\RequirePackage{xcolor}
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}
\lstset{numbers=left,  frame=tb,aboveskip=3mm,belowskip=3mm,showstringspaces=false,columns=flexible,framerule=1pt,rulecolor=\color{gray!35},backgroundcolor=\color{gray!5},basicstyle={\ttfamily},numberstyle=\tiny\color{gray},keywordstyle=\color{blue},commentstyle=\color{dkgreen},stringstyle=\color{mauve},breaklines=true,breakatwhitespace=true,tabsize=3,
}\begin{document}{\Huge \bfseries~高等数学分析数学实验报告\\}{\Large\noindent % 取消首行缩进{\bfseries 实验人员:}院(系):\ XXX学院\ \ 学号:\ XXXXXXXX\ \ 姓名:\ Teddy van Jerry\noindent % 取消首行缩进{\bfseries 实验地点:}计算机中心机房}\section{实验一}\subsection{实验题目}通过绘图,观察下面的重要极限:$$\lim\limits_{n\rightarrow \infty }\left(1+\frac{1}{n}\right)^n=e$$\subsection{实验目的和意义}本实验的目的是利用数学软件Mathematica绘制数列点集图像来加深对数列极限概念的理解。\subsection{计算公式}和题目中一致。\subsection{程序设计}\begin{lstlisting}[language=Mathematica,escapeinside=``]
an = {(1 + 1/1)^1, (1 + 1/2)^2, (1 + 1/3)^3};
Do[an = Append[an, (1 + 1/i)^i];t = ListPlot[an, PlotRange -> {1.8, 2.8},PlotStyle -> PointSize[0.015]]; Print[t], {i, 4, 20}]\end{lstlisting}\subsection{程序运行结果}\begin{figure}[h]\centering\includegraphics[width = .4\textwidth]{1.1.pdf}\caption{习题1.1}\label{1.1}\end{figure}\subsection{结果的讨论和分析}从图\ref{1.1}中可以看出,极限大约是$2.7$,很接近$e$的值。\section{实验二}\subsection{实验题目}已知函数$$f(x)=\frac{1}{x^2+2x+c}\ (-5\leqslant x \leqslant 4)$$作出并比较当$c$分别取$-1,0,1,2,3$ 时的图形,并从图上观察极值点、驻点、单调区间、凹凸区间以及渐近线。\subsection{实验目的和意义}本实验的目的是利用数学软件Mathematica绘制函数及其导函数的图像来直观感受函数的性态有关的内容。\subsection{计算公式}和题目中一致。\subsection{程序设计}\begin{lstlisting}[language=Mathematica,escapeinside=``]
f[x_] := 1/(x^2 + 2 x + c);c = -1;
Plot[f[x], {x, -5, 4},GridLines -> Automatic,Frame -> True,PlotStyle -> RGBColor[1, 0, 0],PlotLabel -> "A Graph of f[x], c = -1"]
Plot[f'[x], {x, -5, 4},GridLines -> Automatic,Frame -> True,PlotStyle -> RGBColor[1, 0, 0],PlotLabel -> "A Graph of f'[x], c = -1"]
Plot[f''[x], {x, -5, 4},GridLines -> Automatic,Frame -> True,PlotStyle -> RGBColor[1, 0, 0],PlotLabel -> "A Graph of f''[x], c = -1"]c = 0;
Plot[f[x], {x, -5, 4},GridLines -> Automatic,Frame -> True,PlotStyle -> RGBColor[1, 0, 0],PlotLabel -> "A Graph of f[x], c = 0"]
Plot[f'[x], {x, -5, 4},GridLines -> Automatic,Frame -> True,PlotStyle -> RGBColor[1, 0, 0],PlotLabel -> "A Graph of f'[x], c = 0"]
Plot[f''[x], {x, -5, 4},GridLines -> Automatic,Frame -> True,PlotStyle -> RGBColor[1, 0, 0],PlotLabel -> "A Graph of f''[x], c = 0"]c = 1;
Plot[f[x], {x, -5, 4},GridLines -> Automatic,Frame -> True,PlotStyle -> RGBColor[1, 0, 0],PlotLabel -> "A Graph of f[x], c = 1"]
Plot[f'[x], {x, -5, 4},GridLines -> Automatic,Frame -> True,PlotStyle -> RGBColor[1, 0, 0],PlotLabel -> "A Graph of f'[x], c = 1"]
Plot[f''[x], {x, -5, 4},GridLines -> Automatic,Frame -> True,PlotStyle -> RGBColor[1, 0, 0],PlotLabel -> "A Graph of f''[x], c = 1"]c = 2;
Plot[f[x], {x, -5, 4},GridLines -> Automatic,Frame -> True,PlotStyle -> RGBColor[1, 0, 0],PlotLabel -> "A Graph of f[x], c = 2"]
Plot[f'[x], {x, -5, 4},GridLines -> Automatic,Frame -> True,PlotStyle -> RGBColor[1, 0, 0],PlotLabel -> "A Graph of f'[x], c = 2"]
Plot[f''[x], {x, -5, 4},GridLines -> Automatic,Frame -> True,PlotStyle -> RGBColor[1, 0, 0],PlotLabel -> "A Graph of f''[x], c = 2"]c = 3;
Plot[f[x], {x, -5, 4},GridLines -> Automatic,Frame -> True,PlotStyle -> RGBColor[1, 0, 0],PlotLabel -> "A Graph of f[x], c = 3"]
Plot[f'[x], {x, -5, 4},GridLines -> Automatic,Frame -> True,PlotStyle -> RGBColor[1, 0, 0],PlotLabel -> "A Graph of f'[x], c = 3"]
Plot[f''[x], {x, -5, 4},GridLines -> Automatic,Frame -> True,PlotStyle -> RGBColor[1, 0, 0],PlotLabel -> "A Graph of f''[x], c = 3"]\end{lstlisting}\subsection{程序运行结果}以$c=-1$的为例:\begin{figure}[h]\centering\includegraphics[width = .4\textwidth]{3.2-1.pdf}\caption{习题3.2(a)\ $f(x)$}\label{3.2-1}\end{figure}\begin{figure}[h]\centering\includegraphics[width = .4\textwidth]{3.2-2.pdf}\caption{习题3.2(b)\ $f^{'}(x)$}\label{3.2-2}\end{figure}\begin{figure}[h]\centering\includegraphics[width = .4\textwidth]{3.2-3.pdf}\caption{习题3.2(c)\ $f^{''}(x)$}\label{3.2-3}\end{figure}\subsection{结果的讨论和分析}\subsubsection{结果讨论}下面讨论$c=-1$时的情况。\begin{itemize}\item 极值点:$x=-1$\item 驻点:$x=-1$\item 单调区间:单调增区间:$(-\infty,-1.5)\text{和}(-1.5,-1]$;单调减区间:$(-1.5,0.5)\text{和}(0.5,+\infty)$\item 凹凸区间:凹区间:$(-2.5,0.5)$;凸区间:$(-\infty,-2.5)\text{和}(1.5,+\infty)$\item 渐近线 $x=-2.5,\ x=0.5,\ y=0$\end{itemize}\subsubsection{分析}由于图表标题问题,这个程序没有写循环结构,所以代码会显得比较冗长。\section{实验三}\subsection{实验题目}对$\cos(x)$展开到五阶并输出其误差。\subsection{实验目的和意义}熟悉 Taylor 公式及 Mathematica 中的代码书写。\subsection{计算公式}$$f(x)=f(x_0)\sum_{k = 1}^{n} \frac{\cos\left(x_0+n\frac{\pi}{2}\right)}{k!}x^k+o\left(|x-x_0|^{n+1}\right) $$\subsection{程序设计}\begin{lstlisting}[language=Mathematica,escapeinside=``]
d0 = -1;
While[d0 <= 1,a = N[Normal[Series[Cos[x], {x, 0, 5}]]] /. x -> d0;Print[d0, "\t", a, "\t", N[Cos[d0]], "\t", N[Cos[d0]] - a];d0 += 0.4;]]\end{lstlisting}\subsection{程序运行结果}-1\qquad 0.541667\qquad 0.540302\qquad -0.00136436-0.6\qquad 0.8254\qquad 0.825336\qquad -0.0000643851-0.2\qquad 0.980067\qquad 0.980067\qquad -8.8825410\^-80.2\qquad 0.980067\qquad 0.980067\qquad -8.8825410\^-80.6\qquad 0.8254\qquad 0.825336\qquad -0.00006438511.\qquad 0.541667\qquad 0.540302\qquad -0.00136436\subsection{结果的讨论和分析}在五次迭代之后在$-1\textless x\textless 1$的范围内误差较小,可以验证Taylor展开公式。\section{实验三}\subsection{实验题目}分别用梯形法、抛物线法求下面的积分的近似值(精确到$0.0001$)。$$\int_{0}^{\frac{\pi}{2}} \sin(x^2) \,dx $$\subsection{实验目的和意义}熟悉定积分的近似计算公式及 Mathematica 中的代码书写。\subsection{梯形法}\subsubsection{计算公式}$$\int_{a}^{b} f(x) \,dx \approx \frac{b-a}{n} \left[ \frac{f(a)+f(b)}{2} + \sum_{i = 1}^{n} f\left(a+i\frac{b-a}{n}\right) \right]$$梯形法的绝对误差为:$$\frac{(b-a)^2}{12n^3}M_2 \text{,}$$其中,$M_2$ 为$|f^{''}(x)|$ 在曲间$[a,b]$上的最大值。\subsubsection{程序设计}\begin{lstlisting}[language=Mathematica,escapeinside=``]
f[x_] := Sin[x^2];
a = 0;
b = Pi/2;
m2 = N[f''[0]];
delta = 10^(-4);
n0 = 100;
t[n_] := (b - a)/n*((f[a] + f[b])/2 + Sum[f[a + i*(b - a)/n], {i, 1, n - 1}]);
Do[Print[n, "\t", N[t[n], 8]];If[(b - a)^3/(12 n^2)*m2 < delta, Break[], If[n == n0, Print["fail to achieve the accuracy"]]], {n, n0}]\end{lstlisting}\subsubsection{程序设计结果}\begin{figure}[h]\centering\includegraphics[width = .45\textwidth]{5.2 - 1.jpg}\caption{习题5.2(梯形法)}\label{5.2 - 1}\end{figure}\subsection{抛物线法}\subsubsection{计算公式}$$\int_{a}^{b} f(x) \,dx \approx \frac{b-a}{6k} \left[ f(a)+f(b) + 4\sum_{i = 1}^{k} f \left(x_{2i-1} \right) + 2\sum_{i = 1}^{k-1} f \left(x_{2i} \right) \right]$$梯形法的绝对误差为:$$\frac{(b-a)^5}{180n^4}M_4 \text{,}$$其中,$M_4$ 为$|f^{(4)}(x)|$ 在曲间$[a,b]$上的最大值。\subsubsection{程序设计}\begin{lstlisting}[language=Mathematica,escapeinside=``]
f[x_] := Sin[x^2];
a = 0;
b = Pi/2;
m4 = D[f[x], {x, 4}] /. x -> Pi/2;
delta = 10^(-4);
k0 = 50;
p[k_] := (b - a)/(6 k)*(f[a] + f[b] + 2 Sum[f[a + i*(b - a)/(2 k)], {i, 2, 2 k - 2, 2}] + 4 Sum[f[a + i*(b - a)/(2 k)], {i, 1, 2 k - 1, 2}]);
Do[Print[k, "\t", N[p[k]]];If[(b - a)^5/(180*(2 k)^4)*m4 < delta, Break[], If[k == k0, Print["fail to achieve the accuracy"]]], {k, k0}]\end{lstlisting}\subsubsection{程序运行结果}首先求$M_4$,用指令求出$f(x)$的四阶导数,然后用Plot命令绘出图像,由观察可得$M_4$在$x=\frac{\pi}{2}$取到。\begin{figure}[h]\centering\includegraphics[width = .55\textwidth]{5.2 - 2.jpg}\caption{习题5.2(抛物线法) - 求出$M_4$}\label{5.2 - 2}\end{figure}然后运行主程序:\begin{figure}[h]\centering\includegraphics[width = .6\textwidth]{5.2 - 3.jpg}\caption{习题5.2(抛物线法)}\label{5.2 - 3}\end{figure}\subsection{结果的讨论和分析}答案:0.8281两种算法都要考虑到误差问题。循环结束条件也与误差的判断有关。两种方法相比可以发现抛物线法的迭代次数更小,即与原函数更接近。\newpage\section*{附录}实验报告的撰写使用 \LaTeX。实验报告的 Mathematica 和 \LaTeX 代码为我(Teddy van Jerry)在 CSDN 上开源共享。\\\LaTeX 代码:\url{https://blog.csdn.net/weixin_50012998/article/details/112255688}实验一代码:\url{https://blog.csdn.net/weixin_50012998/article/details/110676930}实验二代码:\url{https://blog.csdn.net/weixin_50012998/article/details/110729035}实验三代码:\url{https://blog.csdn.net/weixin_50012998/article/details/111810707}实验四代码:\url{https://blog.csdn.net/weixin_50012998/article/details/112237731}\end{document}% Copyright 2021 Teddy van Jerry

效果











ALL RIGHTS RESERVED © 2021 Teddy van Jerry
欢迎转载,转载请注明出处。


See also

Teddy van Jerry 的导航页

【LaTeX】 案例分析 (8) - 高等数学分析 Mathematica 实验报告相关推荐

  1. 【LaTeX】 案例分析 (10) - 高等数学分析(下) Mathematica 实验报告

    ALL RIGHTS RESERVED © Teddy van Jerry 版权所有,报告仅供参考,代码引用注明出处 链接 [GitHub 仓库] SEU_Mathematica [Mathemati ...

  2. LaTeX写一份完整的物理实验报告

    直流非平衡电桥 用LaTeX写一份完整的物理实验报告.主要复习一下LaTeX的文本编辑,和学习LaTeX的最新编译环境和系统. 本物理实验报告的编辑软件和环境分别是:Texlive2022 + Tex ...

  3. 用Hadoop分析金庸人物关系网-实验报告

    用Hadoop分析金庸人物关系网 --- 用大数据粗略的分析金庸人物关系网 整体结果报告 达到预期目标并完成了选做内容 实验目标描述: 金庸的江湖 课程设计目标 通过一个综合数据分析案例:" ...

  4. 计算机基础知识实验结果及分析,计算机大学计算机基础实验报告.doc

    计算机大学计算机基础实验报告 计算机__大学计算机基础实验报告 2012 年 12 月 13日 姓 名学 号年 级2012级专 业班 级2班实验题目:文件与文件夹的管理实验目的: 1.熟练掌握资源管理 ...

  5. 编译原理预测分析法c语言,编译原理预测分析法C语言的实验报告.doc

    题目:编写识别由下列文法所定义的表达式的预测分析程序. EàE+T | E-T | T TàT*F | T/F |F Fà(E) | i 输入:每行含一个表达式的文本文件. 输出:分析成功或不成功信息 ...

  6. 中大近代物理实验实验报告(LaTeX实现)

    最近在学LaTeX,终于用LaTeX做出了一份完整的实验报告.自己所学有限,报告里用到的图片设置以及表格设置命令都非常基础,见谅.实验分析写的稀碎,请自行忽略.此报告使用TeXworks编译器实现.此 ...

  7. 第二次实验报告:使用Packet Tracer分析应用层协议

    姓名:谢明亮 学号:201821121103 班级:1814 1.实验目的 熟练使用Packet Tracer工具.分析抓到的应用层协议数据包,深入理解应用层协议,包括语法.语义.时序. 2.实验内容 ...

  8. matlab数字信号处理实验报告,数字信号处理实验报告(Matlab与数字信号处理基础).doc...

    西华大学实验报告(理工类) 开课学院及实验室:电气信息学院 6A-205实验时间 :年月日学 生 姓 名学号成 绩学生所在学院电气信息学院年级/专业/班课 程 名 称数字信号处理课 程 代 码实验项目 ...

  9. 计算机word做课程表实验报告,《用Word制作课程表》“学讲方式”案例分析

    2014年,徐州教育局"大力推进课堂教学改革,改变学与教的方式,使学习变得更主动.有趣.活泼.愉悦,使教学活动更有目的性.针对性.实效性,使老师的教和学生的学变得更有成效.更具教育和生活意义 ...

  10. 大学计算机案例实验教程文件,大学计算机实训及案例分析教程

    目录 前言 第一部分 基本操作及应用 第1章 信息管理及平台操作实验 3 实验1-1-1 文件和文件夹的基本操作 3 实验1-1-2 文件压缩与解压缩 11 实验1-1-3 信息检索与信息管理 14 ...

最新文章

  1. MySQL事务的幻读
  2. 国防科大计算机专业分数线,2018国防科技大学各省录取分数线_2017年国防科大录取线...
  3. jenkins中通过Publish Over SSH将项目部署到远程机器上
  4. 【无码专区9】序列统计(带权并查集 + 前缀和建边 + dp)
  5. 批量执行命令(SSH)
  6. java对象组合_java并发编程(三): 对象的组合
  7. 学到了一个一分不亏的地推妙招
  8. Object中的clone方法
  9. Atitit 获取一列拼接为字符串 逗号分隔 目录1.1. Sql Group_contackt,但是排序只能拍一个的。。如果多个列对应排序则不行。。。 11.2. Js 使用map函数 1
  10. 设计一个一元多项式加法器_【每日上机】一元多项式求导
  11. NSString+NSMutableString+NSValue+NSAraay用法汇总
  12. 360 极速模式 html,360浏览器极速模式怎么开
  13. Win10系统无法访问局域网共享文件夹的问题解
  14. 洛谷 CF7E Defining Macros 题解
  15. 计算机基础运用知识woord,《计算机基础知识word.doc
  16. Linux下基本指令
  17. x264中码率控制(二)x264_ratecontrol_start函数
  18. 使用公网NAT网关SNAT功能访问互联网
  19. SQL Server 数据库基本操作入门篇【2】
  20. 怎么禁止windows音频设备图形隔离程序_Windows 10中音频设备图形间隔内存占用较高的处理方法...

热门文章

  1. Keil(MDK)4升级到Keil(MDK)5
  2. 智慧路灯综合解决方案
  3. libtorrent源码分析(三)BT下载相关知识总结
  4. 漫威超级英雄大全(二)
  5. 精易论坛多线程培训第二期
  6. 短视频源码开启“短视频+”
  7. ABB机器人RobotStudio编程指令大全
  8. 两台局域网内的阿里云服务器传文件
  9. 数据库考点之关系代数表达
  10. python自动排版公众号_GitHub - sunshine2337/maxpress: MaxPress:MarkDown+Python实现微信公众号一键排版...