亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ode45.m

?? 這是一個整理后比較全面的數學建模所用到的基本的十種計算方法的matlab源代碼!
?? M
?? 第 1 頁 / 共 2 頁
字號:
function [tout,yout,varargout] = ode45(odefile,tspan,y0,options,varargin)
%[tout,yout] = ode45('ypfun', tspan, y0, options)
%這里字符串ypfun是用以表示f(t, y)的M文件名,
%tspan=[t0, tfinal]表示自變量初值t0和終值tf
%     y0表示初值向量y0,可選參數options為用odeset設置精度等參數。 
%     輸出列向量tout表示節點 (t0 , t1 , … , tn)'
%     輸出矩陣yout 表示數值解,每一列對應y的一個分量
%     若無輸出參數,則作出圖形。
%例 解微分方程
%							y' = y-2t/y, y(0)=1, 0<t<1				
%  先寫M函數quadeg5fun.m
%             function f=quadeg5fun(t,y)
%             f=y-2*t./y;
%             f=f(:);			%保證f為一個列向量
%  再用
%   [t,y]=ode45('quadeg5fun',[0,1],1)
%   plot(t,y); 
%
%ODE45  Solve non-stiff differential equations, medium order method.
%   [T,Y] = ODE45('F',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.  'F' is a string containing the name of an ODE
%   file.  Function F(T,Y) must return a column vector.  Each row in
%   solution array Y corresponds to a time returned in column vector T.  To
%   obtain solutions at specific times T0, T1, ..., TFINAL (all increasing
%   or all decreasing), use TSPAN = [T0 T1 ... TFINAL].
%   
%   [T,Y] = ODE45('F',TSPAN,Y0,OPTIONS) solves as above with default
%   integration parameters 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] = ODE45('F',TSPAN,Y0,OPTIONS,P1,P2,...) passes the additional
%   parameters P1,P2,... to the ODE file as F(T,Y,FLAG,P1,P2,...) (see
%   ODEFILE).  Use OPTIONS = [] as a place holder if no options are set.
%   
%   It is possible to specify TSPAN, Y0 and OPTIONS in the ODE file (see
%   ODEFILE).  If TSPAN or Y0 is empty, then ODE45 calls the ODE file
%   [TSPAN,Y0,OPTIONS] = F([],[],'init') to obtain any values not supplied
%   in the ODE45 argument list.  Empty arguments at the end of the call list
%   may be omitted, e.g. ODE45('F').
%   
%   As an example, the commands
%   
%       options = odeset('RelTol',1e-4,'AbsTol',[1e-4 1e-4 1e-5]);
%       ode45('rigidode',[0 12],[0 1 1],options);
%   
%   solve the system y' = rigidode(t,y) with relative error tolerance 1e-4
%   and absolute tolerances of 1e-4 for the first two components and 1e-5
%   for the third.  When called with no output arguments, as in this
%   example, ODE45 calls the default output function ODEPLOT to plot the
%   solution as it is computed.
%   
%   [T,Y,TE,YE,IE] = ODE45('F',TSPAN,Y0,OPTIONS) with the Events property in
%   OPTIONS set to 'on', solves as above while also locating zero crossings
%   of an event function defined in the ODE file.  The ODE file must be
%   coded so that F(T,Y,'events') returns appropriate information.  See
%   ODEFILE for details.  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.
%   
%   See also ODEFILE and
%       other ODE solvers:  ODE23, ODE113, ODE15S, ODE23S, ODE23T, ODE23TB
%       options handling:   ODESET, ODEGET
%       output functions:   ODEPLOT, ODEPHAS2, ODEPHAS3, ODEPRINT
%       odefile examples:   ORBITODE, ORBT2ODE, RIGIDODE, VDPODE

%   ODE45 is an implementation of the explicit Runge-Kutta (4,5) pair of
%   Dormand and Prince called variously RK5(4)7FM, DOPRI5, DP(4,5) and DP54.
%   It uses a "free" interpolant of order 4 communicated privately by
%   Dormand and Prince.  Local extrapolation is done.

%   Details are to be found in The MATLAB ODE Suite, L. F. Shampine and
%   M. W. Reichelt, SIAM Journal on Scientific Computing, 18-1, 1997.

%   Mark W. Reichelt and Lawrence F. Shampine, 6-14-94
%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 5.53 $  $Date: 1997/11/21 23:31:04 $

true = 1;
false = ~true;

