% m35_ChebfunBVP.m - solving a BVP with Chebfun. % See Chapters 7 and 10 of the Chebfun Guide and Appendix A % of Exploring ODEs. This equation is Example 91 of Appendix B. % You can also do everything in Chebgui (including export the M-file). L = chebop(-1,1); % domain [-1,1] L.op = @(x,u) .001*diff(u,2)+2*x*diff(u); % u -> ep*u" + 2xu' L.lbc = -1; L.rbc = 1; % left and right BCs u = L\0; % solve Lu = 0 for u plot(u), grid on length(u) % For smaller ep, set domain with chebop([-1 0 1])