Find Jobs
Hire Freelancers

C++ simple Programming (easy)

$30-250 USD

Completed
Posted about 13 years ago

$30-250 USD

Paid on delivery
Please see file for details. Write a C++ program that does the following: a. Solves the differential equation (equation 1) from 0 to 100 min in step sizes of 1 minute for the twenty combinations of 5 patch sizes and 4 body weights. This must be done using two functions that you write. The first function will be a void function called "eulers" and will execute the euler's method for a given set of parameters. The second function will be a single-result function called "yprime", and will be the function that calculates the value of the function to be integrated by "eulers" (the right side of equation 1). A common problem you will encounter is how to let the yprime function know what the values are for body weight and patch area. We recommend passing the parameters used in equation 1 as arguments passed by value, with the weight and patch size parameters for each case being changed within the main program before being passed by a function call to "eulers" and then to "yprime". b. For each of the twenty solutions, the main program determines, using numerical integration, the time-averaged concentration of the drug (Cd,ave). We recommend (but it is optional) storing the twenty values of Cd,ave in a 4x5 double-indexed array for use in parts c and d. c. In a third void function the program compares these time-averaged concentrations, Cd,ave, with the target concentration of 2.1 mg/lb to determine which size patch (i.e. area) is best suited for each body weight. The best patch size is the one that gives a Cd,ave, that is closest to the target. d. Prints the results of the computations to the screen, and to two different text files, as follows: 1. The Cd vs. time results for all 20 cases are printed to a file named cdvst.txt. Each case will be a separate table within the file. The tables will have titles for the body weight and patch area at the top, followed by column headings of t and cd (see the example below). The numbers should be printed with good formatting using iomanip functions. 2. A table listing body weight, patch area, and Cd,ave for each of the 20 cases to a file named cdave.txt. The table should have proper headings and units, and be well formatted using iomanip. 3. The final results of the calculations are printed to the screen only. These will be the best patch size for each body weight, the Cd,ave that can be achieved with that patch size, and the target value for Cd,ave .
Project ID: 1015576

About the project

1 proposal
Remote project
Active 13 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
interested to do this project
$30 USD in 2 days
4.0 (2 reviews)
1.7
1.7

About the client

Flag of UNITED STATES
amherst, United States
4.8
1
Member since Apr 8, 2011

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.