Skip to content

Commit 7a85977

Browse files
committed
Add mass-spring system
1 parent d67818f commit 7a85977

File tree

10 files changed

+160
-0
lines changed

10 files changed

+160
-0
lines changed

Dynamics/Discrete/MS.inp

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
** based on example spring1.inp
2+
*NODE,NSET=NALL
3+
1,0.,0.,0.
4+
2,1.,0.,0.
5+
3,2,0,0
6+
4,3,0,0
7+
5,4,0,0
8+
*nset,nset=response
9+
2,4
10+
*ELEMENT,TYPE=SPRINGA,ELSET=ESpring
11+
1,1,2
12+
3,3,4
13+
** this element enforces the existence of node 5 in the model,
14+
** in the expanded model it is otherwise not existent any more
15+
5,4,5
16+
*ELEMENT,TYPE=DASHPOTA,ELSET=EDash
17+
6,1,2
18+
7,3,4
19+
*ELEMENT,TYPE=B31,ELSET=Emass
20+
2,2,3
21+
4,4,5
22+
*BOUNDARY
23+
1,1,3
24+
2,2,3
25+
3,2,6
26+
4,2,6
27+
5,2,6
28+
*equation
29+
2
30+
2,1,1,3,1,-1
31+
*equation
32+
2
33+
4,1,1,5,1,-1
34+
*SPRING,ELSET=Espring
35+
36+
10.
37+
*DASHPOT,elset=EDash
38+
39+
0.000001
40+
*MATERIAL,NAME=EL
41+
*ELASTIC
42+
210000.,.3
43+
*DENSITY
44+
7.8E-9
45+
*beam section, elset=Emass,material=EL,section=rect
46+
1,1
47+
*STEP
48+
*frequency,storage=yes
49+
2
50+
*cload
51+
5,1,0
52+
*NODE file
53+
U
54+
*END STEP
55+
*STEP
56+
*STEADY STATE DYNAMICS
57+
0,12000
58+
*cload
59+
5,1,1
60+
*NODE file
61+
PU,U
62+
*NODE print,nset=response
63+
U
64+
*END STEP

Dynamics/Discrete/README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Spring/Mass Oscillator
2+
Tested with CGX/CCX 2.10
3+
4+
+ Frequency response analysis
5+
+ 2-Mass oszillator
6+
+ Mass element faked using beam element and appropriate constraints.
7+
8+
| File | Contents |
9+
| :------------- | :------------- |
10+
| [run.fbd](pre.fbd) | Top level control script for CGX|
11+
| [MS.inp](MS.inp) | Input for CCX |
12+
| [V.gnu](V.gnu) | Gnuplot script for the response function |
13+
14+
The system consists of two rigid bodies connected by springs and dashpots.
15+
16+
![](System.png)
17+
18+
| Parameter | Value |
19+
| :------------- | :------------- |
20+
| k | 10 N/mm |
21+
| m | 7.8 mg |
22+
| c | 0.000001 N/(m/s)|
23+
24+
Run the analysis:
25+
```
26+
> cgx -b run.fbd
27+
```
28+
29+
## Preprocessing
30+
31+
There is no cgx-based preprocessing. The model is entirely defined within the input file `MS.inp`.
32+
Springs and dashpots are represented by the appropriate discrete elements,
33+
the masses are represented by beam elements which are rigidized by an equation linking their nodes.
34+
35+
<img src="mesh.png" width=400>
36+
37+
## Solving
38+
39+
First, a `*frequency` step is performed and then a `*steady state dynamics` step.
40+
```
41+
> ccx MS
42+
```
43+
## Postprocessing
44+
45+
Mode shapes
46+
<img src="modes.png">
47+
48+
49+
Magnitude and phase plot of the response (displacement of the masses)
50+
51+
<img src="V.png">

Dynamics/Discrete/System.pdf

22.9 KB
Binary file not shown.

Dynamics/Discrete/System.png

12.8 KB
Loading

Dynamics/Discrete/V.gnu

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
set term pngcairo enhanced
2+
# mode shapes
3+
set out "modes.png"
4+
set key top left
5+
set grid
6+
set xlabel "Position in mm"
7+
set ylabel "Amplitude (unitless)"
8+
plot "graph_0.out" using 2:3 title "Mode 1" w lp, "graph_1.out" using 2:3 title "Mode 2" w lp
9+
set out "V.png"
10+
set multiplot layout 2,1 title "Displacement response"
11+
set key top left
12+
set grid
13+
#set xlabel "Frequency in Hz"
14+
set ylabel "Magnitude in mm"
15+
set yrange [0:1]
16+
plot "graph_response_PDISP_MAG1.out" using 1:3 title "M1" w lp, "" using 1:5 title "M2" w lp
17+
set xlabel "Frequency in Hz"
18+
set ylabel "Phase in °"
19+
set yrange [*:*]
20+
set ytics 90
21+
set nokey
22+
plot "graph_response_PDISP_PHA1.out" using 1:3 title "M1" w lp, "" using 1:5 title "M2" w lp

Dynamics/Discrete/V.png

42.8 KB
Loading

Dynamics/Discrete/mesh.png

5.04 KB
Loading

Dynamics/Discrete/modes.png

30.6 KB
Loading

Dynamics/Discrete/run.fbd

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
sys ccx MS
2+
read MS.frd
3+
read MS.inp nom
4+
# plot model
5+
seta ! all
6+
hcpy png
7+
sys mv hcpy_1.png mesh.png
8+
# plot mode shapes
9+
seta path n 1 3 5
10+
ds 1 e 1
11+
graph path length
12+
ds 2 e 1
13+
graph path length
14+
15+
graph response time PDISP MAG1
16+
graph response time PDISP PHA1
17+
18+
sys gnuplot V.gnu

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,8 @@ This page uses animated gifs. In Firefox, you might want to install the plugin [
151151
width="200"
152152
title="Illustration of plane stress/strain condition">
153153
](Linear/PSE/)
154+
[<img
155+
src="Dynamics/Discrete/V.png"
156+
width="200"
157+
title="Freqency response of a 2 DOF spring-mass-system">
158+
](Dynamics/Discrete/)

0 commit comments

Comments
 (0)