Mathematica100例题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
利用mathematica计算二重积分 (1)
幂函数作图 (2)
Sin函数多次迭代 (3)
冒泡排序 (3)
钢管切割 (3)
工资序列 (3)
表格输出 (4)
读入数据、站点实测数据 (5)
追踪 (5)
截断切割(数组应用) (6)
煤矸石 (6)
旋转体 (6)
柱面 (7)
定积分动画 (7)
幂级数 (8)
牛顿 (8)
切线 (8)
fourer级数 (9)
级数和 (9)
二重积分的实验 (9)
导数 (10)
欧拉常数 (11)
解不等式 (11)
动态规划 (11)
四人追逐三人多人 (12)
二分法 (13)
模拟 (13)
追踪Trace (14)
文件的存放 (15)
混沌 (15)
随机点的投掷 (15)
蒙特卡罗法计算定积分 (15)
利用mathematica计算二重积分
问题:
曲面z=12-2x^2-2y^2,z=x^2+y^2 +3所围成的几何体的体积
先作图:
< debll=InequalityPlot3D[ 12-2x^2-2y^2-z>=0⇓ x^2+y^2+3-z<=0, {x}, {y}, {z}, Axes -> True]; < Shadow[debll,XShadow→False,YShadow→False] lims,0,,r,0,5;93r^2Sequence lims 9.03r^2Sequence lims 28.099258924162907 幂函数作图 1. f[x_,n_]:=x^n; a[n_]:=Plot[x^n,{x,0,2},PlotStyle→RGBColor[0.2n,0.8,1-0.1n]]; A=Array[a,5]; Show[A,Axes→True,AxesLabel→{"x","y"},AspectRatio→Automatica] 2 f[n_]:=x^n;f/@{1,2,3,4}; Plot[Evaluate[f/@{1,2,3,4}],{x,0,1}] 3. f[n_]:=x^n;f[{1,2,3,4}]; Plot[Evaluate[f[{1,2,3,4}]],{x,0,1}] 4. Plot[Evaluate[Table[x^i,{i,6}]],{x,0,2}] 5. Clear[f]; f[n_]:=x^n; Plot[Evaluate[Map[f,{1,2,3,4,5,6}]],{x,0,2}] Plot[Evaluate[x^Range[6]],{x,0,2}] Sin函数多次迭代 1. Plot[{Nest[Sin,x,10],Nest[Sin,x,50],Nest[Sin,x,100]},{x,0,4Pi},PlotStyle→{RGBCol or[1,0,0],RGBColor[0,1,0],RGBColor[0,0,1]}] 2. Plot[{Nest[Sin,x,100],Nest[Sin,x,500],Nest[Sin,x,1000]},{x,0,4Pi},PlotStyle→{RGB Color[1,0,0],RGBColor[0,1,0],RGBColor[0,0,1]}] 冒泡排序 bubble[x_List]:=x//.{p___,a_,b_,q___}/;b>a->{p,b,a,q} bubble[{9,7,1,6,11,21}] 钢管切割 For[i=0,i<3,i++, For[j=0,j<4,j++, For[k=0,k<=4,k++, If[7.4-2.9i-2.1j-1.5k<1.5&&7.4-2.9i-2.1j-1.5k≥0,Print[{i," ",j," ",k," ",7.4-2.9i-2.1j-1.5k}] ] ] ] ] 工资序列 1. Clear[x,b,c] c={10,5,2,1,0.5,0.2,0.1,0.05,0.02,0.01}; (*Input[x];*) Print["工资序列"] x={58.58,47.35,95.62,88.88} b=Table[0,{i,1,Length[x]},{j,1,10}]; For[k=1,k≤Length[x],k++, b[[k,1]]=Floor[x[[k]]/10]; For[i=2,i<10,i++, b[[k,i]]=Floor[(x[[k]]-Take[b[[k]],i-1].Take[c,i-1])/c[[i]]] ]; b[[k,10]]=(x[[k]]-Take[b[[k]],9].Take[c,9])/c[[10]] ] Print["结果"] Print["10元","5元","2元","1元","5角","2角""1角","5分","2分","1分"] b//MatrixForm Print["合计:"] Print["10元","5元","2元","1元","5角","2角""1角","5分","2分","1分"] Plus@@b 2.提示输入 Clear[x,b,c] c={10,5,2,1,0.5,0.2,0.1,0.05,0.02,0.01}; Print["工资序列"] Input[x] m=Length[x]; b=Table[0,{i,1,m},{j,1,10}]; For[k=1,k≤m,k++, b[[k,1]]=Floor@(x[[k]]/10); For[i=2,i<10,i++, b[[k,i]]=Floor[(x[[k]]-Take[b[[k]],i-1].Take[c,i-1])/c[[i]]] ]; b[[k,10]]=(x[[k]]-Take[b[[k]],9].Take[c,9])/c[[10]] ] Print["结果"] Print["10元","5元","2元","1元","5角","2角""1角","5分","2分","1分"] b//MatrixForm Print["合计:"] Print["10元","5元","2元","1元","5角","2角""1角","5分","2分","1分"] Plus@@b 3.输入输出 表格输出 templist1={1,2,3}; templist2={4,5,6}; templist3={7,8,9}; FrameBox[