How do I integrate a piecewise function with an upper bound variable
조회 수: 10 (최근 30일)
이전 댓글 표시
As shown in the code, the Angle function alpha is a piecewise function with respect to r (the others are known sign values), and it can be performed as an indeterminate integral or a definite integral of a definite value, but it cannot be calculated when the upper limit of the integral is the variable r. The error message is that the continuity of the function in the integral interval cannot be determined.
...
syms r alpha(r)
alpha(r) = piecewise((r >= part_p(1, 1)) & (r <= part_p(2, 1)), alpha_part(1));
for i = 2:11
alpha(r) = piecewise((r > part_p(2*i-2, 1)) & (r <= part_p(2*i-1, 1)),...
atan(((-1)^(mod(i, 2)) * (r - cir_x(i)) / sqrt(cir_r(i)^2 - (r - cir_x(i))^2))), alpha(r));
alpha(r) = piecewise((r > part_p(2*i-1, 1)) & (r <= part_p(2*i, 1)),...
alpha_part(i), alpha(r));
end
syms arcLength(r)
arcLength(r) = int(sqrt(tan(alpha)^2 + 1), [part_p(1, 1), r]);
댓글 수: 5
Sam Chak
2024년 12월 16일
It is somewhat difficult to interpret the lines from a mathematician's perspective. Therefore, I attempted to separate them. The sub-functions of part_p() and alpha_part() are unknown. Are they mathematically defined, or do they refer to a table (cell) from which you extract fixed values?
syms alpha(r)
condition_1 = r >= part_p(1, 1); % condition 1
condition_2 = r <= part_p(2, 1); % condition 2
outcome = alpha_part(1); % outcome
%% Piecewise function
alpha(r) = piecewise(condition_1 & condition_2, outcome);
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Assumptions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!