# 使用延拓验证 BVP 一致性

Falkner-Skan 边界值问题 [1] 源于为平板粘性不可压缩层流问题求取相似解的过程。示例方程是

${{{\mathit{f}}^{\prime }}^{\prime }}^{\prime }+\mathit{f}\text{}{{\mathit{f}}^{\prime }}^{\prime }+\beta \left(1-{{\mathit{f}}^{\prime }}^{\text{}2}\right)=0$.

$\mathit{f}\left(0\right)=0$,

${\mathit{f}}^{\prime }\left(0\right)=0$,

${\mathit{f}}^{\prime }\left(\infty \right)=1$.

### 编写方程代码

• x 是自变量。

• f 是因变量。

${{\mathit{f}}_{1}}^{\prime }={\mathit{f}}_{2}$,

${{\mathit{f}}_{2}}^{\prime }={\mathit{f}}_{3}$,

${{\mathit{f}}_{3}}^{\prime }=-{\mathit{f}}_{1}{\mathit{f}}_{3}-\beta \left(1-{\mathit{f}}_{2}^{2}\right)$.

function dfdeta = fsode(x,f)
b = 0.5;
dfdeta = [ f(2)
f(3)
-f(1)*f(3) - b*(1 - f(2)^2) ];
end

### 编写边界条件代码

• f0 是在区间的开始处的边界条件的值。

• finf 是在区间的结束处的边界条件的值。

$\mathit{f}\left(0\right)=0$,

${\mathit{f}}^{\prime }\left(0\right)=0$,

${\mathit{f}}^{\prime }\left(\infty \right)-1=0$.

function res = fsbc(f0,finf)
res = [f0(1)
f0(2)
finf(2) - 1];
end

### 创建初始估计值

infinity = 3;
maxinfinity = 6;
solinit = bvpinit(linspace(0,infinity,5),[0 0 1]);

### 求解方程并绘制解

sol = bvp4c(@fsode,@fsbc,solinit);
x = sol.x;
f = sol.y;
plot(x,f(2,:),x(end),f(2,end),'o');
axis([0 maxinfinity 0 1.4]);
title('Falkner-Skan Equation, Positive Wall Shear, \beta = 0.5.')
xlabel('x')
ylabel('df/dx')
hold on

fprintf('Cebeci & Keller report that f''''(0) = 0.92768.\n')
Cebeci & Keller report that f''(0) = 0.92768.
fprintf('Value computed using infinity = %g is %7.5f.\n', ...
infinity,f(3,1))
Value computed using infinity = 3 is 0.92915.

for Bnew = infinity+1:maxinfinity
solinit = bvpinit(sol,[0 Bnew]); % Extend solution to new interval
sol = bvp4c(@fsode,@fsbc,solinit);
x = sol.x;
f = sol.y;

fprintf('Value computed using infinity = %g is %7.5f.\n', ...
Bnew,f(3,1))
plot(x,f(2,:),x(end),f(2,end),'o');
drawnow
end
Value computed using infinity = 4 is 0.92774.
Value computed using infinity = 5 is 0.92770.
Value computed using infinity = 6 is 0.92770.
hold off

### 局部函数

function dfdeta = fsode(x,f) % equation being solved
dfdeta = [ f(2)
f(3)
-f(1)*f(3) - 0.5*(1 - f(2)^2) ];
end
%-------------------------------------------
function res = fsbc(f0,finf) % boundary conditions
res = [f0(1)
f0(2)
finf(2) - 1];
end
%-------------------------------------------

### 参考

[1] Cebeci, T. and H. B. Keller."Shooting and Parallel Shooting Methods for Solving the Falkner-Skan Boundary-layer Equation."J. Comp.Phys., Vol. 7, 1971, pp. 289-300.