数模论坛

 找回密码
 注-册-帐-号
搜索
热搜: 活动 交友 discuz
查看: 2175|回复: 1

请教一个matlab的问题!!!

[复制链接]
发表于 2004-8-24 06:42:46 | 显示全部楼层 |阅读模式
<>谁能解释一下matlab的odes15函数</P>
<>最好能给个例子</P>
<><v:shapetype> </v:shapetype></P>
发表于 2004-8-24 21:08:24 | 显示全部楼层
<>在matlab6.5中没有ode15这个函数,</P><>有ode15s,ode23,ode45,ode23s等</P><>ODE15S Solve stiff differential equations and DAEs, variable order method.
    [T,Y] = ODE15S(ODEFUN,TSPAN,Y0) with TSPAN = [T0 TFINAL] integrates the
    system of differential equations y' = f(t,y) from time T0 to TFINAL with
    initial conditions Y0. Function ODEFUN(T,Y) must return a column vector
    corresponding to f(t,y). Each row in the solution array Y corresponds to
    a time returned in the column vector T. To obtain solutions at specific
    times T0,T1,...,TFINAL (all increasing or all decreasing), use
    TSPAN = [T0 T1  ... TFINAL].     
   
    [T,Y] = ODE15S(ODEFUN,TSPAN,Y0,OPTIONS) solves as above with default
    integration properties replaced by values in OPTIONS, an argument created
    with the ODESET function. See ODESET 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).  
   
    [T,Y] = ODE15S(ODEFUN,TSPAN,Y0,OPTIONS,P1,P2...) passes the additional
    parameters P1,P2,... to the ODE function as ODEFUN(T,Y,P1,P2...), and to
    all functions specified in OPTIONS. Use OPTIONS = [] as a place holder if
    no options are set.   
   
    The Jacobian matrix df/dy is critical to reliability and efficiency. Use
    ODESET to set 'Jacobian' to a function FJAC if FJAC(T,Y) returns the
    Jacobian df/dy or to the matrix df/dy if the Jacobian is constant. If the
    'Jacobian' option is not set (the default), df/dy is approximated by
    finite differences. Set 'Vectorized' 'on' if the ODE function is coded so
    that ODEFUN(T,[Y1 Y2 ...]) returns [ODEFUN(T,Y1) ODEFUN(T,Y2) ...]. If
    df/dy is a sparse matrix, set 'JPattern' to the sparsity pattern of
    df/dy, i.e., a sparse matrix S with S(i,j) = 1 if component i of f(t,y)
    depends on component j of y, and 0 otherwise.   

    ODE15S can solve problems M(t,y)*y' = f(t,y) with mass matrix M(t,y). Use
    ODESET to set the 'Mass' property to a function MASS if MASS(T,Y) returns
    the value of the mass matrix. If the mass matrix is constant, the matrix
    can be used as the value of the 'Mass' option. Problems with
    state-dependent mass matrices are more difficult. If the mass matrix does
    not depend on the state variable Y and the function MASS is to be called
    with one input argument T, set 'MStateDependence' to 'none'. If the mass
    matrix depends weakly on Y, set 'MStateDependence' to 'weak' (the
    default) and otherwise, to 'strong'. In either case the function MASS is
    to be called with the two arguments (T,Y). If there are many differential
    equations, it is important to exploit sparsity: Return a sparse
    M(t,y). Either supply the sparsity pattern of df/dy using the 'JPattern'
    property or a sparse df/dy using the Jacobian property. For strongly
    state-dependent M(t,y), set 'MvPattern' to a sparse matrix S with S(i,j)
    = 1 if for any k, the (i,k) component of M(t,y) depends on component j of
    y, and 0 otherwise.   

    If the mass matrix is non-singular, the solution of the problem is
    straightforward. See examples FEM1ODE, FEM2ODE, BATONODE, or
    BURGERSODE. If M(t0,y0) is singular, the problem is a differential-
    algebraic equation (DAE). ODE15S solves DAEs of index 1. DAEs have
    solutions only when y0 is consistent, i.e., there is a yp0 such that
    M(t0,y0)*yp0 = f(t0,y0). Use ODESET to set 'MassSingular' to 'yes', 'no',
    or 'maybe'. The default of 'maybe' causes ODE15S to test whether M(t0,y0)
    is singular. You can provide yp0 as the value of the 'InitialSlope'
    property. The default is the zero vector. If y0 and yp0 are not
    consistent, ODE15S treats them as guesses, tries to compute consistent
    values close to the guesses, and then goes on to solve the problem. See
    examples HB1DAE or AMP1DAE.  

    [T,Y,TE,YE,IE] = ODE15S(ODEFUN,TSPAN,Y0,OPTIONS...) with the 'Events'
    property in OPTIONS set to a function EVENTS, solves as above while also
    finding where functions of (T,Y), called event functions, 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 vectors returned by EVENTS: [VALUE,ISTERMINAL,DIRECTION] =
    EVENTS(T,Y). 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. Output TE is a column vector of times at which events occur.
    Rows of YE are the corresponding solutions, and indices in vector IE
    specify which event occurred.   
   
    SOL = ODE15S(ODEFUN,[T0 TFINAL],Y0...) returns a structure that can be
    used with DEVAL to evaluate the solution at any point between T0 and
    TFINAL. The steps chosen by ODE15S are returned in a row vector SOL.x.
    For each I, the column SOL.y(:,I) contains the solution at SOL.x(I).  
    If events were detected, SOL.xe is a row vector of points at which events
    occurred. Columns of SOL.ye are the corresponding solutions, and indices
    in vector SOL.ie specify which event occurred. If a terminal event has
    been detected, SOL.x(end) contains the end of the step at which the event
    occurred. The exact point of the event is reported in SOL.xe(end).

    Example
          [t,y]=ode15s(@vdp1000,[0 3000],[2 0]);   
          plot(t,y(:,1));
      solves the system y' = vdp1000(t,y), using the default relative error
      tolerance 1e-3 and the default absolute tolerance of 1e-6 for each
      component, and plots the first component of the solution.

    See also
      other ODE solvers:    ODE23S, ODE23T, ODE23TB, ODE45, ODE23, ODE113
      options handling:     ODESET, ODEGET
      output functions:     ODEPLOT, ODEPHAS2, ODEPHAS3, ODEPRINT
      evaluating solution:  DEVAL
      ODE examples:         VDPODE, FEM1ODE, BRUSSODE, HB1DAE

    NOTE:
      The interpretation of the first input argument of the ODE solvers and
      some properties available through ODESET have changed in this version
      of MATLAB. Although we still support the v5 syntax, any new
      functionality is available only with the new syntax. To see the v5 help
      type in the command line  
          more on, type ode15s, more off
</P>
您需要登录后才可以回帖 登录 | 注-册-帐-号

本版积分规则

小黑屋|手机版|Archiver|数学建模网 ( 湘ICP备11011602号 )

GMT+8, 2024-11-27 18:31 , Processed in 0.055091 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表