I am using Mathematica's ability to integrate over regions to find the mean aerodynamic cord of a wing planform. As an example, here is a simple wing, and its bounds.
points = {{0, 0}, {3, 300}, {120, 310}, {200, 0}}
wing = Polygon[points]
{{xmin, xmax}, {ymin, ymax}} = RegionBounds[wing]
I can use the normal Integrate
to find its area A. But the mean aerodynamic cord is:
$c_m=\frac{1}{A} \int_{R}^{ } c^2(y) \,dy$
where R is the region, and c(y) is the cord at any y. In the past, I did this by defining c(y) as:
c[R_,y_]:=ArcLength[RegionIntersection[R, InfiniteLine[{0, y}, {1, 0}]]]
and doing the integral like this:
cm = 1/A NIntegrate[c[wing, y]^2, {y, ymin, ymax}]
This has always worked, until I upgraded to Mathematica 14. Now it says the integrand is Undefined. Which is odd, because you can still plot:
Plot[c[wing, y]^2, {y, ymin, ymax}]
and it works.