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-salmon" 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 top left font 'Verdana,12' spacing 1.0 maxcols 1 width -0.2
66 #set xrange [] reverse #compression
67 set xrange [] noreverse #tension
71 set xtics autofreq rotate by 45 right
74 set output "brain_cube_stress-stretch-poro-SHEAR.png"
75 plot 'data-for-gnuplot.sol' index 0 using (stretch($5)):(nominal($13)) every 1 with lines ls 1 title '1^{st} cycle', \
76 'data-for-gnuplot.sol' index 1 using (stretch($5)):(nominal($13)) every 1 with lines ls 2 title '2^{nd} cycle', \
77 'data-for-gnuplot.sol' index 2 using (stretch($5)):(nominal($13)) every 1 with lines ls 3 title '3^{rd} cycle'
79 # -------------------- solid Stress vs stretch ---------------------------------------------------------------------------------
80 stretch(x) = (length + x) / length
81 nominal(y) = y / (area*1000) #[10⁻⁶ N / mm² = Pa]
83 set xlabel 'stretch [-]' font 'Verdana,14'
84 set ylabel 'solid nominal stress [kPa]' font 'Verdana,14'
86 set key on box inside top left font 'Verdana,12' spacing 1.0 maxcols 1 width -0.2
88 #set xrange [] reverse #compression
89 set xrange [] noreverse #tension
93 set xtics autofreq rotate by 45 right
96 set output "brain_cube_solid-stress-stretch-poro-SHEAR.png"
97 plot 'data-for-gnuplot.sol' index 0 using (stretch($5)):(nominal($19)) every 1 with lines ls 1 title '1^{st} cycle', \
98 'data-for-gnuplot.sol' index 1 using (stretch($5)):(nominal($19)) every 1 with lines ls 2 title '2^{nd} cycle', \
99 'data-for-gnuplot.sol' index 2 using (stretch($5)):(nominal($19)) every 1 with lines ls 3 title '3^{rd} cycle'
101 # -------------------- Accumulated exiting fluid vs time --------------------------------------------------------------------------
102 set xrange [] noreverse
103 set yrange [] noreverse
104 set xtics 30 norotate nooffset
110 set xlabel 'time [s]' font 'Verdana,14'
111 set ylabel sprintf("accumulated fluid\n outside the sample [mm^3]") font 'Verdana,14'
115 y_axis(y) = (a=a+y*timestep,a)
117 set output "brain_cube_fluid-time-poro-SHEAR.png"
118 plot 'data-for-gnuplot.sol' index 0 using ($1):(y_axis($22)) every 1 with lines ls 1 title '1^{st} cycle', \
119 'data-for-gnuplot.sol' index 1 using ($1):(y_axis($22)) every 1 with lines ls 2 title '2^{nd} cycle', \
120 'data-for-gnuplot.sol' index 2 using ($1):(y_axis($22)) every 1 with lines ls 3 title '3^{rd} cycle'
122 # -------------------- Accumulated exiting fluid vs reaction pressure ---------------------------------------------------------------
123 set xlabel 'fluid reaction pressure [kPa]' font 'Verdana,14'
124 set ylabel sprintf("accumulated fluid\n outside the sample [mm^3]") font 'Verdana,14'
125 set key on box outside above right font 'Verdana,12' spacing 1.0 maxcols 1 width -0.2
132 y_axis(y) = (a=a+y*timestep,a)
134 set output "brain_cube_fluid-reac_p-poro-SHEAR.png"
135 plot 'data-for-gnuplot.sol' index 0 using ($18/1000):(y_axis($22)) every 1 with lines ls 1 title '1^{st} cycle', \
136 'data-for-gnuplot.sol' index 1 using ($18/1000):(y_axis($22)) every 1 with lines ls 2 title '2^{nd} cycle', \
137 'data-for-gnuplot.sol' index 2 using ($18/1000):(y_axis($22)) every 1 with lines ls 3 title '3^{rd} cycle'
139 # -------------------- Pressure and displ. vs time -------------------------------------------------------------------------
140 set term png size 600,380 enhanced font 'Verdana,12'
144 set xtics 30 norotate nooffset
146 set xlabel 'time [s]' font 'Verdana,14'
147 set ylabel 'displacement [mm]' font 'Verdana,14'
148 set y2label 'pressure [kPa]' font 'Verdana,14'
149 set ytics 0.5 nomirror
152 set output "brain_cube_pres-displ-vs-time-poro-SHEAR.png"
153 plot 'data-for-gnuplot.sol' using ($1):($8)/1000 every 1 with lines ls 5 axes x1y2 title 'pressure at central column', \
154 'data-for-gnuplot.sol' using ($1):($5) 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