matlab实现下公式的taylor级数展开

发布网友 发布时间:2022-03-25 19:53

我来回答

3个回答

懂视网 时间:2022-03-26 00:15

matlab求泰勒展开式的方法是:

  

  1、taylor指令简介,现在就看一下matlab的帮助信息。

  

  2、用符号工具包的taylor指令计算,具体的代码及计算结果。

  

  3、直接调用MuPAD引擎计算,具体的代码及计算结果。

  

  4、求“sin(x^2+y)在x=0,y=0”处的截断9阶小量的taylor展开近似。

  

  

热心网友 时间:2022-03-25 21:23

你好,很简单,只要用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

热心网友 时间:2022-03-25 22:41

  在(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
声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。
E-MAIL:11247931@qq.com