diff --git a/+af_tools/@Polar/interppolar.m b/+af_tools/@Polar/interppolar.m index 3b8d661f68fdc8ee70bd179e4fac68e201eed4dc..620800e839d1608ea514c2a066f409c8c64eca06 100644 --- a/+af_tools/@Polar/interppolar.m +++ b/+af_tools/@Polar/interppolar.m @@ -96,15 +96,16 @@ function self = interppolar(Polar1, Polar2, weightPolar2) self.nCrit = Polar1.nCrit; % Interpolate the angle of attack, cl, cd and cm using the base polars - if Polar1.aoa ~= Polar2.aoa + if numel(Polar1.aoa(:, 1)) ~= numel(Polar2.aoa(:, 1)) || ... + any(Polar1.aoa(:, 1) ~= Polar2.aoa(:, 1)) % Reinterpolate the original polars so they share the same range of AOA. aoaMin = min(min(Polar1.aoa(:, 1)), min(Polar2.aoa(:, 1))); aoaMax = max(max(Polar1.aoa(:, 1)), max(Polar2.aoa(:, 1))); aoaStep = min(diff(Polar1.aoa(1:2, 1)), diff(Polar2.aoa(1:2, 1))); aoaVect = aoaMin:aoaStep:aoaMax; - aoa1 = repmapt(aoaVect', 1, nPolars); - aoa2 = repmapt(aoaVect', 1, nPolars); + aoa1 = repmat(aoaVect', 1, nPolars); + aoa2 = repmat(aoaVect', 1, nPolars); cl1 = interp1(Polar1.aoa(:, 1), Polar1.cl, aoaVect'); cl2 = interp1(Polar2.aoa(:, 1), Polar2.cl, aoaVect'); cd1 = interp1(Polar1.aoa(:, 1), Polar1.cd, aoaVect'); diff --git a/CHANGELOG.md b/CHANGELOG.md index 70f8f80e91d59d1c89da778a5bbfc267f5f94ffe..925b257c3172666a02c2c7f809476086dac1bfbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +## [4.4.1] - 2024-03-13 + +### Fixed + +- Issue with interpolation of polars between polars with different range of AOA + ## [4.4.0] - 2024-03-13 ### Added @@ -152,7 +158,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial release -[Unreleased]: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox/-/compare/v4.4.0...master +[Unreleased]: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox/-/compare/v4.4.1...master +[4.4.1]: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox/-/compare/4.4.0...v4.4.1 [4.4.0]: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox/-/compare/4.3.0...v4.4.0 [4.3.0]: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox/-/compare/4.2.1...v4.3.0 [4.2.1]: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox/-/compare/4.2.0...v4.2.1