Skip to content
Snippets Groups Projects
Unverified Commit 0fd62e40 authored by Thomas Lambert's avatar Thomas Lambert
Browse files

Merge branch 'master' of gitlab.uliege.be:am-dept/matlab_airfoil_toolbox

parents e57a7c4a e98f0aa1
No related branches found
No related tags found
No related merge requests found
Pipeline #16447 passed
function vect = spacedvector(spacing, nPoints) function vect = spacedvector(spacing, nPoints)
% SPACEDVECTOR Returns a vector based on chosen spacing and number of points % 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> % Author: Thomas Lambert <t.lambert@uliege.be>
% ULiege - Aeroelasticity and Experimental Aerodynamics % ULiege - Aeroelasticity and Experimental Aerodynamics
% Apache 2.0 License % Apache 2.0 License
...@@ -18,6 +25,9 @@ function vect = spacedvector(spacing, nPoints) ...@@ -18,6 +25,9 @@ function vect = spacedvector(spacing, nPoints)
case 'cosine' case 'cosine'
beta = linspace(0, pi / 2, nPoints); beta = linspace(0, pi / 2, nPoints);
vect = 1 - cos(beta); vect = 1 - cos(beta);
case 'sine'
beta = linspace(0, pi / 2, nPoints);
vect = sin(beta);
end end
end end
...@@ -6,13 +6,13 @@ function [coord, gradY] = nacacamber(varargin) ...@@ -6,13 +6,13 @@ function [coord, gradY] = nacacamber(varargin)
% ----- % -----
% %
% Usage: % Usage:
% [X, Y] = NACACAMBER prompts the user for the airfoil digits, then calculates the coordinates % [coord, gradY] = NACACAMBER prompts the user for the airfoil digits, then calculates the
% of the camberline using 100 points spaced with the half-cosine rule. % 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 % [coord, gradY] = NACACAMBER(DIGITS) calculates the coordinates of the camberline for the
% airfoil specified by DIGITS, without further input. % 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. % specified by DIGITS, using NPOINTS points spaced with the half-cosine rule.
% %
% [...] = NACACAMBER(..., 'spacing', SP) uses the defined spacing rule to determine to % [...] = NACACAMBER(..., 'spacing', SP) uses the defined spacing rule to determine to
...@@ -20,14 +20,14 @@ function [coord, gradY] = nacacamber(varargin) ...@@ -20,14 +20,14 @@ function [coord, gradY] = nacacamber(varargin)
% 'linear' - linear % 'linear' - linear
% 'halfcosine' - (default) finer at leading and trailing edges % 'halfcosine' - (default) finer at leading and trailing edges
% 'cosine' - finer at leading edge, coarser at the trailing edge % 'cosine' - finer at leading edge, coarser at the trailing edge
% 'sine' - finer at trailing edge, coarser at the leading edge
% %
% Inputs: % Inputs:
% digits : Character vector representing the NACA airfoil (ex: '0012', '24120', '24012') % digits : Character vector representing the NACA airfoil (ex: '0012', '24120', '24012')
% nPoints : Number of output coordinates % nPoints : Number of output coordinates
% %
% Output: % Output:
% xc : Camberline X coordinates (0 <= X <= 1) % coord : Camberline coordinates [nPts x 2]
% yc : Camberline Y coordinates
% gradY : Gradient of Y (required to get the whole airfoil coordinates) % gradY : Gradient of Y (required to get the whole airfoil coordinates)
% %
% Example: % Example:
...@@ -41,7 +41,7 @@ function [coord, gradY] = nacacamber(varargin) ...@@ -41,7 +41,7 @@ function [coord, gradY] = nacacamber(varargin)
% <a href="https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox">Documentation (online)</a> % <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> % Author: Thomas Lambert <t.lambert@uliege.be>
% ULiege - Aeroelasticity and Experimental Aerodynamics % ULiege - Aeroelasticity and Experimental Aerodynamics
% MIT License % MIT License
......
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