Numerical Integration with limits-dependent parameters
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I'm looking at integrating numerically a function which has two parameters dependent of the integral limits such as e.g.:
integral from x=-1 to x=1 of f(x)=a^2*(c1*b^2 - c2*b + c3)
where a and b are parameters specified at x=-1 and x=1. And c1, c2, c3 are constants.
So far I've tried to do it like this but struggling to define the parameters
fun = @(x) a^2*(c1 * b^2 - c2 * b + c3);
q = integral(fun,-1,1);
Thanks for the help.
6 个评论
Torsten
2017-11-9
You said the coefficients depend on the integral limits, now they depend on the integration variable.
And the construction
a = @(x) x*(a(xmax) - a(xmin)) + (xmax - xmin);
b = @(x) x*(b(xmax) - b(xmin)) + (xmax - xmin);
where a and b call themselves inside the function handle looks very strange to me.
Best wishes
Torsten.
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!