声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 983|回复: 1

[编程技巧] 谁能帮我看一下关于bessel积分的问题

[复制链接]
发表于 2008-12-18 16:33 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
谁能帮我看看我的程序该如何改进,问题主要集中在 beessel函数中含有未知数,最后求g的积分用求和代替不知是否合理?
公式不知如何贴上来,上传了一个word文件,谢谢各位:)

程序如下:
Ellipsoid.m
function y=ellipsoid(x)
function f=f(m)
nhb=1.4;
npl=1.33;
t=1.3;
k=2.*pi./t;
r=sin(x);
a=3.9;
b=3.9;
c=10;
A=(a.*b).^0.5;
aa=(2.*pi.*npl./t).*A;
f=aa.^2.*(1-exp(-2.*i.*k.*c.*(nhb-npl).*sin(m))).*BESSELJ(0,a.*r.*cos(m)).*cos(m).*sin(m);
end
y=abs(quad(@f,0,pi./2)).^2.*cos(x).*sin(x);
end

Ellipsoid1.m
function y1=sphere1(x)
function f=f(r,m)
nhb=1.4;
npl=1.33;
t=1.3;
k=2.*pi./t;
a=b=3.9;
A=(a.*b).^0.5;
aa=(2.*pi.*npl./t).*A;
c=10;
r=sin(x);
f=aa.^2.*(1-exp(-2.*i.*k.*c.*(nhb-npl).*sin(m))).*BESSELJ(0,aa.*r.*cos(m)).*sin(m).*cos(m);
end
y1=abs(quad(@f,0,pi./2)).^2.*sin(x);
end

clear all
x=0:0.2:pi;
      
ge.m
for ii=1:length(x)
y(ii)=ellipsoid(x(ii));

y1(ii)=ellipsoid1(x(ii));
end
g1=sum(y(ii))
g2=sum(y1(ii))
gm=g1./g2

错误:
??? Input argument "m" is undefined.

Error in ==> ellipsoid>f at 20
f=aa.^2.*(1-exp(-2.*i.*k.*c.*(nhb-npl).*sin(m))).*BESSELJ(0,a.*r.*cos(m)).*cos(m).*sin(m);

Error in ==> quad at 62
y = f(x, varargin{:});

Error in ==> ellipsoid at 22
y=abs(quad(@f,0,pi./2)).^2.*cos(x).*sin(x);

Error in ==> ge at 6
y(ii)=ellipsoid(x(ii));

Ellipsoid.doc

25.5 KB, 下载次数: 3

本帖被以下淘专辑推荐:

回复
分享到:

使用道具 举报

 楼主| 发表于 2008-12-18 17:49 | 显示全部楼层
有什么想法,给点建议也行
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-5-19 00:50 , Processed in 0.111866 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表