使用 Matlab 的 bvp4c 求解边值问题
2012-11-06 15:18
615 查看
Kuiken 利用相似变换,得到如下非线性微分方程
满足如下边界条件
其中,
表示对
求导,
为普朗特数. 此方程是耦合的非线性边值问题,在无穷远点具有奇性.
当
时,使用Matlab的bvp4c求解如下:
将原方程转化为一阶方程组
输入边界条件
以常数作为初始猜测解
调用bvp4c求解,注意此处无界区间被截断
运行如下:
The solution was obtained on a mesh of 105 points.
The maximum residual is 9.866e-013.
There were 6332 calls to the ODE function.
There were 260 calls to the BC function.
Kuiken reports f''(0) = 0.693212.
Value computed here is f''(0) = 0.6932116.
Kuiken reports θ'(0) = -0.769861.
Value computed here is θ'(0) = -0.7698611.
满足如下边界条件
其中,
表示对
求导,
为普朗特数. 此方程是耦合的非线性边值问题,在无穷远点具有奇性.
当
时,使用Matlab的bvp4c求解如下:
将原方程转化为一阶方程组
% kuikenode.m function df=kuikenode(eta,f) sigma=1; df=[ f(2) f(3) f(2)^2-f(4) f(5) 3*sigma*f(2)*f(4)];
输入边界条件
% kuikenbc.m function res=kuikenbc(f0,finf) res =[f0(1) f0(2) f0(4)-1 finf(2) finf(4)];
以常数作为初始猜测解
% kuikeninit.m function v=kuikeninit(eta) v =[ 0 0 1 0 0];
调用bvp4c求解,注意此处无界区间被截断
% solve.m clc; clear; infinity=30; solinit=bvpinit(linspace(0,infinity,5),@kuikeninit); options=bvpset('stats','on','RelTol', 1e-12); sol=bvp4c(@kuikenode,@kuikenbc,solinit,options); eta=sol.x; g=sol.y; fprintf('\n'); fprintf('Kuiken reports f''''(0) = 0.693212.\n') fprintf('Value computed here is f''''(0) = %7.7f.\n',g(3,1)) fprintf('Kuiken reports %c''(0) = -0.769861.\n', char([952])) fprintf('Value computed here is %c''(0) = %7.7f.\n',char([952]),g(5,1)) clf reset subplot(1,2,1); plot(eta,g(2,:)); axis([0 infinity 0 1]); title('Kuiken equation, \sigma =1.') xlabel('\eta') ylabel('df/d\eta') subplot(1,2,2); plot(eta,g(4,:)); axis([0 infinity 0 1]); title('Kuiken equation, \sigma = 1.') xlabel('\eta') ylabel('\theta') shg
运行如下:
The solution was obtained on a mesh of 105 points.
The maximum residual is 9.866e-013.
There were 6332 calls to the ODE function.
There were 260 calls to the BC function.
Kuiken reports f''(0) = 0.693212.
Value computed here is f''(0) = 0.6932116.
Kuiken reports θ'(0) = -0.769861.
Value computed here is θ'(0) = -0.7698611.
相关文章推荐
- 使用 Matlab 的 bvp4c 求解边值问题
- 使用MATLAB进行一次和二次规划问题求解
- 使用MATLAB自带函数求解二次特征值问题
- 求解Matlab微分方程组中的时移问题!!!
- 使用动态规划求解旅行商问题
- 使用matlab进行非线性方程组求解
- 使用Matlab相机标定库(Camera Calibration Toolbox)问题小记
- MATLAB使用过程遇见的问题记录
- 求解 关于C的typedef struct的使用问题
- 使用C++递归求解跳台阶问题
- MatLab建模学习笔记10——利用罚函数求解非线性规划问题
- 使用matlab求解二维浅水方程的数值解(一)—浅水波
- caffe的Matlab接口的使用方法以及会出现的问题
- MATLAB(1)基于遗传算法解决最优化问题及相应的MATLAB遗传工具箱使用
- 学习问题:使用MATLAB工具箱进行双目标定,提示索引超出矩阵范围。
- 解决使用matlab编辑器时,点击右键时字体突然变小的问题
- (Relax dijkstra1.2)POJ 2263 Heavy Cargo(使用dijkstra来求解最大生成树问题)
- MATLAB在调用C/C++程序成功,使用opencv库时出错,错误显示“找不到指定模块”(问题未解决)
- 基于MATLAB的模拟退火算法求解TSP问题
- VC中使用Matlab Engine出现"无法找到libeng.dll"的问题