nsteps = 0;                             % stats
nfailed = 0;                            % stats
nfevals = 0;                            % stats
npds = 0;                               % stats
ndecomps = 0;                           % stats
nsolves = 0;                            % stats

if nargin == 0
  error('Not enough input arguments.  See ODE45.');
elseif ~isstr(odefile) & ~isa(odefile, 'inline')
  error('First argument must be a single-quoted string.  See ODE45.');
end

if nargin == 1
  tspan = []; y0 = []; options = [];
elseif nargin == 2
  y0 = []; options = [];
elseif nargin == 3
  options = [];
elseif ~isempty(options) & ~isa(options,'struct')
  if (length(tspan) == 1) & (length(y0) == 1) & (min(size(options)) == 1)
    tspan = [tspan; y0];
    y0 = options;
    options = [];
    varargin = {};
    msg = sprintf('Use ode45(''%s'',tspan,y0,...) instead.',odefile);
    warning(['Obsolete syntax.  ' msg]);
  else
    error('Correct syntax is ode45(''odefile'',tspan,y0,options).');
  end
end

% Get default tspan and y0 from odefile if none are specified.
if isempty(tspan) | isempty(y0)
  if (nargout(odefile) < 3) & (nargout(odefile) ~= -1)
    msg = sprintf('Use ode45(''%s'',tspan,y0,...) instead.',odefile);
    error(['No default parameters in ' upper(odefile) '.  ' msg]);
  end
  [def_tspan,def_y0,def_options] = feval(odefile,[],[],'init',varargin{:});
  if isempty(tspan)
    tspan = def_tspan;
  end
  if isempty(y0)
    y0 = def_y0;
  end
  if isempty(options)
    options = def_options;
  else
    options = odeset(def_options,options);
  end
end

% Test that tspan is internally consistent.
tspan = tspan(:);
ntspan = length(tspan);
if ntspan == 1
  t0 = 0;
  next = 1;
else
  t0 = tspan(1);
  next = 2;
end
tfinal = tspan(ntspan);
if t0 == tfinal
  error('The last entry in tspan must be different from the first entry.');
end
tdir = sign(tfinal - t0);
if any(tdir * (tspan(2:ntspan) - tspan(1:ntspan-1)) <= 0)
  error('The entries in tspan must strictly increase or decrease.');
end

t = t0;
y = y0(:);
neq = length(y);

% Get options, and set defaults.
rtol = odeget(options,'RelTol',1e-3);
if (length(rtol) ~= 1) | (rtol <= 0)
  error('RelTol must be a positive scalar.');
end
if rtol < 100 * eps 
  rtol = 100 * eps;
  warning(['RelTol has been increased to ' num2str(rtol) '.']);
end

atol = odeget(options,'AbsTol',1e-6);
if any(atol <= 0)
  error('AbsTol must be positive.');
end

normcontrol = strcmp(odeget(options,'NormControl','off'),'on');
if normcontrol
  if length(atol) ~= 1
    error('Solving with NormControl ''on'' requires a scalar AbsTol.');
  end
  normy = norm(y);
else
  if (length(atol) ~= 1) & (length(atol) ~= neq)
    error(sprintf(['Solving %s requires a scalar AbsTol, ' ...
                   'or a vector AbsTol of length %d'],upper(odefile),neq));
  end
  atol = atol(:);
end
threshold = atol / rtol;

% By default, hmax is 1/10 of the interval.
hmax = min(abs(tfinal-t), abs(odeget(options,'MaxStep',0.1*(tfinal-t))));
if hmax <= 0
  error('Option ''MaxStep'' must be greater than zero.');
end
htry = abs(odeget(options,'InitialStep'));
if htry <= 0
  error('Option ''InitialStep'' must be greater than zero.');
end

haveeventfun = strcmp(odeget(options,'Events','off'),'on');
if haveeventfun
  valt = feval(odefile,t,y,'events',varargin{:});
  teout = [];
  yeout = [];
  ieout = [];
end

if nargout > 0
  outfun = odeget(options,'OutputFcn');
else
  outfun = odeget(options,'OutputFcn','odeplot');
end
if isempty(outfun)
  haveoutfun = false;
else
  haveoutfun = true;
  outputs = odeget(options,'OutputSel',1:neq);
end
refine = odeget(options,'Refine',4);    % Necessary for smooth plots.
printstats = strcmp(odeget(options,'Stats','off'),'on');

