76
National Aeronautics and Space Administration Langley Research Center Hampton, Virginia 23681-0001 NASA Technical Paper 3519 PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible Systems Peiman G. Maghami and Sean P. Kenny Langley Research Center • Hampton, Virginia Daniel P. Giesy Lockheed Martin Engineering & Sciences • Hampton, Virginia September 1995

PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

National Aeronautics and Space AdministrationLangley Research Center • Hampton, Virginia 23681-0001

NASA Technical Paper 3519

PLATSIM: An Efficient Linear Simulation andAnalysis Package for Large-Order FlexibleSystemsPeiman G. Maghami and Sean P. KennyLangley Research Center • Hampton, Virginia

Daniel P. GiesyLockheed Martin Engineering & Sciences • Hampton, Virginia

September 1995

Page 2: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

Printed copies available from the following:

NASA Center for AeroSpace Information National Technical Information Service (NTIS)800 Elkridge Landing Road 5285 Port Royal RoadLinthicum Heights, MD 21090-2934 Springfield, VA 22161-2171(301) 621-0390 (703) 487-4650

The use of trademarks or names of manufacturers in this report is foraccurate reporting and does not constitute an official endorsement,either expressed or implied, of such products or manufacturers by theNational Aeronautics and Space Administration.

Available electronically at the following URL address: http://techreports.larc.nasa.gov/ltrs/ltrs.html

Page 3: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

iii

Contents

Chapter 1—Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Chapter 2—Mathematical Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Second-Order Modal Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

First-Order Modal Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Control System Equations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Discrete Time Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Frequency Domain Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Jitter and Stability Measurement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6Chapter 3—Input Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Finite Element Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Modal Damping Schedule. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Effector and Sensor Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Common Data Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Instrument Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Disturbance Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Space Platform Control System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Chapter 4—PLATSIM Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

Time Domain Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Full Time Histories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Time History Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Jitter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16File-Naming Conventions for PC’s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Frequency Domain Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18Transfer Function Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18Bode Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20File-Naming Conventions for PC’s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

Chapter 5—Program Execution Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23File Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23Execution Control Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23On-Line Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

Chapter 6—GUI Execution Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

Workspace. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26Frequency Ratio Modification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26Damping Ratio Modification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

Analysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

Disturbance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

Quit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

Page 4: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

iv

Number of Modes Slider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

Clip Window Slider/Range of Disturbance Events. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29Chapter 7—Command-Driven Execution Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

Time Domain Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

Frequency Domain Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32Chapter 8—Batch Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

Batch Mode Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35Example 1. MATLAB is Started in a Directory Containing Two Files . . . . . . . . . . . . . . . . . . . . . 35Example 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

Chapter 9—Time Domain Analysis Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37

Chapter 10—Plant Definition Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

Continuous Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

Discrete Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40Chapter 11—Disturbance Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

Chapter 12—Simulation Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

Chapter 13—Frequency Domain Analysis Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

Open-Loop Calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

Closed-Loop Calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

Software Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47Chapter 14—Jitter Analysis Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

Chapter 15—Data Reduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

Appendix A—Installation Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

Appendix B—Listing of User-Supplied Routines for EOS-AM-1 Example . . . . . . . . . . . . . . . . . . . . . 55

Appendix C—Execution Control Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

Page 5: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

Chapter 1

Introduction

The software package PLATSIM provides time andfrequency domain analysis of generic space platformsthat can be modeled as linear, time-invariant systems.PLATSIM can perform open-loop analysis or closed-loop analysis with different linear time-invariant space-craft control systems, such as attitude control systemswith or without flexible body controls, active isolationsystems, and payload or instrument local control sys-tems. In the time domain analysis, PLATSIM simulatesthe response of the space platform to disturbances andcalculates the jitter and stability values from the responsetime histories. In the frequency domain analysis,PLATSIM calculates frequency response function matri-ces and provides the corresponding Bode plots. WhilePLATSIM was designed for analyzing space platforms,it only assumes that it has a finite element model of astructure that is being excited by force and/or torqueinputs. Thus, any structure (e.g., aeronautical, automo-tive, structural, or mechanical) that fits this model can beanalyzed by PLATSIM.

Several novel algorithmic features have been devel-oped and are incorporated in PLATSIM. These featuresresult in a significant increase in the computational effi-ciency for all analyses. PLATSIM exploits the particularform of sparsity (block diagonal with 2× 2 blocks) of theplant matrices both in the continuous form used in thefrequency analysis and in the discretized form used in thetime simulation. A new and original algorithm for theefficient computation of closed-loop (as well as open-loop) frequency response functions for large-order sys-tems has been developed and implemented withinPLATSIM. This algorithm is an enabling technology forthe analysis of large-order systems. Furthermore, a noveland efficient jitter analysis routine that determines jitterand stability values from time simulations in an efficientmanner has been developed for and is incorporated in thePLATSIM package (ref. 1). This routine increased thecomputational speed by more than 1600 times in typicalexamples over the brute force approach of sweeping min-ima and maxima.

PLATSIM allows the user to maintain a database ofperformance measurement outputs on the space platformand a database of disturbance scenarios. An individualrun of PLATSIM can use all performance outputs or auser-selected subset, and the user selects one disturbance

scenario for each run. Output options for time domainanalysis include on-screen plots of time histories at user-selected output locations (e.g., instrument boresight),encapsulated Adobe PostScript (EPS) files of these plots,tables of jitter values for user-provided time windowsizes, and files containing the time history data in eithercompressed or full form. Output options for frequencydomain analysis include on-screen Bode plots, EPS filesof these plots, and files containing the plot data.

PLATSIM requires MATLAB® version 4.1 orhigher. MATLAB, a product of The MathWorks, Inc., isa technical computing environment for high-performancenumeric computation and visualization (ref. 2).PLATSIM also uses the Control System Toolbox, whichis another product of The MathWorks, Inc. User input toPLATSIM is provided in MATLAB readable data filesand MATLAB function M-files.

PLATSIM uses six main modules: a plant definitionmodule, a spacecraft control system module (user-supplied), a disturbance module (user-supplied), a simu-lation module, a frequency analysis module, and a jitteranalysis module. All modules are written as MATLABM-files, which are compatible with MATLABversion 4.1 or higher. However, the jitter analysis mod-ule, the frequency analysis module, and the simulationmodule have also been rendered as FORTRAN 77MATLAB MEX-files to improve the execution time forthose modules.

PLATSIM uses a sparse matrix formulation of thespacecraft modal model (which differs from MATLAB’sbuilt-in sparse utilities) for the spacecraft dynamicmodel. Utilizing sparseness makes the time simulationsand frequency analysis efficient, particularly when largenumbers of modes are required to capture the truedynamics of the spacecraft. The user provides a linear,time-invariant, continuous-time state space model of thespacecraft control system. PLATSIM performs time sim-ulation of the system by first discretizing the spacecraftdynamics (taking advantage of the sparsity in the model)and the spacecraft control system and then carrying outan algebraic state propagation for discrete time steps.Frequency domain analysis consists of evaluating thesystem transfer function over a user-specified range offrequencies and then extracting gain and phaseinformation.

Page 6: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

2

Chapter 1

PLATSIM requires the following user inputs: modaldata of the spacecraft as generated by finite element anal-ysis, damping ratios for flexible modes, informationabout control actuators, measurement feedback sensors,and performance instrument outputs (e.g., boresight mea-surements), spacecraft disturbance data, and spacecraftcontrol system matrices. The finite element data, includ-ing the modal frequencies and mode shapes at requiredgrid points, must be provided either in ASCII filesomega.dat andphi.dat , or MATLAB binary filesomega.mat andphi.mat , respectively. The dampingratios for the structural modes are defined in theMATLAB function mkdamp. The data for instrumentconnectivity and input/output selection must be providedthrough the MATLAB function instdata . Therequired data on spacecraft disturbances, such as distur-bance profiles, elements, and integration step sizes, mustbe provided through the MATLAB functiondistdata .In the EOS (Earth Observing System) example usedthroughout this manual,distdata calls other user-defined MATLAB routines, which perform tasks such ascalculating individual disturbance profiles. The matricesmodeling the space platform control system (SCS) mustbe output by the MATLAB functionformscs . Anyspacecraft control system can be implemented byPLATSIM as long as it is stable and has a linear time-invariant model. The space platform control system canbe a basic spacecraft attitude control system with possi-ble augmentations by additional control systems to con-trol local vibrations, isolate payloads, or articulatepayloads.

The program can be used in three modes, a GUImode, a command-driven mode, or a batch mode. Thethree modes differ in the way the required and optional

flags and parameters that control execution are defined.In the GUI mode, the parameters and flags are chosenfrom pop-up MATLAB menus with a keypad and amouse. In the command-driven mode, the requiredparameters and flags are defined through keyboardresponses to PLATSIM questions; however, any optionalparameters are defined with MATLAB command lines.In the batch mode, all flags and parameters are defined inMATLAB command lines, which can be placed in anASCII input file.

Although PLATSIM was developed to analyzegeneric space platforms, the Earth Observing SystemEOS-AM-1 (ref. 3) is used throughout this manual as anexample. Furthermore, several M-files and data filesincluded in the PLATSIM distribution, some of whichare listed in appendix A, correspond to the EOS-AM-1spacecraft. These files are the spacecraft control systemdefined informscs.m , the instrument types and con-nectivity data defined ininstdata.m , the finite ele-ment data defined inomega.mat and phi.mat , thedamping schedule defined inmkdamp.m, and thespacecraft disturbance data defined indistdata.mand its supporting routines. These files can serve as tem-plates for the user-supplied files for other space platformapplications.

The MATLAB convention for naming MEX-files isto append to the function name an extension that startswith the characters.mex and may have additional char-acters depending on the computer or operating system.For example, in this document, the MEX-file for functionjitter is referred to asjitter.mex* . The * can standfor 0 or more additional characters in accordance withthe UNIX or DOS wild card character convention.

Page 7: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

3

Chapter 2

Mathematical Formulation

Second-Order Modal Equations

The dynamics of the spacecraft can be written in asecond-order form as

where M, D, and K are then × n mass, damping, andstiffness matrices, respectively;x is the n × 1 positionand/or attitude vector;u is them × 1 spacecraft controlinput vector, which includes the attitude control systeminputs along with any additional augmenting controllers;w is ther × 1 disturbance vector;H is then × m controlinput influence matrix; andHd is then × r disturbanceinfluence matrix. In addition,y is theq × 1 measurementsoutput vector andypr is thel × 1 performance output vec-tor; Cp andCr areq × n measurement output influencematrices; and , , and are thel × n perfor-mance output influence matrices.

The elements of the control input and the disturbanceinfluence matrices depend on how the control inputs andthe disturbances are applied to the spacecraft. In general,element (i, j) of matrixH represents the influence of thecontrol inputj on the position coordinatei (the ith ele-ment of position vectorx). For example, if the secondcontrol input applies a force and/or torque solely on posi-tion coordinate 15, then all elements of the second col-umn of matrixH would be 0 except its 15th element,which would be 1. Generally, if thejth control inputapplies a force or torque to onlys position coordinates

, , ..., , each with a distribution factor ofαiwith i = 1, ...,s, then the elements of columnj of matrixH would all be 0 except for the elementsl1, l2, ..., ls,which take valuesα1, α2, ...,αs, respectively. The ele-ments of the disturbance influence matrix are defined inthe same manner.

The elements of the measurement output (and theperformance output) influence matrices depend on themeasurement process. In general, element (i, j) of matrixCp represents the contribution of the response at positioncoordinatej to measurementi, and element (i, j) of Crrepresents the contribution of the rate response at posi-

Mx Dx Kx+ + Hu Hdw+=

y Cpx Cr x+=

ypr

Cppr

x Crpr

x Capr

x+ +=

Cppr

Crpr Ca

pr

xl1xl2 xls

tion coordinatej to measurementi. For example, if mea-surement outputk has contributions only from theresponse att position coordinates , , ..., , eachwith a contribution factorθi with i = 1, ...,t, then the ele-ments of rowk of matrix Cp would all be 0 except forelementso1, o2, ...,ot, which take valuesθ1, θ2, ...,θt,respectively. Moreover, all elements of rowk of matrixCr would be 0. The elements of the performance outputinfluence matrices , , and can be defined in asimilar manner.

If the second-order system is transformed into nor-mal mode coordinates, andp of the normal modes areretained to capture the relevant dynamics of the space-craft, then the system equations can be written in a modalform as

where , , and are thep × p modal mass, damping,and stiffness matrices, respectively;q is thep × 1 vectorof modal coordinates; and and are thep × mspacecraft control input and thep × r disturbance influ-ence matrices in modal coordinates, respectively. Futher-more, and areq × p measurement outputinfluence matrices in modal coordinates, and , ,and arel × p performance output influence matricesin modal coordinates.

PLATSIM assumes that the mode shapes arenormalized with respect to the mass matrix anddamping is modal. These assumptions result in

, , and

, where ωi and ζi are the

open-loop frequencies and damping ratios.

The spacecraft control input and disturbance influ-ence matrices are defined as follows:

xo1xo2

xot

Cppr Cr

pr Capr

Mq Dq Kq+ + Hu Hdw+=

y Cpq Crq+=

ypr

Cppr

q Crpr

q Capr

q++=

M D K

H Hd

Cp CrCp

pr Crpr

Capr

M Ip p×= D diag 2ζ1ω1 2ζ2ω2 … 2ζpωp, ,,( )=

K diag ω12 ω2

2 … ωp2, , ,

=

H ΦTH=

Hd ΦTHd=

Page 8: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

4

Chapter 2

The measurement and performance output influencematrices are given by

The columns of matrixΦ are thep retained mode shapes:

First-Order Modal Equations

The second-order modal equations can be rewrittenin a first-order form as follows:

(1)

The vectorxs is the plant state vector whose componentsare as follows:

Furthermore, the vectorsy andypr are the plant (space-craft) measurement and performance outputs, respec-

Cp CpΦ=

Cr CrΦ=

Cppr

CpprΦ=

Crpr

CrprΦ=

Capr

CaprΦ=

Φ φ1 φ2 … φp, , ,[ ]=

xs Asxs Bsu Bdw+ +=

y Cxs=

ypr

C1pr

xs C2pr

xs+=

xs

q1

q1

q2

q2

qp

qp

= ......

tively. The matrixAs is the plant state matrix and has thefollowing form:

(2)

where

(3)

The matrix Bs is the control input influence matrix,which is formed by setting its odd-numbered rows to 0and by using the rows of for its even-numbered rowsas follows:

(4)

in which , for example, represents element (i, j) ofmatrix . (In MATLAB notation,B(1 : 2 : 2p, 1 :m) =zeros(p, m) andB(2 : 2 : 2p, 1 :m) = .) The matrixBdis formed from in the same manner.

The measurement output influence matrixC isdefined by setting the odd-numbered columns ofC to thecolumns of and by setting the even-numbered col-umns ofC to the columns of as follows:

where and denote element (i, j) ofmatrix and , respectively. (In MATLAB notation,C(1 : q, 1 : 2 : 2p) = and C(1 : q, 2 : 2 : 2p) = .)

As

As1

0 … 0

0 As2 … 0

0 0 … Asp

=...

......

...

Asi 0 1

ωi2

– 2ζiωi–=

H

Bs

0 0 … 0

H11 H12 … H1m

0 0 … 0

H21 H22 … H2m

……

0 0 … 0

Hp1 Hp2 … Hpm

= ......

...

...

...

...

HijH

HHd

CpCr

C

Cp 1 1,( ) Cr 1 1,( ) Cp 1 2,( ) Cr 1 2,( ) … … Cp 1 p,( ) Cr 1 p,( )

Cp 2 1,( ) Cr 2 1,( ) Cp 2 2,( ) Cr 2 2,( ) … … Cp 2 p,( ) Cr 2 p,( )

Cp q 1,( ) Cr q 1,( ) Cp q 2,( ) Cr q 2,( ) … … Cp q p,( ) Cr q p,( )

= ......

......

...

......

......

Cp i j,( ) Cr i j,( )Cp Cr

Cp Cr

Page 9: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

5

Mathematical Formulation

Furthermore, is defined from and in thesame fashion, and is defined by setting the odd-numbered columns of to 0 and the even-numberedcolumns of to the columns of . (In MATLABnotation, (1 :l, 1 : 2 : 2p) = zeros(l, p) and(1 : l, 2 : 2 : 2p) = .)

By substituting the first equation of equations (1)into the third, the acceleration term can be replaced byfeedthrough as follows:

(5)

The performance output influence matrix is given by

The performance feedthrough matrices are

Notice that if no performance acceleration outputexists , then and . Thus,both feedthrough matrices and .

Control System Equations

In this development, the space platform is assumedto be controlled by a linear time-invariant attitude controlsystem. However, additional augmenting controllers thatare also linear time invariant can be implemented alongwith the attitude control system and analyzed by thePLATSIM program. The model of a linear time-invariantspacecraft control system for a typical space platform canbe written as

(6)

wherexc denotes the spacecraft control system states;Ac,Bc, andCc represent the spacecraft control system statematrix, input influence matrix, and output influencematrix, respectively; andy is the measurement outputvector defined in the previous section. Typical measure-ment outputs can consist of roll, roll rate, pitch, pitchrate, yaw, and yaw rate measurements taken at the space-craft navigational unit.

C1pr

Cppr

Crpr

C2pr

C2pr

C2pr Ca

pr

C2pr C2

pr

Capr

xs Asxs Bsu Bdw+ +=

y Cxs=

ypr

Cpr

xs Dupr

u Dwpr

w+ +=

Cpr

C1pr

C2pr

As+=

Dupr

C2pr

Bs=

Dwpr

C2pr

Bd=

Capr 0=( ) Ca

pr0= C2

pr0=

Dupr Dw

pr0=

xc Acxc Bcy+=

u Ccxc–=

Discrete Time Simulation

The simulation technique used here is a discreteclosed-loop or open-loop simulation of the spacecraftplant and the spacecraft control system. To perform thissimulation, the plant matrices and the control systemmatrices are separately discretized for the given integra-tion step size, and then the discretized dynamics are com-bined for closed-loop simulation through algebraic statepropagation. Equation (5) discretizes as

(7)

The spacecraft control system, equation (6), discretizesas

(8)

The overbars indicate the discretized system matrices.The discrete plant state matrix has the followingform:

where the square partition matrix is the discretizedcounterpart of the partition matrix , which can be eas-ily computed through the zero-order hold function inMATLAB ( c2d ). The remaining plant and spacecraftcontrol system matrices can also be transformed into dis-crete forms through the same MATLAB function.

Frequency Domain Equations

For the open-loop plant,y andu of equation (5) arenonexistent; thus, the equations reduce to the following:

The open-loop transfer function from the disturbanceswto the performance outputypr is given by

(9)

xs k 1+( ) Asxs k( ) Bsu k( ) Bdw k( )+ +=

y k( ) Cxs k( )=

ypr

k( ) Cpr

xs k( )= Dupr

u k( ) Dwpr

w k( )+ +

xc k 1+( ) Acxc k( ) Bcy k( )+=

u k( ) Ccxc k( )–=

As

As

As1

0 … 0

0 As2

… 0

0 0 … Asp

=...

......

...

Asi

Asi

xs Asxs Bdw+=

ypr

Cpr

xs Dwpr

w+=

T s( ) Cpr

sI As–( ) 1–Bd Dw

pr+=

Page 10: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

6

Chapter 2

The closed-loop system is more complicated. Byusing equations (5) and (6), the closed-loop dynamics ofthe controlled spacecraft can be written as

(10)

wherex represents the closed-loop state vector defined as

(11)

The matrices , , and are the closed-loop statematrix, disturbance influence matrix, and output influ-ence matrix, respectively. These matrices are defined asfollows:

(12)

The closed-loop transfer function from the disturbancesw to the performance outputypr is given by thefollowing:

(13)

Chapter 10 contains the efficient methods used byPLATSIM to calculate the transfer functions inequations (9) and (13).

Jitter and Stability Measurement

One measure of pointing jitter in a time series hasbeen described in an internal report by Martin Marietta as

x Ax Bdw+=

ypr

Cpr

x Dwpr

w+=

xxs

xc

=

A B Cpr

AAs Bs– Cc

BcC Ac

=

BdBd

0=

Cpr

Cpr

Dupr

Cc–=

T s( ) Cpr

sI A–( )1–Bd Dw

pr+=

the worst case peak-to-peak variation of the actual point-ing direction over relatively short time intervals; pointingstability has the same definition except that the timeintervals are relatively long. This measure of jitter (orstability) is the one calculated by PLATSIM. These timeintervals are referred to here as “windows.”

Recall thatypr(j) is the value at time stepj of vectorypr of the performance outputs. A generic component ofthis vector is denoted byz such thatz(j) denotes the(scalar) value of a typical performance output at timestepj. Suppose that the vectorz has lengthn and that thewindow (time interval) that is slid alongz during themeasurement of jitter is of such a length as to coverkpoints ofz. (If the length of the window isTw and thetime increment between points ofz is ∆T, thenk is thelargest integer such that .) Now definezmax andzmin as follows:

Then jitter is given by

The straightforward way to calculate jitter has com-putational complexity as measured bythe number of references into thez vector. A novel algo-rithm with computational complexityO(n) is imple-mented in PLATSIM1 to perform this calculation. If jitteror stability is to be calculated for the same time signal forseveral windows, additional time savings is realized byusing the information inzmax andzmin for a smaller win-dow to calculatezmax andzmin for a larger window. Thiscalculation also hasO(n) complexity but with a smallerO constant than the jitter calculation for the smallestwindow.

