You are on page 1of 15

xPSD: An External Solver To Compute Linear Responses To Random Base Excitations (PSD) In Structures Using ANSYS With The

Large Mass Method
Alex Grishin Matt Sutton Phoenix Analysis And Design Technologies, Inc.
Abstract It is sometimes desirable to incorporate one's own solver with a finite element model created using commercial finite element software. ANSYS facilitates such efforts through the use of User-Defined Features [3] (UDF's) and the ANSYS Application Programmers Interface (API). This paper summarizes one such application developed by the authors for a customer with very specific needs in the calculation of structural response to random base excitations. The software solution described in this report differs substantially with the PSD random vibration solver offered by ANSYS Inc. in several respects - both in theoretical approach taken and program architecture. The net result offers the user a reduction in computer storage requirements and calculation speed for the analysis of structures subjected to a single random base excitation.

Introduction
Phoenix Analysis and Design Technologies (PADT) was approached by a large corporate defense contractor regarding specific needs they had when using ANSYS to analyze the structural response of their products to random base excitations, represented in the form of Power Spectral Density (PSD) curves. The customer wanted to create their FE models using ANSYS’s substantial element library and preprocessing tools but had the following requirements of the random vibration solution: 1. 2. All model databases should be relatively small (preferably never exceeding the 2 GB range for even their largest models). All model databases should be static and load independent (for a given model and constraints, a user should be able to run several different load cases without changing the databases - i.e. without substantial disk i/o - and without re-extracting Eigenquantities). The users experience was determined to be predominantly shaped by program runtimes, therefore, any random vibration result must be computed as expediently as possible. Preferably, all computations should require 60 sec or less for reasonably large models running on standard workstation hardware.

3.

