Simulink simulation of free vibration of multi-degree-of-freedom dual-mass spring oscillator

Write in front:

This is my first coursework report for the first year of graduate school. After communicating with the teacher about the completion of the homework, there were also many small flaws. However, since I am in control of the direction and not in the mechanical direction, I did not continue. Improve the assignment content according to the requirements of the topic. However, this simulation was generally completed and indeed achieved the overall purpose of the simulation. If you are a mechanical student, what I did is actually very amateurish, but it is used as an example of using Simulink to implement state space model simulation. In fact, it is still possible. I will explain other shortcomings with my simulation results at the end of the article. In addition, this assignment is original content and is not plagiarized. Share it with everyone to communicate and learn.

1. Simulation questions

2. Code simulation (simulation has not been completed yet)

At first, when I saw high-dimensional matrix equations, the first thing I thought of was to use Matlab code to solve matrix equations for modeling. So I first tried Matlab code simulation, hoping to directly solve the vibration of the system by solving high-dimensional matrix differential equations. However, Matlab’s built-in dsolve function can only solve three-dimensional matrices at most, that is, it can only solve three-freedom. degree of free vibration curve. I have tried other code simulation methods for a long time but none of them can complete the solution of high-dimensional matrix equations with multiple degrees of freedom. Although the final result has not been produced, it can also be used as a reference for subsequent simulink simulations. The following is the simulation code of a two-degree-of-freedom free vibration system:

syms t;
[x,y]=dsolve('D2x1 + 2000*x1-1000*x2=0','2*D2x2-1000*x1 + 3000*x2=0','x1(0)=0','x2( 0)=12','Dx1(0)=0','Dx2(0)=0','t');
t1=0:0.01:2;
x=subs(x,'t',t1);
y=subs(y,'t',t1);

figure;
plot(t1,x,'-');
xlabel('time/s');
ylabel('displacement/m');

hold on;
plot(t1,y,'-');
title('System response x(1) and x(2) curves');
xlabel('time/s');
ylabel('displacement/m');

Simulation results:

The code principles of three degrees of freedom and two degrees of freedom are the same, and the code simulation procedures are similar, so the simulation results are directly given as follows:

However, after analyzing the actual oscillator motion model shown in class, I feel that there are still some problems in the simulation results of the above code. I think the reason is that the limitations of many physical conditions and other initial conditions are not set, causing the model to be built. It is not completely reasonable, such as the maximum length of the spring, the two oscillators cannot be staggered with each other, etc.

3. Simuink simulation

(I have completed a maximum of 80 degrees of freedom. It seems that I have reached the situation mentioned by the teacher, so I will not continue any further)

After trying the code simulation, I discovered that the teacher’s ppt said that Matlab Simulink could be used for solution, so I switched to trying to use Simulink for modeling. The modeling is based on the state space model of the multi-degree-of-freedom system, and the block diagram of the system is established, and then the relationship between input and output can be established through the system block diagram through Simulink. But just like code simulation, I still don’t know whether the model is completely correct when modeling, so I can only follow one idea to model.

First, I started with the most basic two-degree-of-freedom free vibration system in the book. From the system modeling, the free vibration equation of the system can be obtained as follows, where x1and x2indicates the positions of the two oscillators respectively, x1and x2 represents the acceleration of the oscillator:

Based on the model of the problem, you may wish to set the following initial conditions:

x1=1 x2=x 1 + 1=2m1=m=1m 2=M=2k1= k2=k3=k=1000

Splitting the above system of matrix equations, we can obtain a system of binary differential equations:

mx1 + 2kx1< em>-kx2=0Mx< em>2kx1 + 2kx2=0

Transfer terms to construct the state space equation:

x1=-2kmx< em>1 + kx2x2=kMx12k Mx2=0

Bring in the initial conditions, namely:

x1=-2000x1 + 1000 x2x2= 500x1-1000x2

According to the state space equation, the model block diagram can be constructed in Simulink and simulated. The model diagram is shown in the figure below. In addition, since the oscillator has an initial position, it is necessary to set the initial quantity in the integration link where the integration result is the position, and bring it into x1and x2 are 1 and 2 respectively, and increase by 1 when the number of oscillators continues to increase.