1A paper by Daniel P. Giesy describing this, titled “Efficient Cal-culation of Jitter,” has been submitted for publication.

k 1–( ) ∆T Tw≤

zmax j( ) max z i( ) j i j k 1–+≤ ≤[ ]=

zmin j( ) min z i( ) j i j k 1–+≤ ≤[ ]=

Jitter max zmax j( ) zmin j( )– 1 j n k– 1+≤ ≤[ ]=

O k n k– 1+( )[ ]

Page 11: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

7

Chapter 3

Input Files

To construct the data needed to use the theory ofchapter 2, PLATSIM requires the following information:

1. Information to calculate the first-order dynamicplant equation matrices in equation (5)

2. Matrices for the space platform control system inequation (6)

3. Sampling period to calculate the matrices in thediscrete forms of equations (7) and (8)

4. Disturbance time histories (thew of eq. (7))

5. Windows for jitter-stability analysis

6. Character information to label outputs and menubuttons

PLATSIM obtains this information from input filesthat define the modal model of the spacecraft, the space-craft damping schedule for its elastic modes, the instru-ment types and connectivity data, the spacecraftdisturbances, and the spacecraft control system.

The finite element modal data are read from twoMATLAB readable data files, one for frequencies andone for mode shapes. These data files can be either inASCII format or MATLAB binary MAT-file format.PLATSIM checks to see whether the MATLAB binaryfile is present. If it is, PLATSIM loads it. Otherwise, theASCII file is loaded.

The remaining input data are transmitted toPLATSIM by the execution of user-supplied MATLABfunction M-files. In these files, the user can load the dataneeded by PLATSIM from data files, set the output vari-ables to values hardcoded into the M-file, or performmore extensive internal calculations to determine thedata. Examples of the latter two approaches are includedin the EOS example files distributed with the PLATSIMsoftware. The user must conform exactly to the specifica-tions for input and output parameters for these files.Theremainder of this chapter is devoted to presenting thedetails of these input files.

Finite Element Data

The finite element modal frequency and mode shapedata are provided in ASCII filesomega.dat andphi.dat or MATLAB binary files omega.mat and

phi.mat , respectively. While the ASCII files are moreconvenient for moving the data from a finite elementmodeling program to PLATSIM, using the binaryMAT-files to reduce the loading time for these files ismore efficient, particularly for the mode shape data. Theuser may want to keep both and regenerate theMAT-files from the ASCII files only when the ASCIIfiles change. The data in both ASCII files are assumed tohave a free format. Note that both these files should beplaced in MATLAB’s directory path. They are accessedby loading them into the MATLAB environment in a filenamedformplnt.m .

The file omega.dat contains one frequency perline as follows:

wherep is the number of modes in the spacecraft model.If p frequencies are defined inomega.dat , modalamplitudes on exactlyp modes should be defined inphi.dat and theith mode inphi.dat should corre-spond to frequencyωi.

The file omega.mat should contain a variableomega, which is ap × 1 vector containing the frequen-cies fromomega.dat , as described previously. Such avariable can be generated in MATLAB from theomega.dat file by the command:

>> load omega.dat

The omega.mat file can then be generated by theMATLAB command:

>> save omega omega

Uses to denote the number of grid points at whichmode shape data is to be given in filephi.dat andlabel these grid points with grid numbersN1, N2, ...,Ns.Thenphi.dat has(p × s) lines in the format shown in

figure 1, where , , and are the modal translations

in X, Y, andZ, and , , and are rotations aboutX,

ω1

ω2

ωp

...

Xji Yj

i Zji

θji φj

i ψji

Page 12: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

8

Chapter 3

Y, andZ for modei at grid pointNj. Note that grid pointsthat are not needed to model instruments, the control sys-tem, or disturbances do not need to be included in filephi.dat . However, if they are included, care must betaken to ensure that each mode block contains data forexactly the same grid points.

The file phi.mat should contain a variablephi ,which is a (p × s) × 7 matrix containing the grid numbersand mode shape data fromphi.dat , as described previ-ously. This variable can be generated in MATLAB fromthe filephi.mat by the command

>> load phi.dat

The file phi.mat can then be generated by theMATLAB command

>> save phi phi

Modal Damping Schedule

PLATSIM determines the damping ratios of the flex-ible spacecraft modes by a calling the user-suppliedMATLAB function mkdamp in file mkdamp.m. Thefirst line ofmkdamp.m has the following form:

function [d]=mkdamp(omega)

The inputomega is a vector containing the modalfrequenciesω1, ω2, ...,ωp. The user must set the out-putd to a vector containing the corresponding dampingratios. Appendix B contains a sample filemkdamp.m forthe EOS-AM-1 mission. This file defines a damping ratioof 0.2 percent for structural modes with frequenciesunder 15 Hz, a damping ratio of 0.25 percent for struc-tural modes with frequencies between 15 Hz and 50 Hz,and damping ratio of 0.3 percent for structural modes

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Figure 1. Format ofphi.dat .

N1 X11

Y11

Z11 θ1

1 φ11 ψ1

1

N2 X21

Y21

Z21 θ2

1 φ21 ψ2

1

Ns Xs1

Ys1

Zs1 θs

1 φs1 ψs

1

...

N1 X12

Y12

Z12 θ1

2 φ12 ψ1

2

N2 X22

Y22

Z22 θ2

2 φ22 ψ2

2

Ns Xs2

Ys2

Zs2 θs

2 φs2 ψs

2

...

...

...

...

...

N1 X1p

Y1p

Z1p θ1

p φ1p ψ1

p

N2 X2p

Y2p

Z2p θ2

p φ2p ψ2

p

Ns Xsp

Ysp

Zsp θs

p φsp ψs

p

...

Page 13: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

9

Input Files

with frequencies over 50 Hz. The user runningPLATSIM in its graphical user interface (GUI) mode canuse Modify Damping under the Options menu to changethe damping schedule. (See chapter 6.)

Effector and Sensor Data

The term effectors in a system modeled byPLATSIM refers to the control system actuators and thedisturbances denoted byu and w, respectively, inequation (5). The termsensors refers to the measurementand performance outputs, denoted byy andypr, respec-tively. A commonalty exists in the structure of the dataneeded by PLATSIM to calculate the input influencematricesBs and Bd and the output influence and feed-forward matrices , , , , , and ,which operate on the states and effectors to calculatetheir influence on the sensors.

Common Data Structure

The simplest effector or sensor to model is located ata grid point of the structure and either produces or mea-sures linear motion parallel to an axis or rotationalmotion about an axis. This information is transmitted bypassing PLATSIM the grid number (which must appearin file phi.mat or phi.dat ) and a direction numberwhose value is an integer between 1 and 6. Directionnumber 1 represents a force that is parallel to theX-axisfor an effector, or it represents a linear displacement thatis parallel to theX-axis for a sensor. Direction numbers 2and 3 serve the same purpose for theY- and Z-axes,respectively. Direction number 4 represents torque aboutthe X-axis for an effector or angular displacement abouttheX-axis for a sensor. Direction numbers 5 and 6 servethe same purpose for theY- andZ-axes, respectively. Asensor can measure linear or angular displacements or itcan measure the rate or acceleration of this displacement.Thus, its type is specified to PLATSIM in an additionaltype number that has the value 0 for displacement, thevalue 1 for rate, or the value 2 for acceleration. In addi-tion, each effector and sensor is assigned an identifica-tion number, which should be a positive integer. Thisnumber also tells PLATSIM the order of effectors andsensors in vectors. PLATSIM arranges the effectors andsensors so that their identification numbers are inincreasing order. Thus, the user must define identifica-tion numbers such that the order of entries in the controlinput vectoru and the measurement outputs vectory con-nects properly with the control system model. The identi-fication number is also used to form variable names forMATLAB variables in some output files and to form filenames on some computer systems. A weighting factor isalso included in the common data structure. One use of

Cp Cy Cppr Cy

prDu

pr Dwpr

this weighting factor is for conversion of units. Forexample, if a performance output is a pointing error thatis being calculated in radians and the user wants theresults to be in arc-seconds, then a weighting factor of3600× 180/π would accomplish this conversion.

The weighting factor can also be used to modeleffectors and sensors that might be located off any gridpoint or oriented in a nonaxial direction. Before explain-ing this use of the weighting factor, this documentexplains how the data are passed to PLATSIM.

The grid number, direction number, identificationnumber, and weighting factor (and type number for sen-sors) are stacked in a column vector. The necessary num-ber of column vectors are assembled into a matrix, whichis then passed to PLATSIM. A single effector or sensorcan be modeled by information in more than one of thesecolumns. The user simply uses the same identificationnumber in all columns that refer to a single effector orsensor. Each single effector or sensor described by thegrid number and the direction number of each column(and the type number for sensors) is multiplied by itsweighting factor, and all these weighted columns withthe shared identification number are combined into a sin-gle effector or sensor in the PLATSIM model of theplant.

For example, suppose that anX-axis thruster islocated halfway between grid points 1211 and 1212. Thislocation is identified by including two columns in theact matrix (see section entitled “Instrument Data”) asfollows:

The duplicate use of identification number 550 indi-cates that one actuator is being described by these twocolumns. The weighting factor 0.5 and the directionnumber 1 mean that half the force of actuator 550 will beapplied in theX-direction at each of grid points 1211and 1212. This arrangement gives the effect of placingthe actuator half way between these grid points.

For another example, suppose that the user wants toassess the linear acceleration performance at grid point277 in a direction lying in the first quadrant of the localY-Z plane 30° from the positiveY-axis. This arrangementis identified to PLATSIM by including two columns in

1211 1212

1 1

550 550

0.5 0.5

Page 14: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

10

Chapter 3

thepout matrix (see section entitled “Instrument Data”)as follows:

The two columns are again linked by using the sameidentification number in row 3. Row 1 shows that bothcolumns deal with grid point 277. Row 2 shows thattranslational information in theY- and Z-directions isbeing combined. The weighting factors in row 4 are thedirection cosines for the desired direction. Row 5 isadded to the sensor data and, in this example, indicatesthat acceleration information is desired.

These two applications of the weighting factor canbe combined by multiplying the weighting factors fromeach individual use. For example, suppose grid points515 and 516 are 10 in. apart and a roll attitude sensor ismodeled, which has the identification number 300 and islocated between these grid points 3 in. from gridpoint 515. Furthermore, the output is to be convertedfrom radians to arc-seconds. This conversion is accom-plished by including two columns in thepout matrix asfollows:

The fourth row of weighting factors is found by mul-tiplying the vector (0.7, 0.3), which is used to weight theroll attitude from grid points 515 and 516 by the unitconversion factor 3600× 180/π.

Instrument Data

This section explains how to input data intoPLATSIM to define the instruments on the space plat-form, to provide names for the performance outputs, andto specify the jitter-stability windows to be used in theanalysis. These instruments are the actuators, measure-ment output sensors, and performance outputs, corre-sponding to variablesu, y, and ypr, respectively, ofequation (5). The data should be provided through a user-supplied MATLAB functioninstdata in a file namedinstdata.m . The first line of instdata.m musthave the following form:

277 277

2 3

4 4

0.866 0.500

2 2

515 516

4 4

300 300

1.4439 105× 0.6188 10

5×0 0

function [act,mout,pout,instr,... window]=instdata

The following is a description of the user-definedoutput parameters in fileinstdata . (See appendix Bfor a sample fileinstdata.m for the EOS-AM-1spacecraft.)

1. Parameteract is a matrix with four rows and asmany columns as necessary to represent the actua-tors (vectoru of eq. (5)) in the format given in thesection entitled “Common Data Structure.”

2. Parametermout is a matrix with five rows and asmany columns as necessary to represent the mea-surement outputs (vectoru of eq. (5)) in the formatgiven in the section entitled “Common Data Struc-ture.” PLATSIM is only programmed to handle dis-placement and rate sensors as input to the controlsystem; thus, entries in row five, the type numbers,are limited to 0’s and 1’s. However, accelerationfeedback to the control system can be implementedby the addition of a judiciously selected prefilteringof a velocity signal (e.g., a differentiator followedby a roll-off filter of relative degree of at least twoto eliminate feedforward and fit into the format ofeq. (6)).

3. Parameterpout is a matrix with five rows and asmany columns as necessary to represent the perfor-mance outputs (vectorypr of eq. (5)) in the formatgiven in the section entitled “Common Data Struc-ture.” When PLATSIM is run, the user is given anopportunity to select a subset of the performancemeasurements presented in the matrixpout . Thus,when writing the user-supplied MATLAB functioninstdata , the user can include any performancesensor that may be desired in any analysis. Thisinclusion should reduce the need to edit this filewhen changing analytical focus.WARNING:PLATSIM does not permit the user to mix theacceleration type with displacement and rate typesin a single (multicolumn) performance outputinstrument.

4. Parameterinstr is a matrix of character stringsthat provides names for the performance outputs.The number of rows ininstr must equal thenumber of performance outputs, that is, the numberof distinct entries in the third row ofpout . Eachelement ofinstr is a string consisting of three orfour fields separated from each other by the verticalbar (|) character. The first field is an integer thatmust correspond to one of the performance outputidentification numbers defined in the third row ofpout . Furthermore, every identification number inthat row must be referenced ininstr . The second

Page 15: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

11

Input Files

field contains one or more alphanumeric words thatprovide a unique name for the corresponding per-formance output. These names are used inPLATSIM on menu labels and in output tables andgraphs. These names are also used as parts of filenames after imbedded blanks have been replacedby underscores. For this naming convention, theuser should be aware of the following:

• No special characters (except blanks which arereplaced by underscores) should be used whichwould confuse the operating system when usedin a file name.

• When determining whether character strings aredistinct, embedded blanks should be consideredto be the same as underscores (e.g., SWIR rolland SWIR_roll should be considered to be thesame).

• When determining whether character strings aredistinct, the case sensitivity of the operating sys-tem should be considered (e.g., swir_roll andSWIR_roll can be considered distinct underUNIX, but should be considered the same underDOS).

The third field is used to name the menu optionunder which this instrument is found in menumode. By using the same name in the third field ofseveral entries, the names are grouped in a sub-menu under the same menu heading. For example,if three instruments are named VNIR roll, VNIRpitch, and VNIR yaw in their respective secondfields of their instr entries, then by puttingVNIR in the third field of all three, all three arefound as submenu items under the menu optionVNIR. If the optional fourth field is present,PLATSIM adds it to the second field in labeling theY-axis of time history plots. This field can be used,for example, to give the units of the output.

5. Parameterwindow is a row vector defining thewindow sizes (in the same time units, usually sec-onds, used for parameterperiod in functiondistdata , which is described in the next section)for the jitter analysis.

Disturbance Data

The PLATSIM package was developed with theassumption that spacecraft simulations and analyseswould be performed for a variety of different disturbancescenarios, and users would maintain their own distur-bance database. Easy interactive access to the distur-bance database is provided in PLATSIM through agraphical user interface (GUI). The operation and capa-

bilities of the disturbance GUI are described in the “Dis-turbance” section in chapter 6.

The PLATSIM disturbance data are communicatedto the main package through a user-supplied MATLABfunction distdata in file distdata.m . This user-supplied data file is used to provide a complete descrip-tion of all spacecraft disturbance scenarios, which canconsist of several disturbance events. A disturbanceevent is a force or torque time history acting on the plat-form. This event is modeled in PLATSIM by a pure forceor torque effector (see section entitled “Common DataStructure”) and a discretized force or torque time historystored as a column vector, which is to be applied to theplatform through this effector.

The actual structure of the user disturbance data isdescribed in the remainder of this section. The firstline(s) of file distdata.m must have the followingform:

function [dist,w,period,cnames,... dnames instdat,mapping]... =distdata(casenum)

The data the user returns in the first three parameters(dist , w, andperiod ) depends oncasenum , and thedata returned in the last four parameters (cnames ,dnames, instdat , andmapping ) must be the sameindependent of the value ofcasenum . The data returnedin dist , w, andperiod model the one or more distur-bance events of the disturbance scenario identified bycasenum .

The input fordistdata.m is as follows:

• casenum : If PLATSIM calls distdata withcasenum = 0 , then the user need only return thelast four parameters (cnames , dnames, instdat ,andmapping ). If casenum is input as a positiveinteger between the values of 1 and the number ofrows in character matrixdnames, then all sevenparameters should be returned with the values in thefirst three corresponding to the disturbance scenariowhose name is in rowcasenum of dnames. Allother values ofcasenum are invalid.

The output fordistdata.m is as follows:

• dist : A matrix of four rows and as many columnsas necessary to describe one disturbance effector(see section entitled “Common Data Structure”) foreach column of the matrixw.

• w: A matrix of force and/or torque disturbance timehistory profiles. The number of rows inw is the num-ber of time steps, and the number of columns inw isthe number of disturbance events. During simula-tion, the time history in the first column ofw is

Page 16: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

12

Chapter 3

applied to the disturbance effector indist with thesmallest identification number, the second column ofw to the disturbance with the second smallest identi-fication number, and so on.

• period : A scalar time step value used to define thedisturbance profile and also used as the sampleperiod for time discretization of the space platformcontrol system and plant matrices. The same discret-ization period is used for all the events in a singledisturbance scenario. The parameterperiod shouldbe returned in the same time units, usually seconds,as the parameterwindow returned by the functioninstdata described previously.

• cnames : A string matrix that contains the menuheading labels for the disturbance GUI. The distur-bance GUI creates a pull-down menu option for eachrow in cnames . The entries incnames are used formenu labeling only and do not appear in outputdocumentation.

• dnames: A string matrix of disturbance scenariocase names. The rows indnames are used for label-ing pull-down menu items in the disturbance GUI,for labeling plot figures, for constructing file namesfor the PostScript and ASCII jitter table output files,and for constructing file names for the frequencydomain analysis output files containing transferfunction and Bode plot data. When a disturbancescenario is selected, PLATSIM callsdistdatawith casenum set equal to a number that correctlycorresponds to a row in the matrixdnames. The filedistdata.m must return the disturbance case thatcorresponds to the disturbance scenario defined bycasenum . Individual disturbance scenarios can be“commented out” by editingdistdata.m to returnthe corresponding row ofdnames with an asterisk(*) as the first character. The scenario still appears onthe disturbance GUI menu, but in a distinctive graytype, and it is not selectable. However, PLATSIMdoes not guard against the selection of a “com-mented out” disturbance scenario in batch mode orin command mode when the text version of the dis-turbance selection menu is being used. (This alter-nate menu is used when the UNIX environment vari-able DISPLAY is determined by the MATLABfunctiongetenv to be undefined.)

• instdat : The variablesinstdat andmappingtogether define whichdnames row entries appearunder a GUI pull-down menu for a particularcnames disturbance. The vectorinstdat can beany length and its entries can be in any numericalorder. The only limitation oninstdat entries isthat they must be validdnames matrix row num-

bers. Remember that the entries ininstdat corre-spond to row numbers in thednames string matrix.

• mapping : The vectormapping , which must con-tain nonnegative integers, defines the partitioning ofthe instdat vector required to map the entries indnames to the disturbance GUI labels created fromcnames . The number of entries in themappingvariable must equal the number of rows incnames .Also, the sum of all entries inmapping must equalthe number of elements ininstdat . For example,if instdat has 30 elements then, the MATLABcommandsum(mapping) must also equal 30.

As an example to illustrate the use of the parameterscnames , dnames, instdat , andmapping , supposethe file distdata.m contains the followingcommands:

cnames = str2mat(’Calibration’,’Tracking’);

dnames = str2mat(’Solar Array’,...’Telescope calib’,’Antenna calib’);

dnames = str2mat(dnames,...’Telescope track’, ’Antenna track’,...’Antenna sweep’);

instdat=[1 2 3 1 4 5 6];

mapping=[3 4];

This disturbance database contains six disturbanceswhose names are given in the six lines of thednamesmatrix. When PLATSIM is run in GUI or command linemode, two options on the disturbance menu are labeledCalibration and Tracking. The Calibration submenu hasthree items (mapping(1) = 3 ), which are from thefirst three rows of thednames matrix (the first threeentries ofinstdat are[1 2 3] ). The Tracking sub-menu has four items (mapping(2) = 4 ), which aretaken from rows 1, 4, 5, and 6 ofdnames (the next fourentries ofinstdat are [1 4 5 6] ). Note that thesame disturbance scenario (solar array in this example)can be included in more than one category. TheMATLAB function str2mat can be used to build thesecharacter arrays.

An example of a typical disturbance data structurematrix that is returned with proper execution of adistdata.m disturbance file is given as follows. Theexample is a disturbance scenario that consists of twodistinct disturbance events. The first disturbance event isa roll torque (coordinate direction 4) that is equally dis-tributed across two FEM grid points. The second distur-bance event is a yaw torque (coordinate direction 6) thatis applied at a single grid point.

Page 17: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

13

Input Files

Note that the number of distinct elements in the thirdrow of dist , corresponding to the disturbance numbers,and the column dimension of the disturbancew must bethe same. In the previous example,w must have twoequal length columns. Furthermore, the mappingbetween the disturbance numbers and the columns ofw isbased upon the sorted order (from lowest to highest) ofthe disturbance numbers. That is, the first disturbancew(:,1) is applied at the finite element grid point corre-sponding to the smallest disturbance number. In the pre-vious example,w(:,1) corresponds to disturbance 100,and w(:,2) corresponds to disturbance 150. ThePLATSIM package is not capable of detecting whetheror not the user complies with this sorted-order mappingconvention.

