Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 工程数学软件 > MATLAB论坛
MATLAB论坛 一切MATLAB相关问题在此讨论。
 
 
主题工具 显示模式
旧 2008-04-17, 17:46   #4
yuyiyy10103
初级会员
 
注册日期: 2008-04-08
年龄: 40
帖子: 5
声望力: 0
yuyiyy10103 正向着好的方向发展
默认

付给初始值的函数: adiab.m

epsilon = 1; % Allowable error in temerature (K)
max_iteration = 20; % Maximum number of iterations to convergence
step = 10; % for saving values in var, dvar matrices
dtheta = 1; % integration increment (radians)
% Initial conditions:
y(the) = th;
y(tck) = tk;
y(te) = th;
y(tc) = tk;
iter = 0;
terror = 10*epsilon; % Initial error to enter the loop
% Iteration loop to cyclic convergence
while ((terror >= epsilon)&(iter < max_iteration))
% cyclic initial conditions
tc0 = y(tc);
te0 = y(te);
theta = 0;
y(qk) = 0;
y(qr) = 0;
y(qh) = 0;
y(wc) = 0;
y(we) = 0;
y(w) = 0;
fprintf('iteration %d: tc = %.1f[K], te = %.1f[K]\n',iter,y(tc),y(te))
for(i = 1:1:360)
[theta,y,dy] = rk4('dadiab',7,theta,dtheta,y);
end
terror = abs(tc0 - y(tc)) + abs(te0 - y(te));
iter = iter + 1;
end

if (iter >= max_iteration)
fprintf('No convergence within %d iteration\n',max_iteration)
end
for(j = 1:1:10)
[theta,y,dy] = rk4('dadiab',7,theta,dtheta,y);
end
yuyiyy10103 当前离线   回复时引用此帖
 


发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码


相似的主题
主题 主题作者 版面 回复 最后发表
[求助]求助高手!!用MATLAB制作动画 shingo MATLAB论坛 1 2008-05-11 08:33
【求助】彩色图像转化成灰度图像出现的问题 tcamel MATLAB论坛 7 2008-05-03 01:25
[求助]GUI中控件如何编写回调程序 lg861219 MATLAB论坛 4 2008-04-12 21:01
【文章】**Matlab中下标及希腊字母的使用方法** spy1120 MATLAB论坛 3 2008-01-22 14:37
【求助】求人指导matlab在dsp上的应用 天天天下 MATLAB论坛 2 2008-01-01 11:08


所有时间均为北京时间。现在的时间是 19:54


Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.