Image Generation Script

1. Code

This is just a little script to generate the plots.

{launcher.sh 1}
cd "$(dirname "$0")/.."
## Analytic
#printf '1 0.05 0.5\n 0 1 200\n 3\n 365 1280 1825\n' \
#    | bin/a_advect_dispers | script/plotter.m \
#        YPLOT lit/images/hw3-2.png 'x (m)' 'concentration' \
#            't = 1 yr' 't = 3.5 yr' 't = 5 yr'
#printf '100.0 5.0 8.0\n 0 1 50\n 3\n 1 3 5\n' \
#    | bin/a_advect_dispers | tee lit/images/a_ad.data | script/plotter.m \
#        YPLOT lit/images/hw4a.png 'x (m)' 'concentration (mg/L)' \
#            't = 1 day' 't = 3 days' 't = 5 days'
## Finite Difference
#for dt in 0.05 0.1 0.025 0.0125 0.00625; do
#    ( cat lit/images/a_ad.data \
#            && ( printf "0 100.0 0\n 50 5.0 8.0\n 1.0 $dt\n 3\n 1 3 5\n" \
#                | cafrun -np 8 bin/fd_advect_dispers \
#                | tee "lit/images/fd_ad_$dt.data" ) ) \
#        | script/plotter.m \
#            YPLOT "lit/images/fd_ad_$dt.png" 'x (m)' 'concentration (mg/L)' \
#                't = 1 day (analytic)' 't = 3 days (analytic)' \
#                    't = 5 days (analytic)' NOP \
#                't = 1 day (EFD)' 't = 3 days (EFD)' 't = 5 days (EFD)'
#done

## Homework 5 ##
## D = 8.0 m^2/day
# Analytic
printf '100.0 5.0 8.0\n 0.0 1.0 50.0\n 2\n 1 5\n' \
    | bin/a_advect_dispers > lit/images/a_ad.data
# Explicit Finite Difference
printf "0.0 100.0 0.0\n 50.0 5.0 8.0\n -1\n 1.0 0.05 0.0\n 2\n 1 5\n" \
    | cafrun -np 8 bin/gfd_advect_dispers > lit/images/efd_ad.data
# Crank-Nicolson Finite Difference
printf "0.0 100.0 0.0\n 50.0 5.0 8.0\n -1\n 1.0 0.05 0.5\n 2\n 1 5\n" \
    | cafrun -np 1 bin/gfd_advect_dispers > lit/images/cn_ad.data
# Plot
cat lit/images/a_ad.data lit/images/efd_ad.data lit/images/cn_ad.data \
    | script/plotter.m \
        YPLOT 'lit/images/d_8.0.png' 'x (m)' 'concentration (mg/L)' \
            't = 1 day (analytic)' 't = 5 days (analytic)' \
            NOP 't = 1 day (EFD)' 't = 5 days (EFD)' \
            NOP 't = 1 day (C-N)' 't = 5 days (C-N)'
## D = 0.3 m^2/day
# Analytic
printf '100.0 5.0 0.3\n 0.0 1.0 50.0\n 2\n 1 5\n' \
    | bin/a_advect_dispers > lit/images/a_ad_lowd.data
# Crank-Nicolson Finite Difference
printf "0.0 100.0 0.0\n 50 5.0 0.3\n -1\n 1.0 0.05 0.5\n 2\n 1 5\n" \
    | cafrun -np 8 bin/gfd_advect_dispers > lit/images/cn_ad_lowd.data
# Plot
cat lit/images/a_ad_lowd.data lit/images/cn_ad_lowd.data \
    | script/plotter.m \
        YPLOT 'lit/images/d_0.3.png' 'x (m)' 'concentration (mg/L)' \
            't = 1 day (analytic)' 't = 5 days (analytic)' \
            NOP 't = 1 day (C-N)' 't = 5 days (C-N)'
## Plume
# Crank-Nicolson Finite Difference
printf "0.0 100.0 0.0\n 50.0 5.0 8.0\n 0.4\n 1.0 0.05 0.5\n 3\n 0.5 1 3\n" \
    | cafrun -np 1 bin/gfd_advect_dispers > lit/images/cn_ad_plume.data
printf "0.0 100.0 0.0\n 50.0 5.0 0.0\n 0.4\n 1.0 0.05 0.5\n 3\n 0.5 1 3\n" \
    | cafrun -np 1 bin/gfd_advect_dispers > lit/images/cn_ad_plug.data
# Plot
cat lit/images/cn_ad_plume.data lit/images/cn_ad_plug.data \
    | script/plotter.m \
        YPLOT 'lit/images/d_plume.png' 'x (m)' 'concentration (mg/L)' \
            't = 0.5 days' 't = 1 day' 't = 3 days' NOP \
            't = 0.5 days (plug)' 't = 1 day (plug)' 't = 3 days (plug)'

Previous Chapter