The customer based these requirements on their experience with another leading software package. Since the customer rarely considers multiple simultaneous base excitations and/or nodal excitations (in such cases, the company would employ ANSYS's current random vibration solver), the company's goals were considered reasonable if the authors could develop an external program which would employ mode superposition (mode displacement method) with the Large Mass Method for base excitations - the fastest and simplest method known - and known to be used by the competitor. With this method, it was clear that the only persistent quantities required (in addition to the model DB) were the eigenquantities and eigenvalues (natural frequencies). Linking an external program written in C++ with ANSYS’s C API would create these databases. It can then be invoked on the ANSYS command line as a tilde (~) command. Two other completely external components would be created to complete the authors' solution. The combined suite of software components is called xPSD.

the analyst attempts to simulate a base excitation by coupling a large mass element to the degrees of freedom which make up the base of the structure and applying a force equal to Mω2x. then by the familiar differentiation and substitution.The Large Mass Method (LMM) By application of the Large Mass Method (LMM). x is usually known and F is solved. The base excitation is characterized by the displacement amplitude x1.Single DOF Mass-Spring Subjected To Base Excitation If the base excitation is Xsin(ωt+φ). This is an approximation which can only be justified when M is very large compared with the mass of the structure. the amplitude solution is: xr = Xmω 2 2 ωn − ω 2 (4) . Neglecting damping. and x is the amplitude of base excitation. This leads to: m&&r + m&&1 + kxr = 0 x x or m&&r + kxr = − m&&1 x x Figure 1 . where M is the actual mass. the equation of motion is (upon summing forces): m&&2 + k ( x2 − x1 ) = 0 x To make things simpler. ω is the frequency of the harmonic load. Since the load is a base excitation. An informal explanation of this is as follows: Consider a single DOF spring-mass system subjected to a base excitation as in Figure 1 (the same principles apply to a structure with multiple DOFs). make the following transformation: (1) ( 2) (3) xr = x2 − x1 where xr is the relative motion of the mass with respect to base.

x1 = X1sin(ωt+φ) and x2 = X2sin(ωt+φ). we try to approximate this system with one shown in Figure 2. in the LMM. then the other terms are negligible in the first equation yielding: (7 ) − Mω 2 X 1 ≈ F (8) and. k1 must be very small with respect to k2. Neglecting the k1 term and rearranging gives: k 2 ( X 1 − X 2 ) − Mω 2 X 1 = F k 2 ( X 2 − X 1 ) − m2ω 2 X 2 = 0 and if M is sufficiently large. where k2 and m2 of Figure 2 equal m and k of Figure 1 and represent the FE structure.LMM Approximation Of Base Excitation System If we assume solutions of the form. we have: (k1 + k2 − Mω 2 ) X 1 − k2 X 2 = F − k 2 X 1 + (k2 − m2ω ) X 2 = 0 2 ( 6) after canceling out the sin(ωt+φ) terms. employing a similar coordinate transformation as before : Xr = X2-X1 and substituting into the second equation yields: k2 Xr − m2ω 2 ( Xr + X 1 ) = 0 (9) . To simulate the single DOF system in Figure 1. Summing forces for this system results in: M&&1 + (k2 + k1 ) x1 − k 2 x2 = F x m2 &&2 + k2 x2 − k2 x1 = 0 x (5) Figure 2 .Now. then once again by the process of differentiation and substitution.

e: eigenstresses and eigenstrains) in the mode extraction phase of the analysis. Therefore. the analyst first extracts eigenvectors. Ω denotes the frequency of excitation. Here the indices K and L in (15) are fixed . (4) would become: ui = H ij MdΩ 2 N j (14) where M is the value of the large mass. this works because the applied load is almost completely “reacted out” by the displacement of the large mass. Equation (10) really lies at the heart of the LMM. φ and calculates other derived eigenquantities.or k 2 Xr − m 2ω 2 Xr = X 1m 2ω 2 which yields approximately the same solution as (1): Xr ≈ X 1m2ω 2 2 ωn − ω 2 (10) This solution is approximate because the displacement amplitude X1 is obtained from the approximation: X1 ≈ F Mω 2 (11) which is only exact when m2/M is vanishingly small. because together with the LMM result for Xr . or g's) and the same holds for the response. Fj is the "jth" degree of freedom force component. ϕ jr represents the “rth” mass-normalized Eigenvector. and: H ij = ηirϕ jr (ω − Ω ) + i (2ω r Ωξ r ) 2 r 2 (13) where the index r ranges over the mode numbers. The base excitation may be characterized by some time-derivative of displacement (velocity. The attached structure consequently "feels" the displacement but not the applied force. thus H ij is often referred to as the complex frequency response function [1]. The Mode Superposition Method (MSM) With the MSM. (14) may be written more generally as : ui = H ij N j CKL I (15) where u and I may now represent a response and input excitation. it says: “We can approximately apply a displacement of magnitude equal to F/Mω2 to a DOF by simply applying a load equal to F at a sufficiently large mass M which is coupled to the DOF for the dynamic system under consideration.” In rough terms. There is an implied summation over all repeated indices. and C is the appropriate quantity-type conversion factor found by matching an input quantity from the leftmost column with an output quantity from the top row. N is a unit vector representing the direction of the applied load (the only non-zero components of which correspond to the large-mass unrestrained DOFs). acceleration. and Ω is the frequency. ω r is the “rth” Eigen frequency. η (i. Once this is accomplished. η ir represents the "rth" mass-normalized eigenquantity. and d denotes the magnitude of the applied displacement (usually given as a function of frequency). respectively as any quantity appearing in table 1. the structure's response to any harmonic force excitation may be characterized by: ui = H ij F j (12) where ui stands for the "ith" degree of freedom displacement response. The coefficient i in the denominator denotes an imaginary number. To represent a base excitation using the LMM.

