maple公式简化 |
您所在的位置:网站首页 › sinacosa化简公式 › maple公式简化 |
#maple知道各种特殊函数的化简规则,如果把某个特定的化简规则作为simplify命令的参数特别指定,则simplify命令仅使用这类化简规则。 >expr:=ln(3*x)+sin(x)^2+cos(x)^2; ln(3x)+sin2x+cos2x >simplify(expr,trig); ln(3x)+1 >simplify(expr,ln); ln(3)+ln(x)+ sin2x+cos2x >simplify(expr); ln(3)+ln(x)+1 2. 带有假设的化简 simplify(expr,assume=property); >expr:=sqrt((x*y)^2); expr:=(x2y2)1/2 >simplify(expr); (x2y2)1/2 >simplify(expr,assume=real); Signum(x)xsignum(y)y >simplify(expr,assume=positive); xy 3. 带有附加条件的化简 >simplify(expr, {x*y=1}); >siderel:=x^2+y^2=1; >simplify(expr,{siderel},[y,x]); #maple在表达式中作代换y^2=1-x^2,然后再试图对x^2做代换,由于找不到,就停止了 4. 展开与组合 expand & combine combine是与expand相反的命令,它可以按照数学规则将表达式中的某些项组合在一起 > combine(sin(x)^2+cos(x)^2); 1 > combine(exp(x)^2*exp(y)); e(2x+y) #与simplify相似,combine命令也可以用第二个参数来指定某种规则 > combine(expr, power); > combine(expr, trig); #combine还可以组合具有相同积分区间的积分项、具有相同指标的和式以及具有相同极限点的极限 > combine(int(f(x),x=a..b)+int(g(x),x=a..b)); int((f(x)+g(x)),x=a..b) 5. 等价形式之间的转换 convert > convert(sin(x),exp); > convert(cot(x),sincos); 二表达式的结构 > f:=sin(x)+2*cos(x)^2*sin(x)+3; #确定表达式的类型 > whattype(f); #列出表达式的所有项 > op(f); #求出表达式的项数 > nops(f); #取出这个序列的第二项 > term2:=op(f)[2]; #检测表达式的类型 > type(f,’+’); > type(f,’*’); > type(f,function); > type(f,’^’); > type(op(3,f),integer); #看一个式子中是否有某种子表达式 > has(f,cos) > has(f,cos(x)^2); #看一个式子中是否有某种类型的表达式,而不是包含它们的项,用indets命令把它们找出来 > hastype(sin(1+sqrt(Pi)),’+’); Ture > expr:=(3+x)*x^2*sin(1+sqrt(Pi+3)); expr:=(3+x)x2sin(1+(Pi+3)1/2) > indets(expr,’+’); {3+x,π+3,(π+3)1/2} 三结构运算 map, seq, add, mul, select, remove, zip,… #把一个函数或命令作用到结构的每一个元素上 > map(f,[a,b,c]); [f(a),f(b),f(c)] > map(expand, {(x+1)*(x+2),x*(x+2)}); {x2+2x, x2+3x+2} > map(x->x^2,[a,b,c]); [a2, b2, c2] #如果给map多于两个参数,它会把多于的参数传递给函数作为函数的参数 > map(f,[a,b,c],p,q); > map(diff,[(x+1)*(x+2),x*(x+2)],x); #map2命令与map密切相关,map把一个列表或集合的元素作为第一个参数传递给函数,map2命令则把它们作为函数的第二参数 > map2(f,p,[a,b,c],q,r); [f(p,a,q,r),f(p,b,q,r),f(p,c,q,r)] #map也可以与map2一起使用 > map2(map,{[a,b],[c,d],[e,f]},p,q); #map命令不仅可以作用到列表上,也可以作用到一般表达式上,即作用到表达式的每一项上 > map(g,x^2); g(x)g(2) seq #seq命令的作用是生成序列 > seq(f(i),i={a,b,c}); f(a),f(b),f(c) > seq(f(p,i,q,r),i=[a,b,c]); f(p,a,q,r), f(p,b,q,r), f(p,c,q,r) add & mul #与seq一样,分别生成和与积,而不是序列 > add(i^2,i=[5,y,sin(x),-1]); 26+y2+sin(x)2 #与map一样,seq,add,mul也能够作用于一般的表达式 select > large:=x->is(x>4); > L:=[8,3,2*Pi,sin(4)]; [8, 3, 2π, sin(4)] > select(large,L); [8, 2π] > select(type,L,numeric); [8, 3] remove > remove(large,L); [3, sin(4)] zip X:=[seq(ithprime[z1] (i),i=1..6)]; [2, 3, 5, 7, 11, 13] Y:=[seq(binomial[z2] (6,i),i=1..6)]; [6, 15, 20, 15, 6, 1] NOTE: binomial coefficients (n,r)=n!/(r!(n-r)!) #事先构造一个配对函数 > pair:=(x,y)->[x,y]; > P:=zip(pair,X,Y); [[2, 6], [3, 15], [5, 20], [7, 15], [11, 6], [13, 1]] sort > sort([1, 6, 2, 3, 5, 4, 8, 2, 3, 2, 45, 5]); [1, 2, 2, 2, 3, 3, 4, 5, 5, 6, 8, 45] > sort([Merry, thank, u, pretty, girl]); [Merry, girl, pretty, thank, u] [z1]determine the ith prime number [z2]compute binomial coefficients 来源:http://blog.sina.com.cn/s/blog_636a8b120100jnyt.html |
今日新闻 |
点击排行 |
|
推荐新闻 |
图片新闻 |
|
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭 |