全民k歌最近听众怎样把听众删除了

扫二维码下载作业帮
拍照搜题,秒出答案,一键查看所有搜题记录
下载作业帮安装包
扫二维码下载作业帮
拍照搜题,秒出答案,一键查看所有搜题记录
matlab计算二重积分用循环的方法计算二重积分
扫二维码下载作业帮
拍照搜题,秒出答案,一键查看所有搜题记录
function X = integ(ri,r0,ni,L1,L2,n)dz1=(L2-L1)/(n-1);dr1=(r0-ri)/(ni-1);X=0;for i=1:ni-1r1=ri+dr1*(i-1);r2=ri+dr1*i;for k=1:n-1
z1=L1+dz1*(k-1);
为您推荐:
扫描下载二维码matlab求二重积分
int(exp(-0.099308*s)*int(exp(0.*u)*(exp(-3.1413*s+3.12*u))*((u/(s-u))^(1/2)*BESSELI(1,2*(u*(s-u))^(1/2))+0.293*BESSELI(0,2*(u*(s-u))^(1/2))),u,0,s),s,0,10)
int(exp(-0.099308*s)*int(exp(0.*u)*(exp(-3.1413*s+3.12*u))*((u/(s-u))^(1/2)*BESSELI(1,2*(u*(s-u))^(1/2))+0.293*BESSELI(0,2*(u*(s-u))^(1/2))),u,0,s),s,0,10)
exp(-0.099308*s)*exp(0.*u)*(exp(-3.1413*s+3.12*u))*((u/(s-u))^(1/2)*BESSELI(1,2*(u*(s-u))^(1/2))+0.293*BESSELI(0,2*(u*(s-u))^(1/2))),u,0,s),s,0,10)
是相等的。
以下代码在2009a版以上均可运行:
fun = @(s,u)
exp(-0.099308.*s).*exp(0..*u).*(exp(-3.1413*s+3.12*u)).*((u./(s-u)).^(1/2).*besseli(1,2*(u.*(s-u)).^(1/2))+0.293*besseli(0,2*(u.*(s-u)).^(1/2)))
umax = @(s)
Q = quad2d(fun,0,10,0,umax)
........................
.......................
warning off all
a=2;& %& 输入a的值
f5 = @(r,Phi) dblquad(@(Theta_2,Phi_2)
sin(Theta_2).*sin(Theta_2).*cos(Phi_2)./(sqrt(r.^2 + a^2 -
2.*r.*a.*sin(Theta_2).*cos(Phi - Phi_2))),0,pi,0,pi)
ezsurf(f5,[1, 5, 0, 15] )&&
%& r [1, 5]& Phi [0,
15]& 计算量不小 区间不宜过大
zlabel('f5')
title('f5')
......................
...........................
matlab求二重积分
g = @(x,y)
1.*((x-2.5).^2+(y-1).^2&=1)+0.*((x-2.5).^2+(y-1).^2&1);
f = @(x,y)
1.*((x-2).^2+(y-1).^2&=1)+0.*((x-2).^2+(y-1).^2&1);
z = @(x,y) f(x,y)+g(x,y)
Q = dblquad(z,0,4,-1,3)
...........
以下代码在7.1版以上均可运行。
输入Phi的值
@(Theta_2,Phi_2) sin(Theta_2).*sin(Theta_2).*cos(Phi_2);
@(Theta_2,Phi_2) sqrt(r^2+a^2-2*r*a.*sin(Theta_2).*cos(Phi-Phi_2));
@(Theta_2,Phi_2) f1(Theta_2,Phi_2)./f2(Theta_2,Phi_2);
f5 = dblquad(f3,0,pi,0,pi)
......................
...........................
..................
Numerically evaluate double
integral over rectangle
q = dblquad(fun,xmin,xmax,ymin,ymax)
q = dblquad(fun,xmin,xmax,ymin,ymax,tol)
q = dblquad(fun,xmin,xmax,ymin,ymax,tol,method)
Description
q = dblquad(fun,xmin,xmax,ymin,ymax)
function to evaluatethe double integral fun(x,y) over the
rectangle xmin&= x &= xmax,
ymin &=y &= ymax.
fun isa function handle. See
in the MATLAB Programming documentationfor more
information. fun(x,y) must accept a vector x anda
scalar y and return a vector of values of
theintegrand.
, in the MATLAB Mathematicsdocumentation, explains how
to provide additional parameters to thefunction fun, if
necessary.
q = dblquad(fun,xmin,xmax,ymin,ymax,tol)
usesa tolerance tol instead of the default, which is
dblquad(fun,xmin,xmax,ymin,ymax,tol,method) usesthe
quadrature function specified as method, insteadof the
default quad. Valid values for method are
@quadl orthe function handle of a user-defined quadrature
method that has thesame calling sequence as quad and
Pass function handle @integrnd to dblquad:
Q = dblquad(@integrnd,pi,2*pi,0,pi);
where the function integrnd.m is:
function z = integrnd(x, y)
z = y*sin(x)+x*cos(y);
Pass anonymous function handle F to
F = @(x,y)y*sin(x)+x*cos(y);
Q = dblquad(F,pi,2*pi,0,pi);
The integrnd function integrates
y*sin(x)+x*cos(y) overthe square pi &=
x &= 2*pi, 0 &= y
&= pi. Note that the integrand can be evaluated
with a vector x anda scalar y.
Nonsquare regions can be handled by setting the integrand tozero
outside of the region. For example, the volume of a
hemisphereis:
dblquad(@(x,y)sqrt(max(1-(x.^2+y.^2),0)), -1, 1, -1, 1)
dblquad(@(x,y)sqrt(1-(x.^2+y.^2)).*(x.^2+y.^2&=1), -1, 1, -1, 1)
&...............
Numerically evaluate double
integral over planar region
q = quad2d(fun,a,b,c,d)
[q,errbnd] = quad2d(...)
q = quad2d(fun,a,b,c,d,param1,val1,param2,val2,...)
Description
q = quad2d(fun,a,b,c,d) approximates
theintegral of fun(x,y) over the planar region
and . fun is afunction handle,
c and d mayeach be a scalar or a function
All input functions must be vectorized. The function
Z=fun(X,Y) mustaccept 2-D matrices X and
Y ofthe same size and return a matrix Z of
correspondingvalues. The functions ymin=c(X) and
ymax=d(X) mustaccept matrices and return matrices of the
same size with correspondingvalues.
[q,errbnd] = quad2d(...). errbnd
isan approximate upper bound on the absolute error, |Q -
I|,where I denotes the exact value of the
quad2d(fun,a,b,c,d,param1,val1,param2,val2,...)
performsthe integration as above with specified values of optional
parameters:
absolute error tolerance
relative error tolerance
attempts to satisfy ERRBND&=
max(AbsTol,RelTol*|Q|). This is absolute error controlwhen
|Q| is sufficiently small and relative errorcontrol when
|Q| is larger. A default tolerancevalue is used when a
tolerance is not specified. The default valueof AbsTol is
1e-5. The default value of RelTol is
100*eps(class(Q)).This is also the minimum value of
RelTol. Smaller RelTol valuesare automatically
increased to the default value.
MaxFunEvals
Maximum allowed number of evaluations of
fun reached.
The MaxFunEvals parameter limits the numberof
vectorized calls to fun. The default is 2000.
FailurePlot
Generate a plot if MaxFunEvals is
Setting FailurePlot to true generatesa
graphical representation of the regions needing further
refinementwhen MaxFunEvals is reached. No plot is
generatedif the integration succeeds before reaching
MaxFunEvals.These (generally) 4-sided regions are mapped
to rectangles internally.Clusters of small regions indicate the
areas of difficulty. The defaultis false.
Problem may have boundary singularities
With Singular set to true,
will employ transformations to weaken boundary singularities for
better performance. The defaultis true. Setting
Singular to false willturn these transformations
off, which may provide a performance benefiton some smooth
over , . The true value of the integralis
Q = quad2d(@(x,y) y.*sin(x)+x.*cos(y),pi,2*pi,0,pi)
over the triangle
and . The integrand is infinite
at(0,0). The true value of the integral is .
fun = @(x,y) 1./(sqrt(x + y) .* (1 + x + y).^2 )
In Cartesian coordinates:
ymax = @(x) 1 -
Q = quad2d(fun,0,1,0,ymax)
In polar coordinates:
polarfun = @(theta,r) fun(r.*cos(theta),r.*sin(theta)).*r;
rmax = @(theta) 1./(sin(theta) + cos(theta));
Q = quad2d(polarfun,0,pi/2,0,rmax)
Limitations
begins by mappingthe region of integration to a rectangle.
Consequently, it may havetrouble integrating over a region that
does not have four sides orhas a side that cannot be mapped
smoothly to a straight line. Ifthe integration is unsuccessful,
some helpful tactics are leaving Singular set to its
default value of true, changing betweenCartesian and polar
coordinates, or breaking the region of integrationinto pieces and
adding the results of integration over the pieces.
For example:
fun = @(x,y)abs(x.^2 + y.^2 - 0.25);
c = @(x)-sqrt(1 - x.^2);
d = @(x)sqrt(1 - x.^2);
quad2d(fun,-1,1,c,d,'AbsTol',1e-8,...
'FailurePlot',true,'Singular',false)
Warning: Reached the maximum number of function ...
evaluations (2000). The result fails the
global error test.
The failure plot shows twoareas of difficulty, near the points
(-1,0) and (1,0) andnear the circle
Changing the value of Singular to true
willcope with the geometric singularities at (-1,0) and
(1,0).The larger shaded areas may need refinement but are
probably not areasof difficulty.
Q = quad2d(fun,-1,1,c,d,'AbsTol',1e-8, ...
'FailurePlot',true,'Singular',true)
Warning: Reached the maximum number of function ...
evaluations (2000). The result passes the ...
global error test.
From here youcan take advantage of symmetry:
Q = 4*quad2d(fun,0,1,0,d,'Abstol',1e-8,...
'Singular',true, 'FailurePlot',true)
However, the code is still working very hard near the
singularity.It may not be able to provide higher accuracy:
Q = 4*quad2d(fun,0,1,0,d,'Abstol',1e-10,...
'Singular',true,'FailurePlot',true)
Warning: Reached the maximum number of function ...
evaluations (2000). The result passes the ...
global error test.
At higher accuracy, a change in coordinates may work better.
polarfun = @(theta,r) fun(r.*cos(theta),r.*sin(theta)).*r;
Q = 4*quad2d(polarfun,0,pi/2,0,1,'AbsTol',1e-10)
It is best to put the singularity on the boundary by
splittingthe region of integration into two parts:
Q1 = 4*quad2d(polarfun,0,pi/2,0,0.5,'AbsTol',5e-11);
Q2 = 4*quad2d(polarfun,0,pi/2,0.5,1,'AbsTol',5e-11);
Q = Q1 + Q2
References
[1] L.F. Shampine, "Matlab Program for Quadraturein
2D."Applied Mathematics and Computation. Vol.
202,Issue 1, 2008, pp. 266&274.
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。复杂二重积分计算 - Matlab论坛 -
中国电子技术论坛 -
最好最受欢迎电子论坛!
后使用快捷导航没有帐号?
Hot [直播]
复杂二重积分计算
15:34:41  
function f=G_yi(y,x1,x2,f_p)
y=y(:);n=length(y);
if ischar(x1)==1;xx1=feval(x1,y);else xx1=x1*ones(size(y));end
if ischar(x2)==1;xx2=feval(x2,y);else xx2=x2*ones(size(y));end
for i=1:n;
& & f=zeros(n,1);
f(i)=quad8(f_p,xx1(i),xx2(i),[],[],y(i));
自定义函数没啥问题,可是运行起来老是出现
错误使用 G_yi (line 2)
输入参数的数目不足。
跪求各位大神,到底是出了什么原因啊?
等待验证会员
09:52:06  
PCB在线计价下单
板子大小:
板子数量:
PCB 在线计价
使用输入的什么参数
12个问题&&&&&&&&9534个浏览
21个问题&&&&&&&&21466个浏览
34个问题&&&&&&&&8055个浏览
Powered by查看: 167|回复: 0
计算二重积分高斯点和权系数,以及matlab程序
签到天数: 568 天[LV.9]以坛为家II
【PS,例如:需PDF格式文件,可填无】:无
【文献题名】:计算二重积分高斯点和权系数,以及matlab程序
【文献作者】:
【期刊名称】:
【文献页码】:
【全文链接】:
关注官方微信
QQ咨询: 9: 00-21: 00
Powered by小木虫 --- 600万学术达人喜爱的学术科研平台
&&查看话题
matlab计算二重积分
求助matlab如何计算
无标题.png
亲,你MATLAB怎么积分出来的我的就不行啊
北京学而思教育科技有限公司 地址:北京市海淀区北三环甲18号中鼎大厦A座1层102室 电话:010-

我要回帖

更多关于 全民k歌怎样删除歌曲 的文章

 

随机推荐