Ch2_7_s10to13

Ch2_7_s10to13 - Do-While and For Loops 3 Next Slide...

This preview shows pages 1–4. Sign up to view the full content.

Chapter 2.7: Do-While and For Loops 1 Next Slide Previous Slide CO 2 balances to determine the magnitude of the greenhouse effect (very complex) CO 2 emissions from anthropogenic sources e.g. Power plants, cars, fires non-anthropogenic sources e.g. Fires, biodegradation, animals CO 2 sequestration by oceans and plants. "half-life" = time to reduce the CO 2 concentration by half if no sources of CO 2 existed . A very simple concept that omits a lot of detail! Example: The half-life of CO 2 in the atmosphere

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Chapter 2.7: Do-While and For Loops 2 Next Slide Previous Slide Multiply by dt and divide by concentration of CO 2 eqn2 kdt C dC 2 2 CO CO - = Integrate from initial time (t i =0) to final time (t f ). 3 eqn kdt C dC f i f i 2 2 t 0 t C C CO CO = - = 4 eqn ln , , kt C C f i CO f CO 2 2 - = Rate of decrease of CO 2 is proportional to the amount of CO 2 in the atmosphere. eqn1 kC dt dC 2 2 CO CO - = eqn5 , , e C C f 2 2 kt i CO f CO - = The model: derivation of the equation
Chapter 2.7:

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Do-While and For Loops 3 Next Slide Previous Slide Given a value for half-life we can calculate the corresponding decay constant, k. eqn6 ) . ln( ln / , , kt 5 C C 2 1 i CO f CO 2 2-= = 7 eqn 2 / 1 ) 5 . ln( t k-= eqn8 ) ( , e C t C kt i CO CO 2 2-= Now, we let t f =t, and solve for the CO 2 concentration as a function of k and time, t. The model: calculating the half-life constant Chapter 2.7: Do-While and For Loops 4 Next Slide Previous Slide Determining the half life effect on CO 2 concentration. Using the model enter half-life strart do-while calculate decay constant print results in for-loop end do-while repeat for different half-life, if desired use for-loop to calculate CO 2 value from 0 to 80 years, in 5 year increments co2_half_life_loop.cpp...
View Full Document

Ch2_7_s10to13 - Do-While and For Loops 3 Next Slide...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online