tridging_res_freeze_plots.jl - seaice-experiments - sea ice experiments using Granular.jl
 (HTM) git clone git://src.adamsgaard.dk/seaice-experiments
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
       tridging_res_freeze_plots.jl (2089B)
       ---
            1 #/usr/bin/env julia
            2 ENV["MPLBACKEND"] = "Agg"
            3 import PyPlot
            4 using DelimitedFiles
            5 
            6 cv = 0.1  # compressive velocity
            7 
            8 function readTimeSeries(id::String,
            9                         cv::Float64)
           10 
           11     data = readdlm(id * "-data.txt")  # file is: time, N, τ
           12 
           13     return data[1,:], data[1,:].*cv, data[2,:]./1e3, data[3,:]./1e3
           14 end
           15 
           16 # plot 1
           17 # ridging_res-seed1-size_scaling_1.0-seed1
           18 # ridging_res-seed1-size_scaling_1.0_instantheal-seed1
           19 PyPlot.figure(figsize=(4,3))
           20 t, γ, N, τ = readTimeSeries("ridging_res-seed1-size_scaling_1.0-seed1", 0.1)
           21 PyPlot.plot(γ, N, "C1-", linewidth=1.0, label="No refreezing")
           22 t, γ, N, τ = readTimeSeries("ridging_res-seed1-size_scaling_1.0_instantheal-seed1", 0.1)
           23 PyPlot.plot(γ, N, "C2--", linewidth=1.0, label="Instant refreezing")
           24 PyPlot.legend()
           25 # PyPlot.xlabel("Shear strain, \$\\gamma\$ [-]")
           26 # PyPlot.xlabel("Compressive strain, \$\\epsilon_c\$ [-]")
           27 PyPlot.xlabel("Compressive distance [m]")
           28 # PyPlot.ylabel("Shear friction, $\\mu = \\tau/N$, [-]")
           29 PyPlot.ylabel("Compressive stress [kPa]")
           30 # PyPlot.xlim([0.0, 0.45])
           31 # PyPlot.ylim([1e-4, 2e2])
           32 PyPlot.tight_layout()
           33 PyPlot.savefig("ridging_refreeze_strain-vs-stress.pdf")
           34 PyPlot.savefig("ridging_refreeze_strain-vs-stress.png")
           35 
           36 # plot 2
           37 # ridging_res-seed1-size_scaling_0.5-seed1
           38 # ridging_res-seed1-size_scaling_1.0-seed1
           39 PyPlot.figure(figsize=(4,3))
           40 t, γ, N, τ = readTimeSeries("ridging_res-seed1-size_scaling_1.0-seed1", 0.1)
           41 PyPlot.plot(γ, N, "C1-", linewidth=1.0, label="Normal resolution")
           42 t, γ, N, τ = readTimeSeries("ridging_res-seed1-size_scaling_0.5-seed1", 0.1)
           43 PyPlot.plot(γ, N, "C2--", linewidth=1.0, label="0.5\$\\times\$ resolution")
           44 PyPlot.legend()
           45 # PyPlot.xlabel("Shear strain, \$\\gamma\$ [-]")
           46 # PyPlot.xlabel("Compressive strain, \$\\epsilon_c\$ [-]")
           47 PyPlot.xlabel("Compressive distance [m]")
           48 # PyPlot.ylabel("Shear friction, $\\mu = \\tau/N$, [-]")
           49 PyPlot.ylabel("Compressive stress [kPa]")
           50 # PyPlot.xlim([0.0, 0.45])
           51 # PyPlot.ylim([1e-4, 2e2])
           52 PyPlot.tight_layout()
           53 PyPlot.savefig("ridging_res_strain-vs-stress.pdf")
           54 PyPlot.savefig("ridging_res_strain-vs-stress.png")