How to numerically integrate with variable bounds

58 次查看(过去 30 天)
In short, I am trying to integrate:
where
So my struggle is trying to integrate with respect to g.
my code thus far is:
gmin = 2;
gmax = 6;
p = 2.5;
critmax = gmax.^2;
v= 0:.05: 2.*critmax;
syms g;
in = @(v,g) F(v,g.^2).*g.^-p;
pow= @(v,min,max) vpaintegral(in,g,gmin,gmax);
and F is defined here:
inner = @(z) besselk(5/3,z);
f= @(x,y) x.* integral(inner,x./y,Inf);
F= @(x,y) arrayfun(@(x)f(x,y),x);
The error I recieve is that integral limits must be scalar or double
I know this is because I am using a symbolic g to calculate F, but I can't think of any other way to calculate this nested integral. Perhaps some double integral function I am unaware of, or a different way to represent g?

回答(1 个)

Torsten
Torsten 2022-5-25
编辑:Torsten 2022-5-25
gmin = 2;
gmax = 6;
p = 2.5;
inner = @(x,g) x*integral(@(z)besselk(5/3,z),x/g^2,Inf);
fun = @(x)integral(@(g)g^(-p)*inner(x,g),gmin,gmax,'ArrayValued',true);
x = 0.1:0.1:20;
y = arrayfun(fun,x)
plot(x,y)

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

产品


版本

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by