November 10, 2016

Boiling Water at Elevation

The boiling temperature in degrees Fahrenheit of water at sea level is 212. However, as the atmospheric pressure changes so does the boiling temperature.

The next slide shows a R plot of elevation vs boiling temperature of water.

  • Pressure (in Hg.) = 29.921 * (1 - 6.8753 * 0.000001 * altitude in ft) ^ 5.2559
  • Boiling point = 49.161 * Ln (pressure in Hg.) + 44.932

Simple line graph

Shiny App Description

The corresponding Shiny App is located in the shinyappsio cloud.

The URL is https://classroom-JHU.shinyapps.io/myproject2/

Just cut and past the url string to activate the boiling point calculator.

Enter the elevation in feet and press the Submit button to calculate the appropriate fahrenheit boiling point temperature.

R Code of ShinyApp UI and Server

library(shiny)
shinyUI ( 
  pageWithSidebar( # Application title 
    headerPanel("Boiling Water at Elevation"),
    sidebarPanel
    (numericInput('elev', 'Elevation in feet', 0, min = -500, 
                  max = 30000, step = 500),
  submitButton('Submit')   ), 
  mainPanel( h3('Results of calculation'), 
             h4('You entered elevation in feet of'), 
             verbatimTextOutput("inputValue"), 
             h4('Boiling temperature of water in Fahrenheit '), 
             verbatimTextOutput("prediction") )))
library(shiny)
shinyServer( 
  function(input, output) { 
    output$inputValue <- renderPrint({input$elev}) 
    output$prediction <- renderPrint({round(49.161 * log(29.921 * 
      (1 - 6.8753 * 0.000001 * input$elev)^5.2559) + 44.932, digits=1)})})

Thank you…….Merci…….Gracias…….Danke…..Grazie

Arigato…….Xie Xie…….Spasibo…….Todah…….Shukran

Mahalo…….Shukriya…….Nandri…….Kop Khun…….Asante