ogiveradius.m

来自「isight调用matlab接口进行优化的例子」· M 代码 · 共 37 行

M
37
字号


function [Radius] = OgiveRadius(Length,BaseDiameter,DistanceFromNose)


% OgiveRadius
% Calculates the radius of an Ogive Nose at the location specified, I.E. supply R for a given X
%    along the ogive contour
%
%    a consistent set of units should be used for this routine
%
%   Inputs:
%
%       Length           - Length of Ogive Nose
%       BaseDiameter     - Diameter of the base of the Ogive Nose
%       DistanceFromNose - Distance, from nose of ogive, that radius is to be calculated
%
%   Output - Radius, radial distance from the ogive centerline at the specified X location
%


RMid = BaseDiameter / 2

FinenessRatio = Length / BaseDiameter
RBar = (FinenessRatio ^ 2) + 0.25
RadiusOfCurvature = RBar * BaseDiameter
XBar = DistanceFromNose / Length

TermA = (FinenessRatio ^ 2) / (RBar ^ 2)
TermB = (1 - TermA * ((1 - XBar) ^ 2)) ^ 0.5
TermC = 1 - (2 * RBar * (1 - TermB))
Radius = RMid * TermC
if (Radius < 0) 
    OgiveRadius = 0
else
    OgiveRadius = RMid * TermC
end ;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?