Mathematica对大小写敏感,所以请注意内置函数或功能的大小写区别。
Mathematica一般都是给出精确地答案,除非明确要求,否则2开根给出的就是根号2而非近似值。在计算后面加上“//Timing”,不包含引号,可给出所花费的CPU时间,不包含显示到终端所花费的时间。
此文结束后可以按照自己的兴趣尝试这些函数,熟悉这些对以后的复杂应用很有帮助~
尚未对以下内容一一验证,可能有错误的地方。我会保持修订的。
Pi 3.1415的无限精度数值
E 2.17828的无限精度数值
Catalan 0.915966Catalan常数
EulerGamma 0.5772Euler常数
Khinchin 2.68545Khinchin
Glaisher 0.915966Glaisher
GoldenRatio 1.61803黄金分割数
Degree π/l80角度弧度换算
I 复数单位
Infinity 无穷大
-Infinity 负无穷大
Complexlnfinity 复无穷大
Indeterminate 不定式
Expand[expr] 展开表达式
Factor[expr] 展开表达式
Simplify[expr] 化简表达式
FullSimplify[expr] 将特殊函数也进行化简
PowerExpand[expr] 展开所有的幂次形式
ComplexExpand[expr,{x1,x2⋯}] 按复数实部虚部展开
FunctionExpand[expr] 化简表达式中的特殊函数
Collect[expr,x] 合并同次项
Collect[expr,{x1,x2,⋯}] 合并x1,x2,...的同次项
Together[expr] 通分
Apart[expr] 部分分式展开
Apart[expr,var] 对var的部分分式展开
Cancel[expr] 约分
ExpandAll[expr] 展开表达式
ExpandAll[expr,patt] 展开表达式
FactorTermsrpoly] 提出共有的数字因子
FactorTerms[poly,x] 提出与x无关的数字因子
FactorTerms[poly,(x1,x2…)] 提出与xi无关的数字因子
Coefficient[expr,form] 多项式expr中form的系数
Coefficient[expr,form,n] 多项式expr中form^n的系数
Exponent[expr,form] 表达式expr中form的最高指数
Numerator[expr] 表达式expr的分子
Denominator[expr] 表达式expr的分母
ExpandNumerator[expr] 展开expr的分子部分
Solve[eqns,vats] 从方程组eqns中解出Vats
Solve[eqns,vats,elims] 从方程组eqns中削去变量elims,解出vats
DSolve[eqn,y,x] 解微分方程,其中、y是x的函数
DSolve[{eqnl,eqn2,⋯},{y1,y2⋯},] 解微分方程组,其中yi是x的函数
DSolve[eqn,y,{x1,x2…}] 解偏微分方程
Eliminate[eqns,Vats] 把方程组eqns中变量vars约去
SolveAlways[eqns,vars] 给出等式成立的所有参数满足的条件
Reduce[eqns,Vats] 化简并给出所有可能解的条件
LogicalExpand[expr] 用&&和,,将逻辑表达式展开
InverseFunction[f] 求函数f的反函数
Root[f,k] 求多项式函数的第k个根
Roots[1hs==rhs,var] 得到多项式方程的所有根
微积分
D[f,x] 求f[x]的微分
D[f,{x,n}] 求f[x]的n阶微分
D[f,x1,x2…] 求f[x]x1,x2⋯偏微分
Dt[f,x] 求f[x]的全微分df/dx
Dt(f) 求f[x]的全微分df
Dt[f,{x,n}] n阶全微分d^nf/dx^n
Dt[f,x1,x2..] 对x1,x2..的偏微分
Integrate[f,x] f[x]对x在的不定积分
Integrate[f,{x,xmin,xmax}] f[x]对x在区间(xmin,xmax)的定积分
Integrate[f,{x,xmin,xmax},{y,ymin,ymax}] f[x,y]的二重积分
Limit[expr,x->x0] x趋近于x0时expr的极限
Residue[expr,{x,x0}] expr在x0处的留数
Series[f,{x,x0,n}] 给出f[x]在x0处的幂级数展开
Series[f,{x,x0,nx},{y,y0,ny}] 先对y幂级数展开,再对x幂级数展开
Normal[expr] 化简并给出最常见的表达式
SeriesCoefficient[series,n] 给出级数中第n次项的系数
SeriesCoefficient[series,{n1,n2…}] 一阶导数
InverseSeries[s,x] 给出逆函数的级数
ComposeSeries[seriel,serie2…] 给出两个基数的组合
SeriesData[x,x0,{a0,a1,..},nmin,nmax,den] 表示一个x0处x的幂级数
O[x]^n n阶小量x^n
Variables[poly] 给出多项式poly中独立变量的列表
CoefficientList[poly,var] 给出多项式poly中变量var的系数
CoefficientList[poly,{varl,var2…}] 给出多项式poly中变量var(i)的系数列
PolynomialMod[poly,m] poly中各系数mod m同余后得到的多项式,m可为整式
PolynomialQuotient[p,q,x] 以x为自变量的两个多项式之商式p/
PolynomialRemainder[p,q,x] 以x为自变量的两个多项式之余式
P01ynomialGCD[polyl,poly2,...] poly(i)的最大公因式
PolynomialLCM[polyl,poly2....] poly(i)的最小公倍式
PolynomialReduce[pjoly,{polyl,Poly2,..},{xl,x2⋯}) 得到一个表I(a1,a2,·),b)其中Sumld*polyi]+b=poly
Resultant[polyl,poly2,var] 约去polyl,poly2中的var
Factor[poly] 因式分解(在整式范围内)
FactorTerms[poly] 提出poly中的数字公因子
FactorTerms[poly,{x1,x2⋯}] 提出poly中与xi无关项的数字公因子
FactorList[poly],FactorSquareFreeList[poly],FactorTermsList[poly,{x1,x2⋯}] 给出各个因式列表
Cyclotomic[n,x] n阶柱函数
Decomposet[poly,x] 迭代分解,给出{p1,p2,...},其中P1(p2(⋯))=poly
InterpolafinSPolynomial[data,Var] 在数据data上的插值多项式
RootSum[f,form] 得到f[x]=0的所有根,并求得Sum[form[xi]]
Random[type,range] 产生type类型且在range范围内的均匀分布随机数
Random[] 0-1上的随机实数
SeedRandom[n] 以n为seed产生伪随机数
Random[distribution] 可以产生各种分布
N[expr] 表达式的机器精度近似值
N[expr,n] 表达式的n位近似值,n为任意正整数
NSolve[1hs==rhs,val] 求方程数值解
Nsolve[eqn,Var, n] 求方程数值解,结果精度到n位
NDSolve[eqns,y,{x,xmin,xmax}] 微分方程数值解
NDSolve[eqns,{y1,y2,…},{x,xmin,xmax}] 微分方程组数值解
FindRoot[1hs==rhs,{x,x0}] 以x0为初值,寻找方程数值解
FindRoot[1hs==rhs,{x,xstart,xmin,xmax}] 以xstart为初值,在[xmin,xmax]范围内寻找方程数值解
NSum[f,{imin,imax,di}] 数值求和,di为步长
NSum[f,{imin,imax,di},{jmin,jmax,dj},..] 多维函数求和
NProduct[f,{i,imin,imax,di}] 函数求积
NIntegrate[f,{x,xmin,xmax}] 函数数值积分
FindMinimum[f,{x,x0}] 以x0为初值,寻找函数最小值
FindMinimum[f,{x,xstart,xmin,xmax}] 以xstart为初值,在[xmin,xmax]范围内寻找函数最小值
ConstrainedMin[f,{inequ},{x,y,..}] inequ为线性不等式组,f为x,y,…之线性函数,得到最小值及此时的x,y,…取值
ConstrainedMax[f,{inequ},{x,y,..}] inequ为线性不等式组,f为x,y,…之线性函数,得到最大值及此时的x,y,…取值
LinearProgramming[C,m,b] 解线性组合C*x在m*x>=b&&x>=0约束下的最小值,x,b,C为向量,m为矩阵
LatticeReduce[{v1,v2...}] 向量组Vi的极小无关组
Fit[data,funs,vats] 用指定函数组对数据进行最小二乘拟合
Interpolation[data] 对数据进行插值
Lisfinterpolation[array] 对离散数据插值,array可为n维
ListInterpolafion[array,{{xmin,xmax},{min,ymax},..}] 在特定网格上进行插值
FunctionInterpolation[expr,{x,xmin,xmax},{y,ymin,ymax},..] 以对应expr[xi,yi]的数值为数据进行插值
Fourier[list] 对复数数据进行傅氏变换
InverseFourier[list] 对复数数据进行傅氏逆变换
{e1,e2,...} 一个表,元素可以为任意表达式,无穷嵌套
Table[expr,{imax}] 生成一个表,共imax个元素
Table[expr,{i,imax}] 生成一个表,共imax个元素expr间
Table[expr,{i,imin,imax},{j,jmin,jmax},..] 多维表
Range[imax] 简单数表(1,i+,imax)
Range[imin,imax,di] 从imin到imax,以di为步长的数表
Array[f,n] 一维表,元素为f…(i从1到n)
Array[f,{n1,n2..}] 多维表,元素为f (各自从1到ni)
IdentityMatrix[n] n阶单位阵
DiagonalMatrix[list] 对角阵
Part[expr,i]或expr[[i]] 第i个元素
expr[[-i]] 倒数第i个元素
expr[{i,j,..}] 多维表的元素
expr[{i1,i2,..}] 返回由第i(n)的元素组成的子表
First[expr] 第一个元素
Last[expr] 最后一个元素
Head[expr] 函数头,等于expr[[0]]
Extract[expr,list] 取出由表list指定位置上expr的元素值
Take[list,n] 取出表list前n个元素组成的表
Take[list,{m,n}] 取出表list从m到n的元素组成的表
Drop[list,n] 去掉表list前n个元素组下的表
Rest[expr] 去掉表list第一个元素剩下的表
Select[USt,crit] 把crit作用到每一个list的元素上,为True的所有元素组成的表
Length[expr] expr第一层元素的个数
Dimensions[expr] 表的维数返回(n1,n2..),expr为一个nl*n2⋯的阵
TensorRank[expr] 秩
Depth[expr] expr最大深度
Level[expr,n] 给出expr中第n层子表达式的列表
Count[USt,paUem] 满足模式的list中元素的个数
MembefQ[1ist,form] list中是否有匹配form的元素
FreeQ[expr,form] MemberQ的反函数
FreeQ[expr,form] 表中匹配模式pattern的元素的位置列表
Cases[{e1,e2⋯},pattem] 匹配模式pattem的所有元素ei的表
Append[exp[elem] 返回在表expr的最后追加elem元素后的表
Prepend[expr,elem] 返回在表expr的最前添加elem元素后的表
Insert[1ist,elem,n] 在第n元素前插入elem
lnsert[expr,elem,{i,j,...}] 在元素expr[[{i,j,..}]]前插入elem
Delete[expr,{i,j,..}] 删除元素expr[[{i,j,..}]]后剩下的表
DeleteCases[expr,pattem] 删除匹配pattern的所有元素后剩下的表
ReplacePart[expr,new,n] 将expr的第n元素替换为new
Sort[list] 返回list按顺序排列的表
Reverse[expr] 把表expr倒过来
RotateLeft[expr,n] 把表expr循环左移n次
RotateRight[expr,n] 把表expr循环右移n次
Partition[list,n] 把list按每n个元素为一个子表分割后再组成的大表
Flatten[1ist] 抹平所有子表后得到的一维大表
Flatten[1ist,n] 抹平到第n层
Split[1ist] 把相同的元素组成一个子表,再合成的大表
Plot[f,{x,xmin,xmax}] 一维函数f[x]在区间[xmin,xmax]上的函数曲线
Plot[{fl,f2..},{x,xmin,xmax}] 在同一图形上画几条曲线
ListPlot[{y1,y2,..}] 绘出由离散点对(n,yn)组成的图
ListPlot[{{x1,y1},{x2,y2},…}] 绘出由离散点对(xn,ynl)组成的图
ParametricPlot[{fx,fy},{t,tmin,tmax}] 由参数方程在参数变化范围内产生的曲线
ParametricPlot[{{fx,fy},{gx,gy},...},{t,tmin,truax}] 由参数方程组在参数变化范围内产生的曲线
PlotRange->{0,1} 作图显示的值域范围
AspectRatio->1/GoldenRatio 生成图形的纵横比
PlotLabel->label 标题文字
Axes->{false,True} 分别制定是否画x,y轴
AxesLabel->{xlabel,ylabel} x,y轴上的说明文字
Ticks->None,Automatic,fun 用什么方式画轴的刻度
AxesOrigin->{x,y} 坐标轴原点位置
AxesStyle->{{xstyle},{ystyle}} 设置轴线的线性颜色等属性
Frame->True,False 是否画边框
FrameLabel->{xmlabel,ymlabel,xplabel,yplabel} 边框四边上的文字
FrameTicks 同Ticks 边框上是否画刻度
GridLines 同Ticks 图上是否画栅格线
Framestyle->{{xmstyle},{ymstyle}} 设置边框线的线性颜色等属性
ListPlot[data,PlotJoined->True] 把离散点按顺序连线
Plotsytle->{{style1},{style2},..} 曲线的线性颜色等属性
PlotPoints->15 曲线取样点,越大越细致
Plot3D[f,{x,xmin,xmax},{y,ymin,ymax}] 二维函数flx,y]的空间曲面
Plot3D[{f,s},{x,xmin,xmax},{y,ymin,ymax}] 同上,曲面的染色由s(x,y)值决定
ListPlot3D[array] 二维数据阵array的立体高度图
ListPlot3D[array,shades] 同上,曲面的染色由shades[数据]值决定
ParametricPlot3D[{fx,fy,fz},{t,tmin,tmax}] 三维参数图形
ContourPlot[f,{x,xmin,xmax},{y,ymin,ymax}] 二维函数f(x,y)在指定区间上的等高线图
ListContourPlot[array] 二维函数f(x,y)在指定array上的等高线图
Contours->n 画n条等高线
Contours->{z1,z2,...} 在zi处画等高线
ContourShading->False 是否用深浅染色
ContourLines->True 是否画等高线
ContourStyle->{{stylel},{style2},..} 等高线线性颜色等属性
DensityPlot[f,{x,xmin,xmax},{y,ymin,ymax}] 二维函数f[x,y]在指定区间上的密度图
ListDensityPlot[array] 二维函数f[x,y]在指定array上的密度图
Show[graphics,options] 显示一组图形对象,options为选项设置
Show[g1,g2,⋯] 在一个图上叠加显示一组图形对象
GraphicsArray[{g1,g2,...}] 在一个图上分块显示一组图形对象
SelectionAnimate[notebook,t] 把选中的notebook中的图画循环放映
Graphics[prim,options] prim为下面各种函数组成的表,表示一个二维图形对象
Graphics3D[prim,options] prim为下面各种函数组成的表,表示一个三维图形对象
SurfaceGraphics[array,shades] 表示一个由array和shade决定的曲面对象
ContourGraphics[array] 表示一个由array决定的等高线图对象
DensityGraphics[array] 表示一个由array决定的密度图对象
Point[p] p={x,y}或{x,y,2},在指定位置画点
Line[{p1,p2,..}] 经由Pi点连线
Rectangle[{xmin,ymin},{xmax,ymax}] 画矩形
Cuboid[{xmin,ymin,zmin},{xmax,ymax,zmax}] 由对角线指定的长方体
Polygon[{p1,p2,...}] 封闭多边形
Circle[{x,y},r] 画圆
Circle[{x,y},{rx,ry}] 画椭圆,rx,ry为半长短轴
Circle[{x,y},r,{a1,a2}] 从角度al-a2的圆弧
Disk[{x,y},r] 填充的园、椭圆、圆弧等参数同上
Raster[array,ColorFunction->f] 颜色栅格
Text[expr,coords] 在坐标coords上输出表达式
PostScrip["string"] 直接用Postscript图元语言写
Scaled[{x,y...}] 返回点的坐标,且均大于0小于1
GrayLevel[level] 灰度level为0~1间的实数
RGBColor[red,green,blue] RGB颜色,均为0~I间的实数
Hue[h,s,b] 亮度,饱和度等,均为0~1间的实数
CMYKColor[cyan,magenta,yellow,block] CMYK颜色
Thicknessr[r] 设置线宽为r
PointSize[d] 设置绘点的大小
Dashing[{r1,r2,...}] 画一个单元的间隔长度的虚线
ImageSize->{x,y} 显示图形大小(单位为像素)
If[condition,t,f] 如果condition为True,执行t,否则执行f段
if[condition,t,f,u] 如果condition为Tme,执行t,为False执行f,既非True
又非False,则执行u段
Which[test1,blockl,test2,block2..] 执行第一为True的tesfi对应的blocki
Switch[expr,forml,blockl,form2,block2...] 重复执行expr imax次
Do[expr,{imax}] 重复执行expr imax次
Do[expr,{i,imin,imax},{j,jmin,jmax}] 多重循环
While[test,body] 循环执行body直到test为False
For[start,test,incr,body] 循环执行body直到test为False
Throw[value] 停止计算,把value返回给最近一个Catch处理
Throw[value,tag] 停止计算,把value返回给最近一个Catch处理
Catch[expr] 计算expr,遇到Throw返回的值则停止
Catch[expr,form] 当Throw[value,tag]中Tag匹配form时停止
Return[expr] 从函数返回,返回值为expr
Return[] 返回值Null
Breakl[] 结束最近的一重循环
Continuel[] 停止本次循环,进行下一次循环
Goto[tag] 无条件转向Label[Tag]处
Label[tag] 设置一个断点
Check[expr,fmlexpr] 计算expr,如果有出错信息产生,则返回failexpr的值
Check[expr,failexpr,s1::t1,s2::t2,...] 当特定信息产生时则返回failexpr
CheckAbort[expr,failexpr] 当产生abort信息时返回failexpr
Interrupt[] 中断运行
Abort[] 中断运行
TimeConstrained[expr,t] 计算expr,当耗时超过t秒时终止
MemoryConstrained[expr,b] 计算expr,当耗用内存超过b字节时终止运算
Print[exprl,expr2,...] 顺次输出expri的值
Input[] 产生一个输入对话框,返回所输入的任意表达式
Input["prompt"] 同上,prompt为对话框的提示
Pause[n] 运行暂停n秒
<零碎部分>
N[Exp,n] 取n位有效数字,也可以直接表达式后面加上“//N”,与之等效;
Solve[Exp] 解方程组;
Expand[Exp] 展开表达式;
Prime[n] 取第几位素数,内部原因,从2开始计;
Plot[Exp,{var,min,max}] 二维描点功能;
Plot3D[Exp,{var,min,max}] 三维描点功能;
ImplicitPlot[Exp,{var,min,max}] 隐函数描点功能,需提前挂载Graphics`ImplicitPlot`软件包;
Sqrt[n] 求n的平方根;
Abs[n] 取n的绝对值,复数为取模;
Sign[n] 符号函数,n为正返回“1”,n为负返回“0”,n为“0”返回“0”;
n!或Factorial[n] n的阶乘,n可以不是整数;
Random[*] 产生伪随机数,可选“Integer”“Real”“Complex”等类型;
Fibonacci[n] Fibonacci数列第n个数字;
Round[n] 取离n最近的整数,处于两整数中间时,取偶数;
Floor[n] 返回不超过n的整数;
Ceiling[n] 返回不小于n的整数;
IntegerPart[n] 返回n的整数部分;
FractionalPart[n] 返回n的小数部分;
Quotient[a,b] 返回a除以b得到的商;
Mod[a,b] 返回a除以b得到的余数;
GCD[a,b] 返回a与b的最大公约数,可推广到多个参数;
LCM[a,b] 返回a与b的最小公倍数,可推广到多个参数;
FactorInteger[n] 以嵌套列表(Mathematica的一种对象)的形式给出n的素数分解;
Log[n] 返回n的自然对数,若需要特定的以a为底数则为 Log[a,n];
三角函数分别为 Sin[n] Cos[n] Tan[n] Sec[n] Csc[n] Cot[n] ,默认以弧度为单位,若要以角度为单位,则在加上Degree,例如 Sin[30 Degree],反三角函数分别是ArcSin,ArcCos,ArcTan,ArcSec,ArcCsc,ArcCot,反三角函数返回值皆以弧度表示;
双曲函数分别是:Sinh,Cosh,Tanh,Sech,Csch,Coth;反双曲函数分别是:ArcSinh,ArcCosh,ArcTanh,ArcSech,ArcCsch,ArcCoth,由于Csch和Sech并不是一一对应,所以ArcCosh与ArcSech对于实参数值只返回正值;
Copyright © 2007
3 年前
This type of section 80GG is really important for any salaried employee who is not receiving any HRA from their company or the employer they are currently working for. 80GG In such cases where you have paid for rent money and in house living then you will allow to apply for the refund under the Section 80GG. While applying for the section 80GG of Income tax act for deductions you have to make sure that you are a self employee or a salaried person who has an entity to show to the government.
3 年前 This year's Goa Class Xllth Exams were administered by the Goa Board of Secondary Education. upon the satisfactory completion of the exam. The Goa Board intends to release the Goa Class 11th Examination 2023 Question Paper in the month of May. The Goa Board offers students a superior education. The Board also offers scholarships to students in a variety of fields. those those who are taking the Goa Board Plus-2 Exams. The Goa Board 11th Question Paper 2023 is something they are all anxiously awaiting online. Goa 11th Previous Paper 2023 They may get their Goa Board 11th Important Question Paper 2023 from the Official website, and we've also provided a direct link so they can quickly check their Goa 11th Important Question Paper 2023. Here, we keep a few helpful guidelines that students may simply follow.
2 年前
AP YSR cheyutha scheme is a unique and beneficial social scheme introduced by the Andhra Pradesh government. The main aim of the scheme into fund vulnerable women living in the AP state in self-employment. Navasakam2.apcfss.in They provide financial assistance to boost their upkeep together with their families. Women under self-help groups are also eligible for the scheme. The AP Chief minister Jagan Mohan Reddy aims to help all the women in the poverty or weak section in the community, such as SC/ST/OBC and minority community.
2 年前
The TS bus pass works for students traveling using government buses for studies in a different part of the state. They have to select the type of bus to apply online and fill the application form. Telangana RTC Bus Pass Apply Online The TSRTC bus pass is cheaper compared to regular bus payments. They can save more and have a convenient way of travel. The government helps in the half-rate and nominal rate to encourage all students to study and avail in their respective schools in the state.
2 年前
PLI dates back to 1884, offering various insurance policies. The Company limited its policy cover to postal department employees and later expanding to the telegraph department and general public. PLI Login The insurance provider works with government employees, financial sectors, educational institutions, and other sectors in India. PLI has upgraded from traditional premium payments to new digitalized services. This allows premium holders to clear payments through online services.
2 年前 Australia holidays are viewed differently with their State and county-wide celebrations, and there is different segregation that is shown as per the divided state and territory, and this list of public holidays is declared and is declared when the entire nation does go off from work. Australia Public Holidays 2023 These holidays are permanent holidays that are applicable to everyone who is working in certain states. National holidays are taken as most important, as every stream of working employees and companies does grant them leave which is for free.
2 年前
Previous Paper 2024 SSC is Get Available by the Board of Secondary Education. The Model Question Paper for class 10th will deliver in online mode on the authority site. The Model Paper will comprise of the subject-wise New Question Paper, day, timings, 10th Previous Paper 2024 and significant guidelines for test day. In this article, the up-and-comer will get the data about the 10th Class Latest Question Paper 2024 including delivering PDF and how to download the Latest Question Paper.
2 年前
Trains are among the most convenient and economical mode of travel over both long and shorter distances in India. Among other facilities, the Indian Railways also provides travel insurance to those who opt for it while booking train tickets online. This facility is provided to passengers who book tickets online. This benefit can be availed while booking a ticket on the IRCTC website by checking the ' IRCTC Travel Insurance ' option. This lesser-known facility is seldom available while booking tickets through travel agents, or while booking tickets over the counter This facility is provided to passengers who book tickets online. This benefit can be available while booking a ticket on the IRCTC website by checking the 'Travel Insurance' option on the web page.