The input variablecasenum to the user-providedfile distdata.m is used to select a particular distur-bance scenario from the user-provided database. Thevalue of casenum should correspond to a valid rownumber in thednames string matrix. For all nonbatchmode operations, the value ofcasenum is set by the dis-turbance module’s GUI. In batch mode, the value ofcasenum is set in the batch mode input file. The valuecasenum=0 is reserved for internal use.

Space Platform Control System

The space platform control system is provided by acall to MATLAB function formscs in a user-suppliedfile formscs.m . This routine assumes that the space-craft control system of the platform is represented by lin-ear time-invariant dynamics. Note that routineformscscan be used to model the attitude control system as wellas any additional control system that augments the atti-

dist

329526 329527 329526

4 4 6

100 100 150

0.5 0.5 1

=

tude control system for enhanced performance, for exam-ple, flexible body control, local payload isolation, ordisturbance rejection. The first line of fileformscs.mmust have the following form:

function [ascs,bscs,cscs]=formscs

where the output parametersascs , bscs , and cscsdenote the state matrix, the input influence matrix, andthe output influence matrix of the space platform controlsystem, respectively. For time domain analysis, thesematrices are subsequently discretized by the MATLABroutinec2d by using a sampling period equal to the inte-gration step size, which PLATSIM gets from parameterperiod of user-supplied filedistdata.m .

Currently, the contents of fileformscs.m inappendix B correspond to the attitude control system ofthe EOS-AM-1 spacecraft, with the exception that reac-tion wheel dynamics or output quantization are notincluded. The user must replace or modify the contentsof formscs.m to model control systems for platformsother than EOS-AM-1. However, the user has to ensurethat the calling sequence in the revisedformscs.mremains the same; that is, the order and number of theoutput variables remain unchanged. The followingassumptions are made informscs :

1. PLATSIM assumes that the space platform controlsystem is implemented with a negative feedbackconnection. (See eq. (6).) The number of spaceplatform control system inputs are assumed toequal the number of measurement outputs of theplant. Moreover, a straight connection existsbetween the measurement outputs of the plant andthe inputs of the space platform control system.

2. The number of space platform control system out-puts are assumed to equal the number of controlinputs to the plant. Moreover, a straight connectionexists between the outputs of the space platformcontrol system and the inputs of the plant.

Page 18: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible
Page 19: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

15

Chapter 4

PLATSIM Output

PLATSIM returns its results to its users in two gen-eral manners—interactive and permanent. Interactiveoutput includes MATLAB workspace variables that areset to the results of PLATSIM calculations and plots andtables displayed in MATLAB figure windows. Perma-nent output consists of a variety of files. The most usefulof the PLATSIM workspace variables can be captured inMATLAB MAT-files. Plots can be output as encapsu-lated PostScript files. Tables of jitter values are output asboth ASCII and PostScript files. In the following sec-tions, general file naming conventions are given first andthe modifications necessary for PC file-naming conven-tions are given at the end of each section.

Time Domain Analysis

Full Time Histories

When PLATSIM is performing time domain analy-sis, it first calculates the time histories of the selectedperformance outputs in response to the selected distur-bance scenario. The user has two choices. Either a sepa-rate simulation is performed for each individualdisturbance event in the scenario (this is the default), or asimulation is performed showing the response when allevents of the disturbance scenario are applied simulta-neously. These simulations have the potential to producea large amount of data. The results of each simulation arecontained in a variabley, which contains one column foreach performance measurement output and one row foreach row in the user-supplied disturbance time historiesused to drive the simulation.

When the PLATSIM script has finished the timedomain analysis, if multiple simulations have been per-formed, only the most recent one (corresponding to thedisturbance event with the highest identification number)remains in the variabley. The others have been over-written to prevent excessive use of computer memory. Ifthe user needs these full time histories, the user can electto have them written to MAT-files. Filey1.mat con-tains the time history for the first disturbance event(which is the default case) or it contains the time historyfor all events simultaneously (if that choice is made). Ifmore than one disturbance event is used and they arebeing run individually, the additional time histories are infiles y2.mat , y3.mat ,..., up to as many as are needed.

Each file contains the time history in variabley as previ-ously stated, a scalar variable period that contains thetime increment between discrete points of the simulation,and a character arrayinstr whose rows contain thenames of the performance outputs that are being simu-lated. Once again, the user is cautioned to be carefulabout requesting these files because depending on thenumbers of performance outputs, time steps of simula-tion, and disturbance events, they can be large andrequire significant disk space.

Time History Plots

The user can elect to have the time histories plottedon screen and also elect to write EPS files of the on-screen plots (this is the default). If the latter is chosen,then a reduced form of the data is plotted. Although somesimulations have involved a hundred thousand or even amillion time steps, the reduced data typically involvesvectors of length less than ten thousand. The reduction isperformed in such a manner (see chapter 15) that thevisual effect of plotting the reduced data is virtually iden-tical to that of plotting the full time history. Thus, theresults are faster on-screen plotting, faster writing of EPSfiles, smaller PostScript files, and faster printing of thesefiles by a PostScript printer. (The time required for aprinter to process the PostScript file has been seen todecrease from more than 30 min when printing a plotmade from a full time history of 100000 points to lessthan 2 min to print a plot made from the reduced data.)

If each disturbance event is simulated individually,then one time history is generated for each combinationof performance measurement output and disturbanceevent. If the disturbance events are run simultaneously,then one time history exists per performance measure-ment output. The reduced data from a typical time his-tory are contained in a MATLAB variable with a namesuch asp342_1 . The number 342 is a performance out-put identification number, taken from the third row of theuser-supplied matrixpout . (See chapter 3.) The num-ber 1 indicates that this is the response to the first eventin the chosen disturbance scenario when the disturbanceevents are run separately, or it indicates that this is theresponse when the disturbance events are run simulta-neously. If more than one event occurs in the disturbancescenario and if they are run separately, then the reduced

Page 20: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

16

Chapter 4

response to the second event has a number 2 after theunderscore, and so on. The variablep342_1 (or likevariables) is a two-column matrix, with the number ofrows being somewhere between 2 and 4 times the valueof execution time parameternplpts . (See chapter 15and appendix C.) The plots are made by plotting the sec-ond column of this variable as a function of the firstcolumn.

All these variables are saved in a MATLABMAT-file with a name such asMODIS_static_imbalance_1_time.mat . The MODIS_static_imbalance part of the name comes from replacing anyblanks with underscore characters in the name for thedisturbance used in this simulation. This name was givenin the array dnames returned by user-suppliedMATLAB function distdata . The number1 is used ifthis data comes from the first disturbance event in thedisturbance scenario when events are being run sepa-rately and is also used if the events are run simulta-neously. If the events are being run separately, thesecond event would have a number2. The time in thename distinguishes this file from a similarly named filefrom the frequency analysis part of PLATSIM.

If the user chooses the option Plot with Hardcopy,PLATSIM writes EPS files of the plots, which the usercan send to the printer. These files have names such asMODIS_Yaw_1_time.eps . TheMODIS_Yaw part ofthe name comes from replacing any blanks with under-score characters in the name for the performance outputused in this simulation that was given in the second fieldof the appropriate entry of the arrayinstr returned byuser-supplied MATLAB functioninstdata . The num-ber 1 andtime follow the same conventions describedin the previous paragraph.

Jitter

If the calculation of jitter is elected (this is thedefault), then the results of the jitter calculation are avail-able to the user in several forms. If disturbance events arerun separately, then the results of the jitter calculation forthe first event are contained in the MATLAB variableJITTER1 , those for the second event (if any) are inJITTER2 , etc. Each of these variables is a matrix withone column for each jitter window and one row for eachperformance output. (The order of the rows is determinedby the numerical order of the identification numbers ofthe performance outputs.) In addition, the total jitter vari-able,JITTER , is just the sum of the individual jitter cal-culations. If the disturbance events are run simul-

taneously, the results are contained in the variablesJITTER1 andJITTER , which in this case are identical.

The variableJITTER1 is preserved in the same fileas the variables containing the reduced time histories forfirst event (or combined events). If the user chooses notto plot the time histories but wants the jitter values, thevariableJITTER1 is the only thing in this file. Continu-ing the example started in the section on time historyplots, JITTER1 would be in file MODIS_static_imbalance_1_time.mat . If a second disturbanceevent was being used,JITTER2 would be in fileMODIS_static_imbalance_2_time.mat . In ad-dition, a file namedMODIS_static_imbalance_time.mat would be written containing onlyJITTER .

The table of jitter values is displayed on the screen.If the events are run separately, a table is presented foreach event and another for the jitter totals. The worstvalue in each column is displayed in a contrasting colorfor emphasis. These tables are also written in both Post-Script and ASCII files. The PostScript format tries toemulate what is shown on the screen; however, iftoo many performance measurement outputs exists, thePostScript file prints two or more pages. The ASCIIformat is more suitable for importing into a document.If disturbance events are run separately, the Post-Script files for the individual disturbance event jitterresults are saved in files with names suchas MODIS_static_imbalance_1_jitr.ps ,MODIS_static_imbalance_2_jitr.ps . Thetable with the overall totals is saved inMODIS_static_imbalance_jitr.ps . For theASCII files, the names are the same except they havethe extensionout instead ofps . If the simulation isfor a single event in the disturbance scenario or thedisturbance events are run simultaneously, then only onejitter result occurs. This result is written to the fileswith names without event numbers. From the previousexample, these names would beMODIS_static_imbalance_jitr.ps and MODIS_static_imbalance_jitr.out .

Example

As an example, suppose that PLATSIM is run withthe default values of all execution time parameters andthe example data distributed with the PLATSIM soft-ware, which is based on the EOS-AM-1 spacecraft. Sup-pose further that the disturbance scenario selected isMODIS static imbalance. Then the following files aregenerated by PLATSIM:

Page 21: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

17

PLATSIM Output

The reduced time histories for the EOS-AM-1 instru-ments, namely, CERES1, CERES2, MISR, MODIS,MOPITT, NAVBASE, SWIR, TIR, and VNIR, are pro-vided in the corresponding EPS files for roll, pitch, andyaw axes with the extension.eps . For example, the fileCERES1_Roll_1_time.eps contains the rollresponse of the CERES1 instrument due to the firstMODIS static imbalance disturbance element (vector),and VNIR_Yaw_2_time.eps contains the yawresponse of the VNIR instrument due to the secondMODIS static imbalance disturbance element (vector).

A typical time history output in fileMISR_Roll_2_time.eps is shown in figure 2. This time historywas generated with the 703-mode model of theEOS-AM-1 spacecraft being distributed with thePLATSIM software.

The files MODIS_static_imbalance_1_time.mat and MODIS_static_imbalance_2_time.mat are MATLAB binary files that include the

reduced time history data for all EOS-AM-1 instrumentsand the corresponding jitter values (in variables JITTER1and JITTER2) for the first and the second MODIS staticimbalance disturbance elements (vectors), respectively.File MODIS_static_imbalance_time.mat is aMATLAB binary file that has the overall jitter values(in variable JITTER). The filesMODIS_static_imbalance_1_jitr.out and MODIS_static_imbalance_2_jitr.out are ASCII files that con-tain the jitter values, in a tabular form, for the first andthe second MODIS static imbalance disturbance ele-ments (vectors), respectively. The fileMODIS_static_imbalance_jitr.out is an ASCII filecontaining the total jitter values in a tabular form. Thesevalues are obtained through the direct summation of jittervalues in files MODIS_static_imbalance_1_time.mat and MODIS_static_imbalance_2_time.mat . The following is an example of the jitterdata written to fileMODIS_static_imbalance_1_jitr.out :

MODIS_static_imbalance_1_time.mat MODIS_static_imbalance_2_time.mat

MODIS_static_imbalance_time.mat

CERES1_Pitch_1_time.eps CERES1_Pitch_2_time.eps CERES1_Roll_1_time.eps

CERES1_Roll_2_time.eps CERES1_Yaw_1_time.eps CERES1_Yaw_2_time.eps

CERES2_Pitch_1_time.eps CERES2_Pitch_2_time.eps CERES2_Roll_1_time.eps

CERES2_Roll_2_time.eps CERES2_Yaw_1_time.eps CERES2_Yaw_2_time.eps

MISR_Pitch_1_time.eps MISR_Pitch_2_time.eps MISR_Roll_1_time.eps

MISR_Roll_2_time.eps MISR_Yaw_1_time.eps MISR_Yaw_2_time.eps

MODIS_Pitch_1_time.eps MODIS_Pitch_2_time.eps MODIS_Roll_1_time.eps

MODIS_Roll_2_time.eps MODIS_Yaw_1_time.eps MODIS_Yaw_2_time.eps

MOPITT_Pitch_1_time.eps MOPITT_Pitch_2_time.eps MOPITT_Roll_1_time.eps

MOPITT_Roll_2_time.eps MOPITT_Yaw_1_time.eps MOPITT_Yaw_2_time.eps

NAVBASE_Pitch_1_time.eps NAVBASE_Pitch_2_time.eps NAVBASE_Roll_1_time.eps

NAVBASE_Roll_2_time.eps NAVBASE_Yaw_1_time.eps NAVBASE_Yaw_2_time.eps

SWIR_Pitch_1_time.eps SWIR_Pitch_2_time.eps SWIR_Roll_1_time.eps

SWIR_Roll_2_time.eps SWIR_Yaw_1_time.eps SWIR_Yaw_2_time.eps

TIR_Pitch_1_time.eps TIR_Pitch_2_time.eps TIR_Roll_1_time.eps

TIR_Roll_2_time.eps TIR_Yaw_1_time.eps TIR_Yaw_2_time.eps

VNIR_Pitch_1_time.eps VNIR_Pitch_2_time.eps VNIR_Roll_1_time.eps

VNIR_Roll_2_time.eps VNIR_Yaw_1_time.eps VNIR_Yaw_2_time.eps

MODIS_static_imbalance_1_jitr.out MODIS_static_imbalance_2_jitr.out

MODIS_static_imbalance_jitr.out

MODIS_static_imbalance_1_jitr.ps MODIS_static_imbalance_2_jitr.ps

MODIS_static_imbalance_jitr.ps

Page 22: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

18

Chapter 4

The MODIS_static_imbalance_1_jitr .ps ,MODIS_static_imbalance_2_jitr.ps , andMODIS_static_imbalance_jitr.ps files areequivalent to their.out counterpart files except thatthey are in a PostScript format.

File-Naming Conventions for PC’s

PC’s running under DOS (disk operating system)limit which character strings can be file names. Lettersare mapped to uppercase. The file name can have at mosteight characters, which are optionally followed by aperiod and an extension of one to three characters.PLATSIM knows it is running on a PC when the firsttwo characters of the character string returned by theMATLAB function computer are PC. If so, then theoutput files are given alternate names that conform to PCDOS restrictions.

The file that was namedMODIS_static_imbalance_1_time.mat is now namedJITTER1.MAT , and the file MODIS_static_imbalance_time.mat is now namedJITTER.MAT . In addition, MODIS_static_imbalance_1_jitr.out is now JITR_1.OUT

and MODIS_static_imbalance_jitr.out isJITR.OUT . The parallel .ps files are similarlyrenamed. TheCERES2_Yaw_1_time.eps file in theEOS-AM-1 example is now namedP9_2_T.EPS . Thenumber 9 comes from the identification number used forthe instrument namedCERES2 Yaw. Double-digit iden-tification numbers are also used completely as inP19_1_T.EPS for SWIR_Roll_1_time.eps , butonly the low-order two digits of larger identificationnumbers are used. Thus, the PC user must ensure thatinstruments are uniquely identified by the two low-orderdigits of their identification numbers.

Frequency Domain Analysis

Transfer Function Evaluation

When PLATSIM performs frequency domain analy-sis, it first calculates an open- or closed-loop transferfunction from disturbances to performance outputs,which can have multiple inputs or outputs. PLATSIMgenerates the column vectorw of frequencies from infor-mation contained in some execution control parameters.For transfer function inputs, the user first specifies a

Disturbance Source: MODIS static imbalance(1)

Window 1.00 1.80 9.00 55.00 420.00 480.00 1000.00

NAVBASE Roll 3.19 3.82 7.55 12.50 12.50 12.50 12.50NAVBASE Pitch 0.42 0.55 1.40 2.20 2.20 2.20 2.20NAVBASE Yaw 3.97 4.96 14.19 26.88 26.88 26.88 26.88CERES1 Roll 3.19 3.82 7.55 12.50 12.50 12.50 12.50CERES1 Pitch 0.42 0.55 1.40 2.20 2.20 2.20 2.20CERES1 Yaw 3.97 4.96 14.19 26.88 26.88 26.88 26.88CERES2 Roll 3.19 3.82 7.55 12.50 12.50 12.50 12.50CERES2 Pitch 0.42 0.55 1.40 2.20 2.20 2.20 2.20CERES2 Yaw 3.97 4.96 14.19 26.88 26.88 26.88 26.88MISR Roll 3.19 3.82 7.55 12.50 12.50 12.50 12.50MISR Pitch 0.42 0.55 1.40 2.20 2.20 2.20 2.20MISR Yaw 3.97 4.96 14.19 26.88 26.88 26.88 26.88MODIS Roll 3.19 3.82 7.55 12.50 12.50 12.50 12.50MODIS Pitch 0.42 0.55 1.40 2.20 2.20 2.20 2.20MODIS Yaw 3.97 4.96 14.19 26.88 26.88 26.88 26.88MOPITT Roll 3.19 3.82 7.55 12.50 12.50 12.50 12.50MOPITT Pitch 0.42 0.55 1.40 2.20 2.20 2.20 2.20MOPITT Yaw 3.97 4.96 14.19 26.88 26.88 26.88 26.88SWIR Roll 3.19 3.82 7.55 12.50 12.50 12.50 12.50SWIR Pitch 0.42 0.55 1.40 2.20 2.20 2.20 2.20SWIR Yaw 3.97 4.96 14.19 26.88 26.88 26.88 26.88TIR Roll 3.19 3.82 7.55 12.50 12.50 12.50 12.50TIR Pitch 0.42 0.55 1.40 2.20 2.20 2.20 2.20TIR Yaw 3.97 4.96 14.19 26.88 26.88 26.88 26.88VNIR Roll 3.19 3.82 7.55 12.50 12.50 12.50 12.50VNIR Pitch 0.42 0.55 1.40 2.20 2.20 2.20 2.20VNIR Yaw 3.97 4.96 14.19 26.88 26.88 26.88 26.88

RUN DATE: 29-Apr-94

Page 23: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

19

PLATSIM Output

disturbance scenario and PLATSIM uses all (the default)or a user-specified subset of the events of that scenario asinputs. The outputs are either all (the default) of the per-formance output instruments or a user-specified subset.

The natural object to contain the results of these cal-culations is a complex array with three indices (sub-scripts), one each for the inputs, outputs, and frequencyvalues. MATLAB handles the complex part naturally,but only accepts two indices. To overcome this limita-tion, some data manipulation is used. Suppose that therearei inputs andj outputs, and that the transfer functionis evaluated at the frequency inw(k) and placed in thetemporary MATLAB variablegt , which is then a com-plex matrix withj rows andi columns. PLATSIM thentransfers all information from the temporary matrixgtinto row k of the output variableg by a statement withthe form

g(k,:) = reshape(gt,1,j*i);

In other words, the columns ofgt are stacked into a sin-gle column vector and the transpose of that vector isplaced in the row ofg corresponding to the row ofwfrom which the frequency value came. Then the gain in

decibelsm and the phase in degreesp are calculated asfollows:

m=20*log10(g);

p=(180.0/pi)*angle(g);

The variablesw, g, m, andp are MATLAB work-space variables that are available to the user whenPLATSIM completes the frequency domain calculation.They are also written in MATLAB binary form to aMAT-file with a name such asMODIS_static_imbalance_freq.mat . The MODIS_static_imbalance part of the name comes from replacing anyblanks with underscore characters in the name for thedisturbance used in this analysis. This name was given inthe dnames array returned by the user-suppliedMATLAB function distdata . The variablesndistandinstr are also in this file. The variablendist is avector of integers that tells which events of the distur-bance scenario were used in the calculation as inputs.The variableinstr is a matrix of characters, each rowof which names a performance instrument that was usedas an output in the calculation.

Figure 2. Example of time-history plot.

0 100 200 300 400 500 600 700 800 900 1000-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

Time, Seconds

MIS

R R

oll,

arcs

ec

Time Response For Disturbance Sequence MODIS static imbalance(2); 29-Apr-94

Page 24: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

20

Chapter 4

Bode Plots

If plotting is requested, the Bode plots for theselected performance outputs in response to the selecteddisturbances are plotted on screen. If “plot with hard-copy” is selected, in addition to on-screen plotsPLATSIM writes EPS files of the plots. These files havenames such asMODIS_Yaw_1_freq.eps . TheMODIS_Yaw part of the name comes from replacing anyblanks with underscore characters in the name for theperformance output used in this analysis. This name wasdefined in the second field of the appropriate entry of theinstr array returned by the user-supplied MATLABfunction instdata . The number1 means that this wasthe response to the first event in the chosen disturbancescenario. Thefreq part of the name distinguishes theseplots from the time-history plots.

Example

