- Author:
- Andrew Miller <ak.miller@auckland.ac.nz>
- Date:
- 2012-05-08 15:18:10+12:00
- Desc:
- Rename samplingSensitivityAnalysis to repeatedAnalysis to match changes in draft spec
- Permanent Source URI:
- https://models.physiomeproject.org/w/miller/uncertain-starting-parabola/rawfile/b6384e0c20e078d72ba8194f153f9c7660872afd/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
export LD_LIBRARY_PATH=`dirname $RS`
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(-2, 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()
postscript("fig3.eps", width=480, height=480, bg="white")
par(mfrow=c(2,2))
plot(density(dfsa\$dg_pos_initialx), main='Initial x position')
plot(density(dfsa\$dg_pos_initialy), main='Initial y position')
plot(density(dfsa\$dg_vel_initialx), main='Initial x velocity')
plot(density(dfsa\$dg_vel_initialy), main='Initial y velocity')
dev.off()
EOF