function [] = prob_3_24(X) % % Written by: % -- % John L. Weatherwax 2005-04-13 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- solinit = bvpinit(linspace(0,X,10), @guess); sol = bvp4c(@f,@bcs,solinit,[]); % Plot t v.s. y1(t):figure; figure; plot( sol.x, sol.y(1,:), '-bo' ); grid on; title( [ 'X = ', num2str(X) ] ); fprintf( 'The value of DF(0) = %f\n', sol.y(2,1) ); function [v] = guess(x) v = [ 1; 1; 1 ]; function [res] = bcs(ya,yb,beta) % BCS - % res = [ ya(1); ya(3); yb(1)-1; ]; function [ ode ] = f(x,y) % F - % y(1)=F(x); y(2)=F'(x); y(3)=G(x); ode = [ y(2); -2*(x*y(1)-y(3))*y(2) - 2*(1-y(1)^2); x*y(2); ];