Set the simulation time to 10s and the simulation step size to 1e-5 to get the following simulation graph:

(It is worth noting that the position curves I obtained through Simulink modeling and code simulation modeling were not completely consistent. I can’t think of a reasonable reason, which also made me very confused.)

With the foundation of the above two-degree-of-freedom model, I manually established a system model of orders 2 to 10 based on it. The process is as shown below, and the 10-degree-of-freedom model diagram and position signal diagram (real The ones were manually connected after listing the equations. I was still looking for patterns at the time, so the wiring was not sorted out. It looked really messy, but I checked that the connections and the model are in one-to-one correspondence):

Such a model diagram looked very untidy, so I tried to summarize the state space model and simulation block diagram of manually building the first ten degrees of freedom. Based on the original two-degree-of-freedom model, I first established a package sub-module that can be easily expanded. Each sub-module represents the position signal of two degrees of freedom, so as to facilitate the establishment of modules with more degrees of freedom, as shown in the figure below. :

Among them, “500after_in” is connected to “500before_out” of the next module, the last module inputs 0, “1000after_out” is connected to “1000before_in” of the previous module, the first module inputs 0, and “Out1/2” is the signal Output Interface.

With the use of this module, I also used it to compare the output results of the previously manually built vibration model with the encapsulated results. The output position curves are all consistent:

Model before and after two degrees of freedom encapsulation

Model before and after four degrees of freedom encapsulation

In order to further simplify the model and facilitate the simulation of higher degrees of freedom, I further packaged the five two-degree-of-freedom package modules into a package model that can represent ten degrees of freedom. The following is the ten-degree-of-freedom package module and the established ten-degree-of-freedom model. Vibration model:

Ten degrees of freedom package module

Model before and after ten degrees of freedom encapsulation

Output curve under ten degrees of freedom

At this time, I still couldn’t see what the teacher was talking about, so I could only bite the bullet and continue to build a higher-free vibration model. So I directly built an 80-degree-of-freedom vibration simulation model from the 10-degree-of-freedom package model. The block diagram looked very simple and could be connected directly. However, after playing with it, each of the most basic two-degree-of-freedom sub-modules The initial value of the position signal needs to be set manually. That is to say, the simulation of eighty degrees of freedom actually focuses on setting the initial value for each degree of freedom. The workload is really not small. I hope the model will not make a mistake (plus one compared to the previous one). ):

An eighty-degree-of-freedom simulation model composed of eight ten-degree-of-freedom package modules

There are many position output curves with eighty degrees of freedom. In order to facilitate a clearer observation of the curves, as shown in the modeling diagram above, I will divide the output curves into groups of 10, and obtain the following position change curves:

The 1st to 10th oscillator position curve

The 11th to 20th oscillator position curve

The 21st~30th oscillator position curve

The 31st to 40th oscillator position curve

The 41st~50th oscillator position curve

The 51st~60th oscillator position curve

The 61st~70th oscillator position curve

The 71st~80th oscillator position curve

Written at the end: After I learned the true correct data processing method, I realized that my stupid way of pushing it to 80 degrees of freedom was quite funny. Back to the topic, I actually did not add the required unit pulse input. I only set the initial value in each module. This is a bug. In addition, I saw what other students in the mechanical major did, and the final vibration response was The analysis should be carried out in the frequency domain. It is really difficult to obtain the correct waveform from the position-time time domain curve like mine. In the correct response curve, there will be a drop at the resonant frequency, and with the free As the degree increases, the decline will become larger and larger. I also forgot to take pictures of the diagrams in the class here.

Although the model is built correctly, the data processing needs to be further improved. If any students need to refer to me for vibration response analysis, they may need to refer to me for further analysis. I personally have not been exposed to these machines in my undergraduate degree. I don’t know how to convert the relevant knowledge to the frequency domain. Professionals can just watch it for fun.

Finally, thank you for reading this. I mainly work on motor control directions. If you find it troublesome and want files, just message me privately. However, what I wrote should be quite detailed. You can directly Just do it. Welcome to communicate!