As an example, suppose that PLATSIM is run withthe default values of all execution time parameters exceptthattdflag = ’no’ (which selects frequency domainanalysis) and also uses the example data distributed with

the PLATSIM software, which is based on theEOS-AM-1 spacecraft. Suppose further that the distur-bance scenario selected is MODIS static imbalance.Then the following files are generated by PLATSIM.

The Bode plots for the EOS-AM-1 instruments,namely, CERES1, CERES2, MISR, MODIS, MOPITT,NAVBASE, SWIR, TIR, and VNIR, are provided in EPSform in the corresponding files for roll, pitch, and yawaxes with the extension.eps . For example, the fileCERES1_Roll_1_freq.eps contains the Bode plotfor the roll response of the CERES1 instrument due tothe first MODIS static imbalance disturbance element(vector), andVNIR_Yaw_2_time.eps contains theBode plot for the yaw response of the VNIR instrumentdue to the second MODIS static imbalance disturbanceelement (vector). Figure 3 shows a sample Bode plot out-put. This Bode plot was generated with the 703 modemodel being distributed with the PLATSIM software.The fileMODIS_static_imbalance_freq.mat isa MATLAB binary file containing the results of the fre-quency domain calculation in the form indicated at thebeginning of this section.

MODIS_static_imbalance_freq.mat

CERES1_Pitch_1_freq.eps CERES1_Pitch_2_freq.eps CERES1_Roll_1_freq.eps

CERES1_Roll_2_freq.eps CERES1_Yaw_1_freq.eps CERES1_Yaw_2_freq.eps

CERES2_Pitch_1_freq.eps CERES2_Pitch_2_freq.eps CERES2_Roll_1_freq.eps

CERES2_Roll_2_freq.eps CERES2_Yaw_1_freq.eps CERES2_Yaw_2_freq.eps

MISR_Pitch_1_freq.eps MISR_Pitch_2_freq.eps MISR_Roll_1_freq.eps

MISR_Roll_2_freq.eps MISR_Yaw_1_freq.eps MISR_Yaw_2_freq.eps

MODIS_Pitch_1_freq.eps MODIS_Pitch_2_freq.eps MODIS_Roll_1_freq.eps

MODIS_Roll_2_freq.eps MODIS_Yaw_1_freq.eps MODIS_Yaw_2_freq.eps

MOPITT_Pitch_1_freq.eps MOPITT_Pitch_2_freq.eps MOPITT_Roll_1_freq.eps

MOPITT_Roll_2_freq.eps MOPITT_Yaw_1_freq.eps MOPITT_Yaw_2_freq.eps

NAVBASE_Pitch_1_freq.eps NAVBASE_Pitch_2_freq.eps NAVBASE_Roll_1_freq.eps

NAVBASE_Roll_2_freq.eps NAVBASE_Yaw_1_freq.eps NAVBASE_Yaw_2_freq.eps

SWIR_Pitch_1_freq.eps SWIR_Pitch_2_freq.eps SWIR_Roll_1_freq.eps

SWIR_Roll_2_freq.eps SWIR_Yaw_1_freq.eps SWIR_Yaw_2_freq.eps

TIR_Pitch_1_freq.eps TIR_Pitch_2_freq.eps TIR_Roll_1_freq.eps

TIR_Roll_2_freq.eps TIR_Yaw_1_freq.eps TIR_Yaw_2_freq.eps

VNIR_Pitch_1_freq.eps VNIR_Pitch_2_freq.eps VNIR_Roll_1_freq.eps

VNIR_Roll_2_freq.eps VNIR_Yaw_1_freq.eps VNIR_Yaw_2_freq.eps

Page 25: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

21

PLATSIM Output

File-Naming Conventions for PC’s

As in the section on time domain analysis, the file-naming conventions just given do not work for PC’s. Theconventions used on PC’s are exemplified here. The filethat was named MODIS_static_imbalance_freq.mat is FREQ.MAT. What wasCERES2_Yaw_1_freq.eps in the EOS-AM-1 example is now namedP9_2_F.EPS . The number 9 comes from the identifica-

tion number used for the instrument named CERES2Yaw. Double-digit identification numbers are used com-pletely as in P19_1_F.EPS for SWIR_Roll_1_freq.eps , but only the two low-order digits of largeridentification numbers are used. Thus, the PC user mustensure that instruments are uniquely identified by the twolow-order digits of their identification numbers. Thisidentification method allows for up to 99 events in a dis-turbance scenario.

Figure 3. Example of Bode plot.

10-2

10-1

100

101

102

103

104

-200

-100

0

100

Frequency, rad/s

Gai

n, d

bFreq. Response at MISR Roll, arcsec -- Dist.: MODIS static imbalance(2); 29-Apr-94

10-2

10-1

100

101

102

103

104

-200

0

200

Frequency, rad/s

Pha

se, d

eg

Page 26: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible
Page 27: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

23

Chapter 5

Program Execution Overview

Overview

As previously stated, PLATSIM operates in theMATLAB technical computing environment atMATLAB version 4.1 or higher. The Control SystemToolbox, by MathWorks, Inc., must also be available. Torun PLATSIM, the user must first start MATLAB, whichneeds to know where to find the PLATSIM software andthe user-supplied data and M-files. At least onePLATSIM execution control parameter,runmode , mustbe set manually, and depending on the value ofrunmode and the user’s desire to override default val-ues, additional execution control parameters may need tobe set manually as well. The user then invokesPLATSIM. If runmode is not ’batch’ , the user hasan opportunity to set more of the execution control para-meters. (See chapters 6 and 7 on execution in GUI modeand in command mode.) Finally, the time or frequencydomain analysis requested by the user is performed, anyrequested plots are displayed, and any requested outputfiles are created.

File Management

Of the many ways files can be managed, the authorsgive one suggestion here. Because most files that consti-tute the permanent record of PLATSIM’s output havenames that do not reflect the disturbance scenario beingused, each disturbance scenario should be run in its ownsubdirectory. Otherwise, the second disturbance scenariorun uses many of the same file names as the first and thuswrite over output from the first disturbance scenario.Furthermore, if time domain simulations are to be run byusing events in a disturbance scenario both individuallyand simultaneously, these runs should be made in sepa-rate directories to avoid file naming conflicts. The filesfrom the PLATSIM distribution should be kept in a sub-directory of their own, and another directory should bemaintained for the user-supplied files specific to theapplication being considered.

Suppose that PLATSIM is in directory/usr/local/platdir , the user-supplied platform modelfiles are in /astro1/usr2/jdoe/observer , andthe specific disturbance analysis is being run in

/astro1/usr2/jdoe/observer/calib . Alsosuppose that a file namedstartup.m (ref. 2) is in thislast directory and the file included the following lines:

path(’/usr/local/platdir’,path);

path(’/astro1/usr2/jdoe/observer’,path);

Then each time MATLAB is started in direct-ory /astro1/usr2/jdoe/observer/calib ,MATLAB executes filestartup.m and then appropri-ately sets the MATLABPATH variable. When thePLATSIM makefile is executed with the UNIXmakeutility, a templatestartup.m file is created. The usercan use this file to access the EOS-AM-1 example dataincluded with PLATSIM or modify the second pathstatement to point to the user’s own data.

Execution Control Parameters

The execution of PLATSIM is controlled by some20 execution control parameters. One of these,runmode , must be set by the user before invokingPLATSIM. The acceptable values forrunmode are’GUI’ , ’command’ , and ’batch’ . (Only the firstcharacter is significant, and PLATSIM is insensitive tothe case of characters in runmode.) Depending on whichmode PLATSIM is run in and what default values theuser wants to change, the user may need to set someother execution control parameters by MATLAB assign-ment statements before PLATSIM is invoked. The GUImode (runmode=’GUI’ ) and the command mode givethe user a more user-friendly access to some of theseparameters. Appendix C contains a complete list of exe-cution control parameter names, functions, and defaultvalues.

On-Line Help

A small amount of on-line help is available. TheAbout option on the GUI interface window brings up anoverview of PLATSIM. The MATLAB commandhelp platdir (assuming PLATSIM is installed indirectory platdir as suggested in the appendix) pro-vides a list of one-line descriptions of the various M-filesthat constitute PLATSIM.

Page 28: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible
Page 29: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

25

Chapter 6

GUI Execution Mode

A graphical user interface has been developed forPLATSIM, which uses MATLAB’s Handle Graphicsavailable in MATLAB version 4. The objective of thisGUI is to provide the user with a convenient and intuitiveway to set PLATSIM execution control parameters. Fig-ure 4 shows a screen image of the PLATSIM GUI. Thebasic interface consists of five menu options (MATLABuimenu functions) and two slider controls (MATLABuicontrol functions). In addition to setting executioncontrol parameters, the GUI also provides the user witheasy access to some common MATLAB workspace com-mands. The GUI Mode can be executed by typingrunmode=’gui’ followed by platsim in theMATLAB command window. Normal execution of the

PLATSIM GUI creates a file calledplatsim.mat thatcontains parameters associated with various GUI menusand sliders. A complete description of all PLATSIM GUIfeatures is given in the following sections. If the userwants to override the default actions controlled by execu-tion control parametersphold , nplpts , or gad , thenthese parameters must be set by hand in the MATLABcommand window before PLATSIM is invoked.

Workspace

The Workspace menu has the following MATLABfunction commands: New Figure, Clear & ResetDefaults, Who, Whos, Save, and Close Window. A

Figure 4. Graphical user interface for PLATSIM jitter analysis package.

Page 30: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

26

Chapter 6

complete description of all Workspace menu functions,with the exception of Clear & Reset Defaults, can befound in theMATLAB Reference Guide (ref. 2). TheClear & Reset Defaults function requires the existence ofa file calledplatsim.mat , which is automatically cre-ated in the current working directory. Selecting the Clear& Reset Defaults menu executes various MATLAB com-mands, includingclear and load platsim.mat .The result of this action effectively clears all variablesexcept those needed by the GUI. In addition to clearingall variables, the values of all buttons and sliders are resetto their default values.

Options

The Options menu provides access to severalPLATSIM analysis and documentation output functions.This menu allows the user to select the followingPLATSIM features: performance output locations, inter-active graphical modification of the structural model(frequencies and damping ratios), the level of simulationoutput documentation, feedback control, jitter analysis,and whether output time-history data should be saved.The following sections contain detailed descriptions ofthe Options menu features.

• The Performance Outputs menu provides access tothe performance output selection figure window. Theperformance output window allows users to select afull or partial set of output locations from thosedefined in the user-defined functioninstdata.m .This utility allows for a large database of out-put locations to be maintained in functioninstdata.m without the computational expenseof solving for all outputs in every analysis. Thelabeling and grouping of the menu items for the per-formance output window is determined by the thirdfield in the workspace variableinstr , which isdefined in the user-defined functioninstdata.m .All entries with the same character string in the thirdfield of instr are located under the same pull-down menu, and this common character string isused to title the menu group. The performance out-put selection figure window has three button func-tions. These buttons are used to select all outputs,deselect all outputs, or close the selection window,and they are labeled Set All, Clear All, and Close. Auser can select performance outputs by using theSelect All option for each group or the master Set Allbutton for all groups. Any currently selected outputcan be deselected by simply reselecting the item orselecting the Clear All button. Currently, because ofa documented program error in MATLAB 4.1, theClose button has been disabled to eliminate theoccurrence of bus errors on some UNIX machineswhen PLATSIM is running under versions prior

to 4.2. When the Close button is disabled, the perfor-mance output selection figure window can be closedby issuing aclose(perfig) command from theMATLAB workspace.

• The Control menu allows the user to select betweenopen-loop and closed-loop analysis of the spacecraft.The space platform control system must be definedin the user-changeable fileformscs.m . The defaultsetting for the Control menu is closed-loop analysis.

• The Plotting & Printing menu provides the user withthe same options as given for the Command-Drivenmode, as described in the following chapter. Thedefault settings for this menu arepltflag=’yes’; andprtflag=’yes’; .

• The Perform Jitter Analysis menu allows the user toselect whether jitter analysis is performed (this is thedefault) or not.

• The Save Output Time History menu provides theuser with the option to save the complete output timehistory data. In other words, variablesy andinstrare saved if this option is set to yes. However, select-ing yes for this option has the potential of creating alarge file and therefore should be used with caution.The output data are saved in one file per disturbanceevent; these files are labeledy1.mat , y2.mat ,y3.mat , etc. The default setting for this option issaveflag=’no’ . This variable is optional; hence,the user is not prompted when using PLATSIM inthe command-line driven mode. In this mode, issu-ing the MATLAB commandsaveflag=’yes’before issuingplatsim saves the output time-history data.

• The Modify Plant Model menu has two menuoptions: Frequencies and Damping Ratios. Thesemenu options allow the user to graphically modify ordefine both frequency uncertainties and modaldamping ratios. Details for using these optionsfollow.

Frequency Ratio Modification

The Frequencies option of the Modify Plant Modelmenu provides the user access to a graphical interfacetool, which is shown in figure 5. This interface tool has avariety of options for adding modal uncertainties to theplant structural model. Two basic types of uncertaintiesare considered: a constant scaling and a random scaling.The constant scaling uncertainties are defined as follows:

ωi* ωi

o ωio

S×+=

Page 31: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

27

GUI Execution Mode

The random scaling uncertainties are defined as follows:

The variablesS andRi in the previous equations repre-sent a user-defined constant scale factor and a set of ran-dom numbers uniformly distributed over the interval(0, 1) (by the MATLAB random number generatorrand ). The frequency spectrum, as defined in filesomega.dat or omega.mat , can be divided into inter-vals (ranges) to allow for different levels of uncertaintiesfor different ranges of modes within the frequency spec-trum. The user can change the number of ranges byselecting the interface button labeled Ranges. A range, asdefined by the interface, is denoted by the interval (a, b],wherea and b are the lower and upper bounds on theinterval, respectively. For example, ifa = 10 andb = 20,then all modes from 11 through 20 (including mode 20)have the sameS factor. The lower and upper bounds(range) for the interval can be changed by using a mouseto click and drag on the vertical lines that represent inter-val ranges. The scale factors (value) can also be changedby using a mouse to click and drag on the shaded regionsbetween the vertical lines. Both range and value can bechanged with keyboard entries once the corresponding

ωi* ωi

o ωio

Ri S××+=

graphical element has been activated. A range or valueelement is activated by using the mouse to click on a ver-tical line or shaded region, respectively. Once a graphicalelement has been activated, its numeric value is dis-played in the range or value text area of the graphicalinterface.

A user can choose between constant or random scal-ing by using the Scaling button (constant is the defaultsetting). The frequency spectrum axis can be changedfrom Mode Number (default setting) to Frequency (Hz)by using the top button on the interface. Other featuresinclude Reset, File, and Mode-by-Mode. The Reset but-ton resets the frequency uncertainty scale factor to 0 forall modes. The File button allows the user to either savethe current frequency uncertainties to a.mat file or loada preexisting.mat file containing frequency uncertain-ties. The Mode-by-Mode button provides access to agraphical interface that allows convenient mode-at-a-time frequency modifications.

Figure 6 shows a screen image of the Mode-by-Mode graphical interface. This interface gives the user alist of frequencies of all modes displayed in a read-onlytext window on the right side of the interface. The usercan use the Change Selection buttons to scroll through

Figure 5. Spacecraft modal uncertainty graphical user interface.

Page 32: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

28

Chapter 6

the list of frequencies or use the Frequency of Interesttext field to enter a particular frequency region ofinterest. The value in hertz of the currently selected modeis displayed in the Desired Value text field. The currentlyselected mode is shown between the two horizontaldashed lines. The value of this mode can be changed byeither deleting the text and reentering a new value or byscaling it with any arithmetic operator, for example, +,−,* for multiplication, or / for division. Additional optionson the mode-by-mode graphical interface include Reset,Undo, and Close. The Reset button restores the modalfrequencies to their nominal values as defined with theinterface in figure 5, and the Undo button clears only thelast frequency modification. The Close button closes theinterface and accepts all frequency changes. A final noteon frequency modifications is that each time the Fre-quencies submenu is selected, the frequencies defined infiles omega.dat or omega.mat are used as the initialvalues.

Damping Ratio Modification

The Damping Ratios option from the Modify PlantModel menu provides the user access to a graphical toolfor defining or modifying the spacecraft’s modal damp-

ing schedule. The operation of the damping schedulegraphical interface is similar to the frequency modifica-tion graphical interface. The graphical damping toolallows users to easily modify elements within the struc-tural damping matrix. Structural damping ratios andranges are specified by using a mouse to click and dragon graphical elements that represent modal dampingratios and ranges. Keyboard entries are also permittedonce a modal damping range or value element has beenactivated by a mouse click. (See previous frequencymodification description.) Damping schedules can alsobe saved or loaded by using the File button. This GUIfeature uses, as its default damping schedule, the sched-ule defined in the user-changeable filemkdamp.m. Ifmkdamp.m has not been defined, then a default dampingschedule of 0.25 percent is assumed for all modes.

Analysis

The Analysis menu allows the user to select betweeneither time domain or frequency domain analysis modes.The time domain and frequency domain modes are mutu-ally exclusive options; that is, PLATSIM does not allowfor simultaneous time and frequency domain analyses.Selecting the button labeled frequency domain analysis

Figure 6. Mode-by-Mode frequency modification graphical user interface.

Page 33: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

29

GUI Execution Mode

changes the functionality of the slider in the lower rightcorner of the main PLATSIM GUI and displays an addi-tional figure window for setting frequency domainparameters. The additional figure window is closed whenthe frequency domain analysis is started or when fre-quency domain is no longer the mode of analysis.

Additional options under the Analysis top-levelmenu are Display Parameters, Progress Meter, and BeginAnalysis. Selecting the Display Parameters buttonechoes the current values of PLATSIM parameters in theMATLAB command window. Progress Meter is selectedby default and can be deselected by clicking on it withthe mouse. During time domain analysis, if ProgressMeter is selected, a graphic meter is displayed that showsthe percent completion of the simulation response to thecurrent disturbance event. Selecting Begin Analysis exe-cutes the MATLAB script file plattime.m orplatfreq.m for time or frequency domain analyses,respectively. Once an analysis, time or frequencydomain, has been started, all GUI functions are disabled.User control of the GUI is not returned until the analysisis finished. As of MATLAB version 4.2, the user can ter-minate the analysis at any time by sending an interruptsignal (Control C on most UNIX workstations) from theMATLAB command window unless both the ProgressMeter is turned on and the analysis is performed byMEX-file (as opposed to M-file). Even if MATLAB isunresponsive to the interrupt signal, the system respondsto the suspend signal (typically, control Z). The userresorting to this expedient should remember to kill thesuspended process.

Disturbance

The Disturbance menu allows the user to select thedisturbance model to be used in the PLATSIM analysisas well as select how multielement disturbance scenariosare handled in time simulations. The submenu SelectDisturbances provides the user with access to the distur-bance module, which is described in detail in chapter 11.The submenus Run Disturbances Separately and RunDisturbances Together control whether several simula-tions are run, one for each individual disturbance event,or whether the result of all disturbance events actingsimultaneously is simulated. Typically, jitter analysis isperformed by using individual disturbance events (i.e.,run separately), and the contribution of all responses aresummed together. However, to determine overall space-craft response at various output locations, the Run Dis-turbances Together option provides a more usefulapproach. Selecting Run Disturbances Together sets theworkspace variablemultflag to yes (the default is no).Themultflag variable is considered to be an optional

time domain execution control parameter; hence, the useris not prompted for its value when using PLATSIM inthe command-line driven mode. To run the disturbancestogether when using PLATSIM in the command-linemode, the user should issue the following MATLABcommand before issuingplatsim :

>> multflag=’yes’

Quit

The Quit button simply quits the current MATLABsession without saving any workspace variables.

Number of Modes Slider

A slider control can be used to set the number ofmodes to be included in the analysis. The slider allowsthe user to use the mouse to move a sliding bar that setsthe numeric input for the value in the text field of theslider. The slider moves according to the instructionsgiven in the MATLAB 4.1 Release Notes: “When youmouse on an arrow, the slider position indicator (and theassociated slider value) moves in the indicated directionby a value of 1/100th of the total range. Clicking themouse while the pointer is in the trough moves the slider1/10th of the total range.” Currently, the total range forthe number of modes is set to 600. Therefore, one clickon the position indicator of the mode slider sets the num-ber of modes equal to six.

The values of the sliders can also be changed byclicking the mouse in the text field and typing the desiredscalar or vector values. A scalar entry of 100 is equiva-lent to [1:100] in MATLAB notation; that is, the first100 modes are used in the simulation. Vector entries areused when multiple mode ranges are desired or whenmode range starting points do not include the first mode.All vector entries must follow MATLAB’s syntax. Forexample, to capture the rigid body response plus the flex-ible body response between modes 100 and 200, the userwould enter[1:6 100:200] in the slider text field.Negative scalar values are also permitted and used toindicate that a single mode is used in the simulation. Forexample, if a text field entry of−100 is used, only mode100 is used in the simulation. A slider value of 0 (thedefault) implies that all available modes are used in thesimulation. The user must enter mode numbers in the textfield for modes greater than 600.

Clip Window Slider/Range of DisturbanceEvents

This GUI slider serves a dual role. In time domainanalysis, the Clip Window Slider is used to define theclip window (tclip ), and in frequency domain

Page 34: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

30

Chapter 6

analysis, it is used to define the subset of disturbanceevents inputs (ndist ) for a given disturbance scenario.The functionality of this slider is similar to that of the

