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

📄 ex14ch4.m

📁 these codes are for solving OED with matlab
💻 M
字号:
function sol = ex14ch4% The parameter state = +1 if ylag >= -0.427, -1 otherwise.% With this definition of history, state is initially +1.state = +1;opts = ddeset('Events',@events);sol = dde23(@ddes,12,0.6,[0, 120],opts,state);while sol.x(end) < 120   fprintf('Restart at %5.1f.\n',sol.x(end));   state = - state;   sol = dde23(@ddes,12,sol,[sol.x(end), 120],opts,state);endplot(sol.x,sol.y);title('Marriott-DeLisle Controller Problem')xlabel('Restart each time y(t - 12) = -0.427.');%==========================================================function v = ddes(t,y,Z,state)xb = -0.427;a = 0.16;epsilon = 0.02;u = 0.5;tau = 1;Delta = Z - xb;v = (-y + pi * (a + epsilon*state - u*sin(Delta)^2)) / tau;function [value,isterminal,direction] = events(t,y,Z,state)xb = -0.427;value = Z - xb;isterminal = 1;direction = 0;

⌨️ 快捷键说明

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