Code covered by the BSD License  

Highlights from
Automated Failure Boundary Mapping

image thumbnail

Automated Failure Boundary Mapping

by

 

18 Aug 2009 (Updated )

Demo files from July 21, 2009 webinar

flutterLimitFunction(X,factors,varargin)
function failed = flutterLimitFunction(X,factors,varargin)
% Calcualte Flutter Limit Function

%   Copyright 2009 The MathWorks, Inc.

numIter = size(X,1);

% Scale X's
X(:,1) = X(:,1)./10;    % Mach Scaling
X(:,2) = X(:,2).*10000; % Altitude Scaling
%% update dataset array with run values
ds = evalin('base','ds');

lastRun = ds.Properties.ObsNames{end};
if strcmpi(lastRun(1:3),'LIM')
    nextIter = str2num(lastRun(4:end))+1;
else
    nextIter = 1;
end
numIter = numIter+nextIter-1;
nextIter = strrep( strcat({'LIM'},num2str((nextIter:numIter)','%d')), ' ','');
for i = 1:length(factors)
    ds.(factors{i})(nextIter) = X(:,i);
end
%% Update any other parameters
if nargin >2
    designVars = varargin{1};
    if nargin == 4
        Y = varargin{2};
        for i = 1:length(Y)
            ds.(designVars{i})(nextIter) = Y(i);
        end
    else
        for i = 1:length(designVars)
            ds.(designVars{i})(nextIter) = ds.(designVars{i})('Initial');
        end
    end
end
%% run simulink model and update ds
ds(nextIter,:) = runModel(ds(nextIter,:));
assignin('base','ds',ds);
%% extract failure measure
failed = logical( ds.unstable(nextIter) );

Contact us