24小时热门版块排行榜    

查看: 3655  |  回复: 1

huobaozi

新虫 (小有名气)

[求助] dde23求解延迟微分方程的问题

dde23求解延迟微分方程的问题
想求解这样一个延迟微分方程。
假定函数f(t)在小于TAO0的时候为0,等于tao0的时候为0.1(随意假定的一个常数)。
先实现了一个ddefun函数如下:
----------------------------------------
function v = ddefun(t,y,Z)
a=1e-4;
b=-1e-10;
ylag1 =Z;
v=a*y+b*ylag1;
---------------------------------------
然后,主函数中相关代码这样写:
tao0=100;
tspan=tao0:tao0*1000;
fm=@(x) ((x==tao0)*0.1);
sol=dde23('ddefun', tao0,fm,tspan);
——————————————————
运行没有问题,但是因为我也不知道延迟微分方程的解应该什么,所以没办法验证。求问达人,上述代码的求解过程对吗?谢谢。
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

月只蓝

主管区长 (职业作家)

以下是MATLAB的帮助文档,你程序的格式应该没问题。
>> help dde23
DDE23  Solve delay differential equations (DDEs) with constant delays.
    SOL = DDE23(DDEFUN,LAGS,HISTORY,TSPAN) integrates a system of DDEs
    y'(t) = f(t,y(t),y(t - tau_1),...,y(t - tau_k)). The constant, positive
    delays tau_1,...,tau_k are input as the vector LAGS. DDEFUN is a function
    handle. DDEFUN(T,Y,Z) must return a column vector corresponding to
    f(t,y(t),y(t - tau_1),...,y(t - tau_k)). In the call to DDEFUN, a scalar T
    is the current t, a column vector Y approximates y(t), and a column Z(:,j)
    approximates y(t - tau_j) for delay tau_j = LAGS(J).  The DDEs are
    integrated from T0=TSPAN(1) to TF=TSPAN(end) where T0 < TF. The solution
    at t <= T0 is specified by HISTORY in one of three ways: HISTORY can be
    a function handle, where for a scalar T, HISTORY(T) returns a column
    vector y(t). If y(t) is constant, HISTORY can be this column vector.
    If this call to DDE23 continues a previous integration to T0, HISTORY
    can be the solution SOL from that call.

    DDE23 produces a solution that is continuous on [T0,TF]. The solution is
    evaluated at points TINT using the output SOL of DDE23 and the function
    DEVAL: YINT = DEVAL(SOL,TINT). The output SOL is a structure with
        SOL.x  -- mesh selected by DDE23
        SOL.y  -- approximation to y(t) at the mesh points of SOL.x
        SOL.yp -- approximation to y'(t) at the mesh points of SOL.x
        SOL.solver -- 'dde23'

    SOL = DDE23(DDEFUN,LAGS,HISTORY,TSPAN,OPTIONS) solves as above with default
    parameters replaced by values in OPTIONS, a structure created with the
    DDESET function. See DDESET for details. Commonly used options are
    scalar relative error tolerance 'RelTol' (1e-3 by default) and vector of
    absolute error tolerances 'AbsTol' (all components 1e-6 by default).

    DDE23 can solve problems with discontinuities in the solution prior to T0
    (the history) or discontinuities in coefficients of the equations at known
    values of t after T0 if the locations of these discontinuities are
    provided in a vector as the value of the 'Jumps' option.

    By default the initial value of the solution is the value returned by
    HISTORY at T0. A different initial value can be supplied as the value of
    the 'InitialY' property.

    With the 'Events' property in OPTIONS set to a function handle EVENTS,
    DDE23 solves as above while also finding where event functions
    g(t,y(t),y(t - tau_1),...,y(t - tau_k)) are zero. For each function
    you specify whether the integration is to terminate at a zero and whether
    the direction of the zero crossing matters. These are the three column
    vectors returned by EVENTS: [VALUE,ISTERMINAL,DIRECTION] = EVENTS(T,Y,Z).
    For the I-th event function: VALUE(I) is the value of the function,
    ISTERMINAL(I) = 1 if the integration is to terminate at a zero of this
    event function and 0 otherwise. DIRECTION(I) = 0 if all zeros are to
    be computed (the default), +1 if only zeros where the event function is
    increasing, and -1 if only zeros where the event function is decreasing.
    The field SOL.xe is a row vector of times at which events occur. Columns
    of SOL.ye are the corresponding solutions, and indices in vector SOL.ie
    specify which event occurred.   
   
    Example   
          sol = dde23(@ddex1de,[1, 0.2],@ddex1hist,[0, 5]);
      solves a DDE on the interval [0, 5] with lags 1 and 0.2 and delay
      differential equations computed by the function ddex1de. The history
      is evaluated for t <= 0 by the function ddex1hist. The solution is
      evaluated at 100 equally spaced points in [0 5]  
          tint = linspace(0,5);
          yint = deval(sol,tint);
      and plotted with
          plot(tint,yint);
      DDEX1 shows how this problem can be coded using subfunctions. For
      another example see DDEX2.