For example.1 at the second row and second column. or mean response. E may be calculated by [2]: Ei = Program Overview ∫ Ω2 Ω1 Si dΩ (17) After coupling a large mass to the appropriate base nodes. see [2]): Table 2 . the analyst performs a mode extraction to calculate the eigenvectors and derived eigenquantities in (4).this would correspond to the coefficient C 23 . the quantities are written to a binary file through the use of a specialized external command invoked from the ANSYS command line by . The inputs and outputs now represent spectral densities (in units of quantity squared per Hz) and β OP represents a table of quantity conversions similar to those of Table 1. if input quantity is given in terms of velocity and output in acceleration. Table 2 summarizes the new quantity conversions for random vibration (the fact that such conversions exist for random vibrations is not intuitively obvious. respectively in Table 1 starting from 1. Table 1 . For a derivation of this fact. At this point.Quantity-Type Conversions.Random Vibration Quantity Type Conversions. To do this.by the input and output quantity type and correspond to row and column. C I/u Displacement Velocity Acceleration g Displacement Velocity Acceleration g MΩ 2 MΩ 3 MΩ 4 MΩ 4 / g MΩ M gM MΩ 2 MΩ gMΩ MΩ 3 MΩ 2 gMΩ 2 MΩ 3 / g MΩ 2 / g MΩ 2 MSM For Random Base Excitations The MSM may also be employed to calculate the response of structures to random base excitations. one would go to the third row and fourth column over . β S/Si Displacement**2/Hz Velocity**2/Hz Acceleration**2/Hz G**2/Hz Displacement**2/Hz Velocity**2/Hz Acceleration**2/Hz G**2/Hz M 2Ω4 M 2Ω2 M2 g 2M 2 M 2Ω6 M 2Ω4 M 2Ω2 g 2 M 2Ω2 M 2 Ω8 M 2Ω6 M 2Ω4 g 2 M 2Ω4 M 2Ω8 / g 2 M 2Ω6 / g 2 M 2Ω4 / g 2 M 2Ω4 Finally. one need only modify (15) to become [2]: * Si = H ij H jl SN l β OP (16) where H* is the complex conjugate of H. a variance.

Finally. the "solver" is invoked either from the ANSYS command line via a system call or externally from a shell.arg2. named "xpwrite". Figure 3 . By using APDL macros first. . The external command represents a call to a C++ program linked to ANSYS via the API [3].arg1. Finally. The solver simply performs calculations associated with (16) and/or (17) as requested by an ASCII input file. Computing equation (16) results in spectral density response values in the form of graphs or tabulated values. was written in C++ and compiled on several different platforms. referred to as a "task" file. A flowchart of this process can be seen in Figure 3. However. the prototype APDL macros were converted into ANSYS C API calls. the general logic of xpwrite was developed in an environment that facilitated rapid prototyping. load values. The development of xpwrite began with several prototype APDL macros that were refined and debugged within ANSYS before any compiled code was written.Program Flowchart Software Description XPWRITE A large quantity of model dependent data is required to perform a PSD analysis outside of ANSYS. in addition to the eigenquantities. whereas equation (17) results in an array of nodal values which can be plotted on top of a model in ANSYS via the *VPUT command. C++ wrappers were used to transition from the ANSYS C API to the C++ language used to develop xpwrite. etc… are needed for implementation purposes as well. the ability to write these add-ons in an expressive language such as C++ will certainly help mitigate their complexity. a small set of supplementary data such as node numbers. The data required primarily consist of all the eigenquantities for each DOF within the model. and plot requests. Once the general logic of xpwrite was outlined. jobname. object oriented C++ programming language. Data extraction from ANSYS is accomplished within the xPSD system via an ANSYS external “tilde” command. Furthermore. as the complexity of ANSYS add-ons undoubtedly increases in the future. This task file contains problem-specific information such as damping. the conversion from APDL macros to C++ compiled code was expedited by the syntactical similarities between the ANSYS C API and APDL. This technique demonstrates that it is possible to drive ANSYS through a compiled program written in the modern.typing ~xpwrite. The newly created binary file remains untouched and represents the structure's dynamic properties and boundary conditions. All of this data must be extracted from ANSYS for a given geometry before an external PSD analysis can begin. This command.

An example task file with annotations is shown in Figure 4. As in most designs. however. xPSD is designed to be used as a batch tool. It was determined that the most important user experience would be computational speed and platform independence. Likewise. Eigenquantity Binary Database In order to perform a PSD analysis for a given model outside of ANSYS using an external PSD solver. During the execution of the command. each one of the requirements mentioned above is interdependent.The Internal Structure of XPWRITE Internally. 2. followed by arguments). File size was required to be kept to a minimum. The database was required to be platform independent. the program reads instructions for what tasks to perform from a free format ASCII text file. which would produce the task file as an echoed hardcopy of the user's interface picks similar to an ANSYS log file. yet still maintain acceptable access times and platform independence. in-stream compression techniques may be explored as possible alternative implementations that would reduce the file size. At present. modular design philosophy. In this way. changes to the database structure and read/write mechanisms can be made without affecting the object responsible for querying ANSYS. the binary database design gave precedence to platform independence and random access time at the expense of file size. this file also stores all loading information. the methods used to query ANSYS are hidden behind a separate simple interface. the first object queries ANSYS and feeds the resulting data to the second object through a simple interface. job name. The second object is designed to interface with the modal database and provide read/write capabilities to and from the database. and the value of g (acceleration due to gravity). In the future. along with a small quantity of additional data. as well as critical damping ratio. all the eigenquanitites. For example. . Since the mechanics of reading and writing to the binary database are hidden behind a simple interface. Therefore. Consequently. and platform independence. The Task File In its current form. are stored in a binary database. etc… from ANSYS. 3. Because of these conflicts. the requirements were weighed based on their perceived importance to the user’s experience and then sorted based on their weights. Random access was required to be performed in constant time. xpwrite adheres to an object-oriented. they too can be altered without jeopardizing the functionality of the database object. all the eigenquantities for the model must be available for consumption by the external solver. constant time random access conflicts with both minimal file size. the user must create this file manually. but PADT has plans to implement a graphical user interface. and therefore. In addition to storing the task commands (Commands are written as keywords preceded by asterisks. As such. multiple load cases may be stored as separate task files . Several requirements were imposed on the design of the binary database: 1. There are two main objects within xpwrite that collaborate to provide the total functionality for the command. The first object is designed to interface with ANSYS through the ANSYS C API and provide all of the data querying functionality necessary to extract the eigenquantities. within the xPSD system.each containing a unique job name.