mode slider. Definition of thetclip andndist execu-tion control parameters are provided in appendix C. Thedefault value of the Clip Window Slider is 0.

Page 35: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

31

Chapter 7

Command-Driven Execution Mode

In command-driven mode, the user can set many ofthe execution control parameters by responses to ques-tions from PLATSIM. To access and execute PLATSIMin command-driven mode, one must be runningMATLAB 4.1 or higher. The MATLABPATH variablemust be set properly so that MATLAB knows where tofind PLATSIM and the user’s model of the platform. InMATLAB, the user must issue the commandrunmode=’command’; set any PLATSIM executioncontrol parameters that are not accessible throughresponses to PLATSIM questions, and issue the com-mandplatsim to MATLAB. These execution controlparameters used by both time and frequency domainanalyses are as follows:phold to set the maximum timethat any given plot is held on the screen;gad to adjustthe gains matrix, anddesint to select a proper subsetof the performance output instruments defined in theuser-supplied fileinstdata.m . Complete definitionsof all execution control parameters are given inappendix C.

Time Domain Analysis

Additional execution control parameters that applyto time domain analysis are as follows:multflag ,which must be set to yes if multiple events in adisturbance scenario are to be run simultaneously;saveflag , which must be set to yes if the full time his-tories are to be written to MAT-files;jtrflag , whichmust be set to no if no jitter analysis is desired;tclip ,which must be set to a positive value in the time unitsused in the time-history analysis if the user wants to dis-regard an initial segment of the time history during jitteranalysis; andnplpts , which must be set to a value ifthe user does not want the default value for the numberof points to use in reducing time-history data for plotting.Additionally, the performance meter, which is on bydefault, can be turned off by settingpmflag to no.

After the user has set the desired execution controlparameters, theplatsim command is issued. The userthen performs the following steps:

1. Accept the default value, yes, for the time domainanalysis prompt by entering a carriage return.

2. With the left mouse button, the user should choosea disturbance sequence from the MATLAB pop-up

menu that appears on the screen. The menu dis-appears after a choice has been made. (See chap-ter 11 for a full description of the disturbancesmenu.) If PLATSIM has reason to believe that theuser’s terminal does not support graphics, then atext menu with numbered options is used instead ofthe GUI menu.

3. After receiving the promptEnter number ofmodes to use (enter 0 for all) [0]? , theuser should provide the number or range of space-craft modes to be used in the analysis. To use allmodes given in the file omega.mat (oromega.dat ), enter0 or accept the default with acarriage return. To use the firstk modes in the anal-ysis, enterk . To use a mixed range of modes (e.g.,modes 4 to 8, 300, and 450 to 480), enter aMATLAB vector [4:8,300,450:480] . To usea single mode, such as mode k, enter-k .

4. After receiving the promptPlot results[yes]? , enteryes , y, or carriage return for thetime histories to be reduced and plotted on thegraphics display. To obtain jitter results withoutplotting, enterno or n.

5. After requesting plotting (item 4) and receiving thepromptPrint results [yes]? , enteryes , y,or carriage return for the plots to be printed to anencapsulated PostScript file. Otherwise, enternoor n.

6. After receiving the prompt Closed-loopAnalysis [yes]? , enter yes , y, or carriagereturn for a closed-loop analysis with the spacecraftcontrol system. Otherwise, enterno or n.

A typical PLATSIM session in a command-drivenmode is presented in the following computer listing foran EOS-AM-1 disturbance scenario. The commands andcommand responses have been highlighted in bold. Any-thing not in bold was generated by the program. A car-riage return used to accept a default value is shown as<CR>.

>> runmode=’c’;>> desint=13:15;>> pmflag=’n’;>> platsim

Page 36: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

32

Chapter 7

Time Domain Analysis [yes]? <CR>

Form the disturbance vector andinstrument data

Selected disturbance case:MODIS static imbalance

Task completed in 7.45 seconds

Form the continuous plant matrices

Enter range of modes to use (enter 0for all) [0]? [1:6,13:20,25]

Task completed in 5.417 seconds

Discretize the plant dynamicsTask completed in 0.1167 seconds

Plot results [yes]? <CR>

Print results [yes]? n

Perform linear discrete simulation

Closed-loop Analysis [yes]? n

Initiating simulation for disturbancevector 1

Task completed in 21.02 seconds

Perform jitter analysisTask completed in 6.45 secondsCurrent plot held

Truncate, plot, and print timehistories

Task completed in 7.317 seconds

Simulation for disturbance vector 1completed

Initiating simulation for disturbancevector 2

Task completed in 19.53 seconds

Perform jitter analysisTask completed in 6.417 secondsCurrent plot held

Truncate, plot, and print timehistories

Task completed in 7.467 seconds

Simulation for disturbance vector 2completed

Current plot held

PROGRAM COMPLETEDTotal cpu time = 86.65 seconds

In this example, setting the execution control param-eterdesint to 13:15 before invoking PLATSIM sim-ulates the response of only three performance outputsthat were assigned identification numbers 13, 14, and 15.These identification numbers are defined in the user-supplied MATLAB function in fileinstdata.m . Thefirst command response chooses time domain analysis byaccepting the default. Note, the second commandresponse, which is used to choose a disturbance scenario,is a mouse command from the menu shown in figure 7,and thus has not been included in this session. PLATSIMis then asked to build a model of the plant with modes 1through 6, 13 through 20, and 25. The default to plotresults is accepted; thus, the data are reduced for plotting,plots are displayed on the screen, and the plot data arewritten to a MATLAB MAT-file. The user declines printresults; thus, the EPS files of the plots are not created.The last user response selects open-loop analysis.

Frequency Domain Analysis

To perform frequency domain analysis, after settingany desired execution control parameters and issuing theplatsim command, the user performs the followingsteps:

1. Respond withno or n to the time domain analysisprompt. This response informs PLATSIM that fre-quency domain analysis will be performed.

2. With the left mouse button, the user should choosea disturbance scenario from the MATLAB pop-upmenu that appears on the screen. The menu dis-appears after a choice has been made. (See chap-ter 11 for a full description on the disturbancesmenu.) If PLATSIM has reason to believe that thecomputer terminal does not support graphics, thena text menu with numbered options is used insteadof the GUI menu.

Figure 7. Disturbance module pop-up menu.

PLATSIM DISTURBANCESASTER-TIR MODIS MOPITT Misc. Disturbances

CHOOSE A DISTURBANCE MODEL

Page 37: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

33

Command-Driven Execution Mode

3. After receiving the promptEnter number ofmodes to use (enter 0 for all) [0]? ,the user should provide the number or range ofspacecraft modes to be used in the analysis. Touse all modes given in the fileomega.mat (oromega.dat ), enter0 or accept the default with acarriage return. To use the firstk modes in theanalysis, enterk . To use a mixed range of modes(e.g., modes 4 to 8, 300, and 450 to 480), enter aMATLAB vector [4:8,300,450:480] . Touse a single mode, such as mode k, enter-k .

4. After receiving the promptEnter number ofdisturbances to use (enter 0 for all)[0]? , provide the number or range of distur-bance events of the chosen disturbance scenarioto be used in the frequency analysis. To use allevents in the disturbance scenario, enter0 or acarriage return to accept the default. To use thefirst k events in the analysis, enterk . To use amixed range of events, (e.g., events 1, 3, 5, 6, and7), enter a MATLAB vector[1,3,5:7] . To usea single disturbance event, such as mode k,enter-k .

5. After receiving the promptPlot results[yes]? , enteryes , y, or carriage return for theBode logarithmic gain and phase diagrams to beplotted on the graphics display. Otherwise, enterno or n.

6. After requesting plotting (item 5) and receivingthe prompt Print results [yes]? , enteryes , y, or carriage return for the plots to beprinted to an EPS file. Otherwise, enterno or n.

7. After receiving the promptClosed-loopAnalysis [yes]? , enteryes , y, or carriagereturn for a closed-loop frequency analysis withthe spacecraft control system. Otherwise, enterno or n.

8. After receiving the promptInput the lowerbound value for frequency in power of10 [-2]? , enter the desired lower bound fre-quency value (decimals are accepted, carriagereturn accepts the default). Note that the defaultfor the lower bound value is 0.01 (or 10−2).

9. After receiving the promptInput the upperbound value for frequency in power of10 [4]? , enter the desired upper bound fre-quency value (decimals are accepted, carriagereturn accepts the default). Note that the defaultfor the upper bound value is 10000.0 (or 104).

10. After receiving the promptInput the numberof points to be used in the frequencyplots [1000]? , enter the desired number ofpoints to be used in the generation of the fre-quency response function matrix (carriage returnaccepts the default). Note, the default number ofpoints is 1000.

A typical PLATSIM session in a command-drivenmode is presented in the following computer listing foran EOS-AM-1 disturbance sequence. The commands andcommand responses have been highlighted in bold. Any-thing not in bold was generated by the program. A car-riage return used to accept a default value is shownas<CR>.

>> runmode=’c’;>> platsim

Time Domain Analysis [yes]? n

Form the disturbance vector andinstrument data

Selected disturbance case:MODIS static imbalance

Task completed in 7.417 seconds

Form the continuous plant matrices

Enter range of modes to use (enter 0for all) [0]? 40

Task completed in 7.2 seconds

Enter range of disturbance events touse (enter 0 for all) [0]? <CR>

Plot results [yes]? <CR>

Print results [yes]? <CR>

Closed-loop Analysis [yes]? <CR>

Input the lower bound value for fre-quency in power of 10 [-2]? <CR>

Input the upper bound value for fre-quency in power of 10 [4]? 3

Input the number of points to be usedin the frequency plots [1000]? 501

Form the Spacecraft Control System(SCS) matrices

Task completed in 1.067 seconds

Initiating Bode Plot for the distur-bance set

Task completed in 11.33 seconds

Plot and print Bode plotsTask completed in 89.75 seconds

Page 38: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

34

Chapter 7

PROGRAM COMPLETED

Total cpu time = 117 seconds

The first command response selects frequencydomain analysis. Note that the second commandresponse, which is used to choose a disturbancesequence, is a mouse command from the menu shown in

figure 7 and thus has not been shown. In this example,modes 1 through 40 are used in the plant model, all dis-turbance elements of the disturbance sequence are cho-sen for frequency domain analysis. Both plotting andprinting options are chosen; a closed-loop analysis isrequested; and a frequency range between 0.01 (10−2)and 1000.0 (103) with 501 point discretization is chosen.

Page 39: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

35

Chapter 8

Batch Mode

In batch mode, PLATSIM execution control parame-ters are either set by the user with MATLAB assignmentstatements before the commandplatsim is entered orused with their default value. These assignments can bedone in an interactive MATLAB window, but they areprimarily intended to allow the user to run PLATSIM inthe background with commands from a prewritten script.With two exceptions, if the user has not defined an exe-cution control parameter when the commandplatsimis given, PLATSIM assigns a default value to the vari-able. One of these exceptions,runmode , must be setbefore PLATSIM is called. The other exception iscasenum . If PLATSIM is running in GUI or commandmode,casenum is set by user responses to the Distur-bances menu. In batch mode,casenum must be setbefore PLATSIM is called. Appendix C contains specifi-cations for the individual execution control parameters.

Batch Mode Operation

This section uses two examples to demonstrate thebatch mode operations.

Example 1. MATLAB is Started in a DirectoryContaining Two Files

::::::::::::::startup.m::::::::::::::format compactpath(’/scb3/usr5/eos/platdir’,path)path(...’/scb3/usr5/eos/platdir/eos_eg’,path)::::::::::::::runplat.m::::::::::::::diary % generate a diary of

% the run

runmode=’b’; % run in batch mode

tdflag = ’n’ % perform frequency% domain analysis

nmode = 40; % use first 40 modes

clflag = ’n’; % run Bode plot open% loop

casenum = 7; % use ’MODIS static% imbalance’ disturbance% from the EOS-AM-1% example

prtflag = ’n’; % do not write .eps% files

desint = 14; % only output is ’MODIS% Pitch’

ndist = -2; % use only the second% event from the ’MODIS% static imbalance’% disturbance

phold = 120; % give the user at least% 2 minutes to look at% plot

platsim % This should now run a% single input/single% output Bode plot% using 1000 points% logarithmically spaced% between .01% and 10,000.

MATLAB is started and the command>> runplatis given. The necessary calculations are performed andthe Bode plot is displayed. To exit from MATLAB, thecommand >> quit is given. Now two newfiles are in the directory—MODIS_static_imbalance_freq.mat , which contains the results ofthe Bode calculation in MATLAB readable form, anddiary , which contains a record of events. The follow-ing shows the contents ofdiary .

Selected disturbance case:MODIS static imbalance

Form the continuous plant matricesTask completed in 3.333 seconds

Form the Spacecraft Control System(SCS) matrices

Task completed in 0.6833 seconds

Initiating Bode Plot for the distur-bance set

Task completed in 0.55 seconds

Page 40: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

36

Chapter 8

Plot and print Bode plotsTask completed in 39.35 seconds

PROGRAM COMPLETEDTotal cpu time = 43.98 seconds>> quit

1471741 flops.

Example 2

This example uses a batch operation utility such asthe UNIX at command. First a command script is pre-pared and written to a file, saydoit , as follows. (Linenumbers are not present in the script, they have beenadded here for reference purposes.)

1. setenv DISPLAY2. /usr/local/matlab-4.1/bin/matlab\

<< EOF > mat-out3. diary4. runmode=’b’;

5. casenum=7;

6. pmflag=’n’;

7. platsim

8. quit

9. EOF

The UNIX commandat -m 20:00 doit waitsuntil 8 p.m. and then starts executing the commands indoit . Line 1 ofdoit corrects a problem MATLAB hason some systems with trying to run plotting commandswithout being run from a logged-in terminal. Line 2starts MATLAB running and uses the remaining lines asinput to MATLAB until it finds the EOF in line 9.MATLAB then executes lines 3 through 8 causing it torun PLATSIM in batch mode with disturbance number 7(MODIS static imbalance) and with defaults for all otherrun parameters exceptpmflag . When the job is done,the user can obtain results from the files created byPLATSIM.

Page 41: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

37

Chapter 9

Time Domain Analysis Module

The fileplattime.m is the main driver for the lin-ear time domain simulation and jitter analysis program. Itconnects the plant definition module, the spacecraft con-trol system module, the disturbances module, the simula-tion module, and the jitter analysis module. PLATSIMtakes advantage of the sparsity of the spacecraft dynamicmodel system matrix to perform efficient open-loop andclosed-loop simulations. To take advantage of the open-loop sparsity, PLATSIM individually discretizes theplant and the controller models and then combines themin a feedback loop. This loop is generally not restrictivebecause almost all modern control systems are digitallyimplemented. Theplattime module calls various rou-tines to form the open-loop plant and disturbance matri-ces, to discretize the system matrices, to form thespacecraft control system matrices, to obtain time simu-lations of the performance outputs, to perform jitter anal-ysis, and finally to document the results in MATLABbinary, tabular ASCII, and graphical PostScript forms.These routines are described in the order used as follows:

1. Routinedistrbs (in file distrbs.m ) is usedto call user-supplied routinedistdata . Fromthe returned information,distrbs can obtainthe disturbance profiles and the correspondinggrid points and directions for those disturbancesas well as the integration step size.

2. Routine instrmts (in file instrmts.m ) isused to call user-supplied routineinstdata .From the returned information,instrmts candefine instrument types, locations, directions, andnames as well as the window sizes for the jitteranalysis.

3. Routinerminstr (in file rminstr.m ) is usedto redefine the performance output data accordingto parameterdesint , which identifies those per-formance outputs to be used in simulations andjitter analysis.

4. Routine formplnt (in file formplnt.m ) isused to generate the sparse open-loop plantmatrices.

5. Routinediscrtz (in file discrtz.m ) is usedto discretize the sparse system matrices with asampling period equal to the integration step size.

6. User-supplied routine formscs (in fileformscs.m ) is used to generate the spacecraftcontrol system matrices. These matrices are sub-sequently discretized by the MATLAB routinec2d with a sampling period equal to the integra-tion step size.

7. Routine simuc (in file simuc.m orsimuc.mex* ) is used to perform the closed-loop simulations for the discrete system.

8. Routine simuo (in file simuo.m orsimuo.mex* ) is used to perform the open-loopsimulations for the discrete system.

9. Routine jitter (in file jitter.m orjitter.mex* ) is used to compute jitter valuesfrom the time histories computed bysimuc orsimuo for the time windows defined by variablewindow in file instdata.m .

10. Routine jitterds (in file jitterds.m ) isused to generate the ASCII files that contain thejitter results in tabular form.

11. Routinetable (in file table.m ) is used to gen-erate the PostScript files that contain the jitterresults in tabular form.

12. Routinetrplot4 (in file trplot4.mex* ) isused to condense the time-history data in such away that hardcopy plots of the condensed timehistories have the same visual effect as plots ofthe full time history.

The jitter and simulation analysis is started by call-ing the jitter and simulation analysis module that residesin a file namedplattime.m . The optional parametersgad , tclip , desint , saveflag , and multflagare used withinplattime to provide additional capa-bilities. The error and diagnostic messages generated byplattime (in file plattime.m ) are as follows:

1. In the command-line and GUI execution modes, ifa correct disturbancecasenum is not selectedfrom the disturbances menu, then the followingmessage appears in the MATLAB window:

A proper disturbance casenum wasnot specified, please select onenow.

Page 42: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

38

Chapter 9

Solution: Choose a proper disturbancecasenumfrom the pop-up menu. This error also stops execu-tion in batch mode.

2. If the scalar parametertclip defined is greaterthan the simulation time and the execution mode iscommand driven or menu driven, then the follow-ing message appears in the MATLAB window:

• tclip is larger than tfinal;

• input a new value for tclip.If the scalar parametertclip defined is greaterthan the simulation time and the execution mode isbatch, then the following message appears:

• tclip is larger than tfinal;• tclip is set to 0.5*tfinal.”

Solution: Adjust tclip or increase the simulationtime.

Page 43: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

39

Chapter 10

Plant Definition Module

Continuous Model

The Plant Definition module generates the open-loop state matrix, the control input influence matrix, themeasurement and performance output influence matri-ces, and the disturbance influence matrix. These matricesare generated by routineformplnt . As mentioned ear-lier, the plant dynamics in a first-order state space form isgiven in equation (5) as

wherexs is the plant state vector,u is the spacecraft con-trol system input vector,w is the disturbance vector,As isthe plant state matrix,Bs is the input influence matrix,Bdis the disturbance influence matrix,C and Cpr are themeasurement and performance output influence matri-ces, and and are the control input and distur-bance feedthrough matrices. The respective structure ofthese vectors and matrices are defined in chapter 2. How-ever, because of the sparse nature of the open-loop statematrix, this matrix is stored byformplnt in the follow-ing compact form:

In this form,ωi andζi represent the modal frequency andmodal damping ratio of modei. The symbolp representsthe number of modes included in the model. This com-pact form reduces the storage requirements fromp × p to2 × p and prepares the state matrix for PLATSIM sparsecomputations. The routineformplnt requires the fol-lowing user-supplied inputs or input files:

xs Asxs Bsu Bdw+ +=

y Cxs=

ypr

Cpr

xs Dupr

u Dwpr

w+ +=

Dupr

Dwpr

As

0 1

ω12

– 2ζ1ω1–

0 1

ω22

– 2ζ2ω2

0 1

ωp2

– 2ζpωp

=......

...

...

• In the command-driven mode,formplnt promptsthe user for the range of structural modes to be usedin the analysis. The form of this input is discussed inchapter 7.

• For the modal frequencies,formplnt first looksfor a MATLAB binary file omega.mat . If such afile does not exist,formplnt then attempts to loadthe ASCII fileomega.dat .

• For the structural mode shapes,formplnt firstlooks for a MATLAB binary filephi.mat. If sucha file does not exist,formplnt then attempts toload the ASCII filephi.dat .

• As mentioned previously,formplnt uses routinemkdamp (in the user-supplied filemkdamp.m) togenerate the modal damping ratios.

The error and diagnostic messages generated byformplnt are as follows:

• If any of the mode numbers chosen for analysis isgreater than the number of modes available in the fileomega.dat or omega.mat , then the followingmessage appears in the MATLAB window and pro-gram execution stops:

An error has been detected infile formplnt.m; maximum modenumber chosen is greater thannumber of modes available; pro-gram termination in formplnt.

Solution: Check the mode numbers and restart theprogram.

• If the number of rows of arrayphi (in filephi.mat or phi.dat ) is not an integer multipleof the number of modal frequencies defined in fileomega.mat or omega.dat , then the followingerror message appears in the MATLAB window andprogram execution stops:

The number of rows of phi (in filephi.mat or phi.dat) must be aninteger multiple of the number ofelements of omega (in fileomega.mat or omega.dat). Programtermination in formplnt.

Page 44: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

40

Chapter 10

Solution: Make thephi andomega files consistentand restart the program.

• If a grid point defined in fileinstdata.m for thespacecraft control system input is not defined inarrayphi (in file phi.mat or phi.dat ), then thefollowing error message appears in the MATLABwindow and program execution stops:

An error has been detected infile formplnt.m. A FEM spaceplatform control system inputgrid number as referenced in fileinstdata.m is not available infile phi.dat or phi.mat. Programtermination in formplnt.

