⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex26ch2.m

📁 these codes are for solving OED with matlab
💻 M
字号:
function ex26ch2options = odeset('Stats', 'on', 'Events', @ex19ach1e);tspan = [0 2];yzero = [0 ; 0];[t,y,te,ye,ie] = ode45(@ex26ch2f, tspan, yzero, options);exactt = zeros(9,1);for i = 1 : 9    exactt(i) = 2 * sqrt(i/10);enddisp('ie follows: '), disp(ie)disp('ye follows: '), disp(ye)disp('Approximate t follows: '), disp(te)disp('Exact t follows: '), disp(exactt)%===========================================================function yprime = ex26ch2f(t,y)yprime = [y(2) ; 1/2];function [value, isterminal, direction] = ex19ach1e(t,y)isterminal = [0;0;0;0;0;0;0;0;0];direction = [0;0;0;0;0;0;0;0;0];value = zeros(9,1);for i = 1 : 9    value(i) = y(1) - i / 10;end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -