Disclosure of Invention
The invention aims to provide a step-by-step incremental dynamic analysis and data processing method based on OpenSees and MATLAB.
In order to solve the technical problems, the invention provides a step-by-step incremental dynamic analysis and data processing method based on openses and MATLAB, which comprises the following steps:
establishing an OpenSees structure finite element analysis model according to the structure design parameters;
naming the seismic wave file name, and compiling a seismic wave list;
compiling a target amplitude modulation peak list and a seismic oscillation time interval list;
writing a data file name command stream output by OpenSees;
writing an OpenSees earthquake wave loading command stream;
compiling an automatic switching algorithm command stream when the calculation is not converged;
the command stream of the terminal is analyzed and written in the collapse critical state;
writing a command stream of MATLAB software reading OpenSees software output data and writing the data into an Excel table.
In another embodiment, the "establishing an openses structural finite element analysis model according to the structural design parameters" specifically includes:
the end part of the beam-column unit adopts an IMK corner spring unit, and the upper unit adopts an elastic beam column Element which is connected with the IMK corner spring unit in series; the specific parameters of the IMK corner spring are calculated according to a formula according to the design parameters of the section; because the component is formed by connecting an IMK corner spring and an elastic BeamColumn Element in series, the upper elastic BeamColumn Element needs to be corrected for the flexural rigidity, and the calculation formula is as follows:
the node adopts Joint2D Element;
and (3) adopting rayleigh damping, respectively giving a rigidity proportionality coefficient and a mass proportionality coefficient to the elastic unit and the node with mass by using a region command, and adopting initial rigidity in the calculation process.
In another embodiment, the "name of seismic wave file name, writing seismic wave list" specifically includes:
because the input seismic waves are several or even dozens of seismic waves, each seismic wave to be analyzed is named, the name of an output data file is determined by the name of each seismic wave, the name is also the file name searched during MATLAB post-processing, and Arabic numerals 1,2 and 3 are named for simplicity;
a list of seismic wave names, denoted as AA, is written in openses for the foreach loop.
In one embodiment, the "writing a list of target amplitude modulation peaks and a list of seismic motion time intervals" specifically includes:
writing a target amplitude modulation peak list in an OpenSees model, recording the target amplitude modulation peak list as BB, and using the BB for foreach circulation;
writing and reading each seismic wave time interval array by using a list command in an OpenSees model, and marking the array as dt _ AA, wherein the dt _ AA is used for identifying the time interval of each seismic wave.
In one embodiment, writing a data file name command stream output by openses specifically includes:
naming each seismic wave name as an output data folder, and creating a folder for analyzing seismic wave output files by using a filemkdir command;
and naming each seismic oscillation name and the target amplitude modulation peak value as output data files.
In one embodiment, "writing openses load seismic wave command stream" specifically includes:
firstly, opening a seismic oscillation file by using an open command; reading data in the earthquake motion file by using a read command, sequencing earthquake motion data by using an lsort command according to an increasing sequence, acquiring an earthquake motion peak value by using a lindex command, and acquiring a total earthquake motion step number by using a llength command.
In one embodiment, writing a command stream for automatically switching algorithms when the computation does not converge specifically includes:
when the calculation is not converged, firstly, reducing the analysis step time, adjusting the analysis step time to 0.5 time, and transmitting the analysis step time to an algorithm for analysis; when the convergence is not reached again, the integration method is automatically switched: performing (Newton iteration method Krylov Newton of Krylov accelerated convergence) - (Newton iteration method Newton) in the following sequence, wherein the initial stiffness is adopted in the first step, then Newton-initial ThernCurrent is adopted in the Newton iteration method Newton-initial ThernCurrent of the current stiffness, and Linear Newton iteration method Newton LineSearch of solving the nonlinear residual equation (modified Newton iteration method ModifiedNewton) - (Linear iteration method Linear);
if the switching integration method still does not converge, the structure is judged to reach the collapse critical point, and the analysis is terminated.
In one embodiment, the "writing of the analysis termination command stream in the collapse critical state" specifically includes:
if the collapse critical state is judged to be reached, analyzing for one step to finish time course analysis; opening the output file by using an open-r command, writing a puts command into 0.20.2, covering records before analysis unconvergence, taking the records as an analysis unconvergence mark, and closing the file by using close;
the file mkdir FailRecord creates an analysis failure record folder, and the open-w command creates a new txt file, which records the analysis unconverged seismic wave name and the target amplitude at this time.
In one embodiment, writing a command stream in which MATLAB software reads openses software output data and writes the data into an Excel table specifically includes:
reading output file data by utilizing a sprintf command in MATLAB, searching a damage index maximum value and an xlswrite function by a max function, and writing the earthquake motion name, a target peak value and the damage index maximum value into a specified position in an Excel table.
Based on the same inventive concept, the present application also provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of any of the methods when executing the program.
Based on the same inventive concept, the present application also provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of any of the methods.
Based on the same inventive concept, the present application further provides a processor for executing a program, wherein the program executes to perform any one of the methods.
The invention has the beneficial effects that:
the invention provides a step-by-step incremental dynamic rapid analysis and data processing method based on OpenSees and MATLAB, which solves the complex steps of manually changing seismic oscillation peak values, seismic oscillation step numbers and scaling information when seismic oscillation peak values are switched and amplitude modulated; under the conditions of no shutdown and no manual intervention, the problem that the dynamic elastoplasticity time course analysis cannot be carried out in batches is solved, the model calculation efficiency is greatly improved, and software and hardware resources are fully utilized; meanwhile, in the aspect of data post-processing, the MATLAB is used for rapidly reading the output data file and writing the data file into an Excel table, so that the data processing efficiency is greatly improved, the tedious and time-consuming analysis becomes simple and feasible, the boring manual workload and the possibility of writing errors are greatly reduced, and scientific research personnel can spend more energy on parameter analysis. The method for rapidly analyzing and processing the data based on the step-by-step incremental power of OpenSees and MATLAB quickly and accurately solves the problems of batch analysis and data post-processing. The OpenSees is called an Open System for Earthquake Engineering Simulation (Open System) in its entirety. The Earthquake simulation system is an open program software system which is more comprehensive and continuously developed and is mainly developed by American National Science Foundation (NSF) funding, Pacific Earth Engineering Research Center (PEER) of western university alliance and Berkeley university of California and is used for simulating Earthquake response in structural and geotechnical aspects. MATLAB is a commercial mathematical software produced by MathWorks corporation, usa, a software for advanced technical computing languages and interactive environments for algorithm development, data visualization, data analysis, and numerical computation.
Detailed Description
The present invention is further described below in conjunction with the following figures and specific examples so that those skilled in the art may better understand the present invention and practice it, but the examples are not intended to limit the present invention.
A step-by-step incremental power rapid analysis and data processing method based on OpenSees and MATLAB comprises the following steps:
step 1, establishing an OpenSees structure finite element analysis model according to structure design parameters;
step 2, naming the seismic wave file name, and compiling a seismic wave list;
step 3, compiling a target amplitude modulation peak value list and a seismic oscillation time interval list;
step 4, compiling a data file name command stream output by OpenSees;
step 5, writing an OpenSees earthquake wave loading command stream;
step 6, compiling an automatic switching algorithm command stream when the calculation is not converged;
step 7, compiling an analysis termination command stream in a collapse critical state;
step 8, writing a command stream in which MATLAB software reads OpenSees software output data and writes the OpenSees software output data into an Excel table;
by using MATLAB software, reading a data file output by OpenSees software, and writing data into a specified position in an Excel table, such as a maximum interlayer displacement angle (damage index, DM) and a spectral acceleration (intensity index, IM).
The invention has the beneficial effects that:
the invention provides a step-by-step incremental dynamic rapid analysis and data processing method based on OpenSees and MATLAB, which solves the complex steps of manually changing seismic oscillation peak values, seismic oscillation step numbers and scaling information when seismic oscillation peak values are switched and amplitude modulated; under the conditions of no shutdown and no manual intervention, the problem that the dynamic elastoplasticity time course analysis cannot be carried out in batches is solved, the model calculation efficiency is greatly improved, and software and hardware resources are fully utilized; meanwhile, in the aspect of data post-processing, the MATLAB is used for rapidly reading the output data file and writing the data file into an Excel table, so that the data processing efficiency is greatly improved, the tedious and time-consuming analysis becomes simple and feasible, the boring manual workload and the possibility of writing errors are greatly reduced, and scientific research personnel can spend more energy on parameter analysis.
In another embodiment, the method for establishing the openses structure finite element analysis model according to the structure design parameters specifically comprises the following steps:
1. the end part of the beam-column unit adopts an IMK corner spring unit, and the upper unit adopts an elastic beam column Element which is connected with the IMK corner spring unit in series; the specific parameters of the IMK corner spring are calculated according to a formula according to the design parameters of the section; because the component is formed by connecting an IMK corner spring and an elastic BeamColumn Element in series, the upper elastic BeamColumn Element needs to be corrected for the flexural rigidity, and the calculation formula is as follows:
FIG. 2 is a series schematic diagram, and an IMK corner spring skeleton curve and a hysteresis law are shown in FIG. 3;
2. the node adopts Joint2D Element, and FIG. 4 is a schematic diagram of a Joint2D unit;
3. and (3) adopting rayleigh damping, respectively giving a rigidity proportionality coefficient and a mass proportionality coefficient to the elastic unit and the node with mass by using a region command, and adopting initial rigidity in the calculation process.
In another embodiment, the names of seismic wave files are named, and a seismic wave list is written; the method specifically comprises the following steps:
1. because the input seismic waves are several or even dozens of seismic waves, each seismic wave to be analyzed is named, the name of an output data file is determined by the name of each seismic wave, the name is also the file name searched during MATLAB post-processing, and Arabic numerals 1,2 and 3 are named for simplicity;
2. a list of seismic wave names, denoted as AA, is written in openses for the foreach loop.
In one embodiment, a target amplitude modulation peak list and a seismic motion time interval list are written; the method specifically comprises the following steps:
1. writing a target amplitude modulation peak list in an OpenSees model, recording the target amplitude modulation peak list as BB, and using the BB for foreach circulation;
2. writing and reading each seismic wave time interval array by using a list command in an OpenSees model, and marking the array as dt _ AA, wherein the dt _ AA is used for identifying the time interval of each seismic wave.
In one embodiment, the data file name command stream output by openses is written. The method specifically comprises the following steps:
1. naming each seismic wave name as an output data folder, and creating a folder for analyzing seismic wave output files by using a filemkdir command. If the name of the earthquake wave being analyzed is 1, creating a folder with the name of 1, and storing all output files with the name of the earthquake wave being 1 in the folder;
2. naming each seismic oscillation name and target amplitude modulation peak value as output data files, and if the seismic oscillation name under analysis is 1 and the target amplitude modulation peak value is 2.0, then naming the output data files as 1-2-drift (i), wherein the drift is a damage index, the interlayer displacement angle is a damage index, and i is the number of floors.
In one embodiment, an openses load seismic command stream is written. The method specifically comprises the following steps:
firstly, opening a seismic oscillation file by using an open command; reading data in the earthquake motion file by using a read command, sequencing earthquake motion data by using an lsort command according to an increasing sequence, acquiring an earthquake motion peak value by using a lindex command, and acquiring a total earthquake motion step number by using a llength command.
In one embodiment, an automatic switching algorithm command stream is written when the computation does not converge. The method specifically comprises the following steps:
1. when the calculation is not converged, firstly, reducing the analysis step time, adjusting the analysis step time to 0.5 time, and transmitting the analysis step time to an algorithm for analysis; when the convergence is not reached again, the integration method is automatically switched: performing (Newton iteration method Krylov Newton of Krylov accelerated convergence) - (Newton iteration method Newton) in the following sequence, wherein the initial stiffness is adopted in the first step, then Newton-initial ThernCurrent is adopted in the Newton iteration method Newton-initial ThernCurrent of the current stiffness, and Linear Newton iteration method Newton LineSearch of solving the nonlinear residual equation (modified Newton iteration method ModifiedNewton) - (Linear iteration method Linear);
2. if the switching integration method still does not converge, the structure is judged to reach the collapse critical point, and the analysis is terminated.
In one embodiment, the analysis termination command stream in the collapse critical state is written. The method specifically comprises the following steps:
1. if the collapse critical state is judged to be reached, analyzing for one step to finish time course analysis; opening the output file by using an open-r command, writing a puts command into 0.20.2, covering records before analysis unconvergence, taking the records as an analysis unconvergence mark, and closing the file by using close;
and 2, creating an analysis failure record folder by using filemkdir FailRecord, creating a new txt file by using an open-w command, and recording the name of the analysis unconverged seismic wave and the target amplitude at the moment.
In one embodiment, MATLAB software is written as a command stream that reads openses software output data and writes into an Excel table. The method specifically comprises the following steps:
reading output file data by utilizing a sprintf command in MATLAB, searching a damage index maximum value and an xlswrite function by a max function, and writing the earthquake motion name, a target peak value and the damage index maximum value into a specified position in an Excel table.
A specific application scenario is described below:
FIG. 1 shows the steps of the present invention. Performing IDA analysis, namely firstly respectively forming a list of seismic wave interception, a target amplitude modulation peak value and a seismic motion time interval, performing traversal search by using a foreach command, and automatically identifying seismic motion information, such as the peak value and the seismic motion record number, by OpenSees. Firstly, opening a seismic oscillation file by using an open command; reading data in the earthquake motion file by using a read command, sequencing earthquake motion data by using an lsort command according to an increasing sequence, acquiring an earthquake motion peak value by using a lindex command, and acquiring a total earthquake motion step number by using a llength command. And outputting analysis files in the analysis process, and creating a folder for analyzing seismic wave output files by using a file mkdir command. If the name of the earthquake wave being analyzed is 1, creating a folder with the name of 1, and storing all output files with the name of the earthquake wave being 1 in the folder; naming each seismic oscillation name and target amplitude modulation peak value as output data files, and if the seismic oscillation name under analysis is 1 and the target amplitude modulation peak value is 2.0, then naming the output data files as 1-2-drift (i), wherein the drift is a damage index, the interlayer displacement angle is a damage index, and i is the number of floors. And after each cycle is finished, clearing the model, releasing the memory, and reestablishing the model according to the seismic oscillation information of the next cycle until the foreach sentence is finished, wherein manual intervention is not needed in the middle, and the model is automatically switched.
Building a first list: list of seismic waves, AA for short
A second list is established: list of target amplitude modulations, abbreviated as BB
A third list is built: list of seismic intervals, dt _ AA for short
Starting a foreach statement
foreach seismic wave list AA { foreach target amplitude modulation list BB { OpenSees finite element analysis model, lindex command finding seismic time interval FIG. 1}
For example: AA contains A1, A2 and A3 parameters
For example: BB comprises B1, B2 and B3 parameters
For example: dt _ AA comprises parameters of C1, C2 and C3
The calculation sequence is as follows:
cycle 1: the A1, B1 and C1 parameters are transmitted to the model for calculation
Cycle 2: the A1, B2 and C1 parameters are transmitted to the model for calculation
Cycle 3: the A1, B3 and C1 parameters are transmitted to the model for calculation
Cycle 4: the A2, B1 and C2 parameters are transmitted to the model for calculation
Cycle 5: the A2, B2 and C2 parameters are transmitted to the model for calculation
Cycle 6: the A2, B3 and C3 parameters are transmitted to the model for calculation
7, circulation: the A3, B1 and C3 parameters are transmitted to the model for calculation
Cycle 8: the A3, B2 and C3 parameters are transmitted to the model for calculation
Cycle 9: the A3, B3 and C3 parameters are transmitted to the model for calculation
And (3) automatically calculating 9 models, and automatically switching until 9 cycles are finished without manual additional intervention, so that the efficiency is greatly improved, and the time is saved.
The OpenSees calculation result data is output in a text format, and a user can define the name of output content and files. Here the output file is named with the seismic event name at the time, the target amplitude modulation peak and the floor number using the command replaced by the variable, see fig. 1, code: AA- $ BB-dry (i) $ out. For example, the earthquake motion at this time is 1, and the target amplitude modulation peak value is 2.0, then the file name of 1-2-drift (i).
Openses outputs a large amount of data, and then the data needs to be collated to extract useful data so as to facilitate parameter analysis, and the implementation flowchart is shown in fig. 1.
Examples are: the maximum interlayer displacement angles of all model nonlinear analyses are all extracted, and are arranged according to the sequence of seismic wave names, target amplitude modulation peak values and the maximum interlayer displacement angles, as shown in table 1:
TABLE 1
This results in a plurality of IDA curves of seismic waves, as shown in FIG. 6.
According to the method, under the condition of no shutdown, the non-linear time-course analysis can be automatically carried out according to the input earthquake motion without manually modifying the earthquake motion peak value, the earthquake motion time interval, the earthquake motion step number and the target amplitude modulation peak value; the structural damage limit state can be customized according to the analysis requirement, the maximum value data of the limit state is extracted from massive data through MATLAB, seismic oscillation information and the maximum value data of the limit state are written into an Excel table according to the analysis requirement, and the data are analyzed conveniently. The model calculation efficiency and the data post-processing efficiency are greatly improved, and software and hardware resources are fully utilized; the method fully realizes the computerization process, makes the analysis which is tedious and time-consuming become simple and feasible, greatly reduces the tedious manual workload and the possibility of errors in writing the manual change data, and makes scientific research personnel capable of spending more energy on parameter analysis.
The invention provides a step-by-step incremental dynamic rapid analysis and data processing method based on OpenSees and MATLAB, which solves the complex steps of manually changing seismic oscillation peak values, seismic oscillation step numbers and scaling information when seismic oscillation peak values are switched and amplitude modulated; under the conditions of no shutdown and no manual intervention, the problem that the dynamic elastoplasticity time course analysis cannot be carried out in batches is solved, the model calculation efficiency is greatly improved, and software and hardware resources are fully utilized; meanwhile, in the aspect of data post-processing, the MATLAB is used for rapidly reading the output data file and writing the data file into an Excel table, so that the data processing efficiency is greatly improved, the tedious and time-consuming analysis becomes simple and feasible, the boring manual workload and the possibility of writing errors are greatly reduced, and scientific research personnel can spend more energy on parameter analysis. With the improvement of the computer processing speed and the maturity of the IDA analysis theory, the IDA analysis is an important tool for structural performance analysis, and the method realizes the quick IDA analysis and data processing.
The above-mentioned embodiments are merely preferred embodiments for fully illustrating the present invention, and the scope of the present invention is not limited thereto. The equivalent substitution or change made by the technical personnel in the technical field on the basis of the invention is all within the protection scope of the invention. The protection scope of the invention is subject to the claims.