How to plot $f''(0)$ and $g(0)$ via MATLAB bvp4c solver?

48 Views Asked by At

I am working on the following two odes in $t$.

$2f'f'''+\frac{2}{3}ff''-\frac{1}{3}(f')^2=0,$

$g''+fg'=0,$

with boundary conditions as

$f=a, f'=b, g=1$ at $t=0,$ $f'=0=g$ when $t\rightarrow\infty.$ The plots are easier for $f'(t), f''(t), g'(t).$ But what I am interested in is to plot $f''$ and $g'$ under $t=0.$ Here $a$ is Real and $b>0$. Any kind of help will be appreciated.

clc; clf;clear;
global a b 
a=.1;
%b=1.5;
 pp=[1; 1.5; 2; 3;];
 for i=1:numel(pp)
   b=pp(i);
   
     ode = @(X,Y) [Y(2);  Y(3);  ((1/6)*(Y(2)).^(-1)).*(-2*Y(1).*Y(3)+Y(2)^.2); Y(5);
    -Y(1)*Y(5)];                    
     
    res = @(ya,yb) [ya(1)-b;  ya(2)-a;  yb(2); ya(4)-1; yb(4)];      
    SolYinit = bvpinit(linspace(0,100,1000),[0; 1; 0; 0; 0;]);                
    Fsol = bvp4c(ode, res, SolYinit);
    X1{i} = Fsol.x;
    Y1{i} = Fsol.y;
  end
figure (1)
 ax = gca; 
 ax.FontSize = 16;
 set(gca,'XLim',[0 10]);
 xlabel('\fontname{Times New Roman} t ', 'FontSize', 22);
 ylabel('\fontname{Times New Roman} f^{\prime} (t)', 'Fontsize', 22);  
hold on
for k = 1:numel(pp)
 plot(X1{k}, Y1{k}(2,:), 'LineWidth', 2)
end
hold off  
box on