Skip to content
Snippets Groups Projects
Verified Commit 10649d7e authored by Thomas Lambert's avatar Thomas Lambert 🚁
Browse files

fix(Polar): issue with aoa interpolation

parent afa7806a
No related branches found
No related tags found
No related merge requests found
Pipeline #21605 passed
...@@ -96,15 +96,16 @@ function self = interppolar(Polar1, Polar2, weightPolar2) ...@@ -96,15 +96,16 @@ function self = interppolar(Polar1, Polar2, weightPolar2)
self.nCrit = Polar1.nCrit; self.nCrit = Polar1.nCrit;
% Interpolate the angle of attack, cl, cd and cm using the base polars % 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. % Reinterpolate the original polars so they share the same range of AOA.
aoaMin = min(min(Polar1.aoa(:, 1)), min(Polar2.aoa(:, 1))); aoaMin = min(min(Polar1.aoa(:, 1)), min(Polar2.aoa(:, 1)));
aoaMax = max(max(Polar1.aoa(:, 1)), max(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))); aoaStep = min(diff(Polar1.aoa(1:2, 1)), diff(Polar2.aoa(1:2, 1)));
aoaVect = aoaMin:aoaStep:aoaMax; aoaVect = aoaMin:aoaStep:aoaMax;
aoa1 = repmapt(aoaVect', 1, nPolars); aoa1 = repmat(aoaVect', 1, nPolars);
aoa2 = repmapt(aoaVect', 1, nPolars); aoa2 = repmat(aoaVect', 1, nPolars);
cl1 = interp1(Polar1.aoa(:, 1), Polar1.cl, aoaVect'); cl1 = interp1(Polar1.aoa(:, 1), Polar1.cl, aoaVect');
cl2 = interp1(Polar2.aoa(:, 1), Polar2.cl, aoaVect'); cl2 = interp1(Polar2.aoa(:, 1), Polar2.cl, aoaVect');
cd1 = interp1(Polar1.aoa(:, 1), Polar1.cd, aoaVect'); cd1 = interp1(Polar1.aoa(:, 1), Polar1.cd, aoaVect');
......
...@@ -17,6 +17,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -17,6 +17,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### 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 ## [4.4.0] - 2024-03-13
### Added ### Added
...@@ -152,7 +158,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -152,7 +158,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Initial release - 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.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.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 [4.2.1]: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox/-/compare/4.2.0...v4.2.1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment