欢迎使用CSDN-markdown编辑器

来源:互联网 发布:inventor软件多少钱 编辑:程序博客网 时间:2024/06/03 21:12
function [tout,yout]= f_cal_kernel(eqs,ini_cdt,tstart,tfinal)    refine = 4;    options = odeset('RelTol',1e-5,'AbsTol',1e-6,...        'Events', @f_cal_kernel_impact_events,...        'InitialStep',1e-6, 'MaxStep',1e-1,...        'Refine',refine);    y0 =ini_cdt;    tout = tstart;    yout = y0;    teout = [];    yeout = [];    ieout = [];    t_mini=1e-2;    while t_mini<(tfinal-tstart)        [t,y,te,ye,ie] = ode23tb(eqs,[tstart tfinal],y0.',options);        nt = length(t);        tout = [tout; t(2:nt)];        yout = [yout; y(2:nt,:)];        teout = [teout; te];        yeout = [yeout; ye];        ieout = [ieout; ie];        y0(1) = 1e-6;        y0(2) = -0.8*y(nt,2);        y0(3) = y(nt,3);        tstart = t(nt);    endend
0 0
原创粉丝点击