Solution: Check the first row of parameteract infile instdata.m , check file phi.dat orphi.mat , and restart the program.

• If a grid point used in fileinstdata.m for themeasurement outputs is not defined in arrayphi (infile phi.mat or phi.dat ), then the followingerror message appears in the MATLAB window andprogram execution stops:

An error has been detected infile formplnt.m. A FEM measure-ment output grid number as refer-enced in file instdata.m is notavailable in file phi.dat orphi.mat. Program termination informplnt.

Solution: Check the first parametermout in fileinstdatas.m , check filephi.dat or phi.mat ,and restart the program.

• If a grid point used in fileinstdata.m for the per-formance outputs is not defined in arrayphi (in filephi.mat or phi.dat ), then the following errormessage appears in the MATLAB window and pro-gram execution stops:

An error has been detected infile formplnt.m. A FEM perfor-mance output grid number as ref-erenced in file instdata.m is notavailable in file phi.dat orphi.mat. Program termination informplnt.

Solution: Check the first row of parameterpout infile instdata.m , check file phi.dat orphi.mat , and restart the program.

• If a grid point used in filedistdata.m for a distur-bance sequence is not defined in arrayphi (in filephi.mat or phi.dat ), then the following error

message appears in the MATLAB window and pro-gram execution stops:

An error has been detected infile formplnt.m. A FEM distur-bance grid number as referencedin file distdata.m is not avail-able in file phi.dat or phi.matProgram termination in formplnt.

Solution: Check file distdata.m and filephi.dat or phi.mat and restart the program.

Discrete Model

Routinediscrtz (in file discrtz.m ) is used todiscretize the plant dynamics, with a zero-order hold, foruse in the simulation of the open-loop and closed-loopresponse. This routine takes advantage of the sparsity ofthe open-loop state matrix of the plant and discretizes thedynamics of each mode separately. For example, formodei the discretized dynamics is obtained by forming

where is theith 2× 2 partition of state matrix ,is a matrix formed by rows 2i − 1 and 2i of the controlinput influence matrix , is a matrix formed by rows2i − 1 and 2i of the disturbance influence matrix , andthe rows of 0’s are added to produce a square matrix .Then, the exponential of is computed as follows:

where , , and are appropriate partitions of .These partitions represent the discretized state matrix,control input influence matrix, and disturbance influencematrix for modei. The discretized plant matrices can bewritten as

where , , and , respectively, represent the dis-cretized state matrix in compact form, control inputinfluence matrix, and disturbance influence matrix of theplant.

Pi As

iBs

iBd

i

0 0 0≡

Asi

As Bsi

Bs Bdi

BdPi

Pi

Pi

eP

iAs

iBs

iBd

i

0 0 0≡=

Asi

Bsi

Bdi

Pi

As

As1

As2

Asp

= Bs

Bs1

Bs2

Bsp

= Bd

Bd1

Bd2

Bdp

=...

......

As Bs Bd

Page 45: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

41

Chapter 11

Disturbance Module

The PLATSIM disturbance module provides thecapability to interactively select various disturbance sce-narios with a graphical user interface. The disturbancemodule also offers a command-line mode whenMATLAB is run in the terminal graphics mode. Thismodule also allows batch mode simulations. (Seechapter 8.)

The main PLATSIM GUI provides access to threedisturbance functions under the pull-down menu labeledDisturbance. The three disturbance functions are labeledSelect Disturbances, Run Disturbances Separately, andRun Disturbances Together. When the pull-down menulabeled Select Disturbances is selected, an additional fig-ure window with a top-level menu appears. Figure 7shows this menu for the EOS example. The disturbancewindow top-level menu displays labels pertaining to dis-turbance scenario groups that consist of one or more dis-turbance scenarios. A single instrument or system canhave multiple disturbance scenarios. For example, ascanning telescope can have a disturbance scenario thatdescribes the forces and/or torques related to the motionof a scanning mirror, and it can have a separate distur-bance scenario for calibration operations.

The entries in thecnames and dnames matricesprovide the names for the disturbance scenario groupsand the disturbance scenarios, respectively. (See sectionon “Disturbance Data” of chapter 3.) Each disturbancescenario (a row entry indnames) is a separate submenuitem under the top-level menu and can consist of singleor multiple disturbance events. String variables describ-ing the disturbance scenarios are used for labeling timehistory plots, submenus, items, and jitter file names. Thedisturbance scenario group names are used only as label-ing for menu buttons. A disturbance scenario can beselected from the pull-down menu with a single clickfrom a mouse. Upon selection, the appropriate distur-bance models, as defined in the user-provided filedistdata.m , are executed and instrument or systemdisturbance data are loaded into the MATLAB work-space. This procedure can take several seconds to com-plete; actual time depends on the number of data pointsand individual force or torque profiles that comprise thedisturbance scenario.

If the user attempts to run a simulation without firstselecting a disturbance model, a warning message is dis-played with instructions to select a disturbance. Then thedisturbance module figure window is displayed.

The PLATSIM disturbance module consists of twointernal functions (distrbs.m and newmenu.m)and a user-provided filedistdata.m . The filedistrbs.m is the disturbance module executive fileand is used to call bothdistdata.m andnewmenu.m.In batch mode, the disturbance figure window is not dis-played, and disturbance selection is accomplished bypredefining the variablecasenum . The batch modevariablecasenum must be assigned in the batch modeinput file to a valid disturbance scenario case number(i.e., a validdnames row number). As described in thebatch mode operation section, the workspace variablerunmode=’batch’ is reserved as an indicator ofbatch mode operation.

The functionnewmenu.m controls all GUI func-tions for the PLATSIM disturbance module. This func-tion displays a figure window with a top-level menu. Thelabels for this menu correspond to the disturbance sce-nario group labels stored in variablecnames . Each top-level menu has several submenus corresponding to thedisturbance scenarios as referenced in their respectiverows of the matrixdnames. The output argumentcasenum refers to a row number indnames and ispassed back into the filedistdata.m .

The PLATSIM disturbance options labeled Run Dis-turbances Separately and Run Disturbances Togetherdetermine how simulation results are generated. If RunDisturbances Separately is selected, the time historyresponse (including jitter results) for each disturbanceevent in a particular disturbance scenario is calculatedseparately. The total jitter results are then determined byadding the contribution from each disturbance event.When the overall dynamic response of the systems isdesired (i.e., the response of the system due to all distur-bance events applied simultaneously), then Run Distur-bances Together should be selected.

Page 46: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible
Page 47: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

43

Chapter 12

Simulation Module

The simulation routine namedsimuc (in filesimuc.m or simuc.mex* ) takes advantage of thesparsity of the plant system matices to perform efficienttime simulations for the closed-loop system. The open-loop simulations are performed by the routinesimuo (infile simuo.m or simuo.mex* ). These routines use thesparse discrete model of the plant and the discrete modelof the spacecraft control system. A discrete simulation ofthe open-loop and closed-loop behavior of the system isperformed through algebraic state propagation. The dis-cretized dynamics of the plant and the spacecraft controlsystem from equation (7) on mathematical formulationsare as follows:

where refers to the discrete form of the block diago-nal form of chapter 2, and

The simulation routines take advantage of the sparsity ofdiscretized state matrix . The 2× p packed version ofthe discrete system matrix is now denoted by . Thenthe simulation routines propagate the plant states asfollows:

xs k 1+( ) Asxs k( ) Bsu k( ) Bdw k( )+ +=

y k( ) Cxs k( )=

ypr

k( ) Cpr

xs k( ) Dupr

u k( ) Dwpr

w k( )+ +=

As

xc k 1+( ) Acxc k( ) Bcy k( )+=

u k( ) Cc– xc k( )=

AsAs

xs k 1;1:2:2p+( ) As 1:2:2p 1,( ) .* xs k;1:2:2p( )=

As 1:2:2p 2,( ) .* xs k;2:2:2p( )+

xs k 1;2:2:2p+( ) As 2:2:2p 1,( ) .* xs k;1:2:2p( )=

As 2:2:2p 2,( ) .* xs k;2:2:2p( )+

where, for example, uses MATLAB nota-tion to represent a vector whose elements are the first,third, fifth, etc., elements of ; repre-sents a vector using every other element from the secondcolumn of starting with the second row; and , ,

, u, andw denote the discrete plant state matrix, thediscrete spacecraft control input influence matrix, thediscrete disturbance influence matrix, the spacecraft con-trol input vector, and the disturbance vector, res-pectively. Symbols* and .* denote matrix multiplica-tion and element-by-element vector multiplication,respectively.

With this method of propagation, the matrix vectormultiplication requires only about 4p floating-point operations as compared with the 4p2 floating-pointoperations for the full matrix-vector multiplication. Thus,this method results in significant reduction in computa-tional time, particularly as the number of modes in modelincreases (p > 100). Currently, the simulation routinesimuc does not accommodate feedthrough terms (asso-ciated with measurement outputs not performance out-puts) for the plant or the spacecraft control system.However, feedthrough terms for the plant or the space-craft control system can easily be implemented with aslight modification of the routine.

To increase the computational speed of the discretesimulation beyond MATLAB routinessimuc andsimuo , the routines have been implemented inFORTRAN 77 with the same discrete architecture. Thecalling statement of the MEX-file version of the open-loop and closed-loop simulation routines are the same astheir M-file counterparts. Appendix A explains how tocreate the MEX-files from the FORTRAN 77 code dis-tributed with PLATSIM.

xs k 1+( ) xs k 1+( ) Bs* u k( ) Bd* w k( )+ +=

xs k 1:2:p;( )

xs k( ) As 2:2:p 2,( )

As As BsBd

Asxs k( )

Page 48: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible
Page 49: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

45

Chapter 13

Frequency Domain Analysis Module

PLATSIM accomplishes frequency domain analysisby calling the MATLAB scriptplatfreq (in M-fileplatfreq.m ) from the platsim.m script. Theplatfreq script obtains values for any PLATSIM run-time parameters that have not been previously set, calls afrequency domain analysis routine to calculate the Bodeplot data, and forms the plots.

The frequency domain analysis routines are namedsbodeo (in files sbodeo.m andsbodeo.mex* ) foropen-loop analysis andsbodec (in files sbodec.mand sbodec.mex* ) for closed-loop analysis. Theseroutines evaluate the transfer function matrix from theselected events of the chosen disturbance scenario to theselected performance outputs at each point of a user-specified vector of frequency values. Efficiency isachieved in the calculation by taking advantage of spe-cial characteristics of the plant model.2 The open-loopsystem matrix is sparse (see chapter 10), and the odd-numbered rows of the control and disturbance influencematrices are 0.

Open-Loop Calculation

Recall that the open-loop transfer function from thedisturbancesw to the performance outputypr is given inequation (9) as

where, for purposes of this chapter, and containonly the columns requested by execution control parame-terndist . The symbolr denotes the number of columnsin these matrices.

By taking advantage of sparsity in the open-loop sys-tem matrix, the computational complexity of calculating

is much less than it is for the full matrixtechniques. Recall from equations (2) and (3) that

2A paper by Peiman G. Maghami and Daniel P. Giesy describingthis, titled “Efficient Computation of Closed-Loop Frequency Re-sponse Matrices for Large Order Flexible Systems,” has been sub-mitted for publication.

T s( ) Cpr

sI As–( ) 1–Bd Dw

pr+=

Bd Dwpr

sI As–( ) 1– Bd

where

Then is block diagonal with theith blockbeing

whereI2 denotes the 2× 2 identity matrix. Furthermore,as noted in the discussion following equation (4) in chap-ter 2, the odd-numbered rows ofBd are 0. If the rowi ofBd is denoted by ,Q(s) is used to represent

, andQ(s) is partitioned as

(14)

where each partition matrixQi(s) is a 2 byr matrix, then

(15)

The calculation is completed in the following manner:

As

As1

0 … 0

0 As2 … 0

0 0 … Asp

=...

......

...

Asi 0 1

ωi2

– 2ζi– ωi

=

sI As–( ) 1–

sI2 Asi

– 1–

1 s2

2ζiωi s ωi2

+ + ⁄

s 2ζiωi+ 1

ωi2

– s=

i 1 2 … p, , ,=( )

bdi( )

sI As–( ) 1– Bd

Q s( )

Q1 s( )

Q2 s( )

Qp s( )

= ...

Qi s( ) 1 s2

2ζiωi s ωi2

+ + ⁄

bd

2i( )

sbd2i( )

=

i 1 2 … p, , ,=( )

T s( ) Cpr

Q s( ) Dwpr

+=

Page 50: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

46

Chapter 13

The gain and phase angle data (Bode plot data) are thencomputed directly from the frequency response functionmatrix. If no acceleration performance measurementsexist, then the feed-forward term is 0 and the softwarebypasses the step where is added.

The standard, full matrix way to calculateQ(s)involves first performing an LU decomposition of

followed by a backward and then forward solu-tion of the triangular systems of equations using the col-umns ofBd as right-hand sides. The FLOP (floating pointoperations) count for this isO(p3) + O(p2r). When thesolution is calculated as in equations (14) and (15), theFLOP count isO(pr). This count represents a substantialsavings, particularly when a large number of modes isnecessary to model the desired phenomena.

Closed-Loop Calculation

Recall from equations (10) to (12) that the closed-loop dynamics of the controlled spacecraft can be writtenas

where

and

Given the closed-loop state matrix , the blockdiagonal form of the open-loop plant has obviously beendestroyed by the coupling generated by the feedbackconnection of the plant and the spacecraft control system.However, the initial sparsity of the open-loop statematrix is still intact. Now, this sparsity is exploited todevelop an efficient method for the computation of theclosed-loop frequency response function matrix of thecontrolled flexible spacecraft. Recall from equation (13)that the closed-loop transfer function from the distur-bances to the performance outputs is

If sparsity is not exploited and many structural modes aremodeled, then from equation (13), a large computational

Dwpr

sI As–

x Ax Bdw+=

ypr

Cpr

x Dwpr

w+=

xxs

xc

=

AAs BsCc–

BcC Ac

= BdBd

0= C

prC

prDu

prCc–=

A

T s( ) Cpr

sI A–( )1–

= Bd Dwpr

+

effort is required to calculate the closed-loop frequencyresponse function matrix because the matrix term

needss = jω to be computed for all desiredfrequency values.

The matrix term in equation (13) can be written as

(16)

where Is and Ic are identity matrices of orders equal tothe size of plant state vector and controller state vector,respectively. Now let the elements of the matrix term

be defined as

(17)

A formula for this inverse is given in section 5.3g ofreference 4 as follows:

(18)

where it is called Schur’s identity. Using equations (12)and (17) in equation (13), the closed-loop transfer func-tion from the disturbances to the performance outputs isreduced to the following:

Using equation (18) this equation becomes

sI A–( ) 1–Bd

sI A–( )sIs As– BsCc

Bc– C sIc Ac–

E11 s( ) E12

E21 E22 s( )≡=

sI A–( ) 1–

X11 s( ) X12 s( )

X21 s( ) X22 s( )sI A–( )

1–≡

E11 s( ) E12

E21 E22 s( )

1–

=

∆ E22 E21E111–E12–=

X11 E111–

E111–E12∆ 1–

E21E111–

+=

X12 E111–E12∆ 1–

–=

X21 ∆ 1–E21E11

1––=

X22 ∆ 1–=

T s( ) Cpr

Dupr

Cc–X11 X12

X21 X22

Bd

0Dw

pr+=

Cpr

X11Bd Dupr

CcX21Bd– Dwpr

+=

T Cpr

E111–Bd C

prE11

1–E12∆ 1–

E21E111–Bd+=

Dupr

Cc∆ 1–E21E11

1–Bd Dw

pr+ +

Page 51: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

47

Frequency Domain Analysis Module

Using equation (16), replaceE12 andE21 in the expres-sion for ∆ in equation (18) and the previous equation.This substitution produces the following:

(19)

In this form, the following computational efficien-cies are observed:

• Because , and have 0’s in theodd-numbered rows, the subexpressions and

can be computed with the techniques pre-sented for efficient computation of the open-looptransfer function.

• The computation of requires a full matrixcomputation. However, it should not be costly tocompute because∆ is of the same order as the space-craft control system, which is usually small com-pared with the order of the analysis model of theplant.

• Common subexpressions, such as those mentionedin the previous items and those enclosed in parenthe-ses in equation (19), are computed once, saved, andreused.

∆ E22 BcCE111–BsCc+=

T Cpr

E111–Bd C

prE11

1–Bs Cc∆ 1–

BcCE111–Bd

–=

Dupr

Cc∆ 1–BcCE11

1–Bd

– Dw

pr+

E11 sI As–( )= Bs BdE11

1– BsE11

1– Bd

∆ 1–Bc

• Because of the expected shapes of the matrices andthe exploitation of common subexpressions, precom-puting certain matrix products in equation (19) thatare independent of the frequency parameters is notadvisable.

• If no acceleration sensors exist in the performanceoutputs so that the feed-forward matrices are 0, thesoftware can bypass the second line of the calcula-tion in equation (19).

Now, having defined , the frequency responsefunction matrix of the closed-loop system is evaluatedfor various values ofs = jω, with ω taking on the user-specified frequency values. The closed-loop gain andphase plots (Bode plots) are then computed directly fromthe frequency response function matrix.

Software Implementation

The evaluation of the open-loop or closed-looptransfer function is accomplished by MATLAB functionM-files or MEX-files. The M-files contain straight-forward implementations of the calculations presented inthe preceding two subsections.

The FORTRAN 77 source code for the MEX-filesuses the Basic Linear Algebra Subprograms (BLAS) toperform vector-vector, vector-matrix, and matrix-matrixoperations. (See refs. 6 to 12.) In addition, the LAPACK(ref. 12) subroutine ZGESV, a complex double precisionlinear equation solver, is used to calculate .

T

T s( )

∆ 1– Bc

Page 52: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible
Page 53: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

49

Chapter 14

Jitter Analysis Module

The jitter analysis module namedjitter (in filejitter.m and (optionally)jitter.mex* ) performsefficient jitter analysis of discrete time histories repre-sented in MATLAB as a vector of points.

The level of jitter in a given time history is definedas a function of a user-supplied jitter window, which isjust a time interval whose duration is no more than theduration of the time history. Suppose that the discretetime history z containsn points z(1), ...,z(n) at equaltime increment) and the length of the jitter window cancoverk of these points at a time with . First definezmax by setting

and definezmin by setting

The components of the vectorszmax and zmin give themaximum and minimum values inz for each distinctposition of the window as it slides along the vectorz. Jit-ter is then defined by

which is the maximum peak-to-peak excursion inz overthe jitter window in any position. In a typical application,jitter needs to be calculated for several different jitterwindows (i.e., several different values ofk).

If this definition is turned into a simple computerprogram, the calculation is inefficient because

references into thez vector must be made.In typical applications,n is 100000 or more, andk canrun from several hundred through several tens of thou-sands up to as large asn. Several ideas are implementedto improve the efficiency of this calculation.

For the smallest jitter window, a single scan is madethroughz, and lists of pointers are kept that point to loca-tions inz that might possibly contribute tozmax or zmin.At each step, a check is made to determine each valuethat can be dropped from each list. Values can bedropped if the window has passed by the location itpoints to or if new information has superceded it. At each

k n≤

zmax i( ) maxi

z i( ) z i 1+( ) … z i k 1–+( ), ,,[ ]=

zmin i( ) mini

z i( ) z i 1+( ) … z i k 1–+( ), ,,[ ]=

jitter max zmax 1( ) zmin 1( ) … zmax n k– 1+( ), ,–[=

zmin n k– 1+( ) ]–

k n k– 1+( )

step, the value ofzmax is z(j), where j is the smallestpointer in the maximum list. The determination ofzmin isanalogous. A running tally is kept that yields jitter at theend of the sweep.

For each larger jitter window, further efficiency isgained by using the information stored inzmax andzminfrom the previous jitter window. Suppose , theinformation stored inzmax and zmin correspond to awindow containing points, and jitter is to becalculated for a jitter window containing points. Tofind , the interval

is first covered with intervals of length(overlap is permissible and can be used to advantage, butnone of the short intervals can extend outside the longinterval). Then, the maximum of thez data over eachshort interval is found from an appropriate entry ofzmax,and the maximum of thez data over the long interval isdetermined as the maximum of these numbers. By prop-erly choosing this covering, the maximum can be deter-mined for several additional values ofi by moving onlythe left and right covering intervals and leaving the cen-tral group of covering intervals fixed. For these values ofi, is computed by takingthe maximum of just three numbers, that is, values fromthezmax array for the left and right covering intervals anda value for the central group that was calculated at theinitial placement of the covering intervals. Eventually,this moving of left and right intervals and leaving thecentral group fixed arrives at an unusable configuration,at which point a new start must be made with a new cov-ering. The calculation of isperformed in the same manner. With these values,zmaxandzmin can be updated for the new jitter window length,and a value accumulated to find the jitter at the new jitterwindow length.

For some values ofn, k1, andk2, the time to recom-pute the central group contribution each time a new startis made with a new covering becomes significant. Thus,using an adaptation of the technique for the first window,now applied to subsequences from thezmax and zminarrays for thek1 window, provides further efficiency inthek2 window calculation.

The proposed jitter algorithm provides for sub-stantial computational efficiency. In a typical case, withn = 100001 and four jitter windows giving values of

k1 k2<

k1k2

max z i( ) … z i k2 1–+( ), ,[ ]i i k2 1–+,[ ] k1