consisting of approximately 10. 2.Figure 4 . A PSD response plot file. It begins an execution by first parsing the task file for instructions and other problem-dependent data. By writing the output of xpsolve in the format of an ANSYS input deck. future modifications to xpsolve may include writing results directly to the ANSYS result file (*. a onesigma output file contains all of the commands and data necessary to "*VPUT" the resulting one-sigma values onto the model in ANSYS. to further expedite the process of transferring data back into ANSYS. However. Perhaps more important than actual design of xpsolve. contains all the commands and data necessary to generate two-dimensional response plots using the ANSYS X-Y plotting commands. Furthermore. in a spirit similar to xpwrite.rst). the burden of viewing and post-processing the resulting PSD data is lifted from xpsolve and transferred back to ANSYS. The Internal Structure of XPSOLVE The internal structure of xpsolve is considerably more intricate than the structure of xpwrite mentioned above. were the benefits PADT realized by using C++ and object oriented techniques. the user’s experience in this process is enhanced because the only requirement placed on them to view their results is to issue a series of simple "/INP" commands. PSD response plot files One sigma plot files Each output file generated by xpsolve is written as an ANSYS input deck. It is executed from the command line or from a "/SYS" command in ANSYS with the following arguments: xpsolve taskfile binaryfile After reading instructions. Therefore. however. However. The output files fall into two categories: 1. Internally. xpsolve calculates all of the quantities requested in the task file and outputs the results to a series of files.Example xPSD Task File XPSOLVE Xpsolve is the external solver within the xPSD suite. The entire xPSD system. xpsolve contains objects that represent each type of analysis to be preformed as well as objects representing the algorithms associated with the modal superposition method. xpsolve was written in C++ using an object oriented design philosophy. the user simply issues a "/INP" command using one of the xpsolve output files as an argument.000 lines of C++ . to view the resulting calculations in ANSYS. Similarly. output by xpsolve.

