function [] = prob_3_8_pt1(Z) % % 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,Z,30),@guess); sol = bvp4c(@f,@bcs,solinit); figure; p1 = plot( sol.x, sol.y(1,:), '-bo' ); hold on; legend( [ p1 ], 'w(z)' ); grid on; title( [ 'Z = ', num2str(Z) ] ); %deval(sol,0.1) function [ v ] = guess(x) % GUESS - % v = [ 0.5; 0; ]; function [res] = bcs(ya,yb) % BCS - % res = [ ya(1)-1; yb(1); ]; function [ ode ] = f(x,y) % F - % y(1)=w(z); y(2)=w'(z); % alpha = 0.8; ode = [ y(2); -( 2*x/sqrt( 1-alpha*y(1) ) )*y(2); ];