Design a gimbaled boom specular sail model with two bodies.

The sail consists of a boom with a mast and box at the end and a core
box with an attached sail.
Since version 7.
------------------------------------------------------------------------
See also BuildCADModel, CreateBody, CreateComponent, DrawSCPlanPlugIn,
Inertias, FindDirectory, SaveStructure
------------------------------------------------------------------------

Contents

%-------------------------------------------------------------------------------
%   Copyright (c) 2005 Princeton Satellite Systems, Inc. All rights reserved.
%-------------------------------------------------------------------------------

Script control

%---------------
createFiles = 0;

Properties

%-----------
gimbalRadius  =  0.02;
gimbalLength  =  0.125;
sailWidth     =  80.0;
coreWidth     =   0.5;
mastLength    =   10.0;
mastWidth     =   0.125;
boxWidth      =   0.25;
boxMass       =  20.0;
coreMass      =  10.0;
gimbalMass    =   1.0;
mastMass      =   4.0;
sailArealMass =   0.005; % kg/m^2

Create the sail mass structure

%-------------------------------
sailMass      = sailArealMass*sailWidth^2;
inertiaSail   = Inertias( sailMass, [sailWidth sailWidth], 'plate', 1 );
bXToZ         = [0 0 -1;0 1 0;1 0 0];
massSail      = struct('inertia', bXToZ*inertiaSail*bXToZ', 'mass', sailMass, 'cM', [0;0;0] );

Initialize

%-----------
BuildCADModel( 'initialize' );

Add general properties

%-----------------------
BuildCADModel( 'set name' ,  'Solar Sail' );
BuildCADModel( 'set units',  'mks'  );

%------------------------------------------------------------------

Create CAD bodies first

%------------------------------------------------------------------

Core

%-----
m = CreateBody( 'make', 'name', 'Core' );
BuildCADModel('add body', m );

Boom

%-----
m = CreateBody( 'make', 'name', 'Boom', 'bHinge', struct( 'b', eye(3) ),...
                'previousBody', 1, 'rHinge', [coreWidth/2+2*gimbalRadius;0;0 ] );
BuildCADModel('add body', m );

This creates the connections between the bodies

%------------------------------------------------
BuildCADModel( 'compute paths' );

%------------------------------------------------------------------

Create CAD Components second

%------------------------------------------------------------------

Core

%-----
m = CreateComponent( 'make', 'box','x',coreWidth, 'y', coreWidth, 'z', coreWidth,'name','CoreBox','body',1,...
                     'mass', coreMass, 'faceColor', 'gold foil', 'inside', 1  );
BuildCADModel( 'add component', m );

m = CreateComponent( 'make', 'cylinder','rUpper',gimbalRadius, 'rLower', gimbalRadius, 'h', gimbalLength,'name','Gimbal','body',1,...
                     'mass', gimbalMass, 'faceColor', 'aluminum', 'rA', [coreWidth/2+gimbalRadius;0;-gimbalLength/2], 'inside', 1 );
BuildCADModel( 'add component', m );

Sail

%------
v = [0 0 0 0;0.5 -0.5 -0.5 0.5;0.5 0.5 -0.5 -0.5]'*sailWidth;
m = CreateComponent( 'make', 'sail','name','Sail','body',1,...
                     'mass', massSail, 'faceColor', 'mirror','rA',[0;0;0],...
                     'sigmaS', [1 1], 'sigmaD', [0 0], 'sigmaA', [0 0], ...
                     'emissivity',[0.02 0.02],...
                     'vertex',v ,'face', [1 2 3; 1 3 4], 'inside', 0 );
BuildCADModel( 'add component', m );

Boom

%------
m = CreateComponent('make', 'box','x',boxWidth, 'y', boxWidth, 'z', boxWidth,'name','BoomBox','body',2, 'mass', boxMass,...
                    'rA', [mastLength;0;0], 'faceColor', 'gold foil', 'inside', 1 );
BuildCADModel( 'add component', m );

m = CreateComponent('make', 'box','x',mastLength, 'y', mastWidth, 'z', mastWidth,'name','Mast','body',2, 'mass', mastMass,...
                    'rA', [mastLength/2;0;0], 'faceColor', 'gold foil', 'inside', 1 );
BuildCADModel( 'add component', m );

Model is finished

%-------------------
g = BuildCADModel( 'get cad model' );
BuildCADModel('show vehicle');
view(55,30)

%------------------------------------------------------------------

Export

%------------------------------------------------------------------
if( createFiles )
  dataDir = FindDirectory('SailData');
  SaveStructure( g, fullfile(dataDir,'PlateWithBoom') );
  cd(c);
end


%--------------------------------------
% PSS internal file version information
%--------------------------------------