Definite integral with parameter
10 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Edoardo Marelli
il 2 Feb 2022
Commentato: Alan Stevens
il 2 Feb 2022
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;
0 Commenti
Risposta accettata
Alan Stevens
il 2 Feb 2022
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)
2 Commenti
Alan Stevens
il 2 Feb 2022
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)
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!