2 #GNUPLOT file to plot graphs of biomechanical brain tests in Budday et al 2017
3 # **** cycles must be separated in the .sol file by two blank lines ****
4 # UNITS CONSIDERED: g - mm - s
7 # >> show palette colornames
9 #To see line style, line width, etc.:
10 # >> set terminal wxt enhanced dashed
14 set datafile separator ","
15 set term png size 400,300 enhanced font 'Verdana,12'
19 set style line 1 lw 1.5 lc rgb "black" dt 1
20 set style line 2 lw 1.5 lc rgb "blue" dt 1
21 set style line 3 lw 1.5 lc rgb "red" dt 1
22 set style line 4 lw 1.5 lc rgb "dark-turquoise" dt 1
23 set style line 5 lw 1.5 lc rgb "dark-blue" dt 1
25 set style line 100 lt 1 lw 1 lc rgb "gray" dt 3
26 set style line 101 lt 1 lw 1 lc rgb "red"
29 set grid xtics ytics ls 100
31 # -------------------- PROBLEM DATA --------------------------------------------------------------------------------------
32 #length of specimen along loading direction to compute stretch [mm]
35 #area of loading surface to computre reaction force [mm²]
36 area = length * length #cube
37 #area = 3.1416 * (length/2) * (length/2) #cylinder
39 #length to compute pressure gradient [mm]
42 #pressure at drained boundary to compute pressure gradient [Pa]
46 #dynamic (shear) fluid viscosity [Pa·s]
48 #effective fluid density [g/mm³]
50 #kinematic fluid viscosity [mm²/s]
53 #time step to compute numerical dissipation [s]
57 # -------------------- Stress vs stretch ---------------------------------------------------------------------------------
58 stretch(x) = (length + x) / length
59 nominal(y) = y / (area*1000) #[10⁻⁶ N / mm² = Pa]
61 set xlabel 'stretch [-]' font 'Verdana,14'
62 set ylabel 'nominal stress [kPa]' font 'Verdana,14'
64 set key on box inside bottom right font 'Verdana,12' spacing 1.0 maxcols 1 width -0.2
66 #set xrange [] reverse #compression
67 set xrange [1.0:1.11] noreverse #tension
72 set xtics 0.02 rotate by 45 right
77 set output "brain_cube_stress-stretch-poro-TENS.png"
78 plot 'data-for-gnuplot.sol' index 0 using (stretch($7)):(nominal($15)) every 1 with lines ls 1 title '1^{st} cycle', \
79 'data-for-gnuplot.sol' index 1 using (stretch($7)):(nominal($15)) every 1 with lines ls 2 title '2^{nd} cycle', \
80 'data-for-gnuplot.sol' index 2 using (stretch($7)):(nominal($15)) every 1 with lines ls 3 title '3^{rd} cycle'
82 # -------------------- solid Stress vs stretch ---------------------------------------------------------------------------------
83 stretch(x) = (length + x) / length
84 nominal(y) = y / (area*1000) #[10⁻⁶ N / mm² = Pa]
86 set xlabel 'stretch [-]' font 'Verdana,14'
87 set ylabel 'solid nominal stress [kPa]' font 'Verdana,14'
89 set key on box inside bottom right font 'Verdana,12' spacing 1.0 maxcols 1 width -0.2
91 #set xrange [] reverse #compression
92 set xrange [1.0:1.11] noreverse #tension
97 set xtics 0.02 rotate by 45 right
102 set output "brain_cube_solid-stress-stretch-poro-TENS.png"
103 plot 'data-for-gnuplot.sol' index 0 using (stretch($7)):(nominal($21)) every 1 with lines ls 1 title '1^{st} cycle', \
104 'data-for-gnuplot.sol' index 1 using (stretch($7)):(nominal($21)) every 1 with lines ls 2 title '2^{nd} cycle', \
105 'data-for-gnuplot.sol' index 2 using (stretch($7)):(nominal($21)) every 1 with lines ls 3 title '3^{rd} cycle'
107 # -------------------- Accumulated exiting fluid vs time --------------------------------------------------------------------------
108 set xrange [] noreverse
109 set yrange [] noreverse
110 set xtics 30 norotate nooffset
116 set xlabel 'time [s]' font 'Verdana,14'
117 set ylabel sprintf("accumulated fluid\n outside the sample [mm^3]") font 'Verdana,14'
121 y_axis(y) = (a=a+y*timestep,a)
123 set output "brain_cube_fluid-time-poro-TENS.png"
124 plot 'data-for-gnuplot.sol' index 0 using ($1):(y_axis($22)) every 1 with lines ls 1 title '1^{st} cycle', \
125 'data-for-gnuplot.sol' index 1 using ($1):(y_axis($22)) every 1 with lines ls 2 title '2^{nd} cycle', \
126 'data-for-gnuplot.sol' index 2 using ($1):(y_axis($22)) every 1 with lines ls 3 title '3^{rd} cycle'
128 # -------------------- Accumulated exiting fluid vs reaction pressure ---------------------------------------------------------------
129 set xlabel 'fluid reaction pressure [kPa]' font 'Verdana,14'
130 set ylabel sprintf("accumulated fluid\n outside the sample [mm^3]") font 'Verdana,14'
131 set key on box outside above right font 'Verdana,12' spacing 1.0 maxcols 1 width -0.2
137 y_axis(y) = (a=a+y*timestep,a)
139 set output "brain_cube_fluid-reac_p-poro-TENS.png"
140 plot 'data-for-gnuplot.sol' index 0 using ($18/1000):(y_axis($22)) every 1 with lines ls 1 title '1^{st} cycle', \
141 'data-for-gnuplot.sol' index 1 using ($18/1000):(y_axis($22)) every 1 with lines ls 2 title '2^{nd} cycle', \
142 'data-for-gnuplot.sol' index 2 using ($18/1000):(y_axis($22)) every 1 with lines ls 3 title '3^{rd} cycle'
144 # -------------------- Pressure and displ. vs time -------------------------------------------------------------------------
145 set term png size 600,380 enhanced font 'Verdana,12'
149 set xtics 30 norotate nooffset
151 set xlabel 'time [s]' font 'Verdana,14'
152 set ylabel 'displacement [mm]' font 'Verdana,14'
153 set y2label 'pressure [kPa]' font 'Verdana,14'
154 set ytics 0.1 nomirror
157 set output "brain_cube_pres-displ-vs-time-poro-TENS.png"
158 plot 'data-for-gnuplot.sol' using ($1):($8)/1000 every 1 with lines ls 5 axes x1y2 title 'pressure at central column', \
159 'data-for-gnuplot.sol' using ($1):($7) every 1 with lines ls 4 axes x1y1 title 'vertical displacement of top surface'
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams