Disclosure of Invention
The invention aims to solve the technical problem of providing a MATLAB-based force displacement curve main characteristic point batch processing method, which can read force displacement test data, automatically calculate and search main characteristic points, map and show results, and can simply set parameters and rapidly process data in batches when a plurality of files are available.
In order to solve the technical problem, the invention provides a MATLAB-based force displacement curve main characteristic point batch processing method, which comprises the following steps:
copying the force displacement test data into a text, and uniformly and regularly naming the files containing the force displacement data so as to be convenient for searching corresponding files during data post-processing;
compiling a force displacement data text name list to facilitate cyclic processing of data;
inputting the first yield point strength and the multiple of the limit point strength and the peak value strength;
writing a command for reading force displacement data, writing a command for acquiring positive and negative peak points, wherein the command comprises a force value and a displacement value;
writing a calculation formula of a primary yield point force value, writing a position command for obtaining a positive value which is greater than or equal to the primary yield point force value, and writing a position command for obtaining a negative value which is less than or equal to the primary yield point force value;
compiling a command for obtaining a positive first-time yield point force value and a displacement value, and compiling a command for obtaining a negative first-time yield point force value and a displacement value;
writing a command for obtaining a positive first smaller than first yield point force value and displacement value, writing a command for obtaining a negative first larger than first yield point force value and displacement value, and writing a formula for calculating positive and negative first yield point displacement values by linear interpolation;
writing a positive limit force value calculation formula and a negative limit force value calculation formula, writing a command for obtaining a positive limit force value larger than or equal to the limit force value, and writing a command for obtaining a negative limit force value smaller than or equal to the limit force value;
writing a command of obtaining a maximum displacement value with a positive direction larger than or equal to a limit point force value, and writing a command of obtaining a minimum displacement value with a negative direction smaller than or equal to the limit point force value;
writing a first yield point, equivalent yield point, peak point and limit point command into the EXCEL, and drawing a force displacement curve, a first yield point, equivalent yield point, peak point and limit point graphic command.
In one embodiment, "copying the force displacement test data into a text, uniformly and regularly naming the files containing the force displacement data, and searching for corresponding files during data post-processing" specifically includes:
newly building a text file, and copying force displacement test data into the text file, wherein the content format is one row of displacement data, one row of force data and two rows in total;
the text files are named regularly, for simplicity, in increasing numerical order, with arabic numbers 1,2,3.
In one embodiment, writing a list of textual names for the force-displacement data to facilitate cyclic processing of the data specifically includes:
a plurality of files exist in batch processing, each force displacement data file to be analyzed is named in the previous step, and for simplicity, Arabic numerals 1,2 and 3 are used for naming, and the file names are formed into a row vector array in MATLAB;
a list of filenames, denoted AA, for the for loop.
In one embodiment, "writing a read force displacement data command, writing a command to obtain a positive peak point and a negative peak point, including a force value and a displacement value" specifically includes:
reading force displacement data in the text file by a textread command of the MATLAB, and storing the force displacement data in a memory of the computer;
acquiring the positive peak intensity through a max command, and searching for corresponding displacement according to the position of the positive peak intensity; and obtaining the negative peak intensity through a min command, and searching the corresponding displacement according to the position of the negative peak intensity.
In one embodiment, writing a calculation formula of the first yield point force value, writing a position command for obtaining a positive value greater than or equal to the first yield point force value, and writing a position command for obtaining a negative value less than or equal to the first yield point force value specifically includes:
calculating the first yield point strength, namely the peak strength coefficient;
finding out the position with the positive direction greater than or equal to the first yield point strength by the find command;
finding the position with negative direction less than or equal to the first yield point strength by the find command.
In one embodiment, the writing of the command to obtain the first positive yield point force value and the displacement value and the writing of the command to obtain the first negative yield point force value and the displacement value specifically include:
the positive first time yield point force value and the displacement value are first digits of a position array of the first time yield point strength, and corresponding force values and displacement values are respectively found in a force column and a displacement column;
and negative first-time yield point force values and displacement values are first digits of the position array of the first-time yield point strength, and corresponding force values and displacement values are respectively found in the force column and the displacement column.
In one embodiment, writing a command for obtaining a positive first smaller than first yield point force value and displacement value, writing a command for obtaining a negative first larger than first yield point force value and displacement value, and writing a formula for calculating a displacement value of the positive first yield point and the negative first yield point by linear interpolation specifically includes:
acquiring a force value and a displacement value of which the forward direction is smaller than the first yield point for the first time, namely subtracting 1 from the first digit of a position array of which the forward direction is greater than or equal to the first yield point strength, and respectively searching a corresponding force value and a corresponding displacement value in a force column and a displacement column;
acquiring a negative force value and a displacement value which are larger than the first yield point value for the first time, namely subtracting 1 from the first digit of the position array of the strength which is smaller than or equal to the first yield point, and respectively searching a corresponding force value and a corresponding displacement value in the force column and the displacement column;
and determining a first yield point displacement value according to the linear proportional relation.
In one embodiment, "writing a positive limit force value calculation formula and a negative limit force value calculation formula," writing a command for obtaining a positive limit force value greater than or equal to a limit point value, "and writing a command for obtaining a negative limit force value less than or equal to a limit point" specifically include:
the limit point intensity is a multiple relation of the peak intensity, namely a peak intensity coefficient;
finding out the position of the force value of which the forward direction is greater than or equal to the limit point by using the find command;
finding the position with negative direction less than or equal to the limit force value by the find command.
In one embodiment, "writing and acquiring a maximum displacement value with a positive direction greater than or equal to a limit point force value and writing and acquiring a minimum displacement value with a negative direction less than or equal to the limit point force value" specifically includes:
searching in a displacement column by a max command, wherein the positive direction of the maximum displacement value is larger than or equal to the force value of the limit point;
and finding the minimum displacement value with the negative direction less than or equal to the force value of the limit point in the displacement column by the min command.
In one embodiment, writing the first yield point, equivalent yield point, peak point, and limit point commands and drawing the force displacement curve, the first yield point, equivalent yield point, peak point, and limit point graphic commands into the EXCEL specifically includes:
writing first yield point, equivalent yield point, peak point and limit point values (displacement values and force values) into EXCEL by xlswrite command;
and drawing a displacement curve, a first yield point, an equivalent yield point, a peak point and a limit point graphic command by a plot command.
The invention has the beneficial effects that:
the problems that the extraction of main characteristic points (a first yield point, an equivalent yield point, a maximum value point and a limit point) of a force displacement curve needs manual point finding and manual recording and has low efficiency are solved; the problem that a large amount of time and energy are consumed during batch processing, and the accuracy cannot be guaranteed is solved. The program parameters are simply set, the key points of the force displacement curve can be conveniently and rapidly output to the EXCEL, and the force displacement hysteresis curve and the main characteristic point graph are automatically drawn; the method has higher data processing advantages in the aspect of batch processing, and does not need manual intervention in the process; the first yield point and the multiple relation between the limit point strength and the peak strength can be flexibly changed according to the analysis requirements of users, so that the tedious and time-consuming analysis becomes simple and feasible, the tedious manual workload and the possibility of writing errors are greatly reduced, and scientific research personnel can spend more energy on parameter analysis.
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.
Referring to fig. 1, a method for batch processing of the main characteristic points of the force displacement curve based on MATLAB includes:
step 1, copying force displacement test data into a text, uniformly and regularly naming files containing the force displacement data, and conveniently searching corresponding files during data post-processing;
step 2, compiling a force displacement data text name list to facilitate cyclic processing of data;
step 3, inputting the first yield point strength and the multiple of the limit point strength and the peak strength;
step 4, compiling a command for reading force displacement data, and compiling a command for acquiring positive and negative peak points, wherein the command comprises a force value and a displacement value;
step 5, compiling a calculation formula of the first yield point force value, compiling a position command for obtaining a positive value which is greater than or equal to the first yield point force value, and compiling a position command for obtaining a negative value which is less than or equal to the first yield point force value;
step 6, compiling a command for obtaining a positive first-time yield point force value and a displacement value, and compiling a command for obtaining a negative first-time yield point force value and a displacement value;
step 7, writing a command for obtaining a positive first smaller than first yield point force value and a displacement value, writing a command for obtaining a negative first larger than first yield point force value and a displacement value, and writing a formula for calculating displacement values of the positive first yield point and the negative first yield point by linear interpolation;
step 8, writing positive and negative limit point force value calculation formulas, writing a command for obtaining a positive limit point force value larger than or equal to the limit point force value, and writing a command for obtaining a negative limit point force value smaller than or equal to the limit point force value;
step 9, compiling a command of obtaining a maximum displacement value with a positive direction larger than or equal to a limit point force value, and compiling a command of obtaining a minimum displacement value with a negative direction smaller than or equal to the limit point force value;
and step 10, writing commands for writing the first yield point, the equivalent yield point, the peak point and the limit point into the EXCEL, and drawing a force displacement curve, a first yield point, an equivalent yield point, a peak point and a limit point graphic command.
The invention has the beneficial effects that:
the invention provides a MATLAB-based force displacement curve main characteristic point batch processing method, which solves the problems that the extraction of main characteristic points (a first yield point, an equivalent yield point, a maximum value point and a limit point) of a force displacement curve requires manual point finding and manual recording and has low efficiency; the problem that a large amount of time and energy are consumed during batch processing, and the accuracy cannot be guaranteed is solved. The program parameters are simply set, the key points of the force displacement curve can be conveniently and rapidly output to the EXCEL, and the force displacement hysteresis curve and the main characteristic point graph are automatically drawn; the method has higher data processing advantages in the aspect of batch processing, and does not need manual intervention in the process; the first yield point and the multiple relation between the limit point strength and the peak strength can be flexibly changed according to the analysis requirements of users, so that the tedious and time-consuming analysis becomes simple and feasible, the tedious 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 force displacement test data is copied into a text, files containing the force displacement data are named regularly in a unified mode, so that the corresponding files can be conveniently found during data post-processing, and the specific process comprises the following steps:
1. newly building a text file, and copying force displacement test data into the text file, wherein the content format is one row of displacement data, one row of force data and two rows in total;
2. the text files are named regularly, for simplicity, in increasing numerical order, with arabic numbers 1,2,3.
In another embodiment, a force displacement data text name list is written to facilitate cyclic processing of the data; the method specifically comprises the following steps:
1. a plurality of files exist in batch processing, each force displacement data file to be analyzed is named in the previous step, and for simplicity, Arabic numerals 1,2 and 3 are used for naming, and the file names are formed into a row vector array in MATLAB;
2. a list of filenames, denoted AA, for the for loop.
In one embodiment, the first yield strength and the multiple of the limit strength to peak strength are input; the method specifically comprises the following steps:
1. at present, different scholars have different definitions on the method for obtaining the equivalent yield point, and the method for selecting is to input the multiple of the first yield point strength and the peak strength, which is usually 0.75;
2. currently, different scholars have different definitions on the method for taking the limit point, and the selection method inputs the multiple of the first limit point intensity and the peak intensity, and generally takes 0.8.
In one embodiment, a read force displacement data command is written, and a command to obtain positive and negative peak points is written, including force and displacement values. The method specifically comprises the following steps:
1, reading force displacement data in a text file by a textread command of an MATLAB (matrix laboratory), and storing the force displacement data in a memory of a computer;
2. acquiring the positive peak intensity through a max command, and searching for corresponding displacement according to the position of the positive peak intensity; 3. acquiring negative peak intensity through a min command, and searching for corresponding displacement according to the position of the negative peak intensity;
in one embodiment, a primary yield point force value calculation formula is written, a position command is written to obtain a positive primary yield point force value which is greater than or equal to the primary yield point force value, and a position command is written to obtain a negative primary yield point force value which is less than or equal to the primary yield point force value. The method specifically comprises the following steps:
1. calculating the first yield point strength, namely the peak strength coefficient;
2. finding out the position with the positive direction greater than or equal to the first yield point strength by the find command;
3. finding the position with negative direction less than or equal to the first yield point strength by the find command.
In one embodiment, the get positive first equal to or greater than the first yield point force value and displacement value command is written, and the get negative first equal to or less than the first yield point force value and displacement value command is written. The method specifically comprises the following steps:
1. the positive first time yield point force value and the displacement value are first digits of a position array of the first time yield point strength, and corresponding force values and displacement values are respectively found in a force column and a displacement column;
2. and negative first-time yield point force values and displacement values are first digits of the position array of the first-time yield point strength, and corresponding force values and displacement values are respectively found in the force column and the displacement column.
In one embodiment, commands for obtaining the positive first-time smaller-than-first-time yield point force value and displacement value, commands for obtaining the negative first-time larger-than-first-time yield point force value and displacement value, and formulas for calculating the displacement values of the positive first-time yield point and the negative first-time yield point by linear interpolation are written. The method specifically comprises the following steps:
1. acquiring a force value and a displacement value of which the forward direction is smaller than the first yield point for the first time, namely subtracting 1 from the first digit of a position array of which the forward direction is greater than or equal to the first yield point strength, and respectively searching a corresponding force value and a corresponding displacement value in a force column and a displacement column;
2. acquiring a negative force value and a displacement value which are larger than the first yield point value for the first time, namely subtracting 1 from the first digit of the position array of the strength which is smaller than or equal to the first yield point, and respectively searching a corresponding force value and a corresponding displacement value in the force column and the displacement column;
3. and determining a first yield point displacement value according to the linear proportional relation.
In one embodiment, a positive limit force value calculation formula and a negative limit force value calculation formula are written, a command for obtaining the positive limit force value larger than or equal to the limit point force value is written, and a command for obtaining the negative limit force value smaller than or equal to the limit point force value is written. The method specifically comprises the following steps:
1. the limit point intensity is a multiple relation of the peak intensity, namely a peak intensity coefficient;
2. finding out the position of the force value of which the forward direction is greater than or equal to the limit point by using the find command;
3. finding the position with negative direction less than or equal to the limit force value by the find command.
In one embodiment, a maximum displacement value command is written to obtain a positive force value greater than or equal to a limit point force value, and a minimum displacement value command is written to obtain a negative force value less than or equal to a limit point force value. The method specifically comprises the following steps:
1. searching in a displacement column by a max command, wherein the positive direction of the maximum displacement value is larger than or equal to the force value of the limit point;
2. and finding the minimum displacement value with the negative direction less than or equal to the force value of the limit point in the displacement column by the min command.
In one embodiment, write first yield point, equivalent yield point, peak point, and limit point commands and plot force displacement curves, first yield point, equivalent yield point, peak point, and limit point graphical commands into EXCEL are written. The method specifically comprises the following steps:
1. writing first yield point, equivalent yield point, peak point and limit point values (displacement values and force values) into EXCEL by xlswrite command;
2. and drawing a displacement curve, a first yield point, an equivalent yield point, a peak point and a limit point graphic command by a plot command.
A specific application scenario is described below:
FIG. 1 shows the steps of the present invention. After the test is finished, main characteristic points need to be extracted from 10 test piece force displacement curves, and data points at positions shown in fig. 2 or fig. 3 are obtained according to the test type; establishing 10 text files, and respectively copying force displacement test data into 10 files, wherein the file format has two columns, one column is a displacement data column, and the other column is a force data column; naming 10 text files 1,2,3 … …, 10; a file name list array is formed in MATLAB and named as AA for short, and the form is as follows:
AA=[1,2,3……,10];
inputting the first yield point and the multiple relation between the limit point strength and the peak value strength
Beginning for statement
for filename list AA { executive procedure }
And (3) circulating for the first time, reading the data in the file 1, executing a program process, including searching a first yield point, an equivalent yield point, a peak point and a limit point position, writing the data into an EXCEL table after the main characteristic points are found, drawing a force displacement curve, a first yield point, an equivalent yield point, a peak point and a limit point graph as shown in fig. 4, and entering the next file 2 after the execution is finished as shown in fig. 5.
The second loop, reading the data in file 2, executes the program process … …
… … until all files have been read and execution has ended.
Therefore, the program works in the earlier stage, the parameter setting is simple and convenient, and the method has the characteristics of simplicity, practicability and high data processing efficiency. The invention provides a MATLAB-based force displacement curve main characteristic point batch processing method, which solves the problems that the extraction of main characteristic points (a first yield point, an equivalent yield point, a maximum value point and a limit point) of a force displacement curve requires manual point finding and manual recording and has low efficiency; the problem that a large amount of time and energy are consumed during batch processing, and the accuracy cannot be guaranteed is solved. The program parameters are simply set, the key points of the force displacement curve can be conveniently and rapidly output to the EXCEL, and the force displacement hysteresis curve and the main characteristic point graph are automatically drawn; the method has higher data processing advantages in the aspect of batch processing, and does not need manual intervention in the process; the first yield point and the multiple relation between the limit point strength and the peak strength can be flexibly changed according to the analysis requirements of users, so that the tedious and time-consuming analysis becomes simple and feasible, the tedious manual workload and the possibility of writing errors are greatly reduced, and scientific research personnel can spend more energy on parameter analysis.
The invention provides a MATLAB-based force displacement curve main characteristic point batch processing method, which solves the problems that the extraction of main characteristic points (a first yield point, an equivalent yield point, a maximum value point and a limit point) of a force displacement curve requires manual point finding and manual recording and has low efficiency; the problem that a large amount of time and energy are consumed during batch processing, and the accuracy cannot be guaranteed is solved. The program parameters are simply set, the key points of the force displacement curve can be conveniently and rapidly output to the EXCEL, and the force displacement hysteresis curve and the main characteristic point graph are automatically drawn; the method has higher data processing advantages in the aspect of batch processing, and does not need manual intervention in the process; the first yield point and the multiple relation between the limit point strength and the peak strength can be flexibly changed according to the analysis requirements of users, so that the tedious and time-consuming analysis becomes simple and feasible, the tedious manual workload and the possibility of writing errors are greatly reduced, and scientific research personnel can spend more energy on parameter analysis.
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.