max z i( ) … z i k2 1–+( ), ,[ ]

min z i( ) … z i k2 1–+( ), ,[ ]

Page 54: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

50

Chapter 14

k = 500, 900, 4500, and 27500, the processing time fromthe techniques outlined previously is a factor of over1600 times less than that obtained with the brute forcemethod. Testing indicates that the present method is lin-ear in problem size (i.e., the problem is twice as big whenboth n and k values are doubled), and the brute forcemethod is quadratic in problem size.

The jitter analysis is performed with a statement ofthe form

[zjtr, zmax, zmin] = jitter(z, delt,...win);

The required inputs are as follows:

z A vector containing the time history. The valueof n above islength(z) .

delt A scalar containing time increment betweenpoints ofz .

win A vector containing the lengths of the jitterwindows (measured in time units, the values ofk used above are in the vectorwin/delt ).

The restrictions are as follows:

• The value indelt must be positive.

• The numbers inwin must be in nondecreasing order,and the largest must be no bigger thandelt*(length(z) − 1) , the total duration of thetime history in z.

The outputs are as follows:

zjtr A vector the same length aswin . The valuereturned inzjtr(i) is the jitter inz for thejitter window win(i) . This output isrequired.

zmax, These are optional outputs, originally includedzmin for debugging purposes. These are the same as

thezmax andzmin in the definition above for thelongest jitter window inwin .

The file jitter.m contains help information forthe jitter function and does the jitter calculation if noMEX-file is available. The jitter calculation however canbe performed substantially faster with the filejitter.mex* . Appendix A explains how to create theMEX-files from the FORTRAN 77 code distributed withPLATSIM.

The FORTRAN 77 code for jitter analysis is con-tained in six subprograms that are distributed in the files

jitter.for , jitter.f , jitr1b.f , jitr1d.f ,jitrnb.f , jitrnd.f , and jitterg.f . The filejitterg.f contains the MATLAB MEX-file gatewayroutine. This routine manages the transfer of databetween MATLAB and FORTRAN. The remaining fiveroutines can be used as a package in FORTRAN 77applications for jitter analysis.

The main routine is subroutineJITTER . This rou-tine calculates the number of points in each jitter win-dow, then it selects from among the remaining fourmodules to complete the jitter calculation.

Two of the modules,JITR1B and JITR1D , per-form the calculation for the smallest window. They areidentical in function; both take the time history vectorzand the numberk of points in the jitter window as inputand return the amount of jitter inz for this window andthe zmax andzmin arrays. The difference is in the algo-rithm used.JITR1B implements the brute force calcula-tion, andJITR1D uses the more sophisticated version.Both algorithms are included because for values ofkclose to 1 orn, the brute force algorithm is better than themore sophisticated algorithm, which has some nontrivialO(n) overhead. The decision as to which module to use isbased on comparing the estimated timings of the twomodules. These timing estimates are based on timing for-mulas that were empirically determined by timing a vari-ety of problems over a range ofn andk values on a SunSparc 10/512 workstation. A weighted least-squares fit-ting technique is used on the resulting data to providecoefficients in timing formulas. The form of these timingformulas is based on an analysis of the algorithms.

Once the first window calculation has initialized thezmax andzmin arrays, further calculation is performed byeitherJITRNB or JITRND. These are also identical infunction; they take as inputzmax; zmin; n; k1, (the numberof points in the window used in calculating the input val-ues ofzmax andzmin), andk2, (the number of points in thewindow over which jitter is now to be calculated). Theoutput is the value of jitter for this new window andupdated values in the arrayszmax andzmin for this newwindow. The difference betweenJITRNB andJITRNDis in whether the calculation of the maximum and mini-mum ofy over the central group of short input windowsis done in a brute force fashion or by the more sophisti-cated algorithm. Once again, the choice of which moduleto use is determined by comparing the estimated timingsbased on empirical formulas.

Page 55: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

51

Chapter 15

Data Reduction

Plotting and printing time histories from aPLATSIM simulation can place a heavy burden on com-putational resources. These time histories are normally ahundred thousand or even a million points long. Plottinga time history of 100000 points produces an EPS file ofabout half a megabyte, which takes a typical PostScriptprinter about 9.5 min. to print. The EOS-AM-1 studyproduced 24 output time histories that typically con-tained a million points for each of the 59 disturbanceevents. The burden this amount places on disk space andprinter time makes it virtually impossible to producehardcopies of all these plots.

The goal is to use MATLAB to reduce and plot timehistories calculated by the linear time simulation andmake hard copies in a reasonable amount of time with areasonable amount of disk storage. One solution is to plotfewer points by sampling. This solution is fine as long asthe plot is smooth, but the plot looses visual informationwhen a lot of jitter occurs in the signal. In the worst case,major jitter components can be aliased out. At the veryleast, fine detail of the jitter envelope is lost.

The solution presented here is based on physicalcharacteristics of the plot device. Typical printers todayare raster devices. The printers used in the developmentof PLATSIM are laser printers with a resolution of300 dpi (dots per inch). A default size MATLAB plotprinted in landscape mode uses anX-axis of 8.5 in, whichis 2550 pixels long. Plotting 1000001 points over thisaxis means that 392 or 393 points are plotted over eachpixel of theX-axis. Thus, the pen moves vertically upand down about 392 times before it undergoes a motionwith a minimal horizontal movement. The idea is to cal-culate the net effect of all that vertical movement andthen plot it with a minimum of pen strokes.

The data points to be plotted are divided intonplpts (one of the execution control parameters) non-overlapping groups of consecutive points, the groupscontaining, as nearly as possible, the same number ofpoints. A polygonal path is computed that covers therange of each group vertically at a single representativex-coordinate (which is accomplished with a single verti-cal line segment) together with vertical and sideways

positioning moves to transition from one group of data tothe next. To make the resulting graph print as fast as pos-sible, logic was introduced to minimize the number ofline segments in the plot. When this technique wasimplemented in an M-file, it involved a lot of if-then-elselogic and was slow. Thus, this technique was also imple-mented as a MEX-file with a speed increase of about80 times.

The principle module for fast plotting istrplot4 (in file trplot4.m and (optionally)trplot4.mex* ). This routine is used as follows:

>>[a,b]=trplot4(delt,y,nplpts)

The vectory is assumed to be a time history withy(i)occurring at time(i-1)*delt . If nplpts is set to anumber reflecting that pixel count (3600 has been foundto work for full page plots in landscape orientation on300 dpi printers and is the default value of optional vari-ablenplpts ), thenplot(a,b) gives nearly the samepicture as plot(t,y) (where t=delt*(0:length(y)-1)) with 2*nplpts ≤ length(b)≤ 4*nplpts-2 .

Appendix A explains how to create the MEX-filesfrom the FORTRAN 77 code distributed withPLATSIM.

Five files support the fast plotting module:trplot4.for , trplot4.f , trplot4g.f , xn.f ,and trplot4.m . The file trplot4.for is simplya concatenation of the three.f files. The filetrplot4.f is the main computational module fortrplot4.mex* . The file trplot4g.f is the gate-way routine for transforming data between MATLABformat and FORTRAN 77 format. The filexn.f con-tains a utility subroutine. The filetrplot4.m is aMATLAB M-file function that is logically equivalent totrplot4.mex* but much slower. Even if theMEX-file is used,trplot4.m is included to providehelp.

NASA Langley Research CenterHampton, VA 23681-0001June 12, 1995

Page 56: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible
Page 57: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

53

Appendix A

Installation Instructions

UNIX Systems

PLATSIM is distributed in a UNIX tar file, whichmay be in compressed format. The PLATSIM code is indirectory platdir , and the files pertaining to theEOS-AM-1 example are in the subdirectoryplatdir/eos_eg .

If PLATSIM comes in a compressed file (i.e., thelast letter of filename is Z), it should be uncompressedwith the UNIX utility uncompress . The user shouldthen change (cd ) to the directory which will be the par-ent of directoryplatdir and untar the tar file. (Thecommandtar -xf platsim_ tar_file_nameworks on a Sun SPARCstation.)

Next, change the directory toplatdir and editmakefile according to the directions in themakefile comments. This step is necessary to custom-ize makefile to the user’s computing environment.

The MATLAB MEX-files and filestartup.m are thencreated by the UNIX commandmake. If the user doesnot want to compile MEX-files but still wants the tem-plate file startup.m , then use the commandmakestartup .

Other Systems

For systems other than UNIX, the user can install thePLATSIM files on the system by following the directionsincluded with the distribution medium. The directoryplatdir includes six files with.for extensions. Eachof these contains the FORTRAN 77 code for the corre-sponding MEX-file. To obtain MEX-files the user needsto compile each of these files individually with the scriptfmex , which is supplied with the MATLAB. To provideMATLAB with the location of PLATSIM and the user-supplied model, the user needs to edit thestartup.mfile that is distributed with PLATSIM.

Page 58: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible
Page 59: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

55

Appendix B

Listing of User-Supplied Routines for EOS-AM-1Example

The following listings are examples of the routines to be supplied to PLATSIM by the user. These examples arebased on the EOS-AM-1 spacecraft and are distributed with PLATSIM. The source listing for PLATSIM and its sup-porting routines are available through NASA’s software technology transfer center COSMIC.3 The user may want to usethese examples as templates for writing the user-supplied routines for the platform that the user wishes to analyze.

mkdamp.m

function [d]=mkdamp(omega)%% function [d]=mkdamp(omega)%% purpose: to assign modal damping ratios%% input variables:%% omega : vector containing the natural frequencies%% output variables:%% d : vector of damping ratios%%

% Author: Peiman G. Maghami% Spacecraft Controls Branch% NASA Langley Research Center%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% damping schedule for the EOS-AM-1 Spacecraft%% damping ratio = 0.2% for modes with frequency less than 15Hz% damping ratio = 0.25% for modes with frequency greater than 15Hz% but less than 50Hz% damping ratio = 0.3% for modes with frequency greater than 50Hzfor i=1:max(size(omega));%%if omega(i)< 30.0*pi; d(i)=0.002;elseif omega(i)>=30.0*pi&omega(i)<100.0*pi; d(i)=0.0025;else;d(i)=0.003;end;end;d=d’;

3COSMIC (Computer Software Management and Information Center), 382 E. Broad Street, University of Georgia, Athens, GA 30602.

Page 60: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

56

Appendix B

instdata.m

function [act,mout,pout,instr,window]=instdata%% function [act,mout,pout,instr,window]=instdata%% purpose: a user-defined routine to provide the grid point numbers, directions% distribution/contribution factors, and identification numbers for% the spacecraft instruments. It provides names for the prformance% outputs, as well as, window time sizes for jitter/stability analysis.%%% output variables:%%% act : control input information matrix% mout : measurement output information matrix% pout : performance output information matrix% instr : list of names for performance outputs% window : list of time window sizes for jitter analysis%%%

% Author: Peiman G. Maghami% Spacecraft Controls Branch% NASA Langley Research Center% August, 1993%% modified: P. G. Maghami% March, 1994%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% The following parameters are associated with EOS-AM-1 Spacecraft.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% define the spacecraft control input information matrix (the ACS input at% the RWA)%act=[155003,155003,155003; 4, 5, 6; 1, 2, 3; 1.0, 1.0, 1.0];%% define grid points for the measurement feedbacks at the NAVBASE%mout=[111091,111091,111091,111091,111091,111091; 4, 4, 5, 5, 6, 6; 1, 2, 3, 4, 5, 6; 1.0, 1.0, 1.0, 1.0, 1.0, 1.0; 0, 1, 0, 1, 0, 1];%% define grid points for performance outputs

Page 61: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

57

Listing of User-Supplied Routines for EOS-AM-1 Example

% [NAVBASE, CERES1, CERES2, MISR, MODIS-N, MOPITT, SWIR, TIR, VNIR]%pout=[111091,111091,111091,350420,350420,350420,... 351420,351420,351420,333498,333498,333498,361203,361203,361203,... 396400,396400,396400,329722,329722,329722,326989,326989,326989,... 325647,325647,325647; 4,5,6,4,5,6,4,5,6,4,5,6,4,5,6,4,5,6,4,5,6,4,5,6,4,5,6; 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27; 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1; 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];%% convert the performance output units from rads to arcsec%pout(4,:)=(180.0*3600.0/pi)*pout(4,:);%%% define the performance output names, display and unit labels%instr=str2mat(’1|NAVBASE Roll|NAVBASE|arcsec’,’2|NAVBASE Pitch|NAVBASE|arcsec’);instr=str2mat(instr,’3|NAVBASE Yaw|NAVBASE|arcsec’);instr=str2mat(instr,’4|CERES1 Roll|CERES|arcsec’,’5|CERES1 Pitch|CERES|arcsec’);instr=str2mat(instr,’6|CERES1 Yaw|CERES|arcsec’);instr=str2mat(instr,’7|CERES2 Roll|CERES|arcsec’,’8|CERES2 Pitch|CERES|arcsec’);instr=str2mat(instr,’9|CERES2 Yaw|CERES|arcsec’);instr=str2mat(instr,’10|MISR Roll|MISR|arcsec’,’11|MISR Pitch|MISR|arcsec’);instr=str2mat(instr,’12|MISR Yaw|MISR|arcsec’);instr=str2mat(instr,’13|MODIS Roll|MODIS|arcsec’,’14|MODIS Pitch|MODIS|arcsec’);instr=str2mat(instr,’15|MODIS Yaw|MODIS|arcsec’);instr=str2mat(instr,’16|MOPITT Roll|MOPITT|arcsec’,’17|MOPITT Pitch|MOPITT| arcsec’);instr=str2mat(instr,’18|MOPITT Yaw|MOPITT|arcsec’);instr=str2mat(instr,’19|SWIR Roll|ASTER|arcsec’,’20|SWIR Pitch|ASTER|arcsec’);instr=str2mat(instr,’21|SWIR Yaw|ASTER|arcsec’);instr=str2mat(instr,’22|TIR Roll|ASTER|arcsec’,’23|TIR Pitch|ASTER|arcsec’);instr=str2mat(instr,’24|TIR Yaw|ASTER|arcsec’);instr=str2mat(instr,’25|VNIR Roll|ASTER|arcsec’,’26|VNIR Pitch|ASTER|arcsec’);instr=str2mat(instr,’27|VNIR Yaw|ASTER|arcsec’);%% set window sizes for the jitter analysis%window=[1.0,1.8,9.0,55.0,420.,480.0,1000.00];%

distdata.m

function [dist,w,dt,cnames,dnames,instdat,mapping]=distdata(casenum)% function [dist,w,dt,cnames,dnames,instdat,mapping]=distdata(casenum)%

% Author: Sean P. Kenny% NASA Langley Research Center% Spacecraft Controls Branch% Created: 2/14/94%%-----------------------------------------------------------------------

Page 62: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

58

Appendix B

if nargin<1, casenum=0;end;%%% Individual Instrument Disturbances (IID)%% Defines labels for pull-down menus, also labels for jitter tables,% and time history plots.%% An IID GUI menu item can be disabled by including a preceding asterisk% in the string variable, e.g., s23=’* High Gain Antenna’, is% displayed, but cannot be selected with the mouse. This feature% pertains to GUI mode ONLY ! Batch mode or terminal display allows% the selection of all entries.%%s1=’TIR repoint’;s2=’TIR calibrate’;s3=’TIR scan’;s4=’TIR chopper’;s5=’TIR cryocooler LDE’;s6=’MODIS scan mirror’;s7=’MODIS static imbalance’;s8=’MODIS dynamic imbalance’;s9=’MOPITT mirror scan’;s10=’MOPITT cryocooler LDE’;s11=’MOPITT pressure modulated cells’;s12=’Reaction Wheel Assembly case 1’;s13=’* Reaction Wheel Assembly case 2’;s14=’Solar Array Drive’;s15=’Solar Array Thermal Snap’;%%% Combine IID’s into a matrix form (a maximum of 10 arguments are allowed)% Each string variable represents a row entry within the dnames string matrix.dnames=str2mat(s1,s2,s3,s4,s5,s6,s7,s8,s9,s10);dnames=str2mat(dnames,s11,s12,s13,s14,s15);%%%-----------------------------------------------------------------------%% Major Instrument Disturbance Case (MIDC)% (labels for top-level menu items on pop-up figure)%ss1=’ASTER-TIR’;ss2=’MODIS’;ss3=’MOPITT’;ss4=’Misc. Disturbances’;%% Combine MIDC’s into a matrix formcnames=str2mat(ss1,ss2,ss3,ss4);%%% Setup mapping between MIDC’s and IID case numbers.

Page 63: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

59

Listing of User-Supplied Routines for EOS-AM-1 Example

%% instdat(i) corresponds to ss(i), e.g., instdat5 are all IID’s that% belong to MIDC ss5. The elements of the instdat(i) vectors are the% row indices of the IID’s within the dnames string matrix. For example,% if the 4th,5th, and 10th row entries in dnames correspond to instdat5,% then instdat5=[4,5,10].%% mapping=[];instdat1=[1,2,3,4,5]; linst=length(instdat1); mapping=[mapping,linst];instdat2=[6,7,8]; linst=length(instdat2); mapping=[mapping,linst];instdat3=[9,10,11]; linst=length(instdat3); mapping=[mapping,linst];instdat4=[12,13,14,15]; linst=length(instdat4); mapping=[mapping,linst];%instdat=[instdat1,instdat2,instdat3,instdat4];%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Based upon menu selection, create the proper disturbance% input vector(s).%%% TIR Mirror Repointing%if (casenum == 1)% 326990 ==> scannerigrid=[326990];idir=[4];inum=[1];ifac=ones(size(inum));dist=[igrid;idir;inum;ifac];[dt,torque] = tir1;w(:,1)=torque’;%% TIR Mirror Calibration%elseif (casenum == 2)% 326944 ==> chopperigrid=[326990];idir=[4];inum=[1];ifac=ones(size(inum));dist=[igrid;idir;inum;ifac];[dt,torque] = tir2;w(:,1)=torque’;%

Page 64: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

60

Appendix B

% TIR Scanner%elseif (casenum == 3)% 326990 ==> scannerigrid=[326990 326990 326990 326990 326990 326990];idir=[1 2 3 4 5 6];inum=[1:6];ifac=ones(size(inum));dist=[igrid;idir;inum;ifac];[dt,torque] = tirscan1;w(:,1)=torque’;[dt,torque] = tirscan2;w(:,2)=torque’;[dt,torque] = tirscan3;w(:,3)=torque’;[dt,torque] = tirscan4;w(:,4)=torque’;[dt,torque] = tirscan5;w(:,5)=torque’;[dt,torque] = tirscan6;w(:,6)=torque’;%% TIR Chopper%elseif (casenum == 4)% 326944 ==> chopperigrid=[326944 326944];idir=[1 2];inum=[1:2];ifac=ones(size(inum));dist=[igrid;idir;inum;ifac];[dt,torque] = tirchop1;w(:,1)=torque’;[dt,torque] = tirchop2;w(:,2)=torque’;%% TIR Compressor/Displacer Low Distortion Electronics (LDE)%elseif (casenum == 5)% 326992 ==> compressor% 326993 ==> displacerigrid=[326992 326992 326992 326992 326992 326993 326993 326993 326993 326993];idir=[1 2 4 5 6 2 1 4 5 6];inum=[1:10];ifac=ones(size(inum));dist=[igrid;idir;inum;ifac];[dt,torque] = tirca1;w(:,1)=torque’;[dt,torque] = tirca2;w(:,2)=torque’;[dt,torque] = tirca3;w(:,3)=torque’;[dt,torque] = tirca4;w(:,4)=torque’;[dt,torque] = tirca5;

Page 65: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

61

Listing of User-Supplied Routines for EOS-AM-1 Example

w(:,5)=torque’;[dt,torque] = tirda1;w(:,6)=torque’;[dt,torque] = tirda2;w(:,7)=torque’;[dt,torque] = tirda3;w(:,8)=torque’;[dt,torque] = tirda4;w(:,9)=torque’;[dt,torque] = tirda5;w(:,10)=torque’;%%% MODIS scan mirror%elseif (casenum == 6)% 3601 ==> averaged interface% 361203 ==> scan mirror center% 361342 ==> scan mirror motor/encoder% 355349 ==> solar door 8/12/93 spkigrid=[361342];idir=[4];inum=[1];ifac=ones(size(inum));dist=[igrid;idir;inum;ifac];[dt,torque] = modis1;w(:,1)=torque’;%% MODIS static imbalance%elseif (casenum == 7)% 361342 ==> scan mirror motor/encoderigrid=[361342 361342];idir=[2 3];inum=[1:2];ifac=ones(size(inum));dist=[igrid;idir;inum;ifac];[dt,for1,for2] = modis2;w(:,1)=for1’;w(:,2)=for2’;%% MODIS dynamic imbalance%elseif (casenum == 8)% 361342 ==> scan mirror motor/encoderigrid=[361342 361342];idir=[5 6];inum=[1:2];ifac=ones(size(inum));dist=[igrid;idir;inum;ifac];[dt,tor1,tor2] = modis3;w(:,1)=tor1’;w(:,2)=tor2’;%% MOPITT mirror scan

Page 66: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

62

Appendix B

