【问题标题】:Taylor series vs numeric solution of nonlinear DE in maple泰勒级数与枫树非线性DE的数值解
【发布时间】:2018-12-31 13:41:36
【问题描述】:

我想绘制两张图:DE 的数值解和给定 DE 的泰勒级数逼近。我有

de := diff(y(x), x$2) = x+y(x)-y(x)^2;
cond := y(0) = -1, (D(y))(0) = 1;
stp := 0.1e-1;
a, b := -5, 30;
numpts := floor((b-a)/stp+1);
p := dsolve({cond, de}, y(x), numeric, stepsize = stp, output = listprocedure); 

绘制eval 给出了奇怪的垂直线,而我希望获得似乎在x -> ∞ 上振荡的图。对于泰勒系列,我尝试过f:=[seq(taylor(y(x),x=i,n),i=-5..30 by stp)];,但似乎它不会以这种方式工作。我能用它做什么?为什么我的情节与预期不同?

【问题讨论】:

  • 最近,您的另一个问题似乎消失了。那正确吗?被删除了吗?
  • 非常感谢您的回答,情节看起来不错。我的最后一个问题是无用的,因为它源于我对结果的错误想法。事实上,如果可以以这种方式完成,Maple 会自动执行所需的操作,因此无需提问。简单检查(使用另一个类似的 DE)向我表明我的“问题”是我的数学技能问题,而不是我的 Maple 技能问题 :)

标签: maple


【解决方案1】:
restart;
kernelopts(version);

    Maple 2018.0, X86 64 LINUX, Mar 9 2018, Build ID 1298750

de := diff(y(x), x$2) = x+y(x)-y(x)^2:
cond := y(0) = -1, (D(y))(0) = 1:
stp := 0.1e-1:
a, b := -5, 30:
numpts := floor((b-a)/stp+1):

p := dsolve({cond, de}, y(x), numeric, stepsize = stp,
            output = listprocedure):

Y:=eval(y(x),p);

                Y := proc(x)  ...  end;

plot(Y, 0..20);

Order:=10:
S := convert(rhs(dsolve({cond, de}, {y(x)}, series)),polynom);

plot([S, Y(x)], x=0..1.5);

Order:=40:
S := convert(rhs(dsolve({cond, de}, {y(x)}, series)),polynom):

plot([S, Y(x)], x=0..2.0);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-04-03
    • 1970-01-01
    • 2017-12-02
    • 2014-02-23
    • 1970-01-01
    • 1970-01-01
    • 2016-02-10
    • 2016-01-24
    相关资源
    最近更新 更多