Get the same value when using Integral2 function
이전 댓글 표시
I am using integral2 function to calculate the double integral. The source code is shown as follows:
%% Calculate the drag power for the bare fuselage
bl_bare = @(u,z) Oper.rho .* (u ./ Oper.Vinf) .* 0.5 .* (Oper.Vinf^2 - (u.^2));
ke_out_bare = @(u,z) Oper.rho .* (u ./ Oper.Vinf) .* 0.5 .* ((u - Oper.Vinf).^2);
% Perform double integral
q1_bare = integral2(bl_bare, 0, delta99, 0, 2*pi);
q2_bare = integral2(ke_out_bare, 0, delta99, 0, 2*pi);
D_bare = q1_bare + q2_bare;
%% Calculate the drag power for the bare fuselage with induced velocity field
v_induced = u .* (1 + a_fit);
v_slipstream = u .* (1 + (2 .* a_fit));
bl_induced = @(v_induced,z) Oper.rho .* (v_induced ./ Oper.Vinf) .* 0.5 .* (Oper.Vinf^2 - (v_induced .^2));
ke_out_induced = @(v_slipstream,z) Oper.rho .* (v_slipstream ./ Oper.Vinf) .* 0.5 .* ((v_slipstream - Oper.Vinf).^2);
% Perform double integral
q1_induced = integral2(bl_induced, 0, delta99, 0, 2*pi);
q2_induced = integral2(ke_out_induced, 0, delta99, 0, 2*pi);
D_induced = q1_induced + q2_induced;
However, q1_bare and q1_induced are the same, and q2_bare and q2_induced are the same as well.
I have checked that v_induced and v_slipstream are different from u. However, I cannot figure out why I got the same value.
u and a_fit are 1x30 double, and Oper.Vinf and Oper.rho are 1x1 double.
I appricate all the help. Thank you!
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!