MATLAB、MS小问题、普通问题请发帖求助!时间精力有限,恕不接受无偿私信求助。
2楼2013-10-12 08:50:03
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 huobaozi 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 听说今天filecode变了 +17 布布和一二 2026-08-06 31/1550 2026-08-06 22:34 by qusibaya
[基金申请] filecode +10 等待解的谜 2026-08-06 14/700 2026-08-06 21:16 by zhanghaozhu
[基金申请] 固定端突然变了,今天 +3 archvillain 2026-08-06 7/350 2026-08-06 21:05 by archvillain
[基金申请] filecode +8 布布和一二 2026-08-06 11/550 2026-08-06 20:41 by tangpu318
[基金申请] 大家散了吧,后缀研究没有意义,别浪费时间了,过好目前的每一天,不要焦虑 +5 Tide man 2026-08-06 6/300 2026-08-06 20:19 by 苏知砚
[基金申请] 基金中了 +4 laoda193707 2026-08-06 4/200 2026-08-06 18:56 by olivermiaoer
[有机交流] 一个有机合成实验室都需要哪些设备? 50+3 kf2781974 2026-07-31 12/600 2026-08-06 15:11 by eddyin
[基金申请] 求各位大神看下 100+6 hpkpkpkp 2026-08-05 33/1650 2026-08-06 14:49 by zhiyanjiang
[教师之家] 咨询面上基金 +4 李长云 2026-07-31 7/350 2026-08-06 11:20 by 李长云
[基金申请] 影响面上的因素 +8 布布和一二 2026-08-05 11/550 2026-08-06 10:41 by 宝贝虫子
[基金申请] 8月时间戳变的,举个手。玩一下,释放压力 +9 archvillain 2026-08-04 11/550 2026-08-05 20:06 by wlwhappy
[基金申请] 面上再次挂了,太难了,躺也躺不了,倦也卷不过,小学校之殇! +22 低垂的野花 2026-07-31 30/1500 2026-08-05 18:03 by 低垂的野花
[基金申请] 好消息?这个有何含义??? +8 Tide man 2026-08-05 10/500 2026-08-05 16:14 by xmuxiaoyu
[考博] 【2027博士申请】纳米药物递送方向 20+3 13586093586 2026-08-03 4/200 2026-08-05 09:59 by lfy8008
[基金申请] 有没有H口的?有收到消息的吗? +3 超级海虾 2026-08-04 3/150 2026-08-04 17:26 by 学教育滴
[论文投稿] 十年后又回来了,论文投稿求助 +3 哈哈114477 2026-08-01 3/150 2026-08-04 15:40 by tegsgjy20
[基金申请] 纯娱乐,不喜欢勿喷 +7 Tide man 2026-08-04 10/500 2026-08-04 15:10 by loufangrui
[基金申请] 面上提前没消息,有中的吗 +14 archvillain 2026-08-02 18/900 2026-08-04 14:42 by archvillain
[基金申请] 娱乐 +4 Tide man 2026-08-03 4/200 2026-08-04 11:51 by wgch518
[基金申请] 什么时候能放榜呀? +3 Jacob678 2026-08-03 3/150 2026-08-03 16:14 by gltch
信息提示
请填处理意见