if strcmp(odeget(options,'Mass','off'),'on') | ...
  strcmp(odeget(options,'MassConstant','off'),'on')
  error(['Solver does not handle mass matrices, M*y'' or M(t)*y''.  '...
         'See ODE15S, ODE23S, ODE23T, or ODE23TB.']);
end

% Set the output flag.
if ntspan > 2
  outflag = 1;                          % output only at tspan points
elseif refine <= 1
  outflag = 2;                          % computed points, no refinement
else
  outflag = 3;                          % computed points, with refinement
  S = (1:refine-1)' / refine;
end

% Allocate memory if we're generating output.
if nargout > 0
  if ntspan > 2                         % output only at tspan points
    tout = zeros(ntspan,1);
    yout = zeros(ntspan,neq);
  else                                  % alloc in chunks
    chunk = max(ceil(128 / neq),refine);
    tout = zeros(chunk,1);
    yout = zeros(chunk,neq);
  end
  nout = 1;
  tout(nout) = t;
  yout(nout,:) = y.';
end

% Initialize method parameters.
pow = 1/5;
A = [1/5; 3/10; 4/5; 8/9; 1; 1];
B = [
    1/5         3/40    44/45   19372/6561      9017/3168       35/384
    0           9/40    -56/15  -25360/2187     -355/33         0
    0           0       32/9    64448/6561      46732/5247      500/1113
    0           0       0       -212/729        49/176          125/192
    0           0       0       0               -5103/18656     -2187/6784
    0           0       0       0               0               11/84
    0           0       0       0               0               0
    ];
E = [71/57600; 0; -71/16695; 71/1920; -17253/339200; 22/525; -1/40];
f = zeros(neq,7);

% The input arguments of odefile determine the args to use to evaluate f.
if nargin(odefile) == 2
  args = {};                            % odefile accepts only (t,y)
else
  args = [{''} varargin];               % use (t,y,'',p1,p2,...)
end

f0 = feval(odefile,t,y,args{:});
nfevals = nfevals + 1;                  % stats
[m,n] = size(f0);
if n > 1
  error([upper(odefile) ' must return a column vector.'])
elseif m ~= neq
  msg = sprintf('an initial condition vector of length %d.',m);
  error(['Solving ' upper(odefile) ' requires ' msg]);
