我试图在方程组中使用狄拉克δ函数,以便在t = 1.5,t = 3,t = 4.5等时h(t)增加。
以下是我的代码:
A:=30: a:=1: dm:=3: c3:=5: d0:=1/a: t0:=1/dm: h0:=B0: y:=A*a: cc:=t0*c3: #same as cc=c3/Bm
N:=8: T:=0.5:
sys_ode:= diff(h(t),t)=y*sum(Dirac(t-dm*n*T),n=0..N) - exp(1-d(t))*h(t), diff(d(t),t)=exp(1-d(t))*h(t) - cc*d(t);
ics:=h(0)=A*a, d(0)=0:
ND:=dsolve([sys_ode,ics],numeric); #numerical solution to the system
ND(1);
ND(2);
ND(3);
ND(4);
目前,当我运行时,我得到:
ND(1);
[t = 1., d(t) = HFloat(2.6749858704773097),
h(t) = HFloat(23.164506116038023)]
ND(2);
[t = 2., d(t) = HFloat(2.5365091646635465),
h(t) = HFloat(18.95651519442652)]
ND(3);
[t = 3., d(t) = HFloat(2.376810307084265),
h(t) = HFloat(15.018803909414379)]
ND(4);
[t = 4., d(t) = HFloat(2.1927211646807137),
h(t) = HFloat(11.391114874494281)]
但理论上h(t)的值应该增加,因为在t = 1.5和t = 3时系统输入并且在t = 4时没有一直下降到h(t)= 11.39
任何我出错的想法都会受到赞赏。感谢。
答案 0 :(得分:2)
Maple 2015.0增加了对包含0阶Dirac函数的ODE问题的数值积分的支持。由于此添加,您显示的集成结果如下所示:
> ND(1);
[t = 1., d(t) = 3.01973877409584, h(t) = 37.2561191650856]
> ND(2);
[t = 2., d(t) = 3.38932165514909, h(t) = 61.6360962313253]
> ND(3);
[t = 3., d(t) = 3.32743891599543, h(t) = 71.0940887774625]
> ND(4);
[t = 4., d(t) = 3.59829473587253, h(t) = 79.8444924691185]
这个功能确实在增加。
在Maple的早期版本中,没有对数字积分执行Dirac的特殊处理,因此除非一个人完全击中Dirac-0点,否则它们将被忽略,如果它们被击中,则积分将停止并且未定义。旧的方式就好像狄拉克函数不存在一样,这与你的结果一致:
> sys_ode:= diff(h(t),t)= - exp(1-d(t))*h(t),
> diff(d(t),t)=exp(1-d(t))*h(t) - cc*d(t):
> ND:=dsolve([sys_ode,ics],numeric):
> ND(1);
[t = 1., d(t) = 2.67498587047731, h(t) = 23.1645061160380]
> ND(2);
[t = 2., d(t) = 2.53650916466355, h(t) = 18.9565151944265]
> ND(3);
[t = 3., d(t) = 2.37681030708426, h(t) = 15.0188039094144]
> ND(4);
[t = 4., d(t) = 2.19272116468071, h(t) = 11.3911148744943]