Monte Carlo Analysis of Manning’s Equation: A Shiny App

July 20, 2016

(This article was first published on AdventuresInData, and kindly contributed to R-bloggers)

Monte Carlo analysis is a great way to explore the impact of input variable uncertainty on the results of engineering equations, and with vector variables and distribution and sampling functions at its core, R is a natural platform for this analysis.

During a recent rainy vacation, I built a Shiny app that applies Monte Carlo analysis to Manning’s Equation for open channel flow.  You can play with the app here.  The slider bars define the upper and lower limits for input variables such as depth and Manning’s roughness coefficient, and the Shiny app computes resulting discharge (flow) distributions on the fly displayed via histogram and boxplot.  The app uses uniform distributions for input variables, but the script could easily be modified to incorporate other distributions.  I was especially impressed with the speed with which R and Shiny recomputed the distributions in reaction to changed input variables.  For me this project was an update of an older effort using spreadsheet add-ins.  While I will always have a warm place in my heart for Crystal Ball, R’s natural fit to Monte Carlo analysis and unlimited plotting capabilities have me excited to do more.

To leave a comment for the author, please follow the link and comment on their blog: AdventuresInData. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)