Location: Uncertain starting point parabola @ 5822f93f34cd / make-figures.sh

Author:
Andrew Miller <ak.miller@auckland.ac.nz>
Date:
2012-04-30 17:03:41+12:00
Desc:
Merge
Permanent Source URI:
https://models.physiomeproject.org/w/miller/uncertain-starting-parabola/rawfile/5822f93f34cd6d496afae038b81898797f0fc2bc/make-figures.sh

#!/bin/bash

API_PATH=~/code/cellml-api
if [[ ! -d $API_PATH ]]; then
  API_PATH=~/Documents/cellml-api
fi

export LIBRARY_PATH=$API_PATH
RS=$API_PATH/RunSEDML

for i in `seq 1 10`; do
  $RS file://`pwd`/single-run.sedml | tail -n+2 >out$i.csv;
done

$RS file://`pwd`/sens-analysis.sedml |grep -v "Task finished successfully" > out-sa.csv

R --no-save <<EOF
postscript("fig1.eps", width=480, height=480, bg="white")
df1 <- read.csv('out1.csv')
plot(df1\$dg_pos_x, df1\$dg_pos_y, xlim=c(-10, 120), ylim=c(-450, 10), type='l',
     xlab='X Co-ordinate (m)', ylab='Y Co-ordinate (m)', main='Sampled outcomes of parabolic motion model\nwith uncertain initial position and velocity')
for (i in 2:10) {
  dfi <- read.csv(sprintf('out%d.csv', i))
  lines(dfi\$dg_pos_x, dfi\$dg_pos_y)
  dfi <- NULL
}
df1 <- NULL
dev.off()

postscript("fig2.eps", width=480, height=480, bg="white")
dfsa <- read.csv('out-sa.csv')
plot(dfsa\$dg_pos_x, dfsa\$dg_pos_y,
     xlab='Final X (m)', ylab='Final Y (m)', main='Sensitivity analysis of final position\n in parabolic motion model with uncertain initial\n position and velocity')
dev.off()
EOF