1 / 10

Monte Carlo Integration in Excel

Monte Carlo Integration in Excel. Sean Gant Jay Lee. y. A. f(x). x. B. Monte Carlo Integration. y. A. f(x). x. B. Monte Carlo Integration. y. A. f(x). x. B. Monte Carlo Integration. Gas-phase elementary reaction : 2A → B Isothermal reaction in a PFR with no pressure drop

Download Presentation

Monte Carlo Integration in Excel

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Monte Carlo Integration in Excel Sean Gant Jay Lee

  2. y A f(x) x B Monte Carlo Integration

  3. y A f(x) x B Monte Carlo Integration

  4. y A f(x) x B Monte Carlo Integration

  5. Gas-phase elementary reaction: 2A → B Isothermal reaction in a PFR with no pressure drop Only A is fed, P0 = 8.2 atm, T0 = 500K, ε = -0.5 CA0 = 0.2 mol/dm3,k = 10 dm3/mol-s, vo = 25 dm3/s QUESTION What volume is needed to achieve 90% conversion?

  6. Mole Balance: Rate Law: Stoichiometry: Combine:

  7. Setting Up Excel Spreadsheet • What are your inputs? (Using “Rand()” Function) • X: Your independent variable (range you are integrating) • Y: Dependent variable ( from 0 to max over X-range) • What is your defined area? • L x W of “box” (multiply the two ranges) • What constitutes a hit? • If random point lies below function then “hit”

  8. Setting up Excel Spreadsheet

  9. Setting up Excel Spreadsheet • Random Number Generator • Rand()*(b-a)+a • Generate a number between a and b • The “Status” • If(X<f(X), “below”, “above”) • If value of f(X) > Y then mark “below” • The “Count” • If(Status=“below”,1,0) • If value of status is “below” then count a “hit” • Making sense of data • Take total number of hits and divide by total number of points to find fraction under function • Multiply calculated fraction by area of “box” to find the area under the curve. In this case this value is the volume of your PFR. 44.6 dm3 as compared to 45.3 dm3 found by solving analytically.

  10. Setting up Excel Spreadsheet

More Related