%elseif (casenum == 9)% 396400 ==> scan motor 1% 396403 ==> scan motor 2% 3608 ==> Avg. interfaceigrid=[396400];idir=[4];inum=[1];ifac=ones(size(inum));dist=[igrid;idir;inum;ifac];[dt,torque] = mopitt;w(:,1)=torque’;%% MOPITT Compressor/Displacer Low Distortion Electronics (LDE)%elseif (casenum == 10)% 396416 ==> compressor% 396417 ==> displacerigrid=[396416 396416 396416 396417 396417 396417];idir=[2 1 5 2 1 5];inum=[1:6];ifac=ones(size(inum));dist=[igrid;idir;inum;ifac];[dt,torque] = mopittc1;w(:,1)=torque’;[dt,torque] = mopittc2;w(:,2)=torque’;[dt,torque] = mopittc3;w(:,3)=torque’;[dt,torque] = mopittd1;w(:,4)=torque’;[dt,torque] = mopittd2;w(:,5)=torque’;[dt,torque] = mopittd3;w(:,6)=torque’;%% MOPITT pressure modulated cell (PMC)%elseif (casenum == 11)% 396412 ==> PMC #1% 396413 ==> PMC #2igrid=[396412 396413];idir=[1 1];inum=[1:2];ifac=ones(size(inum));dist=[igrid;idir;inum;ifac];[dt,pmc1,pmc2] = mopmc;w(:,1)=pmc1’;w(:,2)=pmc2’;%%% Reaction Wheel Assembly (RWA) Imbalance: Case 1%% ** static imbalance in wheel #1 **%

Page 67: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

63

Listing of User-Supplied Routines for EOS-AM-1 Example

elseif (casenum == 12)% 50600 ==> RWA averaged interface% 155003 ==> RWA 1 (farthest from C.G.)igrid=[155003 155003 155003];idir=[1 2 3];inum=[1:3];ifac=ones(size(inum));dist=[igrid;idir;inum;ifac];[dt,rwax,rway,rwaz] = rwa1;w(:,1)=rwax’;w(:,2)=rway’;w(:,3)=rwaz’;%% Reaction Wheel Assembly (RWA) Imbalance: Case 2%elseif (casenum == 13)% ==>%igrid=[ ];%idir=[1 2 3];%inum=[1:3];%ifac=ones(size(inum));%dist=[igrid;idir;inum;ifac];disp(’THIS CASE IS NOT CURRENT as of 8/11/93 SPK’);%[dt,rwax,rway,rwaz] = rwa2;%w(:,1)=rwax’;%w(:,2)=rway’;%w(:,3)=rwaz’;%% Solar Array Harmonic Drive%elseif (casenum == 14)% 69090 ==> solar array drive (SAD)igrid=[69090];idir=[5];inum=[1];ifac=ones(size(inum));dist=[igrid;idir;inum;ifac];[dt,torque] = sadhd;w(:,1)=torque’;%% Solar Array Thermal Snap%elseif (casenum == 15)% 69090 ==> SAD% 60024 ==> SAigrid=[69090 60024 60024];idir=[4 1 3];inum=[1:3];ifac=ones(size(inum));dist=[igrid;idir;inum;ifac];[dt,torque] = sa1;w(:,1)=torque’;[dt,torque] = sa2;w(:,2)=torque’;[dt,torque] = sa3;

Page 68: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

64

Appendix B

w(:,3)=torque’;%end%% End distdata.m

formscs.m

function [aacs,bacs,cacs]=formscs

%% function [aacs,bacs,cacs]=formscs%% Purpose: To Form the continuous-time spacecraft control system (SCS)% for the space platform%% Currently, this function forms the attitude control system% for the EOS-AM-1 Spacecraft.%%% output variables:%% aacs : the SCS state matrix (continuous)% bacs : the SCS input influence matrix (continuous)% cacs : the SCS output influence matrix%

% Author: P. G. Maghami% Spacecraft Controls Branch% NASA Langley Research Center% December, 1992%% Modified: March, 1994%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% third-order Butterworth filterkf=0.25005;af=1.0;bf=1.2600;cf=0.7938;df=kf;numf=kf;denf=[af,bf,cf,df];% wide-band notch filteran=0.52335;bn=0.19678;cn=1.0;kn=0.57408;numn=[an,bn,cn];denn=[an,kn,cn];% rate gyrokg=1.0;wg=12.5664;zg=0.7071;numg=[kg*wg*wg];deng=[1.0,2.0*zg*wg,wg*wg];% zero order holdtaw=0.512;% numh=taw;denh=[0.125*taw*taw,taw,1.00];

Page 69: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

65

Listing of User-Supplied Routines for EOS-AM-1 Example

numh=1.00;denh=[0.125*taw*taw,taw,1.00];% delaynumd=[0.125*taw*taw,-taw,1.00];dend=[0.125*taw*taw,taw,1.00];%krp=[4284.6;6696.4;8322.5];kri=[30.604;40.761;105.68];%% rate loop compensator-rollnumrr=[krp(1),kri(1)];denrr=[1.00,0.00];%% rate loop compensator-pitchnumrp=[krp(2),kri(2)];denrp=[1.00,0.00];%% rate loop compensator-yawnumry=[krp(3),kri(3)];denry=[1.00,0.00];%kp=[0.051604;0.049064;0.047159];ki=[1.5199e-4;1.6984e-4;3.3011e-4];%% position loop compensator-rollnumpr=[kp(1),ki(1)];denpr=[1.00,0.00];%% position loop compensator-pitchnumpp=[kp(2),ki(2)];denpp=[1.00,0.00];%% position loop compensator-yawnumpy=[kp(3),ki(3)];denpy=[1.00,0.00];%% rate loop total compensation%%% transform (numg,deng) to state-space%[a1,b1,c1,d1]=tf2ss(numg,deng);%%% tranform the position-loop combined TFs to state-space%[ap1,bp1,cp1,dp1]=tf2ss(numpr,denpr);[ap2,bp2,cp2,dp2]=tf2ss(numpp,denpp);[ap3,bp3,cp3,dp3]=tf2ss(numpy,denpy);%%% combine the position loop and rate loop filters%[ac1,bc1,cc1,dc1]=append(ap1,bp1,cp1,dp1,a1,b1,c1,d1);[ac2,bc2,cc2,dc2]=append(ap2,bp2,cp2,dp2,a1,b1,c1,d1);[ac3,bc3,cc3,dc3]=append(ap3,bp3,cp3,dp3,a1,b1,c1,d1);%cc1=cc1(1,:)+cc1(2,:);dc1=dc1(1,:)+dc1(2,:);cc2=cc2(1,:)+cc2(2,:);dc2=dc2(1,:)+dc2(2,:);cc3=cc3(1,:)+cc3(2,:);dc3=dc3(1,:)+dc3(2,:);%% combine the butterworth filter and the notch filter%[num1,den1]=series(numf,denf,numn,denn);%

Page 70: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

66

Appendix B

% combine the rate loop compensator in series with the notch filter%[num31,den31]=series(numrr,denrr,num1,den1);[num32,den32]=series(numrp,denrp,num1,den1);[num33,den33]=series(numry,denry,num1,den1);%% add the zero order hold in series%[num41,den41]=series(num31,den31,numh,denh);[num42,den42]=series(num32,den32,numh,denh);[num43,den43]=series(num33,den33,numh,denh);%% add the time delay in series%[numinr,deninr]=series(num41,den41,numd,dend);[numinp,deninp]=series(num42,den42,numd,dend);[numiny,deniny]=series(num43,den43,numd,dend);%% transform the rate loop TFs to state-space%[ar1,br1,cr1,dr1]=tf2ss(numinr,deninr);[ar2,br2,cr2,dr2]=tf2ss(numinp,deninp);[ar3,br3,cr3,dr3]=tf2ss(numiny,deniny);%%% Form the SCS state-space model%%[aacs1,bacs1,cacs1,dacs1]=series(ac1,bc1,cc1,dc1,ar1,br1,cr1,dr1);[aacs2,bacs2,cacs2,dacs2]=series(ac2,bc2,cc2,dc2,ar2,br2,cr2,dr2);[aacs3,bacs3,cacs3,dacs3]=series(ac3,bc3,cc3,dc3,ar3,br3,cr3,dr3);%[aacs,bacs,cacs,dacs]=append(aacs1,bacs1,cacs1,dacs1,aacs2,bacs2,cacs2,dacs2);[aacs,bacs,cacs,dacs]=append(aacs,bacs,cacs,dacs,aacs3,bacs3,cacs3,dacs3);%% apply the scale factor KW of the reaction wheels (units in lb-in/ssc)%kw=0.22*12.00;cacs=cacs*kw;dacs=dacs*kw;%

Page 71: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

67

Appendix C

Execution Control Parameters

PLATSIM has 20 execution control parameters,which are MATLAB workspace variables. Some of theseparameters have meaning to both time and frequencydomain analysis, some only to time domain, and someonly to frequency domain. With two exceptions, if theuser has not defined an execution control parameterwhen the commandplatsim is given, PLATSIMassigns a default value to the variable. One of these

exceptions,runmode , must be set before PLATSIM iscalled. The other exception iscasenum . If PLATSIM isrunning in GUI or command mode,casenum is set byuser responses to the Disturbances menu. In batch mode,casenum must be set before PLATSIM is called. Speci-fications for the individual execution control parametersfollow:

Execution Control Parameters

Name Default Used by Description

runmode Undefined Both Determines what mode PLATSIM runs in. Must be set toone of’GUI’ , ’command’ , or ’batch’ before theplatsim command is entered. Only the first characterof runmode is significant and may be of either case.

tdflag Yes Both Defaults to time domain analysis. Settdflag = ’no’for frequency domain analysis. Can be set from GUIAnalysis menu and command mode.

casenum None Both Which disturbance to use. PLATSIM inputs this value tothe user-supplied MATLAB functiondistdata . Canbe set from GUI and command mode Disturbance menu.

nmode 0 Both Which structural modes to model. The default0 meansall modes. A positive integern means modes 1throughn. A negative integer-n means only moden. AMATLAB vector like [1:6,10,13:16] means useexactly the mode numbers in the vector. Can be set fromGUI mode by slider or data entry box and from commandmode.

clflag Yes Both Defaults to closed loop analysis. For open loop analysis,setclflag=’no’ . Can be set from GUI mode Controlsubmenu of Options menu and from command mode.

desint Undefined Both Determines which performance outputs will be modeled.If left undefined, all will be used. To use, setdesint toa vector of instrument identification numbers (theseappear in the third row of thepout matrix returned byuser-supplied MATLAB functioninstdata ). Can beset from GUI mode Performance Output submenu ofOptions menu. Note 1 applies.

pltflag Yes Both In time domain analysis, causes reduction of time historydata for plotting and writing of MAT-file with reduced

Page 72: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

68

Appendix C

time histories. In both analyses, causes plots (time his-tory or Bode) to be displayed on screen. Disable by set-ting pltflag=’no’ . Can be set from GUI modePlotting & Printing submenu of Options menu and fromcommand mode.

prtflag Yes Both Ifpltflag is set to yes, this causes the encapsulatedPostScript forms of the plots to be written to files. Dis-able by settingprtflag=’no’ . Can be set from GUImode Plotting & Printing submenu of Options menu andfrom command mode.

gad Identity Both This is used for adjusting the spacecraft control systeminputs. Parametergad should be defined as anm × mmatrix, wherem is the number of spacecraft control sys-tem inputs in the vectoru. The scaled control inputs aregiven byunew= gad × uold. Note that the default matrixfor gad is an identity matrix. This is actually imple-mented by adjusting the spacecraft control system outputinfluence and feedthrough matrices bygad . For open-loop analysis, this parameter is ignored. This option isusually used when inertia changes require gain adjust-ments for the spacecraft system. Notes 1 and 2 apply.

phold 20 Both A mnenmonic for plot hold,phold is the number of sec-onds a time history or Bode plot or jitter analysis tablewill remain on screen before being cleared for the nextplot. Notes 1 and 2 apply.

jtrflag Yes Time Defaults to perform jitter analysis on time histories. Dis-able by settingjtrflag=’no’ . Can be set from GUImode Options menu. Note 1 applies.

multflag No Time Defaults to run a separate time simulation for each eventin the disturbance scenario. To simulate the effect of alldisturbances simultaneously, setmultflag=’yes’ .Can be set from GUI mode Disturbance menu. Note 1applies.

saveflag No Time Defaults to not save full time histories in MAT-files. Tosave full time histories, setsaveflag=’yes’ . Can beset from GUI mode Options menu. Note 1 applies.

tclip 0 Time The parametertclip is used for clipping the time histo-ries. If the value entered is not 0 (the default), any datapoint corresponding to a time beforetclip will beremoved, that is, not used for jitter computation. Units oftclip must match the units of parameterperiodreturned by user-supplied MATLAB functiondistdata . This option is useful in the jitter analysis ofsteady-state disturbance sequences such as theEOS-AM-1 solar array drive disturbance and cryocoolerdisturbances. May be set from GUI mode slider or dataentry box. Note 1 applies.

pmflag Yes Time Defaults to display during simulation a performancemeter that shows what percent of the simulation calcula-tion is completed. Can be set from GUI mode Analysis

Page 73: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

69

Execution Control Parameters

________________________________Note 1: To run PLATSIM in command mode with a nondefault

value for this parameter, it must be set by MATLAB assignmentstatement prior to invokingplatsim .

Note 2: To run PLATSIM in GUI mode with a nondefault valuefor this parameter, it must be set by MATLAB assignment state-ment prior to invokingplatsim .

menu. To turn off the performance meter in command orbatch modes, setpmflag=’no’ . Note 1 applies.

nplpts 3600 Time The parameternplpts is used in reducing the time his-tories for plotting. Refer to chapter 15 for a more com-plete description of this parameter. Notes 1 and 2 apply.

ndist 0 Frequency This parameter determines which events of the distur-bance scenario to use in calculating the frequencyresponse function matrix. The default0 means all events.A positive integern means events 1 through n. A nega-tive integer-n means only event n. A MATLAB vectorlike [1:2,4,7] means use exactly the event numbersin the vector. Can be set from GUI mode by slider or dataentry box and from command mode.

il −2 Frequency The smallest frequency at which frequency domain anal-ysis will be done is10il . May be a decimal. Can be setfrom GUI mode in a data entry box in the FrequencyParameters window, which opens when FrequencyDomain Analysis is selected and from command mode.

iu 4 Frequency The largest frequency at which frequency domain analy-sis will be done is10iu . May be a decimal. Can be setlike il .

npts 1000 Frequency The number of frequency points at which frequencydomain analysis will be done isnpts . Can be setlike il .

Page 74: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible
Page 75: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

71

References1. Belvin, W. Keith; Maghami, Peiman; Tanner, Cheri; Kenny,

Sean; and Cooley, Vic: Evaluation of CSI Enhancements forJitter Reduction on the EOS AM-1 Observatory.Dynamicsand Control of Large Structures—Proceedings of theNinth VPI & SU Symposium, L. Meirovitch, ed., May 1993,pp. 255–266.

2. MATLAB® Reference Guide—High-Performance NumericComputation and Visualization Software. The MathWorks,Inc., 1992.

3. Asrar, Ghassem; and Dokken, David Jon, eds.:1993 EarthObserving System Reference Handbook. NASA NP-202,1993.

4. Marcus, Marvin:Basic Theorems in Matrix Theory. Nat. Bur.Stand., Appl. Math. Ser. 57, U.S. Dep. of Commerce, Jan. 22,1960. (Reprinted 1964.)

5. Lawson, C. L.; Hanson, R. J.; Kincaid, D. R.; and Krogh, F. T.:Basic Linear Algebra Subprograms for Fortran Usage.ACMTrans. Math. Softw., vol. 5, no. 3, Sept. 1979, pp. 308–323.

6. Lawson, C. L.; Hanson, R. J.; Kincaid, D. R.; and Krogh, F. T.:Algorithm 539—Basic Linear Algebra Subprograms for For-tran Usage [F1].ACM Trans. Math. Softw., vol. 5, no. 3,Sept. 1979, pp. 324–325.

7. Dongarra, J. J.; Moler, C. B.; Bunch, J. R.; and Stewart, G. W.:LINPACK Users’ Guide. SIAM, 1979.

8. Dongarra, Jack J.; Du Croz, Jeremy; Hammarling, Sven; andHanson, Richard J.: An Extended Set of FORTRAN BasicLinear Algebra Subprograms.ACM Trans. Math. Softw.,vol. 14, no. 1, Mar. 1988, pp. 1–17.

9. Dongarra, Jack J.; Du Croz, Jeremy; Hammarling, Sven; andHanson, Richard J.: Algorithm 656—An Extended Set ofBasic Linear Algebra Subprograms: Model Implementationand Test Programs.ACM Trans. Math. Softw., vol. 14, no. 1,Mar. 1988, pp. 18–32.

10.Dongarra, Jack J.; Du Croz, Jeremy; Hammarling, Sven; andDuff, Iain: A Set of Level 3 Basic Linear Algebra Sub-programs.ACM Trans. Math. Softw., vol. 16, no. 1, Mar. 1990,pp. 1–17.

11. Dongarra, Jack J.; Du Croz, Jeremy; Hammarling, Sven; andDuff, Iain: Algorithm 679—A Set of Level 3 Basic LinearAlgebra Subprograms: Model Implementation and Test Pro-grams.ACM Trans. Math. Softw., vol. 16, no. 1, Mar. 1990,pp. 18–28.

12. Anderson, E.; Bai, Z.; Bischof, C.; Demmel, J.; Dongarra, J.;Du Croz, J.; Greenbaum, A.; Hammarling, S.; McKenney, A.;Ostrouchov, S.; and Sorensen, D.:LAPACK Users’ Guide.SIAM, 1992.

Page 76: PLATSIM: An Efficient Linear Simulation and Analysis ...mln/ltrs-pdfs/NASA-95-tp3519.pdf · PLATSIM: An Efficient Linear Simulation and Analysis Package for Large-Order Flexible

Form ApprovedOMB No. 0704-0188

Public reporting burden for this collection of information is estimated to average 1 hour per response, including the time for reviewing instructions, searching existing data sources,gathering and maintaining the data needed, and completing and reviewing the collection of information. Send comments regarding this burden estimate or any other aspect of thiscollection of information, including suggestions for reducing this burden, to Washington Headquarters Services, Directorate for Information Operations and Reports, 1215 JeffersonDavis Highway, Suite 1204, Arlington, VA 22202-4302, and to the Office of Management and Budget, Paperwork Reduction Project (0704-0188), Washington, DC 20503.

1. AGENCY USE ONLY (Leave blank) 2. REPORT DATE 3. REPORT TYPE AND DATES COVERED

4. TITLE AND SUBTITLE 5. FUNDING NUMBERS

6. AUTHOR(S)

7. PERFORMING ORGANIZATION NAME(S) AND ADDRESS(ES)

9. SPONSORING/MONITORING AGENCY NAME(S) AND ADDRESS(ES)

11. SUPPLEMENTARY NOTES

8. PERFORMING ORGANIZATIONREPORT NUMBER

10. SPONSORING/MONITORINGAGENCY REPORT NUMBER

12a. DISTRIBUTION/AVAILABILITY STATEMENT 12b. DISTRIBUTION CODE

13. ABSTRACT (Maximum 200 words)

14. SUBJECT TERMS

17. SECURITY CLASSIFICATIONOF REPORT

18. SECURITY CLASSIFICATIONOF THIS PAGE

19. SECURITY CLASSIFICATIONOF ABSTRACT

20. LIMITATIONOF ABSTRACT

15. NUMBER OF PAGES

16. PRICE CODE

NSN 7540-01-280-5500 Standard Form 298 (Rev. 2-89)Prescribed by ANSI Std. Z39-18298-102

REPORT DOCUMENTATION PAGE

September 1995 Technical Paper

PLATSIM: An Efficient Linear Simulation and Analysis Package forLarge-Order Flexible Systems WU 233-01-01-05

Peiman G. Maghami, Sean P. Kenny, and Daniel P. Giesy

L-17437

NASA TP-3519

Maghami and Kenny: Langley Research Center, Hampton, VA; Giesy: Lockheed Martin Engineering &Sciences, Hampton, VA.

PLATSIM is a software package designed to provide efficient time and frequency domain analysis of large-ordergeneric space platforms implemented with any linear time-invariant control system. Time domain analysis pro-vides simulations of the overall spacecraft response levels due to either onboard or external disturbances. The timedomain results can then be processed by the jitter analysis module to assess the spacecraft’s pointing performancein a computationally efficient manner. The resulting jitter analysis algorithms have produced an increase in speedof several orders of magnitude over the brute force approach of sweeping minima and maxima. Frequency domainanalysis produces frequency response functions for uncontrolled and controlled platform configurations. The latterrepresents an enabling technology for large-order flexible systems. PLATSIM uses a sparse matrix formulation forthe spacecraft dynamics model which makes both the time and frequency domain operations quite efficient, partic-ularly when a large number of modes are required to capture the true dynamics of the spacecraft. The package iswritten in MATLAB script language. A graphical user interface (GUI) is included in the PLATSIM software pack-age. This GUI uses MATLAB’s Handle graphics to provide a convenient way for setting simulation and analysisparameters.

PLATSIM; Frequency domain analysis; Time domain analysis; Jitter analysis;Flexible structures; Large-order systems; Controlled systems

74

A04

NASA Langley Research CenterHampton, VA 23681-0001

National Aeronautics and Space AdministrationWashington, DC 20546-0001

Unclassified–UnlimitedSubject Category 18Availability: NASA CASI (301) 621-0390

Unclassified Unclassified Unclassified