end

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
97久久人人超碰| 日韩精品五月天| 91在线国内视频| 亚洲天堂成人在线观看| 97国产一区二区| 伊人开心综合网| 欧美日韩视频在线观看一区二区三区| 亚洲电影一区二区三区| 日韩午夜三级在线| 国产一区二区精品在线观看| 欧美国产丝袜视频| 日本乱码高清不卡字幕| 天天av天天翘天天综合网| 91精品国产综合久久久久| 国产老女人精品毛片久久| 国产精品久久久久久久岛一牛影视 | 欧美在线三级电影| 天天色图综合网| 国产日韩在线不卡| 色综合久久久久综合99| 亚洲成a人片在线观看中文| 日韩欧美一二区| 成人免费视频app| 亚洲成在人线在线播放| 欧美成人在线直播| 99精品热视频| 免费黄网站欧美| 中文字幕一区av| 日韩欧美国产一区二区三区 | 成人动漫视频在线| 午夜欧美视频在线观看| 国产性色一区二区| 欧美在线一二三| 国产精品自拍三区| 亚洲香肠在线观看| 国产精品午夜久久| 91精品国产乱码久久蜜臀| 成人av免费网站| 免费看黄色91| 一区二区三区中文在线观看| 精品美女被调教视频大全网站| 成人午夜精品在线| 久久爱www久久做| 亚洲高清不卡在线| 中文字幕第一区| www久久精品| 欧美精选在线播放| 日本乱人伦一区| 成人激情小说网站| 激情深爱一区二区| 偷拍自拍另类欧美| 一区二区在线免费观看| 国产精品久久久久久久久搜平片| 精品久久国产老人久久综合| 欧美性生交片4| 91麻豆国产在线观看| 国产a区久久久| 激情综合色综合久久| 日日摸夜夜添夜夜添国产精品| 亚洲日韩欧美一区二区在线| 久久久午夜电影| 欧美tk丨vk视频| 日韩情涩欧美日韩视频| 欧美日韩视频一区二区| 在线免费不卡电影| 一本色道久久综合精品竹菊| av电影一区二区| www.一区二区| 99久久免费精品| 色综合久久综合网97色综合| 大胆欧美人体老妇| 波波电影院一区二区三区| 成人天堂资源www在线| 成人小视频在线观看| 丁香网亚洲国际| zzijzzij亚洲日本少妇熟睡| 波多野结衣亚洲| 色偷偷久久一区二区三区| 91精品91久久久中77777| 色老汉一区二区三区| 日本二三区不卡| 欧美日韩国产高清一区二区| 欧美日韩成人激情| 91精品国产综合久久久久久漫画 | 风间由美一区二区av101| 国产精品亚洲成人| 成人精品免费看| 91亚洲精品久久久蜜桃| 日本电影欧美片| 制服丝袜激情欧洲亚洲| 日韩一卡二卡三卡国产欧美| 欧美大胆一级视频| 国产女主播一区| 亚洲乱码日产精品bd| 亚瑟在线精品视频| 久久国产麻豆精品| 国产成人夜色高潮福利影视| 成人激情综合网站| 欧美日韩高清在线播放| 日韩一级完整毛片| 国产精品久久久久久久久图文区| 亚洲美女在线一区| 日本va欧美va瓶| 国产69精品久久777的优势| www.日韩大片| 7777精品伊人久久久大香线蕉超级流畅| 日韩三级伦理片妻子的秘密按摩| 中文字幕乱码日本亚洲一区二区 | 性欧美大战久久久久久久久| 天天亚洲美女在线视频| 国产精品一区二区三区乱码| 91网站黄www| 日韩你懂的在线播放| 国产精品萝li| 日日夜夜精品视频免费| 成人精品一区二区三区四区| 欧美日本不卡视频| 亚洲国产精品激情在线观看| 亚洲1区2区3区4区| 成人av在线资源网| 日韩欧美一级二级三级| 亚洲免费观看在线视频| 激情伊人五月天久久综合| 一本到高清视频免费精品| 精品国产第一区二区三区观看体验 | 色欧美日韩亚洲| 久久青草国产手机看片福利盒子| 亚洲精品乱码久久久久久黑人| 韩国精品主播一区二区在线观看| 欧洲另类一二三四区| 久久久久久久久久电影| 香蕉影视欧美成人| a美女胸又www黄视频久久| 日韩精品一区二| 亚洲成人中文在线| 99精品欧美一区二区蜜桃免费 | 久久综合九色综合欧美亚洲| 亚洲乱码国产乱码精品精98午夜| 久久99国产精品免费网站| 欧美日韩在线播放一区| 日韩美女啊v在线免费观看| 精品亚洲porn| 69堂成人精品免费视频| 亚洲另类中文字| 91一区二区在线| 国产精品国产三级国产普通话三级 | 99久久精品国产一区二区三区| 久久免费国产精品| 另类综合日韩欧美亚洲| 欧美日韩高清一区| 伊人开心综合网| 91亚洲国产成人精品一区二三| 国产欧美日韩精品a在线观看| 韩国女主播一区| 久久蜜桃一区二区| 韩国午夜理伦三级不卡影院| 91精品国产91综合久久蜜臀| 亚洲女女做受ⅹxx高潮| 99免费精品在线| 国产精品盗摄一区二区三区| 国产成人在线网站| 国产欧美日韩久久| 岛国精品一区二区| 中文字幕第一区| 国产91丝袜在线播放九色| 久久蜜桃一区二区| 成人动漫视频在线| 亚洲嫩草精品久久| 在线欧美小视频| 五月婷婷久久综合| 欧美一区二区在线视频| 欧美aaa在线| 久久日韩粉嫩一区二区三区| 国产一区二区视频在线| 国产欧美一区二区精品久导航| 国产999精品久久久久久绿帽| 国产精品美女一区二区三区| av欧美精品.com| 亚洲国产精品影院| 日韩欧美国产综合一区 | 91亚洲大成网污www| 亚洲精品伦理在线| 欧美精品色综合| 久久精品理论片| 国产欧美一区在线| 91免费国产在线观看| 亚洲一区在线免费观看| 欧美一区二区三区白人| 国产综合久久久久久久久久久久| 中文字幕av资源一区| 91久久精品日日躁夜夜躁欧美| 午夜视频在线观看一区二区| 日韩丝袜美女视频| 成人夜色视频网站在线观看| 一级中文字幕一区二区| 日韩三级视频在线看| 成人av第一页| 日本vs亚洲vs韩国一区三区 | 欧美另类一区二区三区| 国产一区二区调教|