load "problem.ppl";
load "analytical.ppl"

set preamble "\usepackage{amsmath}"

set width 7*unit(cm)

set axis x arrow nomirrored
set axis y arrow nomirrored


set grid
set terminal pdf

set output "error-M-vs-cpu-small.pdf"
set key above

set yrange [1e-3:1e2]
set logscale y
set logscale x

set xlabel "CPU time [sec]"
set ylabel "Error in M [MPa]"
plot "convergence-1.dat" u 14:(abs($3-M_vonmises)) w lp lw 2 lt 3 pt 16  color orangered ti "First-order",\
     "convergence-2.dat" u 14:(abs($3-M_vonmises)) w lp lw 3 lt 4 pt 17  color cadetblue ti "Second-order"

set output "error-MB-vs-cpu-small.pdf"
set xlabel "CPU time [sec]"
set ylabel "Error in MB [MPa]"
plot "convergence-1.dat" u 14:(abs($8-MB_vonmises)) w lp lw 2 lt 3 pt 16  color salmon   ti "First-order",\
     "convergence-2.dat" u 14:(abs($8-MB_vonmises)) w lp lw 3 lt 4 pt 17  color navyblue ti "Second-order"