The graph calculation times (second and fourth columns. Accuracy Comparisons In comparing result quantities between xPSD and ANSYS. as the customer expresses no interest in one-sigma strain values but the reader should note that their calculation would almost double the variance calculation times. For case 1. ANSYS calculates all quantities. the complexity associated with the xPSD system as a whole was reduced. and an equivalent stress. the majority of result discrepancies were due to differences in round off from nodal averaging. For cases 2 through 4. Comparing Figures 5 and 6 reveals a discrepancy in the sixth decimal place thought to be due to an insufficiently large mass while Figures 7 and 8 reveal discrepancies in the lower bands of the stress contours. It is thought that with an appropriate large mass selection. Run-Time Comparisons Of all models tested. Examples PADT has used xPSD for consulting work and has performed benchmark testing on several FE models representing real-world structures. in calculating the variance (the one-sigma values). Significant reductions in run-time were realized for problems involving a single base-excitation.code. This was accomplished by maximizing the use of pre-existing. respectively). Consequently. xPSD calculates derived quantities based on the nodeaveraged modal values. the response for six nodes for all load frequencies comprises one graph. six stress components. . whereas ANSYS calculates them on an element basis first. attention was focused on the variance values. xPSD does not currently support the calculation of strain values. By offloading the tedious and error prone programming chores associated with general data structure design to pre-existing template libraries.5 Gigabytes of RAM. These trends in discrepancies were common to all models tested both in their nature and magnitude.the component displacements. high quality libraries such as the Standard Template Library throughout the design. This last discrepancy is thought to be due to the differences in nodal averaging as mentioned previously. All benchmark run-times were obtained on a desktop PC with dual Pentium III processors with 1000 Mhertz clockspeeds and 1. then averages as a final step. Figures 5 through 8 show UZ displacement and SX stress results for the case 4 model of Table 3. The xPSD variance calculation times reflect the time required to calculate 13 quantities . The benchmarks consisted of comparing the run-times between xPSD and the ANSYS Random Vibration Solver as well as the differences between result quantities between the two solvers for given loading conditions. the power spectral density response at two nodes for all load frequencies comprises one graph. PADT realized a substantial increase in productivity and code robustness. It should be noted that. the values in the third column of Table 4 should be multiplied by a factor of two for a more accurate comparison of calculation times. whereas xPSD only calculates those quantities requested by the user. those summarized in Table 3 showed the most significant differences in run-times (these were some of the larger models tested). reflect the time it took both ANSYS and xPSD to calculate and return power spectral density results for the frequency range of the input load curve. three principle stresses. by judiciously subdividing the problem into objects and their relationships. was conceived and written in 20 workdays by two individuals. as can be seen in Table 4. Furthermore.

ANSYS-Calculated UZ For Case 4 Figure 6 .xPSD-Calculated UZ For Case 4 .Figure 5 .

xPSD-Calculated SX For Case 4 .ANSYS-Calculated SX For Case 4 Figure 8 .Figure 7 .

01 . AI*Workbench has made it possible to quickly develop full-fledged analysis tools targeted at a specific audience. 5.2 42. The user imports a model from either a currently running CAD package or an existing file. and the resulting model is submitted to the full ANSYS solver for solution. and selects the base through which the PSD excitation will occur. xPSD Case No.87 135.Run-Time Comparison: ANSYS vs.02 .581 21.675 AI*Workbench and xPSD The recent release of the AI*Workbench environment has opened up exciting opportunities to developers of vertical FEA applications.267 41. The process envisioned by PADT for a standard PSD analysis in workbench is the following: 1. Results are calculated as needed and then returned to the AI*Workbench application for display.2 42.817 42. (seconds) ANSYS Variance Graphs (each) (seconds) xPSD Variance (seconds) Speedup Factor Variance (ANSYS/xPSD) Graphs (each) (seconds) Graphs (ANSYS/xPSD) 1 2 3 4 26050. Nodes 32599 147467 76075 23129 No. 3. The user meshes the model.34 7986. those requests are directly forwarded to the xPSD solver for processing.Table 3 . PADT has launched an exploratory effort focused on providing PSD analysis capabilities through the xPSD core in an AI*Workbench application. Shell63’s 20325 None 12779 None No. The large mass is attached automatically to the selected base.44 4164. By exposing the underlying objects and data structures of the DesignSpace system.01 193 192 194 176 67. The resulting xPSD database contains all of the quantities necessary for any base excitation PSD analysis for the current geometry.6 . 1 2 3 4 No.01 . . Because of these features.3 41.99 8115. Though the work on this project is only in its conceptual stages at the time of this writing. As the user dynamically requests PSD results from within the AI*Workbench application. 2.3 41.1 23. Solid 92/95’s 1124 61694 29587 12524 Contact Pairs 5 None 10 13 Modes Extracted 150 8 11 40 Table 4 . 4. An xPSD modal database is generated during the full ANSYS solve.6 135.FE Model Summary For Benchmarks Case No.1 23. we are pleased to present the current state of our efforts.

