HW03 - Repetitive Control Structures BEE 1510: Introduction...

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

View Full Document Right Arrow Icon
Repetitive Control Structures BEE 1510: Introduction to Computer Programming Homework Exercise 03 Timothy Lin Cornell University due: October 20, 2008
Background image of page 1

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

View Full DocumentRight Arrow Icon
Executive Summary This exercise was meant to calculate the heart rates of a random population of a given gender and population size. In other words, a probability of distribution is being created to model the expected characteristics of both one person and an entire population based on similar characteristics of others. From there, it is possible to say with some confidence that there are certain percentages and parts of the population that maintain a certain characteristic. In this simulation, for example, the average heart rates. Problem The problem faced is how does a heart manage how much blood is receives and how much it pumps out and how do we look at a general randomized population’s heart rates? Objective The objective for this program is to ask the user for the gender of the population being looked at. Then, the program asks the user for the number of people in the population of the gender chosen, checking to make sure, that for this program’s simulation, the population entered is between 100 and 100,000. The program then will randomize the heart parameters that are given previously, perform a bisection to figure out what actual pressure at the right atrium where the cardiac output equals venous return and then using that pressure, determine the heart rate of the individual. Those individuals are then compiled into a histogram. Materials and Methods The first equation used is located in the function file “cardiac_output.” It is calculated by taking the maximum cardiac output divided by one plus quantity squared actual pressure at the right atrium minus the minimum pressure at the right atrium. The second equation is located in the function file “venous_return.” It is calculated by dividing actual pressure at the right atrium by systemic filling pressure and dividing that by resistance to venous return.
Background image of page 2
Materials and Methods – algorithm for script 1. Enter Comments BEE 1510 Introduction to Computer Programming Homework Exercise 03: Repetitive Control Structure Timothy Lin TA: Celina This script file first asks for the gender and size of the population to be simulated. Then, for each individual in the population, the heart parameters are randomized. If the difference between the right and left boundary is greater than the tolerance, that means that the intercept has not been found. As the script loops, if the difference is still greater than the tolerance, the script will perform the bisection to find the root of the CO-VR function until the heart rate for the individual is found. Record of revisions: original code: October 8, 2008 last modified: 2. Inputs ask user for gender of population to be simulated (menu command) ask user for input of size of population to be simulated 3. Coding check if input of size of population must be between 100 and 100,000 (if/else statement)
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/28/2009 for the course BEE 1510 taught by Professor Staff during the Fall '05 term at Cornell University (Engineering School).

Page1 / 12

HW03 - Repetitive Control Structures BEE 1510: Introduction...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online