MATLAB二重参数积分求最小值clearclear allsyms x y a b; Q = cos(0.212*y).*besselj(0,0.2405*x).*exp(-a*x.^2).*exp(-b*y.^2);Dx1 = diff(Q,x);Dy2 = diff(Q,y,2);DxxDx = diff(x.*Dx1,x);fxy = (Q.*(-19.*(1./x.*DxxDx+Dy2)-2654.*Q./sqrt(x.^2+y.^2)))./Q
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/17 04:22:51
MATLAB二重参数积分求最小值clearclear allsyms x y a b; Q = cos(0.212*y).*besselj(0,0.2405*x).*exp(-a*x.^2).*exp(-b*y.^2);Dx1 = diff(Q,x);Dy2 = diff(Q,y,2);DxxDx = diff(x.*Dx1,x);fxy = (Q.*(-19.*(1./x.*DxxDx+Dy2)-2654.*Q./sqrt(x.^2+y.^2)))./Q
MATLAB二重参数积分求最小值
clear
clear all
syms x y a b;
Q = cos(0.212*y).*besselj(0,0.2405*x).*exp(-a*x.^2).*exp(-b*y.^2);
Dx1 = diff(Q,x);
Dy2 = diff(Q,y,2);
DxxDx = diff(x.*Dx1,x);
fxy = (Q.*(-19.*(1./x.*DxxDx+Dy2)-2654.*Q./sqrt(x.^2+y.^2)))./Q.^2;
f = eval(['@(x,y)' vectorize(fxy)]);
B = @(a,b)dblquad(fxy,-4.9999,5,-10,10);
[mx,minf]=randwalknew(B,[0.3,0.5],0.5,0.1,10,1)
单独积分计算很好
单独求最小也不错
但结合不好
MATLAB二重参数积分求最小值clearclear allsyms x y a b; Q = cos(0.212*y).*besselj(0,0.2405*x).*exp(-a*x.^2).*exp(-b*y.^2);Dx1 = diff(Q,x);Dy2 = diff(Q,y,2);DxxDx = diff(x.*Dx1,x);fxy = (Q.*(-19.*(1./x.*DxxDx+Dy2)-2654.*Q./sqrt(x.^2+y.^2)))./Q
这3行肯定有错:
f = eval(['@(x,y)' vectorize(fxy)]);
B = @(a,b)dblquad(fxy,-4.9999,5,-10,10);
[mx,minf]=randwalknew(B,[0.3,0.5],0.5,0.1,10,1)
意思难说了,可以试一下:
fxy = eval(['@(x,y,a,b)' vectorize(fxyExp)]);
fab = @(a,b)integral2(fxy(x,y,a,b),-4.9999,5,-10,10);
[mx,minf] = randwalknew(fab,[0.3,0.5],0.5,0.1,10,1)
randwalknew是你自己写的吧?