Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • am-dept/matlab_airfoil_toolbox
1 result
Show changes
Commits on Source (5)
function vect = spacedvector(spacing, nPoints)
% SPACEDVECTOR Returns a vector based on chosen spacing and number of points
%
% Spacing:
% - linear : points spaced linearily
% - halfcosine : more dense at beginning and end of vector
% - cosine : more dense at the beginning and more spaced out at the end
% - sine : more dense at the end and more spaced out at the beginning
%
% -----
% (c) Copyright 2022 University of Liege
% (c) Copyright 2022-2023 University of Liege
% Author: Thomas Lambert <t.lambert@uliege.be>
% ULiege - Aeroelasticity and Experimental Aerodynamics
% Apache 2.0 License
......@@ -18,6 +25,9 @@ function vect = spacedvector(spacing, nPoints)
case 'cosine'
beta = linspace(0, pi / 2, nPoints);
vect = 1 - cos(beta);
case 'sine'
beta = linspace(0, pi / 2, nPoints);
vect = sin(beta);
end
end
......@@ -145,7 +145,7 @@ classdef Polar < handle
%
% See also: af_tools.findcllinearrange.
[self.Lin.clRange, self.Lin.aoaRange, self.Lin.slope] = ...
[self.Lin.aoaRange, self.Lin.clRange, self.Lin.slope] = ...
af_tools.findcllinearrange(self);
end
......
......@@ -6,13 +6,13 @@ function [coord, gradY] = nacacamber(varargin)
% -----
%
% Usage:
% [X, Y] = NACACAMBER prompts the user for the airfoil digits, then calculates the coordinates
% of the camberline using 100 points spaced with the half-cosine rule.
% [coord, gradY] = NACACAMBER prompts the user for the airfoil digits, then calculates the
% coordinates of the camberline using 100 points spaced with the half-cosine rule.
%
% [X, Y] = NACACAMBER(DIGITS) calculates the coordinates of the camberline for the NACA
% airfoil specified by DIGITS, without further input.
% [coord, gradY] = NACACAMBER(DIGITS) calculates the coordinates of the camberline for the
% NACA airfoil specified by DIGITS, without further input.
%
% [X, Y] = NACACAMBER(DIGITS, NPOINTS) calculates the coordinates of the NACA airfoil
% [coord, gradY] = NACACAMBER(DIGITS, NPOINTS) calculates the coordinates of the NACA airfoil
% specified by DIGITS, using NPOINTS points spaced with the half-cosine rule.
%
% [...] = NACACAMBER(..., 'spacing', SP) uses the defined spacing rule to determine to
......@@ -20,14 +20,14 @@ function [coord, gradY] = nacacamber(varargin)
% 'linear' - linear
% 'halfcosine' - (default) finer at leading and trailing edges
% 'cosine' - finer at leading edge, coarser at the trailing edge
% 'sine' - finer at trailing edge, coarser at the leading edge
%
% Inputs:
% digits : Character vector representing the NACA airfoil (ex: '0012', '24120', '24012')
% nPoints : Number of output coordinates
%
% Output:
% xc : Camberline X coordinates (0 <= X <= 1)
% yc : Camberline Y coordinates
% coord : Camberline coordinates [nPts x 2]
% gradY : Gradient of Y (required to get the whole airfoil coordinates)
%
% Example:
......@@ -41,7 +41,7 @@ function [coord, gradY] = nacacamber(varargin)
% <a href="https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox">Documentation (online)</a>
% -------------------------------------------
% (c) Copyright 2022 University of Liege
% (c) Copyright 2022-2023 University of Liege
% Author: Thomas Lambert <t.lambert@uliege.be>
% ULiege - Aeroelasticity and Experimental Aerodynamics
% MIT License
......