How do I integrate a piecewise function with an upper bound variable
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Sam Chak
le 16 Déc 2024
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);
Réponses (0)
Voir également
Catégories
En savoir plus sur Assumptions dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!