Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 工程数学软件 > MATLAB论坛
MATLAB论坛 一切MATLAB相关问题在此讨论。
回复
 
主题工具 显示模式
旧 2013-04-23, 02:51   #1
reno80
初级会员
 
注册日期: 2010-06-27
帖子: 2
声望力: 0
reno80 正向着好的方向发展
默认 紧急求助, 求高人指点

function Apred = diffusionATR(beta,t) % The calculation from this programm are returned back to programm Appendix B1a. The nlinfit function is used to obtain Apred(predicted absorbance value)

b1 = 0.4; %Predicted best fit diffusion coefficient
b2 = 0.73; %Predicted equilibrium absorbance

global L % Thickness of PA Film

t=xlsread('diffusiondaten.xls','A2:A72')' %(sec) First column in file diffusiondaten.xls gives time 't'
t=t(
nt=length(t);
n=100; %Number of terms in the infinite series
n1=1.4; %Refractive index of PA
n2=2.43;%Refractive index of ATR crystal
angle=pi/4;%Incident angle of IR rays
wavenumber=1043.85;%Wavenumber of (-C=C-) stretching in eugenol
lambda=1/wavenumber;%Wavelength
gamma=(2*n2*pi*sqrt((sin(angle))^2-((n1/n2)^2)))/lambda%gamma or the decay coefficient

%Solution toward the infinite series or summation in Fickian diffsion model
for i=1:nt
for j=0:n
f(j+1)=((2.*j+1).*pi)./(2*L);
g(j+1)=((-b1*10^(-10)).*(2.*j+1)^2.*pi^2.*t(i))./(4*L^2);
h(j+1)=(exp(g(j+1))*(f(j+1).*exp(-2*gamma*L)+(-1)^j.*(2*gamma))./((2.*j).*(4*gamma^2+f(j+1)^2)));
end
A(i) = b2*(1-8*gamma/(pi*(1-exp(-2*gamma*L))).*sum(h));
end
Apred = A; %Predicted absorbance values

--------------------------------------------------------
程序运行gamma可以算出来
但是运行下面For语句的时候,


n an assignment A(I) = B, the number of elements in B and
I must be the same.

Error in ==> diffusionATR at 22
f(j+1)=((2.*j+1).*pi)./(2*L);

不明白为什么左右二边不匹配,左边f(j+1)应该是(f1,f2,f3,.......f101),右边是从j=0开始到100,也是101个值。

什么问题呢?


求高人指点
reno80 当前离线   回复时引用此帖
旧 2013-04-23, 15:54   #2
reno80
初级会员
 
注册日期: 2010-06-27
帖子: 2
声望力: 0
reno80 正向着好的方向发展
默认 回复: 紧急求助, 求高人指点

自己顶下
求帮忙
reno80 当前离线   回复时引用此帖
旧 2013-04-24, 09:41   #3
zhou1990
初级会员
 
注册日期: 2013-04-19
年龄: 34
帖子: 1
声望力: 0
zhou1990 正向着好的方向发展
默认 回复: 紧急求助, 求高人指点

我有程序代码,有数据,谁能帮我运行出结果,我有重谢,有意者请联系我,QQ976171645
zhou1990 当前离线   回复时引用此帖
旧 2013-06-07, 19:38   #4
zhaojing6828
初级会员
 
注册日期: 2012-12-10
帖子: 2
声望力: 0
zhaojing6828 正向着好的方向发展
默认 回复: 紧急求助, 求高人指点

clc;
close all
clear all
f(1)=0;
for j=0:100
f(j+1)=((2.*j+1).*pi)./(2*1);
end
我这样运行了一下,没错,你试试
zhaojing6828 当前离线   回复时引用此帖
回复


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

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



所有时间均为北京时间。现在的时间是 04:22


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