Definite integral with parameter

9 次查看(过去 30 天)
Hi, I have the following equation to integrate:
c = (5.*x.^2-Fa.*x)./(((a.*x+q).*W-((a.*x+q)-2.*t).*(W-2.*t)).*(0.5.*(a.*x+q)-0.5.*q)+(W.*(a.*x+q).^3)./12-((W-2.*t).*(a.*x+q-2.*t).^3)./12);
I need to integrate in terms of x and I don't know the value of Fa (but it is a real value). I tried using int or integral alone or combined with vpa but Matlab gives as a result the same equation without integrating. I tried integrating it as a function but still no luck.
The integration is between 0 and 2300 and the parameters are:
a = 0.043478;
q = 100; % Ha
W = 40;
t = 4;

采纳的回答

Alan Stevens
Alan Stevens 2022-2-2
You could try something like this:
a = 0.043478;
q = 100; % Ha
W = 40;
t = 4;
c = @(x,Fa )(5.*x.^2-Fa.*x)./(((a.*x+q).*W-((a.*x+q)-2.*t).*(W-2.*t)).*(0.5.*(a.*x+q)-0.5.*q)...
+(W.*(a.*x+q).^3)./12-((W-2.*t).*(a.*x+q-2.*t).^3)./12) - Fa; % Subtract Fa for use in integral
lo = 0; hi = 2300;
Fa = 1; % Set rhe value of Fa when you know it
Q = integral(@(x)c(x,Fa),lo,hi);
disp(Q)
1.6580e+03
  2 个评论
Edoardo Marelli
Edoardo Marelli 2022-2-2
Thank you for your answer, I just realised I didn't explain it well.
I need to find Fa equating the integral to 0. So I would need to integrate first, and then equate the integrated function to 0 to get the Fa.
Alan Stevens
Alan Stevens 2022-2-2
Like this then
a = 0.043478;
q = 100; % Ha
W = 40;
t = 4;
c = @(x,Fa )(5.*x.^2-Fa.*x)./(((a.*x+q).*W-((a.*x+q)-2.*t).*(W-2.*t)).*(0.5.*(a.*x+q)-0.5.*q)...
+(W.*(a.*x+q).^3)./12-((W-2.*t).*(a.*x+q-2.*t).^3)./12) - Fa; % Subtract Fa for use in integral
lo = 0; hi = 2300;
Q = @(Fa) integral(@(x)c(x,Fa),lo,hi);
Fa0 = 1; % Initial guess
Fa = fzero(Q,Fa0);
disp(Fa)
1.7207

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Coder 的更多信息

标签

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by