and finally the xPSD system will calculate those quantities and display them appropriately in the Workbench environment. the input PSD plot is updated dynamically. Figure 9 . . PADT developed an HTML input page that provides a familiar spreadsheet user interface. Two examples of PSD result types are graphically shown in Figures 10 and 11. the following discussion and screen captures focus on the user’s experience in step 5 alone. Figure 11 displays a PSD response plot in Workbench containing both an input PSD curve and the resulting PSD response at two specific locations on the circuit board. such as a one sigma plot. then further define the precise quantities corresponding to the result type. As the user inputs data into the load spreadsheet.Steps 1 through 4 listed above are fairly standard AI*Workbench development procedures and they mimick the steps used for the ANSYS version of xPSD. The design philosophy for AI*Workbench xPSD is to dynamically provide PSD results for any user request. To facilitate the entry of PSD input curves into the AI*Workbench xPSD tool. a user will need to review PSD results for their model that correspond to that input curve. Figure 10 displays the AI*Workbench xPSD one-sigma UX plot for the circuit board model corresponding to the Example Case 4. This input page is shown in Figure 9. The deviation from standard AI*Workbench applications occurs primarily in step 5.PSD Input Load Creation Using HTML Once a PSD input curve has been created. Therefore. Random Vibration analysis is driven by a specification often presented to the engineer in the form of an input Power Spectral Density (PSD) curve. thus providing instantaneous user feedback for comparison to the PSD specification. a user will select or create a PSD result type. In practice.

Figure 10 .xPSD SX Result In AI*Workbench Figure 11 .xPSD Nodal Response Curve In AI*Workbench .

The ANSYS command language and the ‘C’ API allowed the development team to use ANSYS’s inherent strengths while only adding the functionality that was needed. In the end. An Introduction to Random Vibration and Spectral Analysis..After completing the initial stages of development presented here. John Wiley & Sons. PADT was able to deliver a significant increase in productivity and efficiency within 20 working days utilizing two part time developers. With a limited budget and an even more limited schedule. harmonics or modal superposition. Roy R. and the pre and post processing strengths of the AI*Workbench environment.User Programmable Features .E. Jr. London ANSYS Programmer's Manual . Longman Group. 3. 1981. the use of an objected oriented approach with C++ allowed the team to reuse a considerable amount of code for data storage. New York Newland. extraction and manipulation. the resulting tool is modular enough to allow it to also be included in an AI*Workbench based tool or to be expanded into a solver for other dynamic analyses such as forced vibration. The amount of time and resources spent on this project was a fraction of what would have required to write a completely stand alone program. it serves as an example of the flexibility and openness of the ANSYS product. D. Ltd. In addition. Also. PADT is confident that a viable AI*Workbench based PSD analysis tool can be created to leverage the user’s understanding of their products and needs while taking advantage of the computational speed of the xPSD core. the element and solver technology of the full ANSYS solver.. Craig. References 1. it was necessary to use as much existing functionality and code as possible. 1975.. Structural Dynamics: An Introduction to Computer Methods. Conclusion Although this project was carried out to address a specific need of a specific customer. 2.