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

📄 ex01ch3.m

📁 these codes are for solving OED with matlab
💻 M
字号:
function ex01ch3% Solve ((1 - x^7)y')' + lambda*x^7*y = 0. Let v = (1 - x^7)*y so% that the equations are y' = v/(1 - x^7), v' = - lambda*x^7*y,% with boundary conditions y(0) = 0, y(1) = 1.lambda = input('Guess for eigenvalue: ');sol = bvpinit(linspace(0,1,10),@guess,lambda);sol = bvp4c(@odes,@bcs,sol);fprintf('Computed the eigenvalue %g.\n',sol.parameters)plot(sol.x,sol.y(1,:));%===========================================================function v = guess(x)g = 5*pi/2;y = x*sin(g*x);yp = sin(g*x) + g*x*cos(g*x);v = [ y; (1 - x^7)*yp];function dydx = odes(x,y,lambda)if x == 1    yp = lambda/7;else    yp = y(2)/(1 - x^7);enddydx = [ yp; -lambda*x^7*y(1) ];function res = bcs(ya,yb,lambda)res = [ ya(1); yb(1)-1; yb(2) ];

⌨️ 快捷键说明

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