matlab实现下公式的taylor级数展开
y=L^2/(L+x1*d1+x2*d2)^2实现x1,x2的一阶展开,即a+b*x1+c*x2的形式。希望能显示结果...
y=L^2/(L+x1*d1+x2*d2)^2实现x1,x2的一阶展开,即a+b*x1+c*x2的形式。希望能显示结果
展开
2个回答
展开全部
你好,很简单,只要用taylor函数就可以
syms x2 x1 d1 d2 L
y=L^2/(L+x1*d1+x2*d2)^2;
f = taylor(y)
f =
L^2/(L + d2*x2)^2 - (2*L^2*d1*x1)/(L + d2*x2)^3 + (3*L^2*d1^2*x1^2)/(L + d2*x2)^4 - (4*L^2*d1^3*x1^3)/(L + d2*x2)^5 + (5*L^2*d1^4*x1^4)/(L + d2*x2)^6 - (6*L^2*d1^5*x1^5)/(L + d2*x2)^7
>>
下面是matlab提供的关于taylor 函数的一些帮助,可以通过 doc taylor 调出来
Examples
Compute the Maclaurin series expansions of these functions:
syms x
taylor(exp(x))
taylor(sin(x))
taylor(cos(x))
ans =
x^5/120 + x^4/24 + x^3/6 + x^2/2 + x + 1
ans =
x^5/120 - x^3/6 + x
ans =
x^4/24 - x^2/2 + 1
Compute the Taylor series expansions around x = 1 for these functions. The default expansion point is 0. To specify a different expansion point, use ExpansionPoint:
syms x
taylor(log(x), x, 'ExpansionPoint', 1)
ans =
x - (x - 1)^2/2 + (x - 1)^3/3 - (x - 1)^4/4 + (x - 1)^5/5 - 1
Alternatively, specify the expansion point as the third argument of taylor:
taylor(acot(x), x, 1)
ans =
pi/4 - x/2 + (x - 1)^2/4 - (x - 1)^3/12 + (x - 1)^5/40 + 1/2
Compute the Maclaurin series expansion for this function. The default truncation order is 6. Taylor series approximation of this function does not have a fifth-degree term, so taylor approximates this function with the fourth-degree polynomial:
syms x
f = sin(x)/x;
t6 = taylor(f)
t6 =
x^4/120 - x^2/6 + 1
Use Order to control the truncation order. For example, approximate the function up to the orders 8 and 10:
t8 = taylor(f, 'Order', 8)
t10 = taylor(f, 'Order', 10)
t8 =
- x^6/5040 + x^4/120 - x^2/6 + 1
t10 =
x^8/362880 - x^6/5040 + x^4/120 - x^2/6 + 1
syms x2 x1 d1 d2 L
y=L^2/(L+x1*d1+x2*d2)^2;
f = taylor(y)
f =
L^2/(L + d2*x2)^2 - (2*L^2*d1*x1)/(L + d2*x2)^3 + (3*L^2*d1^2*x1^2)/(L + d2*x2)^4 - (4*L^2*d1^3*x1^3)/(L + d2*x2)^5 + (5*L^2*d1^4*x1^4)/(L + d2*x2)^6 - (6*L^2*d1^5*x1^5)/(L + d2*x2)^7
>>
下面是matlab提供的关于taylor 函数的一些帮助,可以通过 doc taylor 调出来
Examples
Compute the Maclaurin series expansions of these functions:
syms x
taylor(exp(x))
taylor(sin(x))
taylor(cos(x))
ans =
x^5/120 + x^4/24 + x^3/6 + x^2/2 + x + 1
ans =
x^5/120 - x^3/6 + x
ans =
x^4/24 - x^2/2 + 1
Compute the Taylor series expansions around x = 1 for these functions. The default expansion point is 0. To specify a different expansion point, use ExpansionPoint:
syms x
taylor(log(x), x, 'ExpansionPoint', 1)
ans =
x - (x - 1)^2/2 + (x - 1)^3/3 - (x - 1)^4/4 + (x - 1)^5/5 - 1
Alternatively, specify the expansion point as the third argument of taylor:
taylor(acot(x), x, 1)
ans =
pi/4 - x/2 + (x - 1)^2/4 - (x - 1)^3/12 + (x - 1)^5/40 + 1/2
Compute the Maclaurin series expansion for this function. The default truncation order is 6. Taylor series approximation of this function does not have a fifth-degree term, so taylor approximates this function with the fourth-degree polynomial:
syms x
f = sin(x)/x;
t6 = taylor(f)
t6 =
x^4/120 - x^2/6 + 1
Use Order to control the truncation order. For example, approximate the function up to the orders 8 and 10:
t8 = taylor(f, 'Order', 8)
t10 = taylor(f, 'Order', 10)
t8 =
- x^6/5040 + x^4/120 - x^2/6 + 1
t10 =
x^8/362880 - x^6/5040 + x^4/120 - x^2/6 + 1
展开全部
在(m,n)处泰勒展开:y(x1,x2)=y(m,n)+yx1(m,n)*x1+yx2(m,n)+。。。
结果:y=L^2/(L+m*d1+n*d2)^2 - 2*L^2*d1*(x1-m)/(L+m*d1+n*d2)^3 - 2*L^2*d2*(x2-n)/(L+m*d1+n*d2)^3
若m=n=0,y=1 - 2*d1*x1/L - 2*d2*x2/L
即: a=1
b= - 2*d1/L
c= - 2*d2/L
结果:y=L^2/(L+m*d1+n*d2)^2 - 2*L^2*d1*(x1-m)/(L+m*d1+n*d2)^3 - 2*L^2*d2*(x2-n)/(L+m*d1+n*d2)^3
若m=n=0,y=1 - 2*d1*x1/L - 2*d2*x2/L
即: a=1
b= - 2*d1/L
c= - 2*d2/L
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询