How to numerically integrate with variable bounds

63 Ansichten (letzte 30 Tage)
Nicolas Lamb
Nicolas Lamb am 25 Mai 2022
Kommentiert: Nicolas Lamb am 26 Mai 2022
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?

Antworten (1)

Torsten
Torsten am 25 Mai 2022
Bearbeitet: Torsten am 25 Mai 2022
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)

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by