1

https://i.stack.imgur.com/6x1ju.png

I have to solve f"'+(4a^2+Re*f)f'=0 where a and Re is constant but variable. There are three BCs, f(1)=0,f(-1)=0 , ∫F(∅)d∅=1(integral -1 to 1) Now I had an idea to change ∫F(∅)d∅=G(theta)(integral 0 to theta), then boundary condition could change to G'(1)=0,G'(-1)=0, G(0)=0,G(1)=1/2 (because F(∅) is symmetric in given condition) I have bad coding skills... How should I fix my code?

    `function [theta_0 y2]=flow_BVP

theta_0=linspace(0,1,1000); 
sol2=bvp4c(@flow_ode,@flow_bc,@flow_init);
x2=sol2.x;
y2=sol2.y(1,:);


hold on
%plot(x1,y1) %gammal
plot(x2,y2) %ny
%hold off


function v=flow_init(x)
v=[sin(x); 1; 1;1-cos(x)];

function dydx=flow_ode(x,y)
a=0.0001;
Re=0.00001
dydx = [y(2); y(3); -(4.*a^2+Re.*y(2)).*y(3);y(1)];

function res=flow_bc(ya,yb)
res=[ya(1);ya(4);yb(1);yb(4)